Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2003:
[Freeciv-Dev] Re: (PR#4184) Pre-commit code
Home

[Freeciv-Dev] Re: (PR#4184) Pre-commit code

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] Re: (PR#4184) Pre-commit code
From: "Rafa³ Bursig" <bursig@xxxxxxxxx>
Date: Wed, 7 May 2003 12:06:30 -0700
Reply-to: rt@xxxxxxxxxxxxxx

Dnia 2003.05.07 16:45, Per I. Mathisen napisa³(a):
> 
> On Wed, 7 May 2003, Rafa? Bursig wrote:
> > I'm going to commit my home tree to main cvs but before that I need
> > this code in main cvs.
> > If someone hasve something agains this code then ... "Speak now or
> be
> > silent forever".
> 
> Nitpick:
> 
> You don't need these checks:
> 
>    +  if (has_capability("citizens_style", pc->capability)) {
> 
> when you make citizens_style a mandatory capability.
> 
Fixed.

Rafal

----------------------------------------------------------------------
Codzienny HOROSKOP erotyczny... >>> http://link.interia.pl/f171b 

diff -r -u freeciv/client/packhand.c freeciv/client/packhand.c
--- freeciv/client/packhand.c   Wed May  7 10:11:45 2003
+++ freeciv/client/packhand.c   Wed May  7 19:53:34 2003
@@ -484,6 +484,10 @@
          unit_list_insert(&pcity->units_supported, punit);
       unit_list_iterate_end;
     }
+  } else {
+    if(pcity->owner==game.player_idx) {
+      city_report_dialog_update_city(pcity);
+    }
   }
 
   if (draw_map_grid && can_client_change_view()) {
@@ -1333,6 +1337,9 @@
        update_menus();
       }
     }
+    economy_report_dialog_update();
+    activeunits_report_dialog_update();
+    city_report_dialog_update();
   }
 
   if (pplayer == game.player_ptr && pplayer->turn_done != pinfo->turn_done) {
@@ -2313,6 +2320,8 @@
   sz_strlcpy(cs->name, packet->name);
   sz_strlcpy(cs->graphic, packet->graphic);
   sz_strlcpy(cs->graphic_alt, packet->graphic_alt);
+  sz_strlcpy(cs->citizens_graphic, packet->citizens_graphic);
+  sz_strlcpy(cs->citizens_graphic_alt, packet->citizens_graphic_alt);
 
   tilespec_setup_city_tiles(id);
 }
diff -r -u freeciv/common/capstr.c freeciv/common/capstr.c
--- freeciv/common/capstr.c     Wed May  7 10:11:50 2003
+++ freeciv/common/capstr.c     Wed May  7 11:36:47 2003
@@ -78,7 +78,7 @@
                    "city_struct_minor_cleanup obsolete_last class_legend " \
                    "+impr_req +waste +fastfocus +continent +small_dipl " \
                    "+no_nation_selected +diplomacy +no_extra_tiles" \
-                   "+diplomacy2"
+                   "+diplomacy2 +citizens_style"
 /* "+1.14.0" is protocol for 1.14.0 release.
  *
  * "conn_info" is sending the conn_id field. To preserve compatability
@@ -123,6 +123,9 @@
  * sent to clients (previously used to help with drawing the terrain).
  *
  * "diplomacy2": unified and simplified handling of diplomatic request
+ *
+ * "citizens_style": is support for loading of ruleset-specified
+ * multi style citizens icons.
  */
 
 void init_our_capability(void)
diff -r -u freeciv/common/city.h freeciv/common/city.h
--- freeciv/common/city.h       Wed May  7 10:11:50 2003
+++ freeciv/common/city.h       Wed May  7 11:24:36 2003
@@ -296,6 +296,8 @@
   char name_orig[MAX_LEN_NAME];              /* untranslated */
   char graphic[MAX_LEN_NAME];
   char graphic_alt[MAX_LEN_NAME];
