Download LyraStarterGame/Source/LyraEditor/Private/GameEditorStyle.cpp from Alexhas2/unitysamples: direct link, hf CLI and curl.
- Browser
- Download file 2.37 kB
-
https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraEditor/Private/GameEditorStyle.cpp
- Command line
-
hf download hf://datasets/Alexhas2/unitysamples/LyraStarterGame/Source/LyraEditor/Private/GameEditorStyle.cpp
-
curl -L -o GameEditorStyle.cpp https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraEditor/Private/GameEditorStyle.cpp
2.37 kB
| // Copyright Epic Games, Inc. All Rights Reserved. | |
| TSharedPtr< FSlateStyleSet > FGameEditorStyle::StyleInstance = nullptr; | |
| void FGameEditorStyle::Initialize() | |
| { | |
| if ( !StyleInstance.IsValid() ) | |
| { | |
| StyleInstance = Create(); | |
| FSlateStyleRegistry::RegisterSlateStyle( *StyleInstance ); | |
| } | |
| } | |
| void FGameEditorStyle::Shutdown() | |
| { | |
| FSlateStyleRegistry::UnRegisterSlateStyle( *StyleInstance ); | |
| ensure( StyleInstance.IsUnique() ); | |
| StyleInstance.Reset(); | |
| } | |
| FName FGameEditorStyle::GetStyleSetName() | |
| { | |
| static FName StyleSetName(TEXT("GameEditorStyle")); | |
| return StyleSetName; | |
| } | |
| TSharedRef< FSlateStyleSet > FGameEditorStyle::Create() | |
| { | |
| TSharedRef<FSlateStyleSet> StyleRef = MakeShareable(new FSlateStyleSet(FGameEditorStyle::GetStyleSetName())); | |
| StyleRef->SetContentRoot(FPaths::EngineContentDir() / TEXT("Editor/Slate")); | |
| StyleRef->SetCoreContentRoot(FPaths::EngineContentDir() / TEXT("Slate")); | |
| FSlateStyleSet& Style = StyleRef.Get(); | |
| const FVector2D Icon16x16(16.0f, 16.0f); | |
| const FVector2D Icon20x20(20.0f, 20.0f); | |
| const FVector2D Icon40x40(40.0f, 40.0f); | |
| const FVector2D Icon64x64(64.0f, 64.0f); | |
| // Toolbar | |
| { | |
| Style.Set("GameEditor.CheckContent", new GAME_IMAGE_BRUSH_SVG("Icons/CheckContent", Icon20x20)); | |
| } | |
| return StyleRef; | |
| } | |
| const ISlateStyle& FGameEditorStyle::Get() | |
| { | |
| return *StyleInstance; | |
| } | |