#pragma once #include "Widgets.h" #include "Core/IEditorContext.h" #include "Core/ISceneManager.h" #include #include namespace XCEngine { namespace Editor { namespace UI { inline void DrawSceneStatusWidget(IEditorContext& context) { auto& sceneManager = context.GetSceneManager(); std::string sceneLabel = sceneManager.HasActiveScene() ? sceneManager.GetCurrentSceneName() : "No Scene"; if (sceneLabel.empty()) { sceneLabel = "Untitled Scene"; } const std::string fileLabel = sceneManager.GetCurrentScenePath().empty() ? "Unsaved.xc" : std::filesystem::path(sceneManager.GetCurrentScenePath()).filename().string(); const bool dirty = sceneManager.IsSceneDirty(); const std::string statusText = dirty ? (std::string("* ") + fileLabel) : fileLabel; DrawRightAlignedText( statusText.c_str(), dirty ? MenuBarStatusDirtyColor() : MenuBarStatusIdleColor()); if (ImGui::IsItemHovered()) { BeginTitledTooltip("Scene"); ImGui::Text("Name: %s", sceneLabel.c_str()); ImGui::Text("File: %s", fileLabel.c_str()); ImGui::Text("State: %s", dirty ? "Modified" : "Saved"); ImGui::Text( "Path: %s", sceneManager.GetCurrentScenePath().empty() ? "(not saved yet)" : sceneManager.GetCurrentScenePath().c_str()); EndTitledTooltip(); } } } // namespace UI } // namespace Editor } // namespace XCEngine