+  char citizens_graphic[MAX_LEN_NAME];
+  char citizens_graphic_alt[MAX_LEN_NAME];
   int techreq;                  /* tech required to use a style      */
   int replaced_by;              /* index to replacing style          */
                                 /* client side-only:                 */
diff -r -u freeciv/common/packets.c freeciv/common/packets.c
--- freeciv/common/packets.c    Wed May  7 10:11:50 2003
+++ freeciv/common/packets.c    Wed May  7 19:57:32 2003
@@ -2707,7 +2707,9 @@
   dio_put_string(&dout, packet->name);
   dio_put_string(&dout, packet->graphic);
   dio_put_string(&dout, packet->graphic_alt);
-
+  dio_put_string(&dout, packet->citizens_graphic);
+  dio_put_string(&dout, packet->citizens_graphic_alt);
+  
   SEND_PACKET_END;
 }
 
@@ -2726,7 +2728,9 @@
   dio_get_string(&din, packet->name, MAX_LEN_NAME);
   dio_get_string(&din, packet->graphic, MAX_LEN_NAME);
   dio_get_string(&din, packet->graphic_alt, MAX_LEN_NAME);
-
+  dio_get_string(&din, packet->citizens_graphic, MAX_LEN_NAME);
+  dio_get_string(&din, packet->citizens_graphic_alt, MAX_LEN_NAME);
+       
   RECEIVE_PACKET_END(packet);
 }
 
diff -r -u freeciv/common/packets.h freeciv/common/packets.h
--- freeciv/common/packets.h    Wed May  7 10:11:50 2003
+++ freeciv/common/packets.h    Wed May  7 11:24:36 2003
@@ -806,6 +806,8 @@
   char name[MAX_LEN_NAME];
   char graphic[MAX_LEN_NAME];
   char graphic_alt[MAX_LEN_NAME];
+  char citizens_graphic[MAX_LEN_NAME];
+  char citizens_graphic_alt[MAX_LEN_NAME];
   int techreq;
   int replaced_by;
 };
diff -r -u freeciv/data/default/cities.ruleset 
freeciv/data/default/cities.ruleset
--- freeciv/data/default/cities.ruleset Mon Nov 18 20:46:25 2002
+++ freeciv/data/default/cities.ruleset Wed May  7 11:24:36 2003
@@ -19,6 +19,8 @@
 ;
 ; graphic     = group of tiles to use, see cities spec for
 ;               more info on city tiles
+; citizens_graphic     = group of citizens tiles to use, see citizens/small
+;                        spec for more info on citizens tiles
 ; tech        = technology required for style to be used
 ; replaced_by = which style replaced this one
 
@@ -26,34 +28,53 @@
 name        = _("European")
 graphic     = "city.european"
 graphic_alt = "-"
+citizens_graphic     = "ancient"
+citizens_graphic_alt = "generic"
 tech        = "None"
-replaced_by = "Industrial"
+replaced_by = "Renaissance"
 
 [citystyle_classical]
 name        = _("Classical")
 graphic     = "city.classical"
 graphic_alt = "-"
+citizens_graphic     = "ancient"
+citizens_graphic_alt = "generic"
 tech        = "None"
-replaced_by = "Industrial"
+replaced_by = "Renaissance"
 
 [citystyle_tropical]
 name        = _("Tropical")
 graphic     = "city.tropical"
 graphic_alt = "city.european"
+citizens_graphic     = "ancient"
+citizens_graphic_alt = "generic"
 tech        = "None"
-replaced_by = "Industrial"
+replaced_by = "Renaissance"
 
 [citystyle_asian]
 name        = _("Asian")
 graphic     = "city.asian"
 graphic_alt = "city.classical"
+citizens_graphic     = "ancient"
+citizens_graphic_alt = "generic"
 tech        = "None"
