From 34d3431e49f30f3b47d85b090daa73add9240fee Mon Sep 17 00:00:00 2001 From: "Laurent Alonso(fr)" Date: Wed, 10 Jun 2020 16:01:06 +0200 Subject: [PATCH] Boe Character/Scenario Editor[OsX]: retrieve also PlaySound in the preferences... --- rsrc/dialogs/pref-character.xml | 3 ++- rsrc/dialogs/pref-scenario.xml | 3 ++- src/pcedit/pc.main.cpp | 2 ++ src/scenedit/scen.main.cpp | 4 +++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/rsrc/dialogs/pref-character.xml b/rsrc/dialogs/pref-character.xml index 4466a73a..ea26407a 100644 --- a/rsrc/dialogs/pref-character.xml +++ b/rsrc/dialogs/pref-character.xml @@ -5,7 +5,8 @@ BoE Character Editor Preferences - Apply UI scaling + No Sounds + Apply UI scaling diff --git a/rsrc/dialogs/pref-scenario.xml b/rsrc/dialogs/pref-scenario.xml index 7567a844..63f09175 100644 --- a/rsrc/dialogs/pref-scenario.xml +++ b/rsrc/dialogs/pref-scenario.xml @@ -5,7 +5,8 @@ BoE Scenario Editor Preferences - Apply UI scaling + No Sounds + Apply UI scaling diff --git a/src/pcedit/pc.main.cpp b/src/pcedit/pc.main.cpp index 00aebc8c..1daed736 100644 --- a/src/pcedit/pc.main.cpp +++ b/src/pcedit/pc.main.cpp @@ -516,6 +516,7 @@ bool prefs_event_filter (cDialog& me, std::string id, eKeyMod) { set_pref("UIScale", 1.0); else if(ui_scale.getState() == led_red) set_pref("UIScale", 2.0); + set_pref("PlaySounds", dynamic_cast(me["nosound"]).getState() == led_off); } save_prefs(); return true; @@ -529,6 +530,7 @@ void pick_preferences() { float ui_scale = get_float_pref("UIScale", 1.0); dynamic_cast(prefsDlog["scaleui"]).setState(ui_scale == 1.0 ? led_off : (ui_scale == 2.0 ? led_red : led_green)); + dynamic_cast(prefsDlog["nosound"]).setState(get_bool_pref("PlaySounds", true) ? led_off : led_red); prefsDlog.run(); diff --git a/src/scenedit/scen.main.cpp b/src/scenedit/scen.main.cpp index 3a571c64..2562eb51 100644 --- a/src/scenedit/scen.main.cpp +++ b/src/scenedit/scen.main.cpp @@ -655,7 +655,7 @@ void handle_menu_choice(eMenu item_hit) { void save_prefs(){ bool success = sync_prefs(); if(!success){ - showWarning("There was a problem writing to the preferences file. When the game is next run the preferences will revert to their previously set values.","Should you manage to resolve the problem without closing the program, simply open the preferences screen and click \"OK\" to try again."); + showWarning("There was a problem writing to the preferences file. When the Scenerio Editor is next run the preferences will revert to their previously set values.","Should you manage to resolve the problem without closing the program, simply open the preferences screen and click \"OK\" to try again."); } } @@ -675,6 +675,7 @@ bool prefs_event_filter (cDialog& me, std::string id, eKeyMod) { set_pref("UIScale", 1.0); else if(ui_scale.getState() == led_red) set_pref("UIScale", 2.0); + set_pref("PlaySounds", dynamic_cast(me["nosound"]).getState() == led_off); } save_prefs(); return true; @@ -688,6 +689,7 @@ void pick_preferences() { float ui_scale = get_float_pref("UIScale", 1.0); dynamic_cast(prefsDlog["scaleui"]).setState(ui_scale == 1.0 ? led_off : (ui_scale == 2.0 ? led_red : led_green)); + dynamic_cast(prefsDlog["nosound"]).setState(get_bool_pref("PlaySounds", true) ? led_off : led_red); prefsDlog.run();