comparison gamelib/toolbar.py @ 529:93eab01a1e57

Updated (but no prettier) control dialog.
author Jeremy Thurgood <firxen@gmail.com>
date Fri, 27 Nov 2009 20:44:39 +0000
parents 3e19a7f5333e
children d16ed2a8a33e
comparison
equal deleted inserted replaced
528:04975aa3ec70 529:93eab01a1e57
157 dialog.open() 157 dialog.open()
158 158
159 def show_controls(self): 159 def show_controls(self):
160 """Popup dialog of controls""" 160 """Popup dialog of controls"""
161 161
162 COMBOS = { 162 COMBOS = [
163 'Select Multiple chickens' : 'Shift & Left Click', 163 ('Select Multiple chickens', 'Shift & Left Click'),
164 'Move selected chickens' : 'Ctrl & Left Click', 164 ('Move selected chickens', 'Ctrl & Left Click'),
165 'Toggle between select and move' : 'Right Click', 165 ('Toggle between select and move', 'Right Click'),
166 'Unselect current tool and all chickens' : 'Middle Click', 166 ('Unselect current tool and chickens', 'Middle Click'),
167 'Save selection' : 'Ctrl & 0 .. 9', 167 ('Save selection', 'Ctrl & 0 .. 9'),
168 'Recall saved selection' : '0 .. 9', 168 (' or', 'Alt & 0 .. 9'),
169 'Exit game' : 'Esc', 169 ('Recall saved selection', '0 .. 9'),
170 } 170 ('Exit game', 'Esc'),
171 ]
171 172
172 tbl = gui.Table() 173 tbl = gui.Table()
173 tbl.tr() 174 tbl.tr()
174 doc = gui.Document(width=610) 175 doc = gui.Document(width=610)
175 space = doc.style.font.size(" ") 176 space = doc.style.font.size(" ")
176 for header in ['Action', 'Combination']: 177 for header in ['Action', 'Combination']:
177 doc.add(misc.make_box(header)) 178 doc.add(misc.make_box(header))
178 doc.br(space[1]) 179 doc.br(space[1])
179 for command, combo in COMBOS.iteritems(): 180 for command, combo in COMBOS:
180 doc.add(misc.make_box(command)) 181 doc.add(misc.make_box(command))
181 doc.add(misc.make_box(combo)) 182 doc.add(misc.make_box(combo))
182 doc.br(space[1]) 183 doc.br(space[1])
183 doc.br(space[1]) 184 doc.br(space[1])
184 185