Mercurial > rinkhals
comparison gamelib/gameboard.py @ 519:f84ad10a9625
Remove move tool. Add basic controls reference dialog
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Fri, 27 Nov 2009 13:55:07 +0000 |
parents | 4166a0051bb6 |
children | 787eb032bf8a |
comparison
equal
deleted
inserted
replaced
518:a42852e50df1 | 519:f84ad10a9625 |
---|---|
330 return | 330 return |
331 if e.button == 3: # Right button | 331 if e.button == 3: # Right button |
332 if self.toolbar.MOVE_SELECT_PERMITTED: | 332 if self.toolbar.MOVE_SELECT_PERMITTED: |
333 if self.selected_tool != constants.TOOL_SELECT_CHICKENS: | 333 if self.selected_tool != constants.TOOL_SELECT_CHICKENS: |
334 self.set_selected_tool(constants.TOOL_SELECT_CHICKENS, cursors.cursors["select"]) | 334 self.set_selected_tool(constants.TOOL_SELECT_CHICKENS, cursors.cursors["select"]) |
335 if self.toolbar.IS_DEFAULT: | |
336 self.toolbar.toggle_select_on() | |
337 elif self.selected_tool == constants.TOOL_SELECT_CHICKENS: | 335 elif self.selected_tool == constants.TOOL_SELECT_CHICKENS: |
338 self.set_selected_tool(constants.TOOL_PLACE_ANIMALS, cursors.cursors["chicken"]) | 336 self.set_selected_tool(constants.TOOL_PLACE_ANIMALS, cursors.cursors["chicken"]) |
339 if self.toolbar.IS_DEFAULT: | |
340 self.toolbar.toggle_move_on() | |
341 return | 337 return |
342 elif e.button == 2: # Middle button | 338 elif e.button == 2: # Middle button |
343 self.reset_states() | 339 self.reset_states() |
344 self.unselect_all() | 340 self.unselect_all() |
345 elif e.button != 1: # Left button | 341 elif e.button != 1: # Left button |
350 elif self.selected_tool == constants.TOOL_SELL_EGG: | 346 elif self.selected_tool == constants.TOOL_SELL_EGG: |
351 self.sell_egg(self.tv.screen_to_tile(e.pos)) | 347 self.sell_egg(self.tv.screen_to_tile(e.pos)) |
352 elif self.selected_tool == constants.TOOL_PLACE_ANIMALS: | 348 elif self.selected_tool == constants.TOOL_PLACE_ANIMALS: |
353 self.place_animal(self.tv.screen_to_tile(e.pos)) | 349 self.place_animal(self.tv.screen_to_tile(e.pos)) |
354 self.set_selected_tool(constants.TOOL_SELECT_CHICKENS, cursors.cursors["select"]) | 350 self.set_selected_tool(constants.TOOL_SELECT_CHICKENS, cursors.cursors["select"]) |
355 if self.toolbar.IS_DEFAULT: | |
356 self.toolbar.toggle_select_on() | |
357 elif self.selected_tool == constants.TOOL_SELECT_CHICKENS: | 351 elif self.selected_tool == constants.TOOL_SELECT_CHICKENS: |
358 # ctrl moves current selection without having to select move tool | 352 # ctrl moves current selection without having to select move tool |
359 if (mods & KMOD_CTRL): | 353 if (mods & KMOD_CTRL): |
360 self.place_animal(self.tv.screen_to_tile(e.pos)) | 354 self.place_animal(self.tv.screen_to_tile(e.pos)) |
361 else: | 355 else: |