コード例 #1
0
    def update_path(self, menu_path):
        # FIXME: UPDATE PATH
        # return
        print("update_path", menu_path)
        if self.use_game_center_item():
            from arcade.glui.topmenu import GameCenterItem

            self.top.append_left(GameCenterItem())
        # if len(menu_path) > 0:
        from arcade.glui.topmenu import HomeItem

        self.top.append_left(HomeItem())
        last_index = len(menu_path) - 1
        for i, item in enumerate(menu_path):
            if item.path_title or last_index == i:
                print("adding item", item)
                self.top.append_left(item)
                # if last_index == i:
                #     item.enabled = False
                # else:
                #     item.enabled = True

                # FIXME: FOR NOW, ALWAYS DISABLE PATH ELEMENTS
                item.enabled = False
        self.set_default_top_selected()
コード例 #2
0
ファイル: launchmenu.py プロジェクト: jelmer/fs-uae-debian
 def __init__(self, item, controller):
     Menu.__init__(self)
     # self.top_menu_transition = 0.0
     self.items.append(item)
     if self.use_game_center_item():
         self.top.left.append(GameCenterItem())
     # self.top.left.append(HomeItem())
     # self.top.left.append(MenuItem(item.title))
     self.top.set_selected_index(
         len(self.top.left) + len(self.top.right) - 1)
     self.state = STATE_STARTING
     self.gc_runner = None
     self.controller = controller
     self.throbber = Throbber()
     self.wait_run_time = 0
コード例 #3
0
    def __init__(self, item, controller):
        Menu.__init__(self)
        # self.top_menu_transition = 0.0
        self.items.append(item)
        if self.use_game_center_item():
            self.top.left.append(GameCenterItem())
        # self.top.left.append(HomeItem())
        # self.top.left.append(MenuItem(item.title))
        self.top.set_selected_index(
            len(self.top.left) + len(self.top.right) - 1
        )

        self.controller = controller
        assert isinstance(self.controller, GameDriver)
        self.first_shown_at = 0

        # controller must now initialize input ports
        # self.controller.init_input()

        # for input in self.controller.inputs:
        #     input["device_id"] = None

        # get all available input devices
        # self.devices, info = InputDevice.get_input_devices(
        #     "", 0, 100, version=2)

        device_manager = InputHandler.get_device_manager()
        # self.devices = DeviceManager.instance().get_devices()
        self.devices = device_manager.get_devices()

        self.device_list_version = InputDevices.device_list_version
        self.device_data = DeviceDataDict()
        # [{"index": 0} for x in self.devices]
        for device in self.devices:
            self.device_data[device.id] = {"port": 0, "device": device}
            self.check_device(self.device_data[device.id])
        # FIXME: Make InputHandler / InputDevice set variables
        # etc and self detect when to reinit?
        # InputHandler.reinit_joysticks()

        # calling activate to try to set the active input device
        # to the first input port, if possible
        # self.activate()
        self.set_defaults()
コード例 #4
0
    def __init__(self, item):
        Menu.__init__(self)

        self.runner = None
        self.platform_handler = None
        self.last_menu_data = None

        self.temp_fix_configs(item)

        self.items.append(item)
        if self.use_game_center_item():
            self.top.left.append(GameCenterItem())
        # self.top.left.append(HomeItem())
        # self.top.left.append(MenuItem(item.title))
        self.top.set_selected_index(
            len(self.top.left) + len(self.top.right) - 1)

        self.context = None
        self.controller = None

        self.create_context()
        self.create_controller()
        print("GameMenu.__init__: controller is", self.controller)

        self.config_list = GameConfigList(self.runner, item)
        self.info_panel = GameInfoPanel()

        self.config_list.info_panel = self.info_panel
        # self.config_list.controller = self.controller
        self.info_panel.config_list = self.config_list

        self.navigatable = self.config_list

        # reset transitions
        enter_transition.start = State.get().time
        enter_transition.end = enter_transition.start + 0.2
        exit_transition.start = 0