Tooling
This commit is contained in:
@@ -1,6 +1,39 @@
|
||||
#include "SaltyEditor.h"
|
||||
#include "Modules/ModuleManager.h"
|
||||
|
||||
IMPLEMENT_MODULE(FDefaultModuleImpl, SaltyEditor);
|
||||
#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);
|
||||
|
||||
Reference in New Issue
Block a user