From d65233be9433a01c54e959aea72e87ff2e385937 Mon Sep 17 00:00:00 2001 From: hachem Date: Sun, 17 Aug 2025 22:38:29 +0200 Subject: feat: add world builder state --- src/states/config_state.cpp | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) (limited to 'src/states/config_state.cpp') diff --git a/src/states/config_state.cpp b/src/states/config_state.cpp index 1f1ef16..41fbaad 100644 --- a/src/states/config_state.cpp +++ b/src/states/config_state.cpp @@ -16,20 +16,20 @@ namespace Donut const auto& settings = SettingsManager::get_settings_const(); - m_selected_api = (settings.graphics.render_api == "Vulkan") ? RendererAPI::API::Vulkan : RendererAPI::API::OpenGL; - m_selected_theme = (settings.graphics.selected_theme == "Light") ? 1 : - (settings.graphics.selected_theme == "Blue") ? 2 : 0; - m_target_fps = settings.simulation.target_fps; - m_compute_height = settings.simulation.compute_height; - m_max_steps_moving = settings.simulation.max_steps_moving; - m_max_steps_static = settings.simulation.max_steps_static; - m_early_exit_distance = settings.simulation.early_exit_distance; - m_gravity_enabled = settings.simulation.gravity_enabled; - m_v_sync_enabled = settings.graphics.v_sync_enabled; - m_show_fps = settings.graphics.show_fps; + m_selected_api = (settings.graphics.render_api == "Vulkan") ? RendererAPI::API::Vulkan : RendererAPI::API::OpenGL; + m_selected_theme = (settings.graphics.selected_theme == "Light") ? 1 : + (settings.graphics.selected_theme == "Blue") ? 2 : 0; + m_target_fps = settings.simulation.target_fps; + m_compute_height = settings.simulation.compute_height; + m_max_steps_moving = settings.simulation.max_steps_moving; + m_max_steps_static = settings.simulation.max_steps_static; + m_early_exit_distance = settings.simulation.early_exit_distance; + m_gravity_enabled = settings.simulation.gravity_enabled; + m_v_sync_enabled = settings.graphics.v_sync_enabled; + m_show_fps = settings.graphics.show_fps; m_show_performance_metrics = settings.graphics.show_performance_metrics; - m_show_debug_info = settings.graphics.show_debug_info; - m_enable_anti_aliasing = settings.graphics.enable_anti_aliasing; + m_show_debug_info = settings.graphics.show_debug_info; + m_enable_anti_aliasing = settings.graphics.enable_anti_aliasing; } void ConfigState::on_exit() @@ -52,7 +52,7 @@ namespace Donut void ConfigState::on_render() { - Renderer::set_clear_color({ 0.05f, 0.05f, 0.1f, 1.0f }); + Renderer::set_clear_color({ 0.1f, 0.1f, 0.1f, 1.0f }); Renderer::clear(); } @@ -104,6 +104,7 @@ namespace Donut if (is_selected) ImGui::SetItemDefaultFocus(); } + ImGui::EndCombo(); } @@ -215,7 +216,7 @@ namespace Donut ImGui::Separator(); ImGui::Spacing(); - float button_width = (ImGui::GetWindowWidth() - 100) / 5.0f; + float button_width = (ImGui::GetWindowWidth() - 120) / 6.0f; if (ImGui::Button("Start Simulation", ImVec2(button_width, 35))) { @@ -223,6 +224,13 @@ namespace Donut Application::get().get_state_manager().switch_to_state("Simulation"); } + ImGui::SameLine(); + if (ImGui::Button("World Builder", ImVec2(button_width, 35))) + { + apply_settings(); + Application::get().get_state_manager().switch_to_state("WorldBuilder"); + } + ImGui::SameLine(); if (ImGui::Button("Reset to Defaults", ImVec2(button_width, 35))) reset_to_defaults(); -- cgit v1.3