You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lunarium_OLD/src/run_modes/editor/editor.h

95 lines
2.0 KiB
C++

/******************************************************************************
* File - editor.h
* Author - Joey Pollack
* Date - 2021/11/01 (y/m/d)
* Mod Date - 2021/11/01 (y/m/d)
* Description - Entry point for the editor run mode.
******************************************************************************/
#ifndef EDITOR_H_
#define EDITOR_H_
#include <core/iRunMode.h>
#include <utils/opRes.h>
#include "project/project.h"
#include "panel_manager.h"
#include "panels/about.h"
#include <gui/file_browser.h>
#include <filesystem>
#include <map>
namespace lunarium
{
class FileBrowser;
}
namespace lunarium { namespace editor
{
enum ToolType
{
TT_MAIN_EDITOR,
TT_MAP_EDITOR,
};
class MapEditor;
class Editor : public iRunMode
{
public:
static uint32_t LogCat;
public:
Editor();
[[nodiscard]] OpRes Initialize();
void Shutdown();
void OnTick(double delta);
void OnRender(lunarium::IGraphics* g);
uint32_t GetLogCat() const;
unsigned int GetNextWindowID();
bool IsToolOpen(ToolType type) const;
private:
Editor(const Editor&) = delete;
const Editor& operator=(const Editor&) = delete;
private: // Data
PanelManager mPanelManager;
Project mProject;
// Tools
unsigned int mNextWindowID;
MapEditor* mpMapEditor;
FileBrowser mFileBrowser;
const std::filesystem::path* mpPath;
// Non-Docking panels
AboutPanel mAboutPanel;
// Menu Bar Events
// Don't want to handles these events during rendering
bool mDoNewProject;
bool mDoOpenProject;
bool mDoSaveProject;
bool mDoSaveAs;
private: // HELPERS
void RenderWindow();
void DoMainMenu();
void DoStatusBar();
void DestroyTools();
void HandleMenuEvents();
void HandleOpenPanel(const char* name, gui::PanelType type);
};
}}
#endif // EDITOR_H_