comparison gamelib/scenes/scene_widgets.py @ 499:cfd9c2bb4474

Make poster only work if JIM is online
author Neil Muller <neil@dip.sun.ac.za>
date Tue, 31 Aug 2010 14:25:09 +0200
parents 54853e61b149
children e49e4fe76241
comparison
equal deleted inserted replaced
498:168e9424fe91 499:cfd9c2bb4474
182 return None 182 return None
183 183
184 184
185 class BaseCamera(Thing): 185 class BaseCamera(Thing):
186 "Base class for the camera puzzles" 186 "Base class for the camera puzzles"
187 187
188 INITIAL = 'online' 188 INITIAL = 'online'
189 INITIAL_DATA = { 189 INITIAL_DATA = {
190 'state': 'online', 190 'state': 'online',
191 } 191 }
192 192
193 def get_description(self): 193 def get_description(self):
194 return "A security camera watches over the room" 194 return "A security camera watches over the room"
195 195
196 def interact_with_escher_poster(self, item): 196 def interact_with_escher_poster(self, item):
197 # Order matters here, because of helper function 197 # Order matters here, because of helper function
198 ai_response = make_jim_dialog("3D scene reconstruction failed. Critical error. Entering emergency shutdown.", self.state) 198 if self.state.scenes['bridge'].get_data('ai status') == 'online':
199 self.state.scenes['bridge'].set_data('ai status', 'looping') 199 ai_response = make_jim_dialog("3D scene reconstruction failed. Critical error. Entering emergency shutdown.", self.state)
200 return ai_response 200 self.state.scenes['bridge'].set_data('ai status', 'looping')
201 201 return ai_response
202
202 def animate(self): 203 def animate(self):
203 ai_status = self.state.scenes['bridge'].get_data('ai status') 204 ai_status = self.state.scenes['bridge'].get_data('ai status')
204 if ai_status != self.get_data('status'): 205 if ai_status != self.get_data('status'):
205 self.set_data('status', ai_status) 206 self.set_data('status', ai_status)
206 self.set_interact(ai_status) 207 self.set_interact(ai_status)