comparison gamelib/scenes/game_widgets.py @ 770:a35f5364437d pyntnclick

Merge i18n
author Stefano Rivera <stefano@rivera.za.net>
date Sat, 26 Jan 2013 17:00:43 +0200
parents 43b49f1de828
children bdebe693453f
comparison
equal deleted inserted replaced
764:a8510f4e2ea1 770:a35f5364437d
1 """Generic, game specific widgets""" 1 """Generic, game specific widgets"""
2 2
3 3
4 from pyntnclick.i18n import _
4 from pyntnclick.state import Thing, Result 5 from pyntnclick.state import Thing, Result
5 6
6 from gamelib.custom_widgets import JimLabel 7 from gamelib.custom_widgets import JimLabel
7 8
8 9
22 def interact_without(self): 23 def interact_without(self):
23 """Go to map.""" 24 """Go to map."""
24 self.game.change_scene("map") 25 self.game.change_scene("map")
25 26
26 def get_description(self): 27 def get_description(self):
27 return 'An open doorway leads to the rest of the ship.' 28 return _('An open doorway leads to the rest of the ship.')
28 29
29 def interact_default(self, item): 30 def interact_default(self, item):
30 return self.interact_without() 31 return self.interact_without()
31 32
32 33
47 } 48 }
48 49
49 def get_description(self): 50 def get_description(self):
50 status = self.state.get_jim_state() 51 status = self.state.get_jim_state()
51 if status == 'online': 52 if status == 'online':
52 return "A security camera watches over the room" 53 return _("A security camera watches over the room")
53 elif status == 'looping': 54 elif status == 'looping':
54 return "The security camera is currently offline but should be" \ 55 return _("The security camera is currently offline but should be"
55 " working soon" 56 " working soon")
56 else: 57 else:
57 return "The security camera is powered down" 58 return _("The security camera is powered down")
58 59
59 def is_interactive(self, tool=None): 60 def is_interactive(self, tool=None):
60 return self.state.get_jim_state() == 'online' 61 return self.state.get_jim_state() == 'online'
61 62
62 def interact_with_escher_poster(self, item): 63 def interact_with_escher_poster(self, item):
63 # Order matters here, because of helper function 64 # Order matters here, because of helper function
64 if self.state.get_jim_state() == 'online': 65 if self.state.get_jim_state() == 'online':
65 ai_response = make_jim_dialog("3D scene reconstruction failed." 66 ai_response = make_jim_dialog(_("3D scene reconstruction failed."
66 " Critical error. Entering emergency shutdown.", 67 " Critical error."
67 self.game) 68 " Entering emergency shutdown."),
69 self.game)
68 self.game.data.loop_ai() 70 self.game.data.loop_ai()
69 return ai_response 71 return ai_response
70 72
71 def select_interact(self): 73 def select_interact(self):
72 if 'bridge' not in self.state: 74 if 'bridge' not in self.state: