You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#preflight 6272a74d2f6d177be3c6fdda #rb Matt.Kuhlenschmidt #ROBOMERGE-OWNER: Lauren.Barnes #ROBOMERGE-AUTHOR: lauren.barnes #ROBOMERGE-SOURCE: CL 20057269 via CL 20070159 via CL 20072035 via CL 20072203 #ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690) #ROBOMERGE-CONFLICT from-shelf [CL 20105363 by Lauren Barnes in ue5-main branch]
73 lines
2.3 KiB
C++
73 lines
2.3 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "ViewportInteractionStyle.h"
|
|
#include "Styling/SlateTypes.h"
|
|
#include "Styling/AppStyle.h"
|
|
#include "Styling/SlateStyleRegistry.h"
|
|
#include "Widgets/Layout/SUniformGridPanel.h"
|
|
#include "Brushes/SlateImageBrush.h"
|
|
#include "Brushes/SlateBoxBrush.h"
|
|
#include "Brushes/SlateBorderBrush.h"
|
|
#include "Fonts/SlateFontInfo.h"
|
|
#include "Framework/Application/SlateApplication.h"
|
|
|
|
TSharedPtr< FSlateStyleSet > FViewportInteractionStyle::ViewportInteractionStyleInstance = NULL;
|
|
|
|
void FViewportInteractionStyle::Initialize()
|
|
{
|
|
if ( !ViewportInteractionStyleInstance.IsValid() )
|
|
{
|
|
ViewportInteractionStyleInstance = Create();
|
|
FSlateStyleRegistry::RegisterSlateStyle( *ViewportInteractionStyleInstance);
|
|
}
|
|
}
|
|
|
|
void FViewportInteractionStyle::Shutdown()
|
|
{
|
|
FSlateStyleRegistry::UnRegisterSlateStyle( *ViewportInteractionStyleInstance);
|
|
ensure(ViewportInteractionStyleInstance.IsUnique() );
|
|
ViewportInteractionStyleInstance.Reset();
|
|
}
|
|
|
|
FName FViewportInteractionStyle::GetStyleSetName()
|
|
{
|
|
static FName StyleSetName(TEXT("ViewportInteractionStyle"));
|
|
return StyleSetName;
|
|
}
|
|
|
|
#define IMAGE_BRUSH( RelativePath, ... ) FSlateImageBrush( Style->RootToContentDir( RelativePath, TEXT(".png") ), __VA_ARGS__ )
|
|
#define BOX_BRUSH( RelativePath, ... ) FSlateBoxBrush( Style->RootToContentDir( RelativePath, TEXT(".png") ), __VA_ARGS__ )
|
|
#define BORDER_BRUSH( RelativePath, ... ) FSlateBorderBrush( Style->RootToContentDir( RelativePath, TEXT(".png") ), __VA_ARGS__ )
|
|
|
|
const FVector2D Icon14x14(14.0f, 14.0f);
|
|
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);
|
|
const FVector2D Icon512x512(512.0f, 512.0f);
|
|
|
|
TSharedRef< FSlateStyleSet > FViewportInteractionStyle::Create()
|
|
{
|
|
TSharedRef< FSlateStyleSet > Style = MakeShareable(new FSlateStyleSet(FViewportInteractionStyle::GetStyleSetName()));
|
|
|
|
Style->SetContentRoot(FPaths::EngineContentDir() / TEXT("Editor/Slate"));
|
|
Style->SetCoreContentRoot(FPaths::EngineContentDir() / TEXT("Slate"));
|
|
|
|
return Style;
|
|
}
|
|
|
|
void FViewportInteractionStyle::ReloadTextures()
|
|
{
|
|
FSlateApplication::Get().GetRenderer()->ReloadTextureResources();
|
|
}
|
|
|
|
const ISlateStyle& FViewportInteractionStyle::Get()
|
|
{
|
|
return *ViewportInteractionStyleInstance;
|
|
}
|
|
|
|
|
|
#undef IMAGE_BRUSH
|
|
#undef BOX_BRUSH
|
|
#undef BORDER_BRUSH
|