Download LyraStarterGame/Source/LyraGame/UI/Foundation/LyraButtonBase.cpp from Alexhas2/unitysamples: direct link, hf CLI and curl.
- Browser
- Download file 1.13 kB
-
https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/UI/Foundation/LyraButtonBase.cpp
- Command line
-
hf download hf://datasets/Alexhas2/unitysamples/LyraStarterGame/Source/LyraGame/UI/Foundation/LyraButtonBase.cpp
-
curl -L -o LyraButtonBase.cpp https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/UI/Foundation/LyraButtonBase.cpp
1.13 kB
| // Copyright Epic Games, Inc. All Rights Reserved. | |
| void ULyraButtonBase::NativePreConstruct() | |
| { | |
| Super::NativePreConstruct(); | |
| UpdateButtonStyle(); | |
| RefreshButtonText(); | |
| } | |
| void ULyraButtonBase::UpdateInputActionWidget() | |
| { | |
| Super::UpdateInputActionWidget(); | |
| UpdateButtonStyle(); | |
| RefreshButtonText(); | |
| } | |
| void ULyraButtonBase::SetButtonText(const FText& InText) | |
| { | |
| bOverride_ButtonText = InText.IsEmpty(); | |
| ButtonText = InText; | |
| RefreshButtonText(); | |
| } | |
| void ULyraButtonBase::RefreshButtonText() | |
| { | |
| if (bOverride_ButtonText || ButtonText.IsEmpty()) | |
| { | |
| if (InputActionWidget) | |
| { | |
| const FText ActionDisplayText = InputActionWidget->GetDisplayText(); | |
| if (!ActionDisplayText.IsEmpty()) | |
| { | |
| UpdateButtonText(ActionDisplayText); | |
| return; | |
| } | |
| } | |
| } | |
| UpdateButtonText(ButtonText); | |
| } | |
| void ULyraButtonBase::OnInputMethodChanged(ECommonInputType CurrentInputType) | |
| { | |
| Super::OnInputMethodChanged(CurrentInputType); | |
| UpdateButtonStyle(); | |
| } | |