gui: improve settings dialog

This commit is contained in:
oltolm 2024-11-10 02:00:14 +01:00 committed by bookmist
parent 2fa64c915f
commit b9cf81a776
3 changed files with 5 additions and 2 deletions

1
.gitignore vendored
View File

@ -17,3 +17,4 @@ CMakeUserPresets.json
compile_commands.json
# AppImage builder
appimage/linuxdeploy.AppImage
/.gdbinit

View File

@ -1231,10 +1231,11 @@ void draw_settings_dialog(GuiState &gui, EmuEnvState &emuenv) {
ImGui::SameLine(0, 20.f * SCALE.x);
const auto is_apply = !emuenv.io.app_path.empty() && (!is_custom_config || (emuenv.app_path == emuenv.io.app_path));
const auto is_reboot = (emuenv.renderer->current_backend != emuenv.backend_renderer) || (config.resolution_multiplier != emuenv.cfg.current_config.resolution_multiplier);
if (ImGui::Button(is_apply ? (is_reboot ? lang.main_window["save_reboot"].c_str() : lang.main_window["save_apply"].c_str()) : common.save_data.save["title"].c_str(), BUTTON_SIZE)) {
if (ImGui::Button(is_apply ? (is_reboot ? lang.main_window["save_reboot"].c_str() : lang.main_window["save_apply"].c_str()) : lang.main_window["save_close"].c_str(), BUTTON_SIZE)) {
save_config(gui, emuenv);
if (is_apply)
set_config(gui, emuenv, emuenv.io.app_path);
show_settings_dialog = false;
}
SetTooltipEx(lang.main_window["keep_changes"].c_str());

View File

@ -511,7 +511,8 @@ struct LangState {
{ "title", "Settings" },
{ "save_reboot", "Save & Reboot" },
{ "save_apply", "Save & Apply" },
{ "keep_changes", "Click on Save to keep your changes." }
{ "keep_changes", "Click on Save to keep your changes." },
{ "save_close", "Save & Close" }
};
std::map<std::string, std::string> core = {
{ "title", "Core" },