mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-15 20:08:54 +03:00
UI system now working well with the new component changes, fixed trait compile issues, fixed inspector rendering issues
This commit is contained in:
@@ -15,47 +15,47 @@ public:
|
||||
|
||||
void Draw(Nuake::Entity entity) override
|
||||
{
|
||||
using namespace Nuake;
|
||||
|
||||
if (!entity.HasComponent<UIComponent>())
|
||||
return;
|
||||
|
||||
auto& component = entity.GetComponent<UIComponent>();
|
||||
BeginComponentTable(UI EMITTER, UIComponent);
|
||||
{
|
||||
{
|
||||
ImGui::Text("HTML File");
|
||||
ImGui::TableNextColumn();
|
||||
|
||||
std::string path = component.UIFilePath;
|
||||
ImGui::Button(component.UIFilePath.c_str(), ImVec2(ImGui::GetContentRegionAvail().x, 0));
|
||||
if (ImGui::BeginDragDropTarget())
|
||||
{
|
||||
if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload("_UIFile"))
|
||||
{
|
||||
char* file = (char*)payload->Data;
|
||||
std::string fullPath = std::string(file, 256);
|
||||
path = Nuake::FileSystem::AbsoluteToRelative(fullPath);
|
||||
component.UIFilePath = path;
|
||||
}
|
||||
ImGui::EndDragDropTarget();
|
||||
}
|
||||
|
||||
ImGui::TableNextColumn();
|
||||
|
||||
ComponentTableReset(component.UIFilePath, "");
|
||||
}
|
||||
ImGui::TableNextColumn();
|
||||
{
|
||||
ImGui::Text("Worldspace");
|
||||
ImGui::TableNextColumn();
|
||||
|
||||
ImGui::Checkbox("##WorldSpace", &component.IsWorldSpace);
|
||||
ImGui::TableNextColumn();
|
||||
|
||||
ComponentTableReset(component.IsWorldSpace, false);
|
||||
}
|
||||
}
|
||||
EndComponentTable();
|
||||
// using namespace Nuake;
|
||||
//
|
||||
// if (!entity.HasComponent<UIComponent>())
|
||||
// return;
|
||||
//
|
||||
// auto& component = entity.GetComponent<UIComponent>();
|
||||
// BeginComponentTable(UI EMITTER, UIComponent);
|
||||
// {
|
||||
// {
|
||||
// ImGui::Text("HTML File");
|
||||
// ImGui::TableNextColumn();
|
||||
//
|
||||
// std::string path = component.UIFilePath;
|
||||
// ImGui::Button(component.UIFilePath.c_str(), ImVec2(ImGui::GetContentRegionAvail().x, 0));
|
||||
// if (ImGui::BeginDragDropTarget())
|
||||
// {
|
||||
// if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload("_UIFile"))
|
||||
// {
|
||||
// char* file = (char*)payload->Data;
|
||||
// std::string fullPath = std::string(file, 256);
|
||||
// path = Nuake::FileSystem::AbsoluteToRelative(fullPath);
|
||||
// component.UIFilePath = path;
|
||||
// }
|
||||
// ImGui::EndDragDropTarget();
|
||||
// }
|
||||
//
|
||||
// ImGui::TableNextColumn();
|
||||
//
|
||||
// ComponentTableReset(component.UIFilePath, "");
|
||||
// }
|
||||
// ImGui::TableNextColumn();
|
||||
// {
|
||||
// ImGui::Text("Worldspace");
|
||||
// ImGui::TableNextColumn();
|
||||
//
|
||||
// ImGui::Checkbox("##WorldSpace", &component.IsWorldSpace);
|
||||
// ImGui::TableNextColumn();
|
||||
//
|
||||
// ComponentTableReset(component.IsWorldSpace, false);
|
||||
// }
|
||||
// }
|
||||
// EndComponentTable();
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user