From 1fc84b9538d7e4f8c822451250e4d214d5c648d6 Mon Sep 17 00:00:00 2001 From: ssdfasd <2156608475@qq.com> Date: Thu, 12 Mar 2026 19:26:38 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BF=AE=E5=A4=8DPanel=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=E5=85=B3=E9=97=AD=E8=A1=8C=E4=B8=BA=E5=B9=B6=E4=BC=98?= =?UTF-8?q?=E5=8C=96ProjectManager=E8=B7=AF=E5=BE=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/Managers/ProjectManager.cpp | 2 +- ui/src/panels/ConsolePanel.cpp | 2 +- ui/src/panels/GameViewPanel.cpp | 2 +- ui/src/panels/InspectorPanel.cpp | 2 +- ui/src/panels/ProjectPanel.cpp | 2 +- ui/src/panels/SceneViewPanel.cpp | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ui/src/Managers/ProjectManager.cpp b/ui/src/Managers/ProjectManager.cpp index c4f0908c..34e031f1 100644 --- a/ui/src/Managers/ProjectManager.cpp +++ b/ui/src/Managers/ProjectManager.cpp @@ -102,7 +102,7 @@ std::wstring ProjectManager::GetCurrentFullPathW() const { if (m_path.empty()) return Utf8ToWstring(m_projectPath); std::wstring fullPath = Utf8ToWstring(m_projectPath); - for (size_t i = 1; i < m_path.size(); i++) { + for (size_t i = 0; i < m_path.size(); i++) { fullPath += L"/" + Utf8ToWstring(m_path[i]->name); } return fullPath; diff --git a/ui/src/panels/ConsolePanel.cpp b/ui/src/panels/ConsolePanel.cpp index 73544d48..f7df0193 100644 --- a/ui/src/panels/ConsolePanel.cpp +++ b/ui/src/panels/ConsolePanel.cpp @@ -14,7 +14,7 @@ ConsolePanel::ConsolePanel() : Panel("Console") { } void ConsolePanel::Render() { - ImGui::Begin(m_name.c_str(), &m_isOpen, ImGuiWindowFlags_None); + ImGui::Begin(m_name.c_str(), nullptr, ImGuiWindowFlags_None); if (ImGui::Button("Clear")) { LogSystem::Get().Clear(); diff --git a/ui/src/panels/GameViewPanel.cpp b/ui/src/panels/GameViewPanel.cpp index e1f89f38..d4389e1e 100644 --- a/ui/src/panels/GameViewPanel.cpp +++ b/ui/src/panels/GameViewPanel.cpp @@ -7,7 +7,7 @@ namespace UI { GameViewPanel::GameViewPanel() : Panel("Game") {} void GameViewPanel::Render() { - ImGui::Begin(m_name.c_str(), &m_isOpen, ImGuiWindowFlags_None); + ImGui::Begin(m_name.c_str(), nullptr, ImGuiWindowFlags_None); RenderGameView(); diff --git a/ui/src/panels/InspectorPanel.cpp b/ui/src/panels/InspectorPanel.cpp index 73cf074f..b3899edf 100644 --- a/ui/src/panels/InspectorPanel.cpp +++ b/ui/src/panels/InspectorPanel.cpp @@ -16,7 +16,7 @@ InspectorPanel::~InspectorPanel() { } void InspectorPanel::Render() { - ImGui::Begin(m_name.c_str(), &m_isOpen, ImGuiWindowFlags_None); + ImGui::Begin(m_name.c_str(), nullptr, ImGuiWindowFlags_None); EntityID selectedId = SelectionManager::Get().GetSelectedEntity(); Entity* entity = SceneManager::Get().GetEntity(selectedId); diff --git a/ui/src/panels/ProjectPanel.cpp b/ui/src/panels/ProjectPanel.cpp index 0adb0b60..24c255e6 100644 --- a/ui/src/panels/ProjectPanel.cpp +++ b/ui/src/panels/ProjectPanel.cpp @@ -14,7 +14,7 @@ void ProjectPanel::Initialize(const std::string& projectPath) { } void ProjectPanel::Render() { - ImGui::Begin(m_name.c_str(), &m_isOpen, ImGuiWindowFlags_None); + ImGui::Begin(m_name.c_str(), nullptr, ImGuiWindowFlags_None); auto& manager = ProjectManager::Get(); diff --git a/ui/src/panels/SceneViewPanel.cpp b/ui/src/panels/SceneViewPanel.cpp index 97ff809e..6fc8d98d 100644 --- a/ui/src/panels/SceneViewPanel.cpp +++ b/ui/src/panels/SceneViewPanel.cpp @@ -7,7 +7,7 @@ namespace UI { SceneViewPanel::SceneViewPanel() : Panel("Scene") {} void SceneViewPanel::Render() { - ImGui::Begin(m_name.c_str(), &m_isOpen, ImGuiWindowFlags_None); + ImGui::Begin(m_name.c_str(), nullptr, ImGuiWindowFlags_None); ImVec2 canvasSize = ImGui::GetContentRegionAvail(); ImDrawList* drawList = ImGui::GetWindowDrawList();