47 lines
1.1 KiB
C++
47 lines
1.1 KiB
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
|
|
#include "widgets/styles/DTFluxStatusStyle.h"
|
|
|
|
#include "Interfaces/IPluginManager.h"
|
|
#include "Styling/SlateStyleRegistry.h"
|
|
#include "Styling/SlateStyleMacros.h"
|
|
|
|
#define RootToContentDir Style->RootToContentDir
|
|
|
|
TSharedPtr<ISlateStyle> FDTFluxStatusStyle::StyleSet = nullptr;
|
|
|
|
void FDTFluxStatusStyle::RegisterStyle()
|
|
{
|
|
if(StyleSet.IsValid()) return;
|
|
|
|
StyleSet = Create();
|
|
FSlateStyleRegistry::RegisterSlateStyle(*StyleSet);
|
|
}
|
|
|
|
void FDTFluxStatusStyle::UnregisterStyle()
|
|
{
|
|
if(StyleSet.IsValid())
|
|
{
|
|
FSlateStyleRegistry::UnRegisterSlateStyle(*StyleSet);
|
|
ensure(StyleSet.IsUnique());
|
|
StyleSet.Reset();
|
|
}
|
|
|
|
|
|
}
|
|
|
|
void FDTFluxStatusStyle::ReloadTextures()
|
|
{
|
|
}
|
|
|
|
TSharedPtr<ISlateStyle> FDTFluxStatusStyle::Create()
|
|
{
|
|
TSharedPtr<FSlateStyleSet> Style = MakeShareable(new FSlateStyleSet("DTFluxAPIStatusStyle"));
|
|
Style->SetContentRoot(IPluginManager::Get().FindPlugin("DTFluxAPI")->GetBaseDir()/TEXT("Resources"));
|
|
|
|
Style->Set("LevelEditor.Tab.Icon", new IMAGE_BRUSH_SVG("DTFluxServerStatusWhite", FVector2d(16)) );
|
|
return Style;
|
|
}
|
|
|