Download LyraStarterGame/Source/LyraGame/UI/Subsystem/LyraUIMessaging.cpp from Alexhas2/unitysamples: direct link, hf CLI and curl.
- Browser
- Download file 1.78 kB
-
https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/UI/Subsystem/LyraUIMessaging.cpp
- Command line
-
hf download hf://datasets/Alexhas2/unitysamples/LyraStarterGame/Source/LyraGame/UI/Subsystem/LyraUIMessaging.cpp
-
curl -L -o LyraUIMessaging.cpp https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/UI/Subsystem/LyraUIMessaging.cpp
1.78 kB
| // Copyright Epic Games, Inc. All Rights Reserved. | |
| class FSubsystemCollectionBase; | |
| UE_DEFINE_GAMEPLAY_TAG_STATIC(TAG_UI_LAYER_MODAL, "UI.Layer.Modal"); | |
| void ULyraUIMessaging::Initialize(FSubsystemCollectionBase& Collection) | |
| { | |
| Super::Initialize(Collection); | |
| ConfirmationDialogClassPtr = ConfirmationDialogClass.LoadSynchronous(); | |
| ErrorDialogClassPtr = ErrorDialogClass.LoadSynchronous(); | |
| } | |
| void ULyraUIMessaging::ShowConfirmation(UCommonGameDialogDescriptor* DialogDescriptor, FCommonMessagingResultDelegate ResultCallback) | |
| { | |
| if (UCommonLocalPlayer* LocalPlayer = GetLocalPlayer<UCommonLocalPlayer>()) | |
| { | |
| if (UPrimaryGameLayout* RootLayout = LocalPlayer->GetRootUILayout()) | |
| { | |
| RootLayout->PushWidgetToLayerStack<UCommonGameDialog>(TAG_UI_LAYER_MODAL, ConfirmationDialogClassPtr, [DialogDescriptor, ResultCallback](UCommonGameDialog& Dialog) { | |
| Dialog.SetupDialog(DialogDescriptor, ResultCallback); | |
| }); | |
| } | |
| } | |
| } | |
| void ULyraUIMessaging::ShowError(UCommonGameDialogDescriptor* DialogDescriptor, FCommonMessagingResultDelegate ResultCallback) | |
| { | |
| if (UCommonLocalPlayer* LocalPlayer = GetLocalPlayer<UCommonLocalPlayer>()) | |
| { | |
| if (UPrimaryGameLayout* RootLayout = LocalPlayer->GetRootUILayout()) | |
| { | |
| RootLayout->PushWidgetToLayerStack<UCommonGameDialog>(TAG_UI_LAYER_MODAL, ErrorDialogClassPtr, [DialogDescriptor, ResultCallback](UCommonGameDialog& Dialog) { | |
| Dialog.SetupDialog(DialogDescriptor, ResultCallback); | |
| }); | |
| } | |
| } | |
| } | |