From 74f2c58b29d3e35d0f84f8779b5e646c4b6b2d74 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Mon, 4 May 2026 13:08:14 -0600 Subject: [PATCH] UI: Preset tweaks --- res/rml/window.rcss | 24 +++++++++++++++++------- src/dusk/imgui/ImGuiConsole.cpp | 8 -------- src/dusk/imgui/ImGuiConsole.hpp | 1 - src/dusk/ui/preset.cpp | 14 +++++++------- src/m_Do/m_Do_main.cpp | 10 ++++++---- 5 files changed, 30 insertions(+), 27 deletions(-) diff --git a/res/rml/window.rcss b/res/rml/window.rcss index 1fe36fdf00..db3558778a 100644 --- a/res/rml/window.rcss +++ b/res/rml/window.rcss @@ -3,6 +3,7 @@ } body { + display: flex; width: 100%; height: 100%; padding: 64dp; @@ -17,6 +18,7 @@ window { display: flex; flex-flow: column; height: 100%; + width: 100%; max-width: 1088dp; max-height: 768dp; margin: auto; @@ -32,6 +34,15 @@ window { transition: filter transform 0.2s cubic-in-out; } +window.small { + height: auto; + width: auto; +} + +window.preset { + min-width: 650dp; +} + window[open] { filter: opacity(1); transform: scale(1); @@ -62,7 +73,7 @@ window tab-bar tab { window content { display: flex; - flex: 1 1 0; + flex: 1 1 auto; min-width: 0; min-height: 0; overflow: hidden; @@ -72,7 +83,6 @@ window content pane { display: flex; flex-flow: column; flex: 1 1 0; - height: 100%; min-width: 0; min-height: 0; padding: 24dp; @@ -345,7 +355,7 @@ button.achievement-clear { flex-flow: column; padding: 32dp; gap: 20dp; - flex: 1 1 0; + flex: 0 1 auto; } .preset-title { @@ -358,7 +368,7 @@ button.achievement-clear { .preset-intro { display: block; - font-size: 16dp; + font-size: 18dp; text-align: center; color: rgba(224, 219, 200, 65%); } @@ -367,7 +377,7 @@ button.achievement-clear { display: flex; flex-direction: row; gap: 20dp; - flex: 1 1 0; + flex: 0 1 auto; align-items: flex-start; } @@ -385,7 +395,7 @@ button.preset-btn { .preset-desc { display: block; - font-size: 15dp; - color: rgba(224, 219, 200, 55%); + font-size: 16dp; + color: rgba(224, 219, 200, 65%); text-align: center; } diff --git a/src/dusk/imgui/ImGuiConsole.cpp b/src/dusk/imgui/ImGuiConsole.cpp index daeeb472d3..355ef14450 100644 --- a/src/dusk/imgui/ImGuiConsole.cpp +++ b/src/dusk/imgui/ImGuiConsole.cpp @@ -304,14 +304,6 @@ namespace dusk { } ImGui::PopStyleColor(); - if (!getSettings().backend.wasPresetChosen) { - if (!m_presetShown) { - m_presetShown = true; - dusk::ui::push_document(std::make_unique()); - } - return; - } - if (dusk::IsGameLaunched && !m_isLaunchInitialized) { AddToast(ImGui::GetIO().MouseSource == ImGuiMouseSource_TouchScreen ? "3-finger tap to toggle menu"s : diff --git a/src/dusk/imgui/ImGuiConsole.hpp b/src/dusk/imgui/ImGuiConsole.hpp index c203ba5a5f..1755c02856 100644 --- a/src/dusk/imgui/ImGuiConsole.hpp +++ b/src/dusk/imgui/ImGuiConsole.hpp @@ -44,7 +44,6 @@ private: ImVec2 m_dragScrollLastMousePos = {}; std::deque m_toasts; - bool m_presetShown = false; ImGuiMenuGame m_menuGame; ImGuiPreLaunchWindow m_preLaunchWindow; diff --git a/src/dusk/ui/preset.cpp b/src/dusk/ui/preset.cpp index 2bf171a8e3..c636402eb2 100644 --- a/src/dusk/ui/preset.cpp +++ b/src/dusk/ui/preset.cpp @@ -61,7 +61,7 @@ const Rml::String kDocumentSource = R"RML( - +
@@ -88,8 +88,8 @@ PresetWindow::PresetWindow() auto* intro = createElement(dialog, "div"); intro->SetClass("preset-intro", true); intro->SetInnerRML( - "Choose a preset to get started. " - "You can change any setting later from the Enhancements menu."); + "Choose a preset to get started.
" + "You can change any setting later from the Settings menu."); auto* grid = createElement(dialog, "div"); grid->SetClass("preset-grid", true); @@ -102,11 +102,11 @@ PresetWindow::PresetWindow() static constexpr PresetInfo kPresets[] = { {"Classic", - "All enhancements disabled to match the GameCube version. " + "Enhancements disabled to match the GameCube version. " "Good for speedrunning or simple nostalgia!", applyPresetClassic}, {"Dusk", - "Graphical enhancements & quality of life tweaks. " + "Graphics & quality of life tweaks, including some from the Wii U version. " "Our recommended way to play!", applyPresetDusk}, }; @@ -131,7 +131,7 @@ PresetWindow::PresetWindow() auto* desc = createElement(col, "div"); desc->SetClass("preset-desc", true); - desc->SetInnerRML(escape(preset.desc)); + desc->SetInnerRML(preset.desc); } } @@ -151,7 +151,7 @@ bool PresetWindow::visible() const { bool PresetWindow::focus() { if (!mButtons.empty()) { - return mButtons.front()->focus(); + return mButtons.back()->focus(); } return false; } diff --git a/src/m_Do/m_Do_main.cpp b/src/m_Do/m_Do_main.cpp index 09979a4113..c2984e3863 100644 --- a/src/m_Do/m_Do_main.cpp +++ b/src/m_Do/m_Do_main.cpp @@ -52,15 +52,14 @@ #include "dusk/frame_interpolation.h" #include "dusk/game_clock.h" #include "dusk/gyro.h" +#include "dusk/imgui/ImGuiConsole.hpp" #include "dusk/imgui/ImGuiEngine.hpp" #include "dusk/logging.h" #include "dusk/main.h" -#include "dusk/imgui/ImGuiConsole.hpp" -#include "dusk/ui/ui.hpp" -#include "dusk/ui/editor.hpp" #include "dusk/ui/popup.hpp" #include "dusk/ui/prelaunch.hpp" -#include "dusk/ui/settings.hpp" +#include "dusk/ui/preset.hpp" +#include "dusk/ui/ui.hpp" #include "version.h" #include @@ -634,6 +633,9 @@ int game_main(int argc, char* argv[]) { } dusk::ui::push_document(std::make_unique(), false); + if (!dusk::getSettings().backend.wasPresetChosen) { + dusk::ui::push_document(std::make_unique()); + } dusk::version::init(); LanguageInit();