Files
UnrealPrototyping/Source/SaltyEditor/SaltyEditor.cpp
T
2026-09-25 17:02:24 +03:00

40 lines
1.0 KiB
C++

#include "SaltyEditor.h"
#include "Framework/Application/SlateApplication.h"
#include "Modules/ModuleManager.h"
#include "WorldMap/WorldMapTab.h"
// The editor module now has a startup of its own: the World Map tab registers here. Before it there was
// nothing to start and FDefaultModuleImpl was enough.
class FSaltyEditorModule : public IModuleInterface
{
public:
virtual void StartupModule() override
{
// A commandlet - Scripts/Authoring runs several through -run=pythonscript - loads editor modules with
// no Slate at all, and registering a tab spawner there would crash on the way to building a level.
if (IsRunningCommandlet() || !FSlateApplication::IsInitialized())
{
return;
}
SaltyWorldMapTab::Register();
bRegisteredTab = true;
}
virtual void ShutdownModule() override
{
if (bRegisteredTab && FSlateApplication::IsInitialized())
{
SaltyWorldMapTab::Unregister();
}
bRegisteredTab = false;
}
private:
bool bRegisteredTab = false;
};
IMPLEMENT_MODULE(FSaltyEditorModule, SaltyEditor);
DEFINE_LOG_CATEGORY(LogSaltyEditor);