MCPcopy Create free account
hub / github.com/NotYetGames/DlgSystem / Initialize

Method Initialize

Source/DlgSystemEditor/Private/DialogueStyle.cpp:98–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96FString FDialogueStyle::PluginContentRoot = FString();
97
98void FDialogueStyle::Initialize()
99{
100 // Only register once
101 if (StyleSet.IsValid())
102 {
103 return;
104 }
105
106 StyleSet = MakeShared<FSlateStyleSet>(GetStyleSetName());
107 EngineContentRoot = FPaths::EngineContentDir() / TEXT("Editor/Slate");
108 TSharedPtr<IPlugin> CurrentPlugin = IPluginManager::Get().FindPlugin(DIALOGUE_SYSTEM_PLUGIN_NAME.ToString());
109 if (CurrentPlugin.IsValid())
110 {
111 // Replaces the Engine Content Root (Engine/Editor/Slate) with the plugin content root
112 StyleSet->SetContentRoot(CurrentPlugin->GetContentDir());
113 PluginContentRoot = CurrentPlugin->GetContentDir();
114 }
115 else
116 {
117 UE_LOG(LogDlgSystemEditor, Fatal, TEXT("Could not find the Dialogue System Plugin :("));
118 return;
119 }
120
121 // Content Browser icons for asset types
122 StyleSet->Set(
123 PROPERTY_DlgDialogueClassIcon,
124 new FSlateImageBrush(GetPluginContentPath("Icons/DlgDialogue_16x.png"), Icon16x16)
125 );
126 StyleSet->Set(
127 PROPERTY_DlgDialogueClassThumbnail,
128 new FSlateImageBrush(GetPluginContentPath("Icons/DlgDialogue_64x.png"), Icon64x64)
129 );
130 StyleSet->Set(
131 PROPERTY_DlgEventCustomClassIcon,
132 new FSlateImageBrush(GetPluginContentPath("Icons/DlgEventCustom_16x.png"), Icon16x16)
133 );
134 StyleSet->Set(
135 PROPERTY_DlgEventCustomClassThumbnail,
136 new FSlateImageBrush(GetPluginContentPath("Icons/DlgEventCustom_64x.png"), Icon64x64)
137 );
138 StyleSet->Set(
139 PROPERTY_DlgConditionCustomClassIcon,
140 new FSlateImageBrush(GetPluginContentPath("Icons/DlgConditionCustom_16x.png"), Icon16x16)
141 );
142 StyleSet->Set(
143 PROPERTY_DlgConditionCustomClassThumbnail,
144 new FSlateImageBrush(GetPluginContentPath("Icons/DlgConditionCustom_64x.png"), Icon64x64)
145 );
146 StyleSet->Set(
147 PROPERTY_DlgTextArgumentCustomClassIcon,
148 new FSlateImageBrush(GetPluginContentPath("Icons/DlgTextArgumentCustom_16x.png"), Icon16x16)
149 );
150 StyleSet->Set(
151 PROPERTY_DlgTextArgumentCustomClassThumbnail,
152 new FSlateImageBrush(GetPluginContentPath("Icons/DlgTextArgumentCustom_64x.png"), Icon64x64)
153 );
154 StyleSet->Set(
155 PROPERTY_DlgNodeDataClassIcon,

Callers 1

ExtendMenuMethod · 0.45

Calls 3

IsValidMethod · 0.45
ToStringMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected