Author: cazfi
Date: Mon Nov 16 22:00:44 2015
New Revision: 30645

URL: http://svn.gna.org/viewcvs/freeciv?rev=30645&view=rev
Log:
Made unit upkeep icon offset tileset configurable.

See patch #6511

Modified:
    branches/S2_6/client/tilespec.c
    branches/S2_6/data/alio.tilespec
    branches/S2_6/data/amplio.tilespec
    branches/S2_6/data/amplio2.tilespec
    branches/S2_6/data/cimpletoon.tilespec
    branches/S2_6/data/hex2t.tilespec
    branches/S2_6/data/hexemplio.tilespec
    branches/S2_6/data/isophex.tilespec
    branches/S2_6/data/isotrident.tilespec
    branches/S2_6/data/toonhex.tilespec
    branches/S2_6/data/trident.tilespec
    branches/S2_6/doc/README.graphics

Modified: branches/S2_6/client/tilespec.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/tilespec.c?rev=30645&r1=30644&r2=30645&view=diff
==============================================================================
--- branches/S2_6/client/tilespec.c     (original)
+++ branches/S2_6/client/tilespec.c     Mon Nov 16 22:00:44 2015
@@ -492,6 +492,7 @@
   int activity_offset_y;
   int occupied_offset_x;
   int occupied_offset_y;
+  int unit_upkeep_offset_y;
 
 #define NUM_CORNER_DIRS 4
 #define TILES_PER_CORNER 4
@@ -799,7 +800,7 @@
 ****************************************************************************/
 int tileset_unit_layout_offset_y(const struct tileset *t)
 {
-  return tileset_tile_height(tileset);
+  return t->unit_upkeep_offset_y;
 }
 
 /****************************************************************************
@@ -1856,6 +1857,9 @@
     log_error("Tileset \"%s\" invalid: %s", t->name, secfile_error());
     goto ON_ERROR;
   }
+
+  t->unit_upkeep_offset_y = secfile_lookup_int_default(file, 
tileset_tile_height(t),
+                                                       
"tilespec.unit_upkeep_offset_y");
 
   set_city_names_font_sizes(t->city_names_font_size,
                             t->city_productions_font_size);

Modified: branches/S2_6/data/alio.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/data/alio.tilespec?rev=30645&r1=30644&r2=30645&view=diff
==============================================================================
--- branches/S2_6/data/alio.tilespec    (original)
+++ branches/S2_6/data/alio.tilespec    Mon Nov 16 22:00:44 2015
@@ -71,6 +71,13 @@
 
 ; offset the tile label text by this amount
 tilelabel_offset_y = 20
+
+; offset the upkeep icons by this amount from the top of the unit itself.
+; The default is the normal tile height, which means that the upkeep icons
+; appear below the unit icon if the unit icons are equal to tile height
+; (typical in overhead tileset), or overlay lower part of the unit icon,
+; if unit icon is higher than tiles (typical in iso tilesets)
+;unit_upkeep_offset_y = 0
 
 ; Font to use to draw city names:
 city_names_font = "9x15bold"

Modified: branches/S2_6/data/amplio.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/data/amplio.tilespec?rev=30645&r1=30644&r2=30645&view=diff
==============================================================================
--- branches/S2_6/data/amplio.tilespec  (original)
+++ branches/S2_6/data/amplio.tilespec  Mon Nov 16 22:00:44 2015
@@ -61,6 +61,13 @@
 
 ; offset the tile label text by this amount
 tilelabel_offset_y = 15
+
+; offset the upkeep icons by this amount from the top of the unit itself.
+; The default is the normal tile height, which means that the upkeep icons
+; appear below the unit icon if the unit icons are equal to tile height
+; (typical in overhead tileset), or overlay lower part of the unit icon,
+; if unit icon is higher than tiles (typical in iso tilesets)
+;unit_upkeep_offset_y = 0
 
 ; Font size (points) to use to draw city names and productions:
 city_names_font_size = 10

Modified: branches/S2_6/data/amplio2.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/data/amplio2.tilespec?rev=30645&r1=30644&r2=30645&view=diff
==============================================================================
--- branches/S2_6/data/amplio2.tilespec (original)
+++ branches/S2_6/data/amplio2.tilespec Mon Nov 16 22:00:44 2015
@@ -61,6 +61,13 @@
 
 ; offset the tile label text by this amount
 tilelabel_offset_y = 15
+
+; offset the upkeep icons by this amount from the top of the unit itself.
+; The default is the normal tile height, which means that the upkeep icons
+; appear below the unit icon if the unit icons are equal to tile height
+; (typical in overhead tileset), or overlay lower part of the unit icon,
+; if unit icon is higher than tiles (typical in iso tilesets)
+;unit_upkeep_offset_y = 0
 
 ; Font size (points) to use to draw city names and productions:
 city_names_font_size = 10

Modified: branches/S2_6/data/cimpletoon.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/data/cimpletoon.tilespec?rev=30645&r1=30644&r2=30645&view=diff
==============================================================================
--- branches/S2_6/data/cimpletoon.tilespec      (original)
+++ branches/S2_6/data/cimpletoon.tilespec      Mon Nov 16 22:00:44 2015
@@ -61,6 +61,13 @@
 
 ; offset the tile label text by this amount
 tilelabel_offset_y = 15
+
+; offset the upkeep icons by this amount from the top of the unit itself.
+; The default is the normal tile height, which means that the upkeep icons
+; appear below the unit icon if the unit icons are equal to tile height
+; (typical in overhead tileset), or overlay lower part of the unit icon,
+; if unit icon is higher than tiles (typical in iso tilesets)
+;unit_upkeep_offset_y = 0
 
 ; Font size (points) to use to draw city names and productions:
 city_names_font_size = 10

Modified: branches/S2_6/data/hex2t.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/data/hex2t.tilespec?rev=30645&r1=30644&r2=30645&view=diff
==============================================================================
--- branches/S2_6/data/hex2t.tilespec   (original)
+++ branches/S2_6/data/hex2t.tilespec   Mon Nov 16 22:00:44 2015
@@ -64,6 +64,13 @@
 
 ; offset the tile label text by this amount
 tilelabel_offset_y = 28
+
+; offset the upkeep icons by this amount from the top of the unit itself.
+; The default is the normal tile height, which means that the upkeep icons
+; appear below the unit icon if the unit icons are equal to tile height
+; (typical in overhead tileset), or overlay lower part of the unit icon,
+; if unit icon is higher than tiles (typical in iso tilesets)
+;unit_upkeep_offset_y = 0
 
 ; Font to use to draw city names:
 city_names_font = "6x13bold"

Modified: branches/S2_6/data/hexemplio.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/data/hexemplio.tilespec?rev=30645&r1=30644&r2=30645&view=diff
==============================================================================
--- branches/S2_6/data/hexemplio.tilespec       (original)
+++ branches/S2_6/data/hexemplio.tilespec       Mon Nov 16 22:00:44 2015
@@ -67,6 +67,13 @@
 
 ; offset the tile label text by this amount
 tilelabel_offset_y = 20
+
+; offset the upkeep icons by this amount from the top of the unit itself.
+; The default is the normal tile height, which means that the upkeep icons
+; appear below the unit icon if the unit icons are equal to tile height
+; (typical in overhead tileset), or overlay lower part of the unit icon,
+; if unit icon is higher than tiles (typical in iso tilesets)
+;unit_upkeep_offset_y = 0
 
 ; Font to use to draw city names:
 city_names_font = "9x15bold"

Modified: branches/S2_6/data/isophex.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/data/isophex.tilespec?rev=30645&r1=30644&r2=30645&view=diff
==============================================================================
--- branches/S2_6/data/isophex.tilespec (original)
+++ branches/S2_6/data/isophex.tilespec Mon Nov 16 22:00:44 2015
@@ -64,6 +64,13 @@
 
 ; offset the tile label text by this amount
 tilelabel_offset_y = 10
+
+; offset the upkeep icons by this amount from the top of the unit itself.
+; The default is the normal tile height, which means that the upkeep icons
+; appear below the unit icon if the unit icons are equal to tile height
+; (typical in overhead tileset), or overlay lower part of the unit icon,
+; if unit icon is higher than tiles (typical in iso tilesets)
+;unit_upkeep_offset_y = 0
 
 ; Font to use to draw city names:
 city_names_font = "9x15bold"

Modified: branches/S2_6/data/isotrident.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/data/isotrident.tilespec?rev=30645&r1=30644&r2=30645&view=diff
==============================================================================
--- branches/S2_6/data/isotrident.tilespec      (original)
+++ branches/S2_6/data/isotrident.tilespec      Mon Nov 16 22:00:44 2015
@@ -63,6 +63,13 @@
 
 ; offset the tile label text by this amount
 tilelabel_offset_y = 10
+
+; offset the upkeep icons by this amount from the top of the unit itself.
+; The default is the normal tile height, which means that the upkeep icons
+; appear below the unit icon if the unit icons are equal to tile height
+; (typical in overhead tileset), or overlay lower part of the unit icon,
+; if unit icon is higher than tiles (typical in iso tilesets)
+;unit_upkeep_offset_y = 0
 
 ; Font size (points) to use to draw city names and productions:
 city_names_font_size = 10

Modified: branches/S2_6/data/toonhex.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/data/toonhex.tilespec?rev=30645&r1=30644&r2=30645&view=diff
==============================================================================
--- branches/S2_6/data/toonhex.tilespec (original)
+++ branches/S2_6/data/toonhex.tilespec Mon Nov 16 22:00:44 2015
@@ -68,6 +68,13 @@
 
 ; offset the tile label text by this amount
 tilelabel_offset_y = 20
+
+; offset the upkeep icons by this amount from the top of the unit itself.
+; The default is the normal tile height, which means that the upkeep icons
+; appear below the unit icon if the unit icons are equal to tile height
+; (typical in overhead tileset), or overlay lower part of the unit icon,
+; if unit icon is higher than tiles (typical in iso tilesets)
+;unit_upkeep_offset_y = 0
 
 ; Font to use to draw city names:
 city_names_font = "9x15bold"

Modified: branches/S2_6/data/trident.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/data/trident.tilespec?rev=30645&r1=30644&r2=30645&view=diff
==============================================================================
--- branches/S2_6/data/trident.tilespec (original)
+++ branches/S2_6/data/trident.tilespec Mon Nov 16 22:00:44 2015
@@ -63,6 +63,13 @@
 
 ; offset the tile label text by this amount
 tilelabel_offset_y = 10
+
+; offset the upkeep icons by this amount from the top of the unit itself.
+; The default is the normal tile height, which means that the upkeep icons
+; appear below the unit icon if the unit icons are equal to tile height
+; (typical in overhead tileset), or overlay lower part of the unit icon,
+; if unit icon is higher than tiles (typical in iso tilesets)
+;unit_upkeep_offset_y = 0
 
 ; Font size (points) to use to draw city names and productions:
 city_names_font_size = 10

Modified: branches/S2_6/doc/README.graphics
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/doc/README.graphics?rev=30645&r1=30644&r2=30645&view=diff
==============================================================================
--- branches/S2_6/doc/README.graphics   (original)
+++ branches/S2_6/doc/README.graphics   Mon Nov 16 22:00:44 2015
@@ -131,6 +131,14 @@
   activity_offset_y      draw normal unit activity icons. "Auto" icons are not
                          affected by this as they are usually wanted in 
different
                          offset than real activity icons for both to appear 
simultaneously
+  unit_upkeep_offset_y : Gives an offset from the unit origin at which to draw
+                         the upkeep icons when they are shown along the unit. 
The upkeep
+                         icons can safely extend below the unit icon itself.
+                         If this value is omitted, normal tile height is used 
instead;
+                         - Upkeep icons appear below the unit icon if the unit 
icons are
+                           equal to tile height (typical in overhead tileset)
+                         - Upkeep icons overlay lower part of the unit icon, 
if unit icon
+                           is higher than tile height (typical in iso tilesets)
   citybar_offset_y     : Gives an offset from city tile origin at which to
                          draw city bar text.
   hex_side             : When is_hex is specified (see is_hex, below), this


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

Reply via email to