added editor WIP
This commit is contained in:
48
TSE_Editor/src/UI/windows/PropertiesView.cpp
Normal file
48
TSE_Editor/src/UI/windows/PropertiesView.cpp
Normal file
@@ -0,0 +1,48 @@
|
||||
#include "PropertiesView.hpp"
|
||||
|
||||
TSE::EDITOR::PropertiesView::PropertiesView() : GuiWindow("Properies", ImGuiWindowFlags_MenuBar | ImGuiWindowFlags_NoCollapse) { }
|
||||
|
||||
void TSE::EDITOR::PropertiesView::Define()
|
||||
{
|
||||
MenuBar();
|
||||
if(currentlyInspecting.type == InspectableType::None) return;
|
||||
|
||||
ElementDrawer::Draw(currentlyInspecting, debugMode);
|
||||
}
|
||||
|
||||
void TSE::EDITOR::PropertiesView::MenuBar()
|
||||
{
|
||||
if(ImGui::BeginMenuBar())
|
||||
{
|
||||
if(ImGui::BeginMenu("..."))
|
||||
{
|
||||
if(ImGui::MenuItem("Debug"))
|
||||
{
|
||||
debugMode = !debugMode;
|
||||
}
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
bool style = locked;
|
||||
if(style) ImGui::PushStyleColor(ImGuiCol_Text, {0,1,0,1});
|
||||
if(ImGui::MenuItem("Lock")) locked = !locked;
|
||||
if(style) ImGui::PopStyleColor();
|
||||
}
|
||||
ImGui::EndMenuBar();
|
||||
}
|
||||
|
||||
void TSE::EDITOR::PropertiesView::SetInspectorElement(InspectableType type, void *element)
|
||||
{
|
||||
if(!locked)
|
||||
currentlyInspecting = Inspectable(type, element);
|
||||
}
|
||||
|
||||
void TSE::EDITOR::PropertiesView::ClearInspectorElement()
|
||||
{
|
||||
if(!locked)
|
||||
currentlyInspecting = Inspectable(InspectableType::None, nullptr);
|
||||
}
|
||||
|
||||
void TSE::EDITOR::PropertiesView::ForceClearInspectorElement()
|
||||
{
|
||||
currentlyInspecting = Inspectable(InspectableType::None, nullptr);
|
||||
}
|
||||
Reference in New Issue
Block a user