+replaced_by = "Renaissance"
+
+[citystyle_renaissance]
+name        = _("Renaissance")
+graphic     = "city.industrial"
+graphic_alt = "-"
+citizens_graphic     = "renaissance"
+citizens_graphic_alt = "generic"
+tech        = "University"
 replaced_by = "Industrial"
 
 [citystyle_industrial]
 name        = _("Industrial")
 graphic     = "city.industrial"
 graphic_alt = "-"
+citizens_graphic     = "industrial"
+citizens_graphic_alt = "generic"
 tech        = "Railroad"
 replaced_by = "Modern"
 
@@ -61,6 +82,8 @@
 name        = _("Modern")
 graphic     = "city.modern"
 graphic_alt = "-"
+citizens_graphic     = "modern"
+citizens_graphic_alt = "generic"
 tech        = "Automobile"
 replaced_by = "PostModern"
 
@@ -68,5 +91,7 @@
 name        = _("PostModern")
 graphic     = "city.postmodern"
 graphic_alt = "-"
+citizens_graphic     = "postmodern"
+citizens_graphic_alt = "generic"
 tech        = "Superconductors"
 replaced_by = "-"
diff -r -u freeciv/server/plrhand.c freeciv/server/plrhand.c
--- freeciv/server/plrhand.c    Wed May  7 10:12:13 2003
+++ freeciv/server/plrhand.c    Wed May  7 11:24:36 2003
@@ -673,8 +673,8 @@
            get_nation_name_plural(pplayer->nation), preq->tax, preq->luxury,
            preq->science);
     conn_list_do_buffer(&pplayer->connections);
-    send_player_info(pplayer, pplayer);
     global_city_refresh(pplayer);
+    send_player_info(pplayer, pplayer);
     conn_list_do_unbuffer(&pplayer->connections);
   }
 }
@@ -733,10 +733,8 @@
   }
 
   check_player_government_rates(pplayer);
-
-  send_player_info(pplayer, pplayer);
-
   global_city_refresh(pplayer);
+  send_player_info(pplayer, pplayer);
 }
 
 /**************************************************************************
@@ -758,12 +756,10 @@
          get_nation_name_plural(pplayer->nation));
 
   check_player_government_rates(pplayer);
-
+  global_city_refresh(pplayer);
   send_player_info(pplayer, pplayer);
   if (player_owns_active_govchange_wonder(pplayer))
     pplayer->revolution=1;
-
-  global_city_refresh(pplayer);
 }
 
 /**************************************************************************
diff -r -u freeciv/server/ruleset.c freeciv/server/ruleset.c
--- freeciv/server/ruleset.c    Fri Apr 11 13:17:37 2003
+++ freeciv/server/ruleset.c    Wed May  7 20:01:06 2003
@@ -2289,6 +2289,12 @@
               secfile_lookup_str(file, "%s.graphic", styles[i]));
     sz_strlcpy(city_styles[i].graphic_alt, 
               secfile_lookup_str(file, "%s.graphic_alt", styles[i]));
+    sz_strlcpy(city_styles[i].citizens_graphic, 
+              secfile_lookup_str_default(file, "-", 
+                       "%s.citizens_graphic", styles[i]));
+    sz_strlcpy(city_styles[i].citizens_graphic_alt, 
+              secfile_lookup_str_default(file, "generic", 
+                       "%s.citizens_graphic_alt", styles[i]));
     city_styles[i].techreq = lookup_tech(file, styles[i], "tech", TRUE,
                                          filename, city_styles[i].name);
     
@@ -2743,6 +2749,9 @@
     sz_strlcpy(city_p.name, city_styles[k].name_orig);
     sz_strlcpy(city_p.graphic, city_styles[k].graphic);
     sz_strlcpy(city_p.graphic_alt, city_styles[k].graphic_alt);
+    sz_strlcpy(city_p.citizens_graphic, city_styles[k].citizens_graphic);
+    sz_strlcpy(city_p.citizens_graphic_alt,
+                        city_styles[k].citizens_graphic_alt);
 
     lsend_packet_ruleset_city(dest, &city_p);
   }

[Prev in Thread] Current Thread [Next in Thread]