@@ -261,6 +261,20 @@ private void FrmSettings_Load(object sender,
261261 cbx_TryUseGeoNamesLanguage . Enabled = true ;
262262 }
263263
264+ // (re)set the map colour mode
265+ if ( rbt_MapColourModeDarkPale . Checked )
266+ {
267+ HelperVariables . SMapColourMode = "DarkPale" ;
268+ }
269+ else if ( rbt_MapColourModeDarkInverse . Checked )
270+ {
271+ HelperVariables . SMapColourMode = "DarkInverse" ;
272+ }
273+ else
274+ {
275+ HelperVariables . SMapColourMode = "Normal" ; // technically we could just ignore this
276+ }
277+
264278 _nowLoadingSettingsData = false ;
265279
266280 LoadCustomRulesDGV ( ) ;
@@ -480,6 +494,19 @@ private void Btn_Cancel_Click(object sender,
480494 private void Btn_OK_Click ( object sender ,
481495 EventArgs e )
482496 {
497+ List < string > rbtGeoNamesLanguage = new ( )
498+ {
499+ "rbt_UseGeoNamesLocalLanguage" ,
500+ "rbt_TryUseGeoNamesLanguage"
501+ } ;
502+
503+ List < string > rbtMapColourOptions = new ( )
504+ {
505+ "rbt_MapColourModeNormal" ,
506+ "rbt_MapColourModeDarkInverse" ,
507+ "rbt_MapColourModeDarkPale"
508+ } ;
509+
483510 HelperNonStatic helperNonstatic = new ( ) ;
484511 IEnumerable < Control > c = helperNonstatic . GetAllControls ( control : this ) ;
485512 if ( c != null )
@@ -521,8 +548,9 @@ private void Btn_OK_Click(object sender,
521548 if ( cItem is RadioButton rbt )
522549 {
523550 // this needs to be an IF rather than an ELSE IF
524- if ( rbt . Name == "rbt_UseGeoNamesLocalLanguage" || rbt . Name == "rbt_TryUseGeoNamesLanguage" )
551+ if ( rbtGeoNamesLanguage . Contains ( item : rbt . Name ) )
525552 {
553+ // (rbt.Font.Style & FontStyle.Bold) here means that there has been a change of state and it needs saving
526554 if ( ( rbt . Font . Style & FontStyle . Bold ) != 0 && rbt . Checked )
527555 {
528556 ComboBox cbxLng = cbx_TryUseGeoNamesLanguage ;
@@ -534,14 +562,26 @@ private void Btn_OK_Click(object sender,
534562 else if ( rbt . Name == "rbt_TryUseGeoNamesLanguage" )
535563 {
536564 cbxLng . Enabled = true ;
537- IEnumerable < KeyValuePair < string , string > > result = HelperGenericAncillaryListsArrays . GetISO_639_1_Languages ( )
538- . Where ( predicate : kvp => kvp . Value == cbxLng . SelectedItem . ToString ( ) ) ;
565+ IEnumerable < KeyValuePair < string , string > > result = HelperGenericAncillaryListsArrays
566+ . GetISO_639_1_Languages ( )
567+ . Where (
568+ predicate : kvp =>
569+ kvp . Value ==
570+ cbxLng . SelectedItem
571+ . ToString ( ) ) ;
539572
540573 HelperVariables . APILanguageToUse = result . FirstOrDefault ( )
541574 . Key ;
542575 }
543576 }
544577 }
578+ else if ( rbtMapColourOptions . Contains ( item : rbt . Name ) )
579+ {
580+ if ( ( rbt . Font . Style & FontStyle . Bold ) != 0 && rbt . Checked )
581+ {
582+ HelperVariables . SMapColourMode = rbt . Name . Replace ( oldValue : "rbt_MapColourMode" , newValue : "" ) ;
583+ }
584+ }
545585 }
546586 }
547587 }
0 commit comments