mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-08 03:37:02 -04:00
UI: Preset tweaks
This commit is contained in:
+17
-7
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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<dusk::ui::PresetWindow>());
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (dusk::IsGameLaunched && !m_isLaunchInitialized) {
|
||||
AddToast(ImGui::GetIO().MouseSource == ImGuiMouseSource_TouchScreen ?
|
||||
"3-finger tap to toggle menu"s :
|
||||
|
||||
@@ -44,7 +44,6 @@ private:
|
||||
ImVec2 m_dragScrollLastMousePos = {};
|
||||
std::deque<Toast> m_toasts;
|
||||
|
||||
bool m_presetShown = false;
|
||||
ImGuiMenuGame m_menuGame;
|
||||
ImGuiPreLaunchWindow m_preLaunchWindow;
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ const Rml::String kDocumentSource = R"RML(
|
||||
<link type="text/rcss" href="res/rml/window.rcss" />
|
||||
</head>
|
||||
<body>
|
||||
<window id="window">
|
||||
<window id="window" class="small preset">
|
||||
<div id="preset-dialog" class="preset-dialog"></div>
|
||||
</window>
|
||||
</body>
|
||||
@@ -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.<br/>"
|
||||
"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;
|
||||
}
|
||||
|
||||
@@ -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 <aurora/aurora.h>
|
||||
@@ -634,6 +633,9 @@ int game_main(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
dusk::ui::push_document(std::make_unique<dusk::ui::Popup>(), false);
|
||||
if (!dusk::getSettings().backend.wasPresetChosen) {
|
||||
dusk::ui::push_document(std::make_unique<dusk::ui::PresetWindow>());
|
||||
}
|
||||
|
||||
dusk::version::init();
|
||||
LanguageInit();
|
||||
|
||||
Reference in New Issue
Block a user