implement the preference with an LED group for clarity
This commit is contained in:
@@ -41,9 +41,13 @@
|
||||
<led name='slow' relative='pos pos-in' anchor='med' top='0' left='15'>Slow</led>
|
||||
<led name='snail' relative='pos pos-in' anchor='slow' top='0' left='15'>Quite Slow</led>
|
||||
</group>
|
||||
<text name='misc-head' size='large' relative='pos-in pos' anchor='spd-head' top='30' left='0' width='182' height='17'>Miscellaneous:</text>
|
||||
<text name='keyshift-head' size='large' relative='pos-in pos' anchor='spd-head' top='30' left='0' width='182' height='17'>When targeting, directional keys should:</text>
|
||||
<group name='keyshift-options'>
|
||||
<led name='screen-shift' relative='pos-in pos' anchor='keyshift-head' top='4' left='15'>Shift the screen</led>
|
||||
<led name='target-adjacent' relative='pos pos-in' anchor='screen-shift' top='0' left='15'>Select adjacent squares</led>
|
||||
</group>
|
||||
<text name='misc-head' size='large' relative='pos-in pos' anchor='keyshift-head' top='30' left='0' width='182' height='17'>Miscellaneous:</text>
|
||||
<led name='nosound' relative='pos-in pos' anchor='misc-head' top='6' left='15'>No Sounds</led>
|
||||
<led name='keyshift' relative='pos-in pos' rel-anchor='prev' top='10' left='0'>Directional keys can shift the screen</led>
|
||||
<led name='repeatdesc' relative='pos-in pos' rel-anchor='prev' top='10' left='0'>Show room descriptions more than once</led>
|
||||
<led name='easier' relative='pos-in pos' rel-anchor='prev' top='10' left='0'>Make game easier (monsters much weaker)</led>
|
||||
<led name='lesswm' relative='pos-in pos' rel-anchor='prev' top='10' left='0'>Fewer wandering monsters</led>
|
||||
|
||||
@@ -1185,7 +1185,7 @@ static bool prefs_event_filter (cDialog& me, std::string id, eKeyMod) {
|
||||
else if(cur_display_mode == "br") set_pref("DisplayMode", 4);
|
||||
else if(cur_display_mode == "win") set_pref("DisplayMode", 5);
|
||||
set_pref("PlaySounds", dynamic_cast<cLed&>(me["nosound"]).getState() == led_off);
|
||||
set_pref("DirectionalKeyScrolling", dynamic_cast<cLed&>(me["keyshift"]).getState() != led_off);
|
||||
set_pref("DirectionalKeyScrolling", dynamic_cast<cLed&>(me["screen-shift"]).getState() != led_off);
|
||||
set_pref("RepeatRoomDescriptions", dynamic_cast<cLed&>(me["repeatdesc"]).getState() != led_off);
|
||||
set_pref("ShowInstantHelp", dynamic_cast<cLed&>(me["nohelp"]).getState() == led_off);
|
||||
|
||||
@@ -1279,7 +1279,6 @@ void pick_preferences(bool record) {
|
||||
}
|
||||
|
||||
dynamic_cast<cLed&>(prefsDlog["nosound"]).setState(get_bool_pref("PlaySounds", true) ? led_off : led_red);
|
||||
dynamic_cast<cLed&>(prefsDlog["keyshift"]).setState(get_bool_pref("DirectionalKeyScrolling", true) ? led_red : led_off);
|
||||
dynamic_cast<cLed&>(prefsDlog["repeatdesc"]).setState(get_bool_pref("RepeatRoomDescriptions") ? led_red : led_off);
|
||||
dynamic_cast<cLed&>(prefsDlog["nohelp"]).setState(get_bool_pref("ShowInstantHelp", true) ? led_off : led_red);
|
||||
if(overall_mode == MODE_STARTUP && !party_in_memory) {
|
||||
@@ -1306,6 +1305,13 @@ void pick_preferences(bool record) {
|
||||
break;
|
||||
}
|
||||
|
||||
cLedGroup& keyshiftOptions = dynamic_cast<cLedGroup&>(prefsDlog["keyshift-options"]);
|
||||
if(get_bool_pref("DirectionalKeyScrolling", true)){
|
||||
keyshiftOptions.setSelected("screen-shift");
|
||||
}else{
|
||||
keyshiftOptions.setSelected("target-adjacent");
|
||||
}
|
||||
|
||||
cLedGroup& uiScale = dynamic_cast<cLedGroup&>(prefsDlog["scaleui"]);
|
||||
double ui_scale = get_ui_scale();
|
||||
if (ui_scale>0.95 && ui_scale<1.05) uiScale.setSelected("1");
|
||||
|
||||
Reference in New Issue
Block a user