1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- import FSM
- import utils as u
- import menus as m
- #====================================
-
- State = type("State", (object,), {})
- #====================================
- class State(object):
- def __init__(self, FSM):
- self.FSM = FSM
- def Enter(self):
- pass
- def Execute(self):
- pass
- def Exit(self):
- pass
- #====================================
- class About(State):
- def __init__(self,FSM):
- super(About, self).__init__(FSM)
-
- def Enter(self):
- o = self.FSM.owner
- o.header_text = "About"
- o.pub.register("beat", self)
-
- if o.keyState[16] > 0 or o.keyState[17] > 0:
- pass
- else:
- u.draw_header(o)
- o.update_display(0)
- self.draw_main(o)
- super(About, self).Enter()
-
- def Execute(self):
- o = self.FSM.owner
- m.menu1_actions(self, o)
- if o.keyState[16] == 1:
- m.draw_menu1(o)
- o.update_display(0)
- elif o.keyState[16] == 4:
- u.draw_header(o)
- self.draw_main(o)
- o.update_display(0)
-
- if o.keyState[0] == 1 or o.keyState[0] == 3 or o.keyState[1] == 1 or o.keyState[1] == 3 or o.keyState[2] == 1 or o.keyState[2] == 3 or o.keyState[3] == 1 or o.keyState[3] == 3:
- u.draw_header(o)
- self.draw_main(o)
- o.update_display(0)
-
- def draw_main(self, o):
- o.center_block("rob@robzilla-beats.com", o.h2, [0, 0, o.width, o.height], o.light_grey)
-
- def ReceiveMessage(self, message):
- o = self.FSM.owner
- u.play_seq(o, message)
-
- def Exit(self):
- self.FSM.owner.pub.unregister("beat", self)
|