Author: cazfi
Date: Thu Oct 15 18:20:39 2015
New Revision: 30093

URL: http://svn.gna.org/viewcvs/freeciv?rev=30093&view=rev
Log:
Replaced misnamed "draw specials" client options with "draw resources" and 
"draw huts".

See patch #6420

Modified:
    trunk/client/control.c
    trunk/client/control.h
    trunk/client/gui-gtk-2.0/menu.c
    trunk/client/gui-gtk-3.0/menu.c
    trunk/client/gui-sdl/mapctrl.c
    trunk/client/gui-sdl2/mapctrl.c
    trunk/client/options.c
    trunk/client/options.h
    trunk/client/tilespec.c
    trunk/data/gtk_menus.xml

Modified: trunk/client/control.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/control.c?rev=30093&r1=30092&r2=30093&view=diff
==============================================================================
--- trunk/client/control.c      (original)
+++ trunk/client/control.c      Thu Oct 15 18:20:39 2015
@@ -2102,15 +2102,28 @@
 }
 
 /**************************************************************************
- Toggle display of specials
-**************************************************************************/
-void request_toggle_specials(void)
+ Toggle display of resources
+**************************************************************************/
+void request_toggle_resources(void)
 {
   if (!can_client_change_view()) {
     return;
   }
 
   options.draw_specials ^= 1;
+  update_map_canvas_visible();
+}
+
+/**************************************************************************
+ Toggle display of huts
+**************************************************************************/
+void request_toggle_huts(void)
+{
+  if (!can_client_change_view()) {
+    return;
+  }
+
+  options.draw_huts ^= 1;
   update_map_canvas_visible();
 }
 
@@ -3255,11 +3268,19 @@
 }
 
 /**************************************************************************
-  Handle user 'toggle specials display' input
-**************************************************************************/
-void key_specials_toggle(void)
-{
-  request_toggle_specials();
+  Handle user 'toggle resources display' input
+**************************************************************************/
+void key_resources_toggle(void)
+{
+  request_toggle_resources();
+}
+
+/**************************************************************************
+  Handle user 'toggle huts display' input
+**************************************************************************/
+void key_huts_toggle(void)
+{
+  request_toggle_huts();
 }
 
 /**************************************************************************

Modified: trunk/client/control.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/control.h?rev=30093&r1=30092&r2=30093&view=diff
==============================================================================
--- trunk/client/control.h      (original)
+++ trunk/client/control.h      Thu Oct 15 18:20:39 2015
@@ -143,7 +143,8 @@
 void request_toggle_irrigation(void);
 void request_toggle_mines(void);
 void request_toggle_bases(void);
-void request_toggle_specials(void);
+void request_toggle_resources(void);
+void request_toggle_huts(void);
 void request_toggle_pollution(void);
 void request_toggle_cities(void);
 void request_toggle_units(void);
@@ -195,7 +196,8 @@
 void key_irrigation_toggle(void);
 void key_mines_toggle(void);
 void key_bases_toggle(void);
-void key_specials_toggle(void);
+void key_resources_toggle(void);
+void key_huts_toggle(void);
 void key_pollution_toggle(void);
 void key_cities_toggle(void);
 void key_units_toggle(void);

Modified: trunk/client/gui-gtk-2.0/menu.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-2.0/menu.c?rev=30093&r1=30092&r2=30093&view=diff
==============================================================================
--- trunk/client/gui-gtk-2.0/menu.c     (original)
+++ trunk/client/gui-gtk-2.0/menu.c     Thu Oct 15 18:20:39 2015
@@ -715,12 +715,22 @@
 }
 
 /****************************************************************
-  Action "SHOW_SPECIALS" callback.
-*****************************************************************/
-static void show_specials_callback(GtkToggleAction *action, gpointer data)
+  Action "SHOW_RESOURCES" callback.
+*****************************************************************/
+static void show_resources_callback(GtkToggleAction *action, gpointer data)
 {
   if (options.draw_specials ^ gtk_toggle_action_get_active(action)) {
-    key_specials_toggle();
+    key_resources_toggle();
+  }
+}
+
+/****************************************************************
+  Action "SHOW_HUTS" callback.
+*****************************************************************/
+static void show_huts_callback(GtkToggleAction *action, gpointer data)
+{
+  if (options.draw_huts ^ gtk_toggle_action_get_active(action)) {
+    key_huts_toggle();
   }
 }
 
@@ -1558,8 +1568,10 @@
       {"SHOW_BASES", NULL, _("_Bases"),
        NULL, NULL, G_CALLBACK(show_bases_callback), FALSE},
 
-      {"SHOW_SPECIALS", NULL, _("_Specials"),
-       NULL, NULL, G_CALLBACK(show_specials_callback), FALSE},
+      {"SHOW_RESOURCES", NULL, _("_Resources"),
+       NULL, NULL, G_CALLBACK(show_resources_callback), FALSE},
+      {"SHOW_HUTS", NULL, _("_Huts"),
+       NULL, NULL, G_CALLBACK(show_huts_callback), FALSE},
       {"SHOW_POLLUTION", NULL, _("Po_llution & Fallout"),
        NULL, NULL, G_CALLBACK(show_pollution_callback), FALSE},
       {"SHOW_CITIES", NULL, _("Citi_es"),
@@ -2649,7 +2661,8 @@
   menus_set_active(safe_group, "SHOW_IRRIGATION", options.draw_irrigation);
   menus_set_active(safe_group, "SHOW_MINES", options.draw_mines);
   menus_set_active(safe_group, "SHOW_BASES", options.draw_fortress_airbase);
-  menus_set_active(safe_group, "SHOW_SPECIALS", options.draw_specials);
+  menus_set_active(safe_group, "SHOW_RESOURCES", options.draw_specials);
+  menus_set_active(safe_group, "SHOW_HUTS", options.draw_huts);
   menus_set_active(safe_group, "SHOW_POLLUTION", options.draw_pollution);
   menus_set_active(safe_group, "SHOW_CITIES", options.draw_cities);
   menus_set_active(safe_group, "SHOW_UNITS", options.draw_units);

Modified: trunk/client/gui-gtk-3.0/menu.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.0/menu.c?rev=30093&r1=30092&r2=30093&view=diff
==============================================================================
--- trunk/client/gui-gtk-3.0/menu.c     (original)
+++ trunk/client/gui-gtk-3.0/menu.c     Thu Oct 15 18:20:39 2015
@@ -715,12 +715,22 @@
 }
 
 /****************************************************************
-  Action "SHOW_SPECIALS" callback.
-*****************************************************************/
-static void show_specials_callback(GtkToggleAction *action, gpointer data)
+  Action "SHOW_RESOURCES" callback.
+*****************************************************************/
+static void show_resources_callback(GtkToggleAction *action, gpointer data)
 {
   if (options.draw_specials ^ gtk_toggle_action_get_active(action)) {
-    key_specials_toggle();
+    key_resources_toggle();
+  }
+}
+
+/****************************************************************
+  Action "SHOW_HUTS" callback.
+*****************************************************************/
+static void show_huts_callback(GtkToggleAction *action, gpointer data)
+{
+  if (options.draw_huts ^ gtk_toggle_action_get_active(action)) {
+    key_huts_toggle();
   }
 }
 
@@ -1559,8 +1569,10 @@
       {"SHOW_BASES", NULL, _("_Bases"),
        NULL, NULL, G_CALLBACK(show_bases_callback), FALSE},
 
-      {"SHOW_SPECIALS", NULL, _("_Specials"),
-       NULL, NULL, G_CALLBACK(show_specials_callback), FALSE},
+      {"SHOW_RESOURCES", NULL, _("_Resources"),
+       NULL, NULL, G_CALLBACK(show_resources_callback), FALSE},
+      {"SHOW_HUTS", NULL, _("_Huts"),
+       NULL, NULL, G_CALLBACK(show_huts_callback), FALSE},
       {"SHOW_POLLUTION", NULL, _("Po_llution & Fallout"),
        NULL, NULL, G_CALLBACK(show_pollution_callback), FALSE},
       {"SHOW_CITIES", NULL, _("Citi_es"),
@@ -2650,7 +2662,8 @@
   menus_set_active(safe_group, "SHOW_IRRIGATION", options.draw_irrigation);
   menus_set_active(safe_group, "SHOW_MINES", options.draw_mines);
   menus_set_active(safe_group, "SHOW_BASES", options.draw_fortress_airbase);
-  menus_set_active(safe_group, "SHOW_SPECIALS", options.draw_specials);
+  menus_set_active(safe_group, "SHOW_RESOURCES", options.draw_specials);
+  menus_set_active(safe_group, "SHOW_HUTS", options.draw_huts);
   menus_set_active(safe_group, "SHOW_POLLUTION", options.draw_pollution);
   menus_set_active(safe_group, "SHOW_CITIES", options.draw_cities);
   menus_set_active(safe_group, "SHOW_UNITS", options.draw_units);

Modified: trunk/client/gui-sdl/mapctrl.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-sdl/mapctrl.c?rev=30093&r1=30092&r2=30093&view=diff
==============================================================================
--- trunk/client/gui-sdl/mapctrl.c      (original)
+++ trunk/client/gui-sdl/mapctrl.c      Thu Oct 15 18:20:39 2015
@@ -2439,10 +2439,17 @@
         }
         return FALSE;
   
-      /* show specials - Ctrl+s */
+      /* show resources - Ctrl+s */
       case SDLK_s:
         if (LCTRL || RCTRL) {
-          key_specials_toggle();
+          key_resources_toggle();
+        }
+        return FALSE;
+
+        /* show huts - Ctrl+s */
+      case SDLK_h:
+        if (LCTRL || RCTRL) {
+          key_huts_toggle();
         }
         return FALSE;
   

Modified: trunk/client/gui-sdl2/mapctrl.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-sdl2/mapctrl.c?rev=30093&r1=30092&r2=30093&view=diff
==============================================================================
--- trunk/client/gui-sdl2/mapctrl.c     (original)
+++ trunk/client/gui-sdl2/mapctrl.c     Thu Oct 15 18:20:39 2015
@@ -2610,10 +2610,17 @@
         }
         return FALSE;
 
-        /* show specials - Ctrl+s */
+        /* show resources - Ctrl+s */
       case SDLK_s:
         if (LCTRL || RCTRL) {
-          key_specials_toggle();
+          key_resources_toggle();
+        }
+        return FALSE;
+
+        /* show huts - Ctrl+h */
+      case SDLK_h:
+        if (LCTRL || RCTRL) {
+          key_huts_toggle();
         }
         return FALSE;
 

Modified: trunk/client/options.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/options.c?rev=30093&r1=30092&r2=30093&view=diff
==============================================================================
--- trunk/client/options.c      (original)
+++ trunk/client/options.c      Thu Oct 15 18:20:39 2015
@@ -149,6 +149,7 @@
   .draw_mines = TRUE,
   .draw_fortress_airbase = TRUE,
   .draw_specials = TRUE,
+  .draw_huts = TRUE,
   .draw_pollution = TRUE,
   .draw_cities = TRUE,
   .draw_units = TRUE,
@@ -1918,8 +1919,13 @@
                   N_("Setting this option will draw the bases on the map."),
                   COC_GRAPHICS, GUI_STUB, TRUE,
                   view_option_changed_callback),
-  GEN_BOOL_OPTION(draw_specials, N_("Draw the specials"),
-                  N_("Setting this option will draw the specials on the "
+  GEN_BOOL_OPTION(draw_specials, N_("Draw the resources"),
+                  N_("Setting this option will draw the resources on the "
+                     "map."),
+                  COC_GRAPHICS, GUI_STUB, TRUE,
+                  view_option_changed_callback),
+  GEN_BOOL_OPTION(draw_huts, N_("Draw the huts"),
+                  N_("Setting this option will draw the huts on the "
                      "map."),
                   COC_GRAPHICS, GUI_STUB, TRUE,
                   view_option_changed_callback),

Modified: trunk/client/options.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/options.h?rev=30093&r1=30092&r2=30093&view=diff
==============================================================================
--- trunk/client/options.h      (original)
+++ trunk/client/options.h      Thu Oct 15 18:20:39 2015
@@ -169,6 +169,7 @@
   bool draw_mines;
   bool draw_fortress_airbase;
   bool draw_specials;
+  bool draw_huts;
   bool draw_pollution;
   bool draw_cities;
   bool draw_units;

Modified: trunk/client/tilespec.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/tilespec.c?rev=30093&r1=30092&r2=30093&view=diff
==============================================================================
--- trunk/client/tilespec.c     (original)
+++ trunk/client/tilespec.c     Thu Oct 15 18:20:39 2015
@@ -4917,7 +4917,7 @@
     }
   }
   if (is_extra_caused_by(pextra, EC_HUT)) {
-    if (!options.draw_specials) {
+    if (!options.draw_huts) {
       return FALSE;
     }
   }

Modified: trunk/data/gtk_menus.xml
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/gtk_menus.xml?rev=30093&r1=30092&r2=30093&view=diff
==============================================================================
--- trunk/data/gtk_menus.xml    (original)
+++ trunk/data/gtk_menus.xml    Thu Oct 15 18:20:39 2015
@@ -55,7 +55,8 @@
         <menuitem action="SHOW_MINES" />
         <menuitem action="SHOW_BASES" />
       </menu>
-      <menuitem action="SHOW_SPECIALS" />
+      <menuitem action="SHOW_RESOURCES" />
+      <menuitem action="SHOW_HUTS" />
       <menuitem action="SHOW_POLLUTION" />
       <menuitem action="SHOW_CITIES" />
       <menuitem action="SHOW_UNITS" />


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to