Author: cazfi
Date: Thu Oct 15 18:20:49 2015
New Revision: 30094

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

See patch #6420

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

Modified: branches/S2_6/client/control.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/control.c?rev=30094&r1=30093&r2=30094&view=diff
==============================================================================
--- branches/S2_6/client/control.c      (original)
+++ branches/S2_6/client/control.c      Thu Oct 15 18:20:49 2015
@@ -2077,15 +2077,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();
 }
 
@@ -3304,11 +3317,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: branches/S2_6/client/control.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/control.h?rev=30094&r1=30093&r2=30094&view=diff
==============================================================================
--- branches/S2_6/client/control.h      (original)
+++ branches/S2_6/client/control.h      Thu Oct 15 18:20:49 2015
@@ -144,7 +144,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);
@@ -196,7 +197,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: branches/S2_6/client/gui-gtk-2.0/menu.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-2.0/menu.c?rev=30094&r1=30093&r2=30094&view=diff
==============================================================================
--- branches/S2_6/client/gui-gtk-2.0/menu.c     (original)
+++ branches/S2_6/client/gui-gtk-2.0/menu.c     Thu Oct 15 18:20:49 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();
   }
 }
 
@@ -1550,8 +1560,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"),
@@ -2632,7 +2644,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: branches/S2_6/client/gui-gtk-3.0/menu.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.0/menu.c?rev=30094&r1=30093&r2=30094&view=diff
==============================================================================
--- branches/S2_6/client/gui-gtk-3.0/menu.c     (original)
+++ branches/S2_6/client/gui-gtk-3.0/menu.c     Thu Oct 15 18:20:49 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();
   }
 }
 
@@ -1551,8 +1561,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"),
@@ -2633,7 +2645,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: branches/S2_6/client/gui-sdl/mapctrl.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-sdl/mapctrl.c?rev=30094&r1=30093&r2=30094&view=diff
==============================================================================
--- branches/S2_6/client/gui-sdl/mapctrl.c      (original)
+++ branches/S2_6/client/gui-sdl/mapctrl.c      Thu Oct 15 18:20:49 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: branches/S2_6/client/gui-sdl2/mapctrl.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-sdl2/mapctrl.c?rev=30094&r1=30093&r2=30094&view=diff
==============================================================================
--- branches/S2_6/client/gui-sdl2/mapctrl.c     (original)
+++ branches/S2_6/client/gui-sdl2/mapctrl.c     Thu Oct 15 18:20:49 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: branches/S2_6/client/gui-xaw/menu.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-xaw/menu.c?rev=30094&r1=30093&r2=30094&view=diff
==============================================================================
--- branches/S2_6/client/gui-xaw/menu.c (original)
+++ branches/S2_6/client/gui-xaw/menu.c Thu Oct 15 18:20:49 2015
@@ -154,7 +154,8 @@
     { { N_("Irrigation"), 0           },      "", MENU_VIEW_SHOW_IRRIGATION, 0 
},
     { { N_("Mines"), 0                },      "", MENU_VIEW_SHOW_MINES, 0 },
     { { N_("Bases"), 0                },      "", MENU_VIEW_SHOW_BASES, 0 },
-    { { N_("Specials"), 0             },      "", MENU_VIEW_SHOW_SPECIALS, 0 },
+    { { N_("Resources"), 0            },      "", MENU_VIEW_SHOW_RESOURCES, 0 
},
+    { { N_("Huts"), 0                 },      "", MENU_VIEW_SHOW_HUTS, 0 },
     { { N_("Pollution & Fallout"), 0  },      "", MENU_VIEW_SHOW_POLLUTION, 0 
},
     { { N_("Cities"), 0               },      "", MENU_VIEW_SHOW_CITIES, 0 },
     { { N_("Units"), 0                },      "", MENU_VIEW_SHOW_UNITS, 0 },
@@ -368,7 +369,8 @@
     menu_entry_sensitive(MENU_VIEW, MENU_VIEW_SHOW_IRRIGATION, 1);
     menu_entry_sensitive(MENU_VIEW, MENU_VIEW_SHOW_MINES, 1);
     menu_entry_sensitive(MENU_VIEW, MENU_VIEW_SHOW_BASES, 1);
-    menu_entry_sensitive(MENU_VIEW, MENU_VIEW_SHOW_SPECIALS, 1);
+    menu_entry_sensitive(MENU_VIEW, MENU_VIEW_SHOW_RESOURCES, 1);
+    menu_entry_sensitive(MENU_VIEW, MENU_VIEW_SHOW_HUTS, 1);
     menu_entry_sensitive(MENU_VIEW, MENU_VIEW_SHOW_POLLUTION, 1);
     menu_entry_sensitive(MENU_VIEW, MENU_VIEW_SHOW_CITIES, 1);
     menu_entry_sensitive(MENU_VIEW, MENU_VIEW_SHOW_UNITS, 1);
@@ -720,8 +722,11 @@
   case MENU_VIEW_SHOW_BASES:
     key_bases_toggle();
     break;
-  case MENU_VIEW_SHOW_SPECIALS:
-    key_specials_toggle();
+  case MENU_VIEW_SHOW_RESOURCES:
+    key_resources_toggle();
+    break;
+  case MENU_VIEW_SHOW_HUTS:
+    key_huts_toggle();
     break;
   case MENU_VIEW_SHOW_POLLUTION:
     key_pollution_toggle();

Modified: branches/S2_6/client/gui-xaw/menu.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-xaw/menu.h?rev=30094&r1=30093&r2=30094&view=diff
==============================================================================
--- branches/S2_6/client/gui-xaw/menu.h (original)
+++ branches/S2_6/client/gui-xaw/menu.h Thu Oct 15 18:20:49 2015
@@ -60,7 +60,8 @@
   MENU_VIEW_SHOW_IRRIGATION,
   MENU_VIEW_SHOW_MINES,
   MENU_VIEW_SHOW_BASES,
-  MENU_VIEW_SHOW_SPECIALS,
+  MENU_VIEW_SHOW_RESOURCES,
+  MENU_VIEW_SHOW_HUTS,
   MENU_VIEW_SHOW_POLLUTION,
   MENU_VIEW_SHOW_CITIES,
   MENU_VIEW_SHOW_UNITS,

Modified: branches/S2_6/client/options.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/options.c?rev=30094&r1=30093&r2=30094&view=diff
==============================================================================
--- branches/S2_6/client/options.c      (original)
+++ branches/S2_6/client/options.c      Thu Oct 15 18:20:49 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,
@@ -1915,8 +1916,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: branches/S2_6/client/options.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/options.h?rev=30094&r1=30093&r2=30094&view=diff
==============================================================================
--- branches/S2_6/client/options.h      (original)
+++ branches/S2_6/client/options.h      Thu Oct 15 18:20:49 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: branches/S2_6/client/tilespec.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/tilespec.c?rev=30094&r1=30093&r2=30094&view=diff
==============================================================================
--- branches/S2_6/client/tilespec.c     (original)
+++ branches/S2_6/client/tilespec.c     Thu Oct 15 18:20:49 2015
@@ -4940,7 +4940,7 @@
     }
   }
   if (is_extra_caused_by(pextra, EC_HUT)) {
-    if (!options.draw_specials) {
+    if (!options.draw_huts) {
       return FALSE;
     }
   }

Modified: branches/S2_6/data/gtk_menus.xml
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/data/gtk_menus.xml?rev=30094&r1=30093&r2=30094&view=diff
==============================================================================
--- branches/S2_6/data/gtk_menus.xml    (original)
+++ branches/S2_6/data/gtk_menus.xml    Thu Oct 15 18:20:49 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