From: Jan D. Behrens Date: Wed, 29 Aug 2012 21:03:11 +0000 (+0200) Subject: More work on classic and minimal themes; now both include a fancy Xonotic logo! X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8a4eed3f953adb1458f6e931a1f2ff0dde62229a;p=xonotic%2Fxonstat.git More work on classic and minimal themes; now both include a fancy Xonotic logo! --- diff --git a/xonstat/batch/badges/gen_badges.py b/xonstat/batch/badges/gen_badges.py index 4465ead..0cd17a3 100644 --- a/xonstat/batch/badges/gen_badges.py +++ b/xonstat/batch/badges/gen_badges.py @@ -38,38 +38,43 @@ skin_minimal = Skin( "minimal", overlay = "overlay_minimal", width = 560, height = 40, + nick_fontsize = 16, + nick_pos = (36,16), num_gametypes = 3, - gametype_pos = (8,30), - gametype_color = (0.8, 0.8, 0.8), + nick_maxwidth = 300, + gametype_pos = (78,30), + gametype_color = (0.0, 0.0, 0.0), gametype_text = "%s:", - gametype_width = 112, + gametype_width = 96, gametype_fontsize = 10, gametype_center = False, - elo_pos = (75,30), + elo_pos = (82,30), elo_text = "Elo %.0f", - elo_color = (0.9, 0.9, 0.7), - elo_center = True, + elo_color = (0.7, 0.7, 0.7), + elo_center = False, rank_pos = None, - nostats_pos = (75,30), + nostats_pos = (82,30), nostats_fontsize = 10, nostats_angle = 0, nostats_text = "no stats!", - nostats_color = (0.8, 0.3, 0.3), - nostats_center = True, + nostats_color = (0.7, 0.4, 0.4), + nostats_center = False, kdr_pos = (392,15), + kdr_fontsize = 10, kdr_colortop = (0.1, 0.8, 0.1), kdr_colormid = (0.6, 0.6, 0.1), kdr_colorbot = (0.8, 0.1, 0.1), kills_pos = None, deaths_pos = None, winp_pos = (508,15), - wins_pos = None, + winp_fontsize = 10, winp_colortop = (0.1, 0.6, 0.6), winp_colormid = (0.2, 0.6, 0.2), winp_colorbot = (0.6, 0.6, 0.1), + wins_pos = None, loss_pos = None, ptime_pos = (451,30), - ptime_color = (0.7, 0.7, 0.9), + ptime_color = (0.7, 0.7, 0.7), ) diff --git a/xonstat/batch/badges/img/overlay.png b/xonstat/batch/badges/img/overlay.png deleted file mode 100644 index b00bf5a..0000000 Binary files a/xonstat/batch/badges/img/overlay.png and /dev/null differ diff --git a/xonstat/batch/badges/img/overlay_classic.png b/xonstat/batch/badges/img/overlay_classic.png index fdc58d8..9578e90 100644 Binary files a/xonstat/batch/badges/img/overlay_classic.png and b/xonstat/batch/badges/img/overlay_classic.png differ diff --git a/xonstat/batch/badges/img/overlay_classic.xcf b/xonstat/batch/badges/img/overlay_classic.xcf index 360fc8d..ab01944 100644 Binary files a/xonstat/batch/badges/img/overlay_classic.xcf and b/xonstat/batch/badges/img/overlay_classic.xcf differ diff --git a/xonstat/batch/badges/img/overlay_minimal.png b/xonstat/batch/badges/img/overlay_minimal.png index 1f39a71..fa8eb8b 100644 Binary files a/xonstat/batch/badges/img/overlay_minimal.png and b/xonstat/batch/badges/img/overlay_minimal.png differ diff --git a/xonstat/batch/badges/img/overlay_minimal.xcf b/xonstat/batch/badges/img/overlay_minimal.xcf index fefa526..fe74fd6 100644 Binary files a/xonstat/batch/badges/img/overlay_minimal.xcf and b/xonstat/batch/badges/img/overlay_minimal.xcf differ diff --git a/xonstat/batch/badges/img/xonotic_logo.svg b/xonstat/batch/badges/img/xonotic_logo.svg new file mode 100644 index 0000000..b8bc1b2 --- /dev/null +++ b/xonstat/batch/badges/img/xonotic_logo.svg @@ -0,0 +1,346 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + 2010 + + + Xonotic Community + + + + + + + + + + Xonotic Community + + + + + + + + + + + Xonotic + Phoenix + Logo + + + + The logo of the Xonotic project. + + + + + diff --git a/xonstat/batch/badges/img/xonotic_logo_black-white.svg b/xonstat/batch/badges/img/xonotic_logo_black-white.svg new file mode 100644 index 0000000..e0c8dbb --- /dev/null +++ b/xonstat/batch/badges/img/xonotic_logo_black-white.svg @@ -0,0 +1,120 @@ + + + + + + + + + + + + image/svg+xml + + + 2010 + + + Xonotic Community + + + + + + + + + + Xonotic Community + + + + + + Xonotic + Phoenix + Logo + + + A print version of the Xonotic logo. Completely black. + Xonotic Logo + + + + + diff --git a/xonstat/batch/badges/skin.py b/xonstat/batch/badges/skin.py index 0af57d8..a2bb0ed 100644 --- a/xonstat/batch/badges/skin.py +++ b/xonstat/batch/badges/skin.py @@ -64,31 +64,31 @@ class Skin: 'width': 560, 'height': 70, 'nick_fontsize': 20, - 'nick_pos': (5,18), - 'nick_maxwidth': 330, - 'gametype_fontsize':12, - 'gametype_pos': (60,31), - 'gametype_width': 110, + 'nick_pos': (56,18), + 'nick_maxwidth': 280, + 'gametype_fontsize':10, + 'gametype_pos': (101,33), + 'gametype_width': 94, 'gametype_color': (0.9, 0.9, 0.9), 'gametype_text': "[ %s ]", 'gametype_center': True, 'num_gametypes': 3, 'nostats_fontsize': 12, - 'nostats_pos': (60,59), + 'nostats_pos': (101,59), 'nostats_color': (0.8, 0.2, 0.1), 'nostats_angle': -10, 'nostats_text': "no stats yet!", - 'nostats_center': False, - 'elo_pos': (60,47), + 'nostats_center': True, + 'elo_pos': (101,47), 'elo_fontsize': 10, 'elo_color': (1.0, 1.0, 0.5), 'elo_text': "Elo %.0f", - 'elo_center': False, + 'elo_center': True, 'rank_fontsize': 8, - 'rank_pos': (60,57), + 'rank_pos': (101,57), 'rank_color': (0.8, 0.8, 1.0), 'rank_text': "Rank %d of %d", - 'rank_center': False, + 'rank_center': True, 'wintext_fontsize': 10, 'wintext_pos': (508,3), 'wintext_color': (0.8, 0.8, 0.8), @@ -281,6 +281,9 @@ class Skin: # show up to three gametypes the player has participated in xoffset = 0 for gt in data.total_stats['gametypes'][:self.num_gametypes]: + if not elos.has_key(gt) or not ranks.has_key(gt): + continue + if self.gametype_pos: ctx.select_font_face(font, C.FONT_SLANT_NORMAL, C.FONT_WEIGHT_BOLD) ctx.set_font_size(self.gametype_fontsize) @@ -290,10 +293,11 @@ class Skin: if self.gametype_center: ctx.move_to(self.gametype_pos[0]+xoffset-xoff-tw/2, self.gametype_pos[1]-yoff) else: - ctx.move_to(self.gametype_pos[0]+xoffset-xoff, self.gametype_pos[1]-yoff) + ctx.move_to(self.gametype_pos[0]+xoffset-xoff-tw, self.gametype_pos[1]-yoff) ctx.show_text(txt) if not elos.has_key(gt) or not ranks.has_key(gt): + pass if self.nostats_pos: ctx.select_font_face(font, C.FONT_SLANT_NORMAL, C.FONT_WEIGHT_BOLD) ctx.set_font_size(self.nostats_fontsize)