mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-16 12:24:45 -04:00
Fix Graphics Backend option value (#2295)
* Graphics backend setting bugfix * Better solution
This commit is contained in:
@@ -220,6 +220,18 @@ AuroraBackend configured_backend() {
|
||||
return configuredBackend;
|
||||
}
|
||||
|
||||
bool is_graphics_backend_restart_pending() {
|
||||
return getSettings().backend.graphicsBackend.getValue() !=
|
||||
prelaunch_state().initialGraphicsBackend;
|
||||
}
|
||||
|
||||
Rml::String graphics_backend_display_name() {
|
||||
if (is_graphics_backend_restart_pending()) {
|
||||
return Rml::String{backend_name(configured_backend())};
|
||||
}
|
||||
return Rml::String{backend_name(aurora_get_backend())};
|
||||
}
|
||||
|
||||
Rml::String configured_data_path_display_name() {
|
||||
const auto path = data::abbreviated_path_string(data::configured_data_path());
|
||||
if (path.empty()) {
|
||||
@@ -602,12 +614,8 @@ SettingsWindow::SettingsWindow(bool prelaunch) : mPrelaunch(prelaunch) {
|
||||
leftPane.register_control(
|
||||
leftPane.add_select_button({
|
||||
.key = "Graphics Backend",
|
||||
.getValue = [] { return Rml::String{backend_name(aurora_get_backend())}; },
|
||||
.isModified =
|
||||
[] {
|
||||
return getSettings().backend.graphicsBackend.getValue() !=
|
||||
prelaunch_state().initialGraphicsBackend;
|
||||
},
|
||||
.getValue = [] { return graphics_backend_display_name(); },
|
||||
.isModified = [] { return is_graphics_backend_restart_pending(); },
|
||||
}),
|
||||
rightPane, [](Pane& pane) {
|
||||
const auto availableBackends = available_backends();
|
||||
|
||||
Reference in New Issue
Block a user