Ejemplo n.º 1
0
 def on_key_press(self, *args):
     if self.next_layer:
         from zombie.common import switch_layer
         switch_layer(self.scene, self.next_layer)
     else:
         from sys import exit
         exit(0)
Ejemplo n.º 2
0
 def cancel(self):
     '''
     Switches back to the MainMenu.
     '''
     from zombie.common import switch_layer
     
     switch_layer(self.scene, MainMenu)
Ejemplo n.º 3
0
 def on_key_press(self, key, modifiers):
     from pyglet.window.key import ENTER
     
     from zombie.common import switch_layer
     
     if key == ENTER:
         switch_layer(self.scene, MainMenu)
Ejemplo n.º 4
0
 def is_connected(self, delta):
     from zombie.common import switch_layer
     
     connected = self._is_connected()
     
     if connected:
         
         switch_layer(self.scene, Client)
     
     from time import time
     
     if (time() - self.connect_start_time) > 10:
         self.unschedule(self.is_connected)
         switch_layer(self.scene, ConnectFailedScreen)
Ejemplo n.º 5
0
 def connect(self):
     from zombie.common import validate_ip_hostname, validate_port
     
     ip = validate_ip_hostname(self.ip.value.encode('ascii'))
     
     if not ip:
         # TODO: error message
         return
     
     port = validate_port(self.port.value)
     
     if not port:
         #TODO: error message
         return
     
     from zombie.common import switch_layer
     ## TODO: Switch to client layer.
     #print('Connecting to', ip, port)
     self.connect_screen.connect(ip, port)
     switch_layer(self.scene, ConnectScreen)
Ejemplo n.º 6
0
 def on_quit(self):
     from zombie.common import switch_layer
     
     self.config.write()
     switch_layer(self.scene, QuitScreen)
Ejemplo n.º 7
0
 def settings(self):
     from zombie.common import switch_layer
     # TODO: Switch
     switch_layer(self.scene, SettingsMenu)
Ejemplo n.º 8
0
 def join_game(self):
     from zombie.common import switch_layer
     
     switch_layer(self.scene, JoinGameMenu)
Ejemplo n.º 9
0
 def cancel(self):
     from zombie.common import switch_layer
     
     switch_layer(self.scene, MainMenu)
Ejemplo n.º 10
0
 def apply(self):
     from zombie.common import switch_layer
     # TODO: validate settings
     self.config.write()
     switch_layer(self.scene, MainMenu)