]> de.git.xonotic.org Git - xonotic/xonstat.git/commitdiff
Added artwork by Archer, in addition to "classic" and "minimal" skins
authorJan Behrens <zykure@web.de>
Sun, 30 Sep 2012 22:14:05 +0000 (00:14 +0200)
committerJan Behrens <zykure@web.de>
Sun, 30 Sep 2012 22:14:44 +0000 (00:14 +0200)
xonstat/batch/badges/gen_badges.py
xonstat/batch/badges/img/background_archer-v2.png [new file with mode: 0644]
xonstat/batch/badges/img/background_archer-v3.png [new file with mode: 0644]
xonstat/batch/badges/skin.py

index 44d73aec3da4f1ea2a16690cf9e965c954777b33..e3b8c1fb1200b025a62c7e2bcba8bc46e43fecb2 100644 (file)
@@ -28,8 +28,21 @@ skin_classic = Skin( "",
 
 # more fancy skin [** WIP **]- writes PNGs into "output/archer/###.png"
 skin_archer = Skin( "archer",
-        bg              = "background_archer-v1",
-        overlay         = None,
+        #bg              = "background_archer-v2_full",
+        bg              = "background_archer-v3",
+        overlay         = "",
+        nick_maxwidth  = 265,
+        gametype_pos    = (91,33),
+        nostats_pos            = (91,59),
+        elo_pos        = (91,47),
+        rank_pos       = (91,58),
+        winp_pos       = (509,20),
+        wins_pos       = (508,35),
+        loss_pos       = (508,45),
+        kdr_pos                = (392,20),
+        kills_pos      = (392,35),
+        deaths_pos     = (392,45),
+        ptime_color    = (0.05, 0.05, 0.1),
     )
 
 # minimal skin - writes PNGs into "output/minimal/###.png"
@@ -112,7 +125,7 @@ for arg in sys.argv[1:]:
             skins.append(skin_archer)
 
 if len(skins) == 0:
-    skins = [ skin_classic, skin_minimal ]
+    skins = [ skin_classic, skin_minimal, skin_archer ]
 
 # environment setup
 env = bootstrap('../../../development.ini')
diff --git a/xonstat/batch/badges/img/background_archer-v2.png b/xonstat/batch/badges/img/background_archer-v2.png
new file mode 100644 (file)
index 0000000..0ae73bd
Binary files /dev/null and b/xonstat/batch/badges/img/background_archer-v2.png differ
diff --git a/xonstat/batch/badges/img/background_archer-v3.png b/xonstat/batch/badges/img/background_archer-v3.png
new file mode 100644 (file)
index 0000000..75b2483
Binary files /dev/null and b/xonstat/batch/badges/img/background_archer-v3.png differ
index 70e6ef38cf4fd03e5ec65d6357ec0c4b1cb0f425..b01e42d5c08c19a10e5683b8d333b59901d59a86 100644 (file)
@@ -280,8 +280,10 @@ class Skin:
         xoff, yoff, tw, th = ctx.text_extents("__")[:4]
         space_w -= tw
 
-        # this hilarious line should determine the spacing between characters
-        sep_w = int(0.25 * space_w)
+        # this hilarious code should determine the spacing between characters
+        sep_w = 0.25*space_w
+        if sep_w <= 0:
+               sep_w = 1
 
         # split nick into colored segments
         xoffset = 0
@@ -320,7 +322,7 @@ class Skin:
             ctx.set_source_rgb(r, g, b)
             ctx.move_to(self.nick_pos[0] + xoffset - xoff, self.nick_pos[1])
             ctx.show_text(txt)
-
+            
             tw += (len(txt)-len(txt.strip())) * space_w  # account for lost whitespaces
             xoffset += tw + sep_w