From 0e48b1249dbe0d6edcfc5dc91035702fd73477a8 Mon Sep 17 00:00:00 2001 From: Anna Wiggins Date: Thu, 19 Apr 2012 01:46:09 -0400 Subject: [PATCH] Use nicer symbols, allow multiple games at once --- lib/goban.py | 9 +++--- pygo.py | 18 ++++------- ui/default.glade | 42 ++++++++++++++++++++++++- ui/res/go_circle_black.png | Bin 0 -> 5550 bytes ui/res/{go_c.png => go_circle_red.png} | Bin ui/res/go_circle_white.png | Bin 0 -> 5302 bytes ui/res/go_square.png | Bin 0 -> 5534 bytes ui/res/{go_t.png => go_triangle.png} | Bin widgets/gogame.py | 33 ++++++++++++++----- 9 files changed, 78 insertions(+), 24 deletions(-) create mode 100644 ui/res/go_circle_black.png rename ui/res/{go_c.png => go_circle_red.png} (100%) create mode 100644 ui/res/go_circle_white.png create mode 100644 ui/res/go_square.png rename ui/res/{go_t.png => go_triangle.png} (100%) diff --git a/lib/goban.py b/lib/goban.py index 311ffc5..d62544d 100644 --- a/lib/goban.py +++ b/lib/goban.py @@ -299,14 +299,15 @@ class Goban: code = self.def_draw_codes[pos] elif point == Goban.BLACK: code = 'b' + if pos == self.last_move: + code += 'Cw' elif point == Goban.WHITE: code = 'w' + if pos == self.last_move: + code += 'Cb' - if pos == self.last_move: - code += 'C' - if pos == self.ko: - code += 'C' + code += 'S' return code diff --git a/pygo.py b/pygo.py index e493903..23dd3d5 100755 --- a/pygo.py +++ b/pygo.py @@ -29,28 +29,22 @@ class Pygo(): self.tree.signal_autoconnect(self) self.window = self.tree.get_widget('window') self.contents = self.tree.get_widget('main_box') + self.games = self.tree.get_widget('games') def init_widgets(self): - self.window.resize(1000,800) - self.gogame = None + self.window.resize(800,600) # gobject.timeout_add(1000, self.update) def on_game_close(self, widget): - if self.gogame: - self.contents.remove(self.gogame) - self.gogame = None + self.games.remove_page(self.games.get_current_page()) def on_local_new(self, widget): - # Remove any existing game - # fixme - we'll remove this later and add a new concurrent game instead - self.on_game_close(None) - - self.gogame = gogame.GoGame(goban.Goban()) - self.contents.pack_start(self.gogame) - self.gogame.show_all() + game = gogame.GoGame(goban.Goban()) + self.games.append_page(game, gtk.Label('Local Game')) + game.show_all() def on_net_direct(self, widget): diff --git a/ui/default.glade b/ui/default.glade index a5b1a40..1a3d4a7 100644 --- a/ui/default.glade +++ b/ui/default.glade @@ -115,7 +115,47 @@ - + + True + True + True + True + GTK_POS_TOP + False + False + + + + + + + + True + label1 + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + 0 + True + True + diff --git a/ui/res/go_circle_black.png b/ui/res/go_circle_black.png new file mode 100644 index 0000000000000000000000000000000000000000..4d98d26da054e736ca20de97a9046b924222bdef GIT binary patch literal 5550 zcmd^@cT`hZx4;t-2p|$f5CQ^`0i*{*5$PZx7@G8+5Nf1pXwno2pbl85As|%~2vzCQ zgTl~ZLJ<`ak&b|rp$Pac&bQXL-dgXQ_x^wD-n){$?0yK6;Os9b#F#d*t4yb%UU=a|QT(28k1^qm}@|r0rfQBXDnjIbl zV&gh~z#vjKFQ8-&G&I&@{&+xWP9q8umFCojaY7TZZ zTL?J(8bLFVPAK<1@ z{2+8pRD_bs=C`_T(<9&KihwNW%)6mV0)xo95QckDCJ_7-2!a7YX`ufs2on^+|7)Rt zRoCG?ZcCT|K5qCQ1p?x@m==WLxY$1mfPFx*;|_pg|0w+9F#g*B|1TE)J&^xkVSs?A z0{E<(6n>)nt`TW@OV>hkHE=5nZn`#%>& z$G}zJ4+eW{`V#w-pTu|H3B^EZ0g~zX?RsvX2k{fq?#K`)TV8)i)}wfN%R2s_*{yz} z0USu64o~a3z6`wK=qYg#g7$)-9C2;-sH9ywRT~mJ#N8uI$j6mr3QhJ#vdia~2@ZI| zZ%)u9g$dg0CRd&ax$n3Ompsvi=q3XO7xt@-K`p3HGVrqFn^#MQq{KajUnJdZP`B?B zzDE)GBkPWueILTUFHg~oMYq>)wr9aSSn+Cp^udMu%_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jWb7O^#7 zW(WTWDBbkifI*1Qz28+lOMGSJkk}nq>qDP#D;)MKif&^jSd)j&6Ie6Hd(z=fp9 zCL&E#z<4ivVc9^!REu^)^-^L($j;aeralapk5&^cnNl z6KNzh5+bQL0czf@`&FW*=`aeal(=L;Hc$0BE!Ry!FY}Hi@)_cKi{CGgTg+!44F_*T{MacO6nSGbTACTCf1YV`WJyv<@uoR5|El0dk4< zZ`UFr0{VX3q;CWU*3P^EvoKjLtr=s(j>5R$GsiJ=UO>M@roYC+UEy;|*ZkH!BQYQ^r6z#L&=Gd+;D!*#<^(%E$@U(( zt{=LaLUeBq6p4|b-f$A!2z)#^& zq+8n5o%Mz76?hc;Yb+nvR;R?+h{k%2x^7KO{ti_@% literal 0 HcmV?d00001 diff --git a/ui/res/go_t.png b/ui/res/go_triangle.png similarity index 100% rename from ui/res/go_t.png rename to ui/res/go_triangle.png diff --git a/widgets/gogame.py b/widgets/gogame.py index bb4af9c..fec8954 100644 --- a/widgets/gogame.py +++ b/widgets/gogame.py @@ -59,7 +59,7 @@ class GoGame(gtk.HBox): info_box.pack_start(self.resign_button, expand=False, padding=10) self.board_area = gtk.DrawingArea() - self.board_area.set_size_request(800, 800) + self.board_area.set_size_request(750,750) self.board_area.set_events(gtk.gdk.POINTER_MOTION_MASK | gtk.gdk.POINTER_MOTION_HINT_MASK | gtk.gdk.BUTTON_PRESS_MASK | @@ -205,8 +205,11 @@ def _magnitude(vector): def _build_img_res(): ret = {} - triangle = _load_png('go_t.png') - circle = _load_png('go_c.png') + triangle = _load_png('go_triangle.png') + circle_red = _load_png('go_circle_red.png') + circle_black = _load_png('go_circle_black.png') + circle_white = _load_png('go_circle_white.png') + square = _load_png('go_square.png') ret['wH'] = _load_png('go_wH.png') ret['bH'] = _load_png('go_bH.png') @@ -237,10 +240,26 @@ def _build_img_res(): ret[d] = _load_png('go_' + d + '.png') for d in ('u', 'd', 'l', 'r', 'm', 'dl', 'dr', 'ul', 'ur', 'h', 'w', 'b'): - ret[d + 'C'] = ret[d].copy() - width = ret[d + 'C'].get_width() - height = ret[d + 'C'].get_height() - circle.composite(ret[d + 'C'], 0, 0, width, height, 0, 0, 1, 1, gtk.gdk.INTERP_NEAREST, 255) + ret[d + 'Cr'] = ret[d].copy() + width = ret[d + 'Cr'].get_width() + height = ret[d + 'Cr'].get_height() + circle_red.composite(ret[d + 'Cr'], 0, 0, width, height, 0, 0, 1, 1, gtk.gdk.INTERP_NEAREST, 255) + + ret[d + 'Cw'] = ret[d].copy() + width = ret[d + 'Cw'].get_width() + height = ret[d + 'Cw'].get_height() + circle_white.composite(ret[d + 'Cw'], 0, 0, width, height, 0, 0, 1, 1, gtk.gdk.INTERP_NEAREST, 255) + + ret[d + 'Cb'] = ret[d].copy() + width = ret[d + 'Cb'].get_width() + height = ret[d + 'Cb'].get_height() + circle_black.composite(ret[d + 'Cb'], 0, 0, width, height, 0, 0, 1, 1, gtk.gdk.INTERP_NEAREST, 255) + + ret[d + 'S'] = ret[d].copy() + width = ret[d + 'S'].get_width() + height = ret[d + 'S'].get_height() + square.composite(ret[d + 'S'], 0, 0, width, height, 0, 0, 1, 1, gtk.gdk.INTERP_NEAREST, 255) + return ret