mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-05 11:33:39 -04:00
Add setting to memorize window size (#2025)
* Add "Memorize Window Size" setting * Code review #2025 * memorize -> remember, helpText revision --------- Co-authored-by: Irastris <irastris15@gmail.com>
This commit is contained in:
@@ -802,6 +802,21 @@ SettingsWindow::SettingsWindow(bool prelaunch) : mPrelaunch(prelaunch) {
|
||||
pane.add_rml(
|
||||
"<br/>Display the current framerate in a corner of the screen while playing.");
|
||||
});
|
||||
config_bool_select(leftPane, rightPane, getSettings().video.rememberWindowSize,
|
||||
{
|
||||
.key = "Remember Window Size",
|
||||
.helpText = "Save and restore the previous session's window size when opening Dusklight.",
|
||||
.onChange =
|
||||
[](bool value) {
|
||||
if (value && !dusk::getSettings().video.enableFullscreen) {
|
||||
const auto windowSize = aurora::window::get_window_size();
|
||||
dusk::getSettings().video.lastWindowWidth.setValue(windowSize.width);
|
||||
dusk::getSettings().video.lastWindowHeight.setValue(windowSize.height);
|
||||
dusk::config::Save();
|
||||
}
|
||||
},
|
||||
.isDisabled = [] { return IsMobile; },
|
||||
});
|
||||
leftPane.add_section("Resolution");
|
||||
graphics_tuner_control(*this, leftPane, rightPane,
|
||||
getSettings().game.internalResolutionScale,
|
||||
|
||||
Reference in New Issue
Block a user