# HG changeset patch # User Neil Muller # Date 1283018130 -7200 # Node ID eef2fca1aa11bd71ebe5d5cdc6761783e069388f # Parent 1a768b72521f65eae31bc53f5dafca6365c555f2 Hook up updated alert screens diff -r 1a768b72521f -r eef2fca1aa11 Resources/images/bridge/comp_alert_base.png Binary file Resources/images/bridge/comp_alert_base.png has changed diff -r 1a768b72521f -r eef2fca1aa11 Resources/images/bridge/comp_detail_1.png Binary file Resources/images/bridge/comp_detail_1.png has changed diff -r 1a768b72521f -r eef2fca1aa11 Resources/images/bridge/comp_log_1.png Binary file Resources/images/bridge/comp_log_1.png has changed diff -r 1a768b72521f -r eef2fca1aa11 Resources/images/bridge/comp_log_2.png Binary file Resources/images/bridge/comp_log_2.png has changed diff -r 1a768b72521f -r eef2fca1aa11 Resources/images/bridge/comp_log_start.png Binary file Resources/images/bridge/comp_log_start.png has changed diff -r 1a768b72521f -r eef2fca1aa11 gamelib/scenes/bridge.py --- a/gamelib/scenes/bridge.py Sat Aug 28 19:39:58 2010 +0200 +++ b/gamelib/scenes/bridge.py Sat Aug 28 19:55:30 2010 +0200 @@ -430,12 +430,28 @@ SIZE = (640, 400) - ALERT = 'comp_detail_1.png' + ALERT_BASE = 'comp_alert_base.png' + ALERTS = { + 'ai looping' : 'comp_alert_ai_looping.png', + 'ai offline' : 'comp_alert_ai_offline.png', + 'engine offline' : 'comp_alert_engine_offline.png', + 'life support' : 'comp_alert_life_support.png', + } - LOGS = ['comp_log_1.png', 'comp_log_2.png', + # Point to start drawing changeable alerts + ALERT_OFFSET = (16, 140) + ALERT_SPACING = 4 + + LOGS = ['comp_log_start.png', 'comp_log_1.png', 'comp_log_end.png'] - BACKGROUND = ALERT + NAVIGATION = { + 'engine offline' : 'bridge_nav_engine.png', + 'life support' : 'bridge_nav_life_support.png', + 'final' : 'bridge_nav_dest.png' + } + + BACKGROUND = ALERT_BASE INITIAL_DATA = { @@ -452,7 +468,13 @@ self.add_thing(CompUpButton()) self.add_thing(CompDownButton()) self._scene_playlist = None - self._alert = get_image(self.FOLDER, self.ALERT) + self._alert = get_image(self.FOLDER, self.ALERT_BASE) + self._alert_messages = {} + self._nav_message = {} + for key, name in self.ALERTS.iteritems(): + self._alert_messages[key] = get_image(self.FOLDER, name) + for key, name in self.NAVIGATION.iteritems(): + self._nav_message[key] = get_image(self.FOLDER, name) self._logs = [get_image(self.FOLDER, x) for x in self.LOGS] def enter(self): @@ -469,6 +491,23 @@ self._background = self._logs[self.get_data('log page')] super(BridgeCompDetail, self).draw_background(surface) + def draw_things(self, surface): + if self.get_data('tab') == 'alert': + xpos, ypos = self.ALERT_OFFSET + if self.state.scenes['bridge'].get_data('ai status') == 'looping': + surface.blit(self._alert_messages['ai looping'], (xpos, ypos)) + ypos += self._alert_messages['ai looping'].get_size()[1] + self.ALERT_SPACING + if self.state.scenes['bridge'].get_data('ai status') == 'broken': + surface.blit(self._alert_messages['ai offline'], (xpos, ypos)) + ypos += self._alert_messages['ai offline'].get_size()[1] + self.ALERT_SPACING + if not self.state.scenes['engine'].get_data('engine online'): + surface.blit(self._alert_messages['engine offline'], (xpos, ypos)) + ypos += self._alert_messages['engine offline'].get_size()[1] + self.ALERT_SPACING + if not self.state.scenes['mess'].get_data('life support online'): + surface.blit(self._alert_messages['life support'], (xpos, ypos)) + ypos += self._alert_messages['life support'].get_size()[1] + self.ALERT_SPACING + super(BridgeCompDetail, self).draw_things(surface) + SCENES = [Bridge] DETAIL_VIEWS = [ChairDetail, BridgeCompDetail] diff -r 1a768b72521f -r eef2fca1aa11 gamelib/scenes/engine.py --- a/gamelib/scenes/engine.py Sat Aug 28 19:39:58 2010 +0200 +++ b/gamelib/scenes/engine.py Sat Aug 28 19:55:30 2010 +0200 @@ -14,6 +14,7 @@ INITIAL_DATA = { 'accessible': True, + 'engine online': False, } def __init__(self, state): diff -r 1a768b72521f -r eef2fca1aa11 gamelib/scenes/mess.py --- a/gamelib/scenes/mess.py Sat Aug 28 19:39:58 2010 +0200 +++ b/gamelib/scenes/mess.py Sat Aug 28 19:55:30 2010 +0200 @@ -17,6 +17,7 @@ INITIAL_DATA = { 'accessible': True, + 'life support online': False, } def __init__(self, state):