Exemplo n.º 1
0
def toggle_camera(user, event):
    mode_for_idx = [pf.CAM_MODE_RTS, pf.CAM_MODE_FPS]

    if event[0] == pf.SDL_SCANCODE_C and not pf.ui_text_edit_has_focus():
        global active_cam_idx
        active_cam_idx = (active_cam_idx + 1) % 2
        pf.activate_camera(active_cam_idx, mode_for_idx[active_cam_idx])
Exemplo n.º 2
0
def toggle_pause(user, event):

    if event[0] == pf.SDL_SCANCODE_P and not pf.ui_text_edit_has_focus():
        ss = pf.get_simstate()
        if ss == pf.G_RUNNING:
            pf.set_simstate(pf.G_PAUSED_UI_RUNNING)
        else:
            pf.set_simstate(pf.G_RUNNING)
Exemplo n.º 3
0
def toggle_camera(user, event):

    if event[0] == pf.SDL_SCANCODE_C and not pf.ui_text_edit_has_focus():
        global active_cam, main_cam, debug_cam
        if active_cam == main_cam:
            active_cam = debug_cam
        else:
            active_cam = main_cam
        pf.set_active_camera(active_cam)
Exemplo n.º 4
0
 def __on_keydown(self, event):
     scancode = event[0]
     if scancode in self.__hotkey_action_map and not pf.ui_text_edit_has_focus():
         self.__hotkey_action_map[scancode]()