Ejemplo n.º 1
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.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 transition
        Transition.start = 0
Ejemplo n.º 2
0
 def render_top_left(self, selected=False):
     # self.render_top_background(selected, style=TOP_ITEM_ARROW)
     MenuItem.render_top_left(self, selected=selected)
     gl.glDisable(gl.GL_DEPTH_TEST)
     fs_emu_blending(True)
     # if app.name == "fs-uae-arcade":
     x = 161
     # else:
     #     x = 138
     y = 14
     # if selected:
     # texture = Texture.top_logo_selected
     # else:
     texture = Texture.top_logo
     texture.render(x, 1080 - y - texture.h, texture.w, texture.h)
     # fs_emu_blending(False)
     gl.glEnable(gl.GL_DEPTH_TEST)
Ejemplo n.º 3
0
 def render_top_left(self, selected=False):
     # self.render_top_background(selected, style=TOP_ITEM_ARROW)
     MenuItem.render_top_left(self, selected=selected)
     gl.glDisable(gl.GL_DEPTH_TEST)
     fs_emu_blending(True)
     # if app.name == "fs-uae-arcade":
     x = 161
     # else:
     #     x = 138
     y = 14
     # if selected:
     # texture = Texture.top_logo_selected
     # else:
     texture = Texture.top_logo
     texture.render(x, 1080 - y - texture.h, texture.w, texture.h)
     # fs_emu_blending(False)
     gl.glEnable(gl.GL_DEPTH_TEST)
Ejemplo n.º 4
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.state = STATE_STARTING
     self.gc_runner = None
     self.controller = controller
     self.throbber = Throbber()
Ejemplo n.º 5
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.controller = controller
        assert isinstance(self.controller, GameRunner)
        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()
Ejemplo n.º 6
0
def create_search_results_menu(text):
    global current_menu
    try:
        if text == current_menu.search_text:
            return False
    except AttributeError:
        pass
    new_menu = SearchResultsMenu("Search Results")
    new_menu.search_text = text
    # words = [v.strip() for v in text.lower().split(" ")]
    # print "Creating search results for", words
    new_menu.top.append_left(
        SearchTextItem("Search: {0}_".format(text)))
    # clause = []
    # args = []
    # for word in words:
    #     clause.append("AND name like ?")
    #     args.append("%{0}%".format(word))
    # clause = " ".join(clause)
    terms = GameNameUtil.extract_search_terms(text.lower())
    for item in MenuItem.create_game_items(terms):
        new_menu.append(item)
    if len(new_menu) == 0:
        new_menu.append(NoItem("No Search Results"))
    # if hasattr(current_menu, "search_text"):
    #     # replace current search menu, not append to path
    #     #new_menu.parent_menu = current_menu.parent_menu
    #     replace = True
    # else:
    #     #new_menu.parent_menu = current_menu
    #     replace = False
    replace = isinstance(current_menu, SearchResultsMenu)
    print("create search results menu")
    # set_current_menu(new_menu)
    enter_menu(new_menu, replace=replace)
    return True
Ejemplo n.º 7
0
 def __init__(self, title):
     MenuItem.__init__(self)
     self.path_title = title