mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-09-26 09:18:40 -04:00
Implement letterbox mode selection in settings
Added letterbox mode options to settings UI.
This commit is contained in:
@@ -103,6 +103,13 @@ constexpr std::array kMagicArmorModes = {
|
||||
"Cosmetic",
|
||||
};
|
||||
|
||||
constexpr std::array kLetterboxModes = {
|
||||
"Off",
|
||||
"On",
|
||||
"Only During Cutscenes",
|
||||
"Only During Gameplay",
|
||||
};
|
||||
|
||||
bool try_parse_backend(std::string_view backend, AuroraBackend& outBackend) {
|
||||
if (backend == "auto") {
|
||||
outBackend = BACKEND_AUTO;
|
||||
@@ -889,11 +896,37 @@ SettingsWindow::SettingsWindow(bool prelaunch) : mPrelaunch(prelaunch) {
|
||||
"during some cutscenes, particularly on ultra-wide displays. "
|
||||
"Visuals beyond the original intended framing may appear buggy."
|
||||
});
|
||||
config_bool_select(leftPane, rightPane, getSettings().game.disableLetterboxing,
|
||||
{
|
||||
leftPane.register_control(
|
||||
leftPane.add_select_button({
|
||||
.key = "Disable Letterboxing",
|
||||
.helpText = "Disable the top and bottom black bars during L-targeting, aiming, "
|
||||
"cutscenes, dialogue, etc."
|
||||
.getValue =
|
||||
[] {
|
||||
return kLetterboxModes[static_cast<u8>(getSettings().game.disableLetterboxing.getValue())];
|
||||
},
|
||||
.isModified =
|
||||
[] {
|
||||
return getSettings().game.disableLetterboxing.getValue() !=
|
||||
getSettings().game.disableLetterboxing.getDefaultValue();
|
||||
},
|
||||
}),
|
||||
rightPane, [](Pane& pane) {
|
||||
for (int i = 0; i < static_cast<int>(kLetterboxModes.size()); i++) {
|
||||
pane.add_button({
|
||||
.text = kLetterboxModes[i],
|
||||
.isSelected =
|
||||
[i] {
|
||||
return getSettings().game.disableLetterboxing.getValue() == static_cast<LetterboxMode>(i);
|
||||
},
|
||||
})
|
||||
.on_pressed([i] {
|
||||
mDoAud_seStartMenu(kSoundItemChange);
|
||||
getSettings().game.disableLetterboxing.setValue(static_cast<LetterboxMode>(i));
|
||||
config::save();
|
||||
});
|
||||
}
|
||||
pane.add_rml(
|
||||
"<br/>Disable the top and bottom black bars during L-targeting, aiming, "
|
||||
"cutscenes, dialogue, etc.");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user