Make prelaunch fade out smoother

This commit is contained in:
Luke Street
2026-05-03 22:01:02 -06:00
parent dccba23980
commit c4b2e2e501
7 changed files with 18 additions and 18 deletions
+1 -1
+1 -1
View File
@@ -12,7 +12,7 @@ body {
background-color: #000000;
decorator: image(../prelaunch-bg.png cover left center);
filter: opacity(0);
transition: filter 1s 0.1s linear-in-out;
transition: filter 1s 0.2s linear-in-out;
}
body[open] {
+4
View File
@@ -31,6 +31,10 @@ public:
show();
}
}
void push(std::unique_ptr<Document> document) {
push_document(std::move(document));
hide(false);
}
void pop() {
hide(true);
show_top_document();
+2 -2
View File
@@ -35,11 +35,11 @@ Popup::Popup() : Document(kDocumentSource), mRoot(mDocument->GetElementById("pop
.onClose = [this] { hide(false); },
.autoSelect = false,
});
mTabBar->add_tab("Settings", [] { push_document(std::make_unique<SettingsWindow>()); });
mTabBar->add_tab("Settings", [this] { push(std::make_unique<SettingsWindow>()); });
// mTabBar->add_tab("Warp", [] {
// // TODO
// });
mTabBar->add_tab("Editor", [] { push_document(std::make_unique<EditorWindow>()); });
mTabBar->add_tab("Editor", [this] { push(std::make_unique<EditorWindow>()); });
mTabBar->add_tab("Reset", [this] {
JUTGamePad::C3ButtonReset::sResetSwitchPushing = true;
mTabBar->set_active_tab(-1);
+1 -2
View File
@@ -125,8 +125,7 @@ Prelaunch::Prelaunch() : Document(kDocumentSource), mRoot(mDocument->GetElementB
apply_intro_animation(mMenuButtons.back()->root(), "delay-1");
mMenuButtons.push_back(std::make_unique<Button>(menuList, "Options"));
mMenuButtons.back()->on_pressed(
[] { push_document(std::make_unique<PrelaunchOptions>()); });
mMenuButtons.back()->on_pressed([this] { push(std::make_unique<PrelaunchOptions>()); });
apply_intro_animation(mMenuButtons.back()->root(), "delay-2");
mMenuButtons.push_back(std::make_unique<Button>(menuList, "Quit To Desktop"));
+9 -9
View File
@@ -368,7 +368,7 @@ SettingsWindow::SettingsWindow() {
leftPane.add_section("Controller");
leftPane.add_button("Configure Controller")
.on_pressed([] { push_document(std::make_unique<ControllerConfigWindow>()); })
.on_pressed([this] { push(std::make_unique<ControllerConfigWindow>()); })
.on_focus([&rightPane](Rml::Event&) {
rightPane.clear();
rightPane.add_text("Open controller binding configuration.");
@@ -474,10 +474,10 @@ SettingsWindow::SettingsWindow() {
getSettings().game.internalResolutionScale.getDefaultValue();
},
})
.on_nav_command([](Rml::Event&, NavCommand cmd) {
.on_nav_command([this](Rml::Event&, NavCommand cmd) {
if (cmd == NavCommand::Confirm || cmd == NavCommand::Left ||
cmd == NavCommand::Right) {
push_document(std::make_unique<Overlay>(OverlayProps{
push(std::make_unique<Overlay>(OverlayProps{
.option = GraphicsOption::InternalResolution,
.title = "Internal Resolution",
.helpText = kInternalResolutionHelpText,
@@ -507,10 +507,10 @@ SettingsWindow::SettingsWindow() {
getSettings().game.shadowResolutionMultiplier.getDefaultValue();
},
})
.on_nav_command([](Rml::Event&, NavCommand cmd) {
.on_nav_command([this](Rml::Event&, NavCommand cmd) {
if (cmd == NavCommand::Confirm || cmd == NavCommand::Left ||
cmd == NavCommand::Right) {
push_document(std::make_unique<Overlay>(OverlayProps{
push(std::make_unique<Overlay>(OverlayProps{
.option = GraphicsOption::ShadowResolution,
.title = "Shadow Resolution",
.helpText = kShadowResolutionHelpText,
@@ -542,10 +542,10 @@ SettingsWindow::SettingsWindow() {
getSettings().game.bloomMode.getDefaultValue();
},
})
.on_nav_command([](Rml::Event&, NavCommand cmd) {
.on_nav_command([this](Rml::Event&, NavCommand cmd) {
if (cmd == NavCommand::Confirm || cmd == NavCommand::Left ||
cmd == NavCommand::Right) {
push_document(std::make_unique<Overlay>(OverlayProps{
push(std::make_unique<Overlay>(OverlayProps{
.option = GraphicsOption::BloomMode,
.title = "Bloom",
.helpText = kBloomHelpText,
@@ -577,10 +577,10 @@ SettingsWindow::SettingsWindow() {
getSettings().game.bloomMultiplier.getDefaultValue();
},
})
.on_nav_command([](Rml::Event&, NavCommand cmd) {
.on_nav_command([this](Rml::Event&, NavCommand cmd) {
if (cmd == NavCommand::Confirm || cmd == NavCommand::Left ||
cmd == NavCommand::Right) {
push_document(std::make_unique<Overlay>(OverlayProps{
push(std::make_unique<Overlay>(OverlayProps{
.option = GraphicsOption::BloomMultiplier,
.title = "Bloom Brightness",
.helpText = kBloomBrightnessHelpText,
-3
View File
@@ -52,9 +52,6 @@ void shutdown() noexcept {
}
Document& push_document(std::unique_ptr<Document> doc, bool show) noexcept {
if (auto* top = top_document()) {
top->hide(false);
}
Document& ret = *doc;
sDocuments.push_back({std::move(doc)});
if (show) {