From: Jan Behrens Date: Sun, 30 Sep 2012 22:14:05 +0000 (+0200) Subject: Added artwork by Archer, in addition to "classic" and "minimal" skins X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b0fde45976d020daf677c9e99c0ce3588a208a2a;p=xonotic%2Fxonstat.git Added artwork by Archer, in addition to "classic" and "minimal" skins --- diff --git a/xonstat/batch/badges/gen_badges.py b/xonstat/batch/badges/gen_badges.py index 44d73ae..e3b8c1f 100644 --- a/xonstat/batch/badges/gen_badges.py +++ b/xonstat/batch/badges/gen_badges.py @@ -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 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 index 0000000..75b2483 Binary files /dev/null and b/xonstat/batch/badges/img/background_archer-v3.png differ diff --git a/xonstat/batch/badges/skin.py b/xonstat/batch/badges/skin.py index 70e6ef3..b01e42d 100644 --- a/xonstat/batch/badges/skin.py +++ b/xonstat/batch/badges/skin.py @@ -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