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.
115 lines
2.5 KiB
C++
115 lines
2.5 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/run_mode.h>
|
|
#include <core/common_defs.h>
|
|
#include <gui/panel_manager.h>
|
|
#include <utils/op_res.h>
|
|
|
|
#include "project.h"
|
|
#include "panels/about.h"
|
|
|
|
#include <filesystem>
|
|
#include <map>
|
|
|
|
namespace lunarium
|
|
{
|
|
class World;
|
|
class Entity;
|
|
}
|
|
|
|
namespace lunarium { namespace editor
|
|
{
|
|
enum ToolType
|
|
{
|
|
TT_MAIN_EDITOR,
|
|
TT_MAP_EDITOR,
|
|
};
|
|
|
|
class EditorAsset;
|
|
class MapEditor;
|
|
class Editor : public iRunMode
|
|
{
|
|
public:
|
|
static uint32_t LogCat;
|
|
|
|
public:
|
|
Editor();
|
|
[[nodiscard]] OpRes Initialize();
|
|
void Shutdown();
|
|
void OnUpdate(double delta);
|
|
void OnRender(lunarium::Renderer2D* g);
|
|
|
|
|
|
bool IsToolOpen(ToolType type) const;
|
|
|
|
|
|
std::filesystem::path GetAssetBrowserLocation();
|
|
Project* GetProject();
|
|
|
|
// Panel events
|
|
void OnEntitySelect(lunarium::Entity* pEnt);
|
|
void ChangeWorld(lunarium::World* pWorld);
|
|
void OnAssetSelected(EditorAsset* pAsset);
|
|
void OnNewAsset(EditorAsset* pAsset);
|
|
void OnAssetUpdate(EditorAsset* pAsset);
|
|
|
|
private:
|
|
Editor(const Editor&) = delete;
|
|
const Editor& operator=(const Editor&) = delete;
|
|
|
|
private: // Data
|
|
Project mProject;
|
|
lunarium::World* mpWorld;
|
|
|
|
|
|
// Panels
|
|
PanelManager mPanelManager;
|
|
struct
|
|
{
|
|
uint32_t AssetBrowser;
|
|
uint32_t WorldTree;
|
|
uint32_t WorldView;
|
|
uint32_t PropertiesView;
|
|
} mPanels;
|
|
|
|
|
|
// 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;
|
|
|
|
// Tools
|
|
MapEditor* mpMapEditor;
|
|
|
|
// TEST DATA
|
|
|
|
|
|
private: // HELPERS
|
|
void RenderWindow();
|
|
|
|
void DoMainMenu();
|
|
void DoStatusBar();
|
|
void DestroyTools();
|
|
void HandleMenuEvents();
|
|
|
|
void HandleOpenPanel(const char* name, uint32_t id);
|
|
};
|
|
|
|
|
|
}}
|
|
|
|
#endif // EDITOR_H_
|