Main editor panel classes created, docked in default positions

Gui_Panel_Refactor
Joeyrp 4 years ago
parent 35dc183111
commit 3f7ae8aaa1

1
.gitignore vendored

@ -39,7 +39,6 @@
# other
*.log
*.zip
*.ini
test_data/test_save.xml
######################## CMAKE IGNORES

@ -22,12 +22,14 @@ Editor:
GUI Panels:
Project Overview (Tree view):
Game Viewport:
Scene View:
Scene Hierarchy (Tree View):
Asset Viewer:
☐ Put files into a table with columns for the file Properties
Tools:
Tile Map Editor:
☐ Tile map canvas
☐ Tile map pallete
@ -35,7 +37,5 @@ Editor:
☐ Stamp creater
☐ Flood Fill
Asset Viewer:
☐ Put files into a table with columns for the file Properties
Properties:

@ -6,6 +6,8 @@ IF not exist build/ (
goto END
)
xcopy /y build\Debug\imgui.ini test_data\imgui.ini
echo Removing the build directory
del /s /q build
rd /s /q build

@ -1,9 +1,11 @@
add_library(editor editor.cpp project/project.cpp panels/iPanel.cpp panels/mainPanel.cpp panels/about.cpp panels/assetBrowser.cpp)
add_library(editor editor.cpp project/project.cpp panels/iPanel.cpp panels/mainPanel.cpp panels/about.cpp
panels/assetBrowser.cpp panels/worldTree.cpp panels/worldView.cpp panels/propertiesView.cpp)
target_include_directories(editor
PUBLIC "${PROJECT_BINARY_DIR}"
PUBLIC ../../
PUBLIC ../../internal_libs
PUBLIC ../../run_modes
PUBLIC ../../../external/glm
PUBLIC ../../../external/glad/include
PUBLIC ../../../external/glfw/include

@ -17,6 +17,9 @@
// Panels
#include "panels/about.h"
#include "panels/assetBrowser.h"
#include "panels/worldTree.h"
#include "panels/worldView.h"
#include "panels/propertiesView.h"
namespace lunarium
{
@ -98,6 +101,9 @@ namespace editor
{
mPanels[PanelType::PT_ABOUT] = new AboutPanel;
mPanels[PanelType::PT_ASSET_BROWSER] = new AssetBrowser("");
mPanels[PanelType::PT_WORLD_TREE] = new WorldTree();
mPanels[PanelType::PT_WORLD_VIEW] = new WorldView();
mPanels[PanelType::PT_PROPERTIES_VIEW] = new PropertiesView();
}
void Editor::DestoryPanels()

@ -20,6 +20,7 @@ namespace editor
PT_WORLD_TREE,
PT_WORLD_VIEW,
PT_ASSET_BROWSER,
PT_PROPERTIES_VIEW,
PT_CONSOLE,
PT_UNKNOWN,
};

@ -70,7 +70,7 @@ namespace editor
return false;
}
// ImGui::DockSpace(ImGui::GetID("LEDockSpace"));
ImGui::DockSpaceOverViewport();
ImGui::PopStyleVar();
ImGui::End();

@ -1,5 +1,5 @@
/******************************************************************************
* File - customProperties.h
* File - property.h
* Author - Joey Pollack
* Date - 2022/01/27 (y/m/d)
* Mod Date - 2022/01/27 (y/m/d)
@ -9,35 +9,32 @@
#ifndef CUSTOM_PROPERTIES_H_
#define CUSTOM_PROPERTIES_H_
namespace lunarium
{
namespace editor
namespace lunarium { namespace editor
{
class CustomProperty
class Property
{
public:
// Custom property types
enum CType
enum Type
{
CPT_INT,
CPT_FLOAT,
CPT_COLOR
PT_INT,
PT_FLOAT,
PT_COLOR
};
public:
CustomProperty(CType type);
Property(Type type);
CType GetType() const;
Type GetType() const;
virtual void Draw() = 0;
private:
CType mType;
Type mType;
};
}
}
}} // lunarium::editor
#endif // CUSTOM_PROPERTIES_H_

@ -0,0 +1,37 @@
/******************************************************************************
* File - propertiesView.h
* Author - Joey Pollack
* Date - 2022/01/26 (y/m/d)
* Mod Date - 2022/01/26 (y/m/d)
* Description - Displayes the properties and components(?) of the selected
* object.
******************************************************************************/
#include "propertiesView.h"
#include <dearimgui/imgui.h>
namespace lunarium { namespace editor
{
PropertiesView::PropertiesView()
: Panel(PT_PROPERTIES_VIEW, true)
{
}
bool PropertiesView::DoFrame()
{
if (!mIsOpen)
return false;
if (!ImGui::Begin("Properties", &mIsOpen, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollbar))
{
ImGui::End();
return false;
}
ImGui::End();
return true;
}
}}

@ -1,5 +1,5 @@
/******************************************************************************
* File - properties.h
* File - propertiesView.h
* Author - Joey Pollack
* Date - 2022/01/26 (y/m/d)
* Mod Date - 2022/01/26 (y/m/d)
@ -17,11 +17,17 @@ namespace lunarium
{
namespace editor
{
class Properties : public Panel
class CustromProperty;
class PropertiesView : public Panel
{
public:
PropertiesView();
bool DoFrame();
private:
std::vector<CustromProperty*> mCustomProps;
};
}
}

@ -41,6 +41,13 @@ namespace editor
return false;
}
if (ImGui::TreeNode("World Root"))
{
// TODO: Build tree of world contents
ImGui::TreePop();
}
ImGui::End();
return true;
}

@ -13,9 +13,9 @@
namespace lunarium
{
class World;
namespace editor
{
class World;
class WorldTree : public Panel
{
public:

@ -7,11 +7,32 @@
******************************************************************************/
#include "worldView.h"
#include <game/world/world.h>
#include <dearimgui/imgui.h>
namespace lunarium
{
namespace editor
{
WorldView::WorldView()
: Panel(PT_WORLD_VIEW, true), mpWorld(nullptr)
{
}
bool WorldView::DoFrame()
{
if (!mIsOpen)
return false;
if (!ImGui::Begin("World View", &mIsOpen, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollbar))
{
ImGui::End();
return false;
}
ImGui::End();
return true;
}
}
}

@ -13,13 +13,23 @@
namespace lunarium
{
class World;
namespace editor
{
class WorldView : public Panel
{
public:
WorldView();
bool DoFrame();
void SetWorld(World* pWorld);
World* GetWorld();
private:
World* mpWorld;
};
}
}
}} // lunarium::editor
#endif // WORLD_VIEW_H_

@ -0,0 +1,138 @@
[Window][Debug##Default]
ViewportPos=278,8
ViewportId=0x9F5F46A1
Size=400,400
Collapsed=0
[Window][Dear ImGui Demo]
ViewportPos=292,184
ViewportId=0xE927CF2F
Size=1280,666
Collapsed=0
[Window][Dear ImGui Metrics/Debugger]
ViewportPos=438,264
ViewportId=0x4AD707D2
Size=812,295
Collapsed=0
[Window][Lunarium Editor]
Pos=0,24
Size=1280,672
Collapsed=0
[Window][LUA Console]
ViewportPos=516,220
ViewportId=0xBCA52B8E
Size=834,396
Collapsed=0
[Window][Debug Log]
Pos=0,470
Size=1280,226
Collapsed=0
DockId=0x00000005,1
[Window][About]
ViewportPos=1450,160
ViewportId=0x74350DE7
Size=300,480
Collapsed=0
[Window][status bar]
Pos=0,688
Size=1280,32
Collapsed=0
[Window][Example: Documents]
ViewportPos=687,626
ViewportId=0x1FD64BEB
Size=641,176
Collapsed=0
[Window][About Dear ImGui]
Pos=60,60
Size=568,134
Collapsed=0
[Window][File Browser]
Pos=620,216
Size=600,400
Collapsed=0
[Window][DockSpaceViewport_11111111]
Pos=0,24
Size=1280,696
Collapsed=0
[Window][DockSpace Demo]
Pos=0,24
Size=1280,696
Collapsed=0
[Window][DockSpaceViewport_BEB76114]
ViewportPos=100,124
ViewportId=0xBEB76114
Size=1280,672
Collapsed=0
[Window][Asset Browser]
Pos=204,493
Size=878,203
Collapsed=0
DockId=0x00000004,0
[Window][World Tree]
Pos=0,22
Size=202,674
Collapsed=0
DockId=0x00000005,0
[Window][World View]
Pos=204,22
Size=878,469
Collapsed=0
DockId=0x00000003,0
[Window][Properties]
Pos=1084,22
Size=196,674
Collapsed=0
DockId=0x00000007,0
[Table][0xC9935533,3]
Column 0 Weight=1.0000
Column 1 Weight=1.0000
Column 2 Weight=1.0000
[Table][0x64418101,3]
RefScale=18
Column 0 Width=60
Column 1 Width=60
Column 2 Width=60
[Table][0x47600645,3]
RefScale=18
Column 0 Width=63
Column 1 Width=149
Column 2 Weight=1.0000
[Table][0xDE6957FF,6]
RefScale=18
Column 0 Width=61
Column 1 Width=193
Column 2 Width=-1
Column 3 Weight=1.0000
Column 4 Weight=1.0000
Column 5 Weight=-1.0000
[Docking][Data]
DockNode ID=0x00000002 Pos=314,118 Size=1280,674 Split=X
DockNode ID=0x00000001 Parent=0x00000002 SizeRef=1082,674 Split=X
DockNode ID=0x00000005 Parent=0x00000001 SizeRef=202,674 Selected=0xFD1747F8
DockNode ID=0x00000006 Parent=0x00000001 SizeRef=878,674 Split=Y
DockNode ID=0x00000003 Parent=0x00000006 SizeRef=1280,469 Selected=0xB4D4B2AA
DockNode ID=0x00000004 Parent=0x00000006 SizeRef=1280,203 Selected=0xB04EBF39
DockNode ID=0x00000007 Parent=0x00000002 SizeRef=196,674 Selected=0xC89E3217
DockSpace ID=0x8B93E3BD Window=0xA787BDB4 Pos=314,120 Size=1280,696 CentralNode=1
Loading…
Cancel
Save