From 1ecaea469e86ef3f5d18122c8b2cc187286e27f7 Mon Sep 17 00:00:00 2001 From: hachem Date: Sun, 17 Aug 2025 22:38:29 +0200 Subject: Add World builder state --- src/States/ConfigState.cpp | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) (limited to 'src/States/ConfigState.cpp') diff --git a/src/States/ConfigState.cpp b/src/States/ConfigState.cpp index 1470c6d..69bb2f1 100644 --- a/src/States/ConfigState.cpp +++ b/src/States/ConfigState.cpp @@ -16,20 +16,20 @@ namespace Donut const auto& settings = SettingsManager::GetSettingsConst(); - m_SelectedAPI = (settings.graphics.renderAPI == "Vulkan") ? RendererAPI::API::Vulkan : RendererAPI::API::OpenGL; - m_SelectedTheme = (settings.graphics.selectedTheme == "Light") ? 1 : - (settings.graphics.selectedTheme == "Blue") ? 2 : 0; - m_TargetFPS = settings.simulation.targetFPS; - m_ComputeHeight = settings.simulation.computeHeight; - m_MaxStepsMoving = settings.simulation.maxStepsMoving; - m_MaxStepsStatic = settings.simulation.maxStepsStatic; - m_EarlyExitDistance = settings.simulation.earlyExitDistance; - m_GravityEnabled = settings.simulation.gravityEnabled; - m_VSyncEnabled = settings.graphics.vSyncEnabled; - m_ShowFPS = settings.graphics.showFPS; + m_SelectedAPI = (settings.graphics.renderAPI == "Vulkan") ? RendererAPI::API::Vulkan : RendererAPI::API::OpenGL; + m_SelectedTheme = (settings.graphics.selectedTheme == "Light") ? 1 : + (settings.graphics.selectedTheme == "Blue") ? 2 : 0; + m_TargetFPS = settings.simulation.targetFPS; + m_ComputeHeight = settings.simulation.computeHeight; + m_MaxStepsMoving = settings.simulation.maxStepsMoving; + m_MaxStepsStatic = settings.simulation.maxStepsStatic; + m_EarlyExitDistance = settings.simulation.earlyExitDistance; + m_GravityEnabled = settings.simulation.gravityEnabled; + m_VSyncEnabled = settings.graphics.vSyncEnabled; + m_ShowFPS = settings.graphics.showFPS; m_ShowPerformanceMetrics = settings.graphics.showPerformanceMetrics; - m_ShowDebugInfo = settings.graphics.showDebugInfo; - m_EnableAntiAliasing = settings.graphics.enableAntiAliasing; + m_ShowDebugInfo = settings.graphics.showDebugInfo; + m_EnableAntiAliasing = settings.graphics.enableAntiAliasing; } void ConfigState::OnExit() @@ -52,7 +52,7 @@ namespace Donut void ConfigState::OnRender() { - Renderer::SetClearColor({ 0.05f, 0.05f, 0.1f, 1.0f }); + Renderer::SetClearColor({ 0.1f, 0.1f, 0.1f, 1.0f }); Renderer::Clear(); } @@ -104,6 +104,7 @@ namespace Donut if (isSelected) ImGui::SetItemDefaultFocus(); } + ImGui::EndCombo(); } @@ -215,7 +216,7 @@ namespace Donut ImGui::Separator(); ImGui::Spacing(); - float buttonWidth = (ImGui::GetWindowWidth() - 100) / 5.0f; + float buttonWidth = (ImGui::GetWindowWidth() - 120) / 6.0f; if (ImGui::Button("Start Simulation", ImVec2(buttonWidth, 35))) { @@ -223,6 +224,13 @@ namespace Donut Application::Get().GetStateManager().SwitchToState("Simulation"); } + ImGui::SameLine(); + if (ImGui::Button("World Builder", ImVec2(buttonWidth, 35))) + { + ApplySettings(); + Application::Get().GetStateManager().SwitchToState("WorldBuilder"); + } + ImGui::SameLine(); if (ImGui::Button("Reset to Defaults", ImVec2(buttonWidth, 35))) ResetToDefaults(); -- cgit v1.3