Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/playerscoreboard.py
diff options
context:
space:
mode:
authorMuriel de Souza Godoi <muriel@laptop.org>2007-09-20 18:40:22 (GMT)
committer Muriel de Souza Godoi <muriel@laptop.org>2007-09-20 18:40:22 (GMT)
commite3af6ee47390ac2bde75a6c31f85c091fdc3bce2 (patch)
treed1a5862820ac0548d35220c412d6faf46a267bcd /playerscoreboard.py
parent5aed505296e2a7ab3d3ec8515f42c357c646f32b (diff)
add create game icons, create game guidevelop
New svgcard system using a cache to minimize memory usage.
Diffstat (limited to 'playerscoreboard.py')
-rwxr-xr-xplayerscoreboard.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/playerscoreboard.py b/playerscoreboard.py
index 2526917..32bf551 100755
--- a/playerscoreboard.py
+++ b/playerscoreboard.py
@@ -54,12 +54,7 @@ class PlayerScoreboard(gtk.EventBox):
self.icon = svglabel.SvgLabel(self.xo_buddy, fill_color, stroke_color, False, self.current_color, 45, 55)
# Set waiting buddy icon
- self.waiting_icon = svglabel.SvgLabel(self.xo_buddy, self.default_color, '#ffffff', False, self.current_color, 45, 55)
-
- # Cache the score icon
- score_label = Score(fill_color, stroke_color)
- self.score_pixbuf_unsel = score_label.get_pixbuf()
- self.score_pixbuf_sel = score_label.get_pixbuf_sel()
+ #self.waiting_icon = svglabel.SvgLabel(self.xo_buddy, self.default_color, '#ffffff', False, self.current_color, 45, 55)
# Set nick label
self.nick = gtk.Label(nick)
@@ -68,10 +63,10 @@ class PlayerScoreboard(gtk.EventBox):
self.nick.set_alignment(0, 0.5)
# Set message label
- self.msg = gtk.Label('Waiting for next game...')
- self.msg.modify_font(pango.FontDescription("12"))
- self.msg.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse('#ffffff'))
- self.msg.set_alignment(0, 0.5)
+ #self.msg = gtk.Label('Waiting for next game...')
+ #self.msg.modify_font(pango.FontDescription("12"))
+ #self.msg.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse('#ffffff'))
+ #self.msg.set_alignment(0, 0.5)
self.add(self.table)
self.table.attach(self.icon, 0, 1, 0, 1)
@@ -82,6 +77,12 @@ class PlayerScoreboard(gtk.EventBox):
self.increase_score()
def increase_score(self):
+ if len(self.scores) == 0:
+ # Cache the score icon
+ score_label = Score(self.fill_color, self.stroke_color)
+ self.score_pixbuf_unsel = score_label.get_pixbuf()
+ self.score_pixbuf_sel = score_label.get_pixbuf_sel()
+
new_score = Score(self.fill_color, self.stroke_color, self.score_pixbuf_sel, self.score_pixbuf_unsel,self.status)
self.scores.append(new_score)
new_score.show()