comparison gamelib/gamescreen.py @ 133:0530547a131f

Better map handling, detail_view stuff in Result.
author Jeremy Thurgood <firxen@gmail.com>
date Tue, 24 Aug 2010 19:49:10 +0200
parents 4223d66d88b4
children faac82748f5a
comparison
equal deleted inserted replaced
132:686bb74a52f8 133:0530547a131f
13 from constants import SCREEN, BUTTON_SIZE, SCENE_SIZE 13 from constants import SCREEN, BUTTON_SIZE, SCENE_SIZE
14 from cursor import CursorWidget 14 from cursor import CursorWidget
15 from hand import HandButton 15 from hand import HandButton
16 from popupmenu import PopupMenu, PopupMenuButton 16 from popupmenu import PopupMenu, PopupMenuButton
17 from state import initial_state, Item 17 from state import initial_state, Item
18 18 from widgets import MessageDialog
19 19
20 class InventoryView(PaletteView): 20 class InventoryView(PaletteView):
21 21
22 sel_color = Color("yellow") 22 sel_color = Color("yellow")
23 sel_width = 2 23 sel_width = 2
75 result.process(self) 75 result.process(self)
76 76
77 def mouse_move(self, event): 77 def mouse_move(self, event):
78 if not self.subwidgets: 78 if not self.subwidgets:
79 self.state.mouse_move(event.pos) 79 self.state.mouse_move(event.pos)
80
81 def show_message(self, message):
82 # Display the message as a modal dialog
83 MessageDialog(message, 60).present()
84 # queue a redraw to show updated state
85 self.invalidate()
80 86
81 def show_detail(self, detail): 87 def show_detail(self, detail):
82 w, h = self.state.set_current_detail(detail) 88 w, h = self.state.set_current_detail(detail)
83 self.detail.set_image_rect(Rect(0, 0, w, h)) 89 self.detail.set_image_rect(Rect(0, 0, w, h))
84 self.add_centered(self.detail) 90 self.add_centered(self.detail)