def get_item_text(self, index):
     item = self.items[index]
     name = item[str("name")]
     platform = item[str("platform")] or ""
     if "[" in name:
         name, extra = name.split("[", 1)
         name = name.strip()
         extra = " \u00b7 " + extra.strip(" ]")
     else:
         extra = ""
     if fsui.toolkit == "wx":
         sep = "\n"
     else:
         sep = " \u00b7 "
         name = name.replace("\n", " \u00b7 ")
     if platform == "Amiga" and not openretro:
         platform = ""
     elif platform:
         platform = sep + PlatformHandler.get_platform_name(platform)
         # if not extra:
         #     sep = ""
         # return "{0}{1}{2}{3}".format(name, sep, extra, "")
     # else:
     text = "{0}{1}{2}".format(name, extra, platform) or "Missing Name"
     return text
 def get_item_text(self, index):
     item = self.items[index]
     name = item[str("name")]
     platform = item[str("platform")] or ""
     if "[" in name:
         name, extra = name.split("[", 1)
         name = name.strip()
         extra = " \u00b7 " + extra.strip(" ]")
     else:
         extra = ""
     if fsui.toolkit == 'wx':
         sep = "\n"
     else:
         sep = " \u00b7 "
         name = name.replace("\n", " \u00b7 ")
     if platform == "Amiga":
         platform = ""
     elif platform:
         platform = sep + PlatformHandler.get_platform_name(platform)
         # if not extra:
         #     sep = ""
         # return "{0}{1}{2}{3}".format(name, sep, extra, "")
     # else:
     text = "{0}{1}{2}".format(name, extra, platform) or "Missing Name"
     return text
Пример #3
0
def render_bottom_bar_text(item):
    strength = 0.9
    x = 544
    y = 290

    title = item.title.upper()
    if title:
        Render.get().text(title, Font.title_font, x, y, 1920 - x - 170,
                          shadow=True, color=(1.0, 1.0, 1.0, 1.0 * strength))

    year_text = str(getattr(State.get().current_menu.selected_item,
                            "year", "") or "").upper()
    if year_text:
        tw, th = Render.get().measure_text(year_text, Font.title_font)
        Render.get().text(year_text, Font.title_font, 1920 - 30 - tw, y, 0,
                          shadow=True, color=(1.0, 1.0, 1.0, 1.0 * strength))

    color = (0x6e / 0xff, 0x8b / 0xff, 0x96 / 0xff, 1.0)
    y = 258
    text_str = ""
    companies = set()
    publisher_text = (getattr(State.get().current_menu.selected_item,
                              "publisher", "") or "").upper()
    for text in publisher_text.split("/"):
        text = text.strip()
        if text:
            if text not in companies:
                text_str = text_str + u" \u00b7 " + text
                companies.add(text)
    developer_text = (getattr(State.get().current_menu.selected_item,
                              "developer", "") or "").upper()
    for text in developer_text.split("/"):
        text = text.strip()
        if text:
            if text not in companies:
                text_str = text_str + u" \u00b7 " + text
                companies.add(text)
    if len(text_str) > 3:
        text_str = text_str[3:]  # remove initial middle dot
        Render.get().text(text_str, Font.subtitle_font, x, y, 0,
                          shadow=True, color=color)

    platform_str = str(
        getattr(State.get().current_menu.selected_item, "platform", "") or "")
    if platform_str:
        platform_str = PlatformHandler.get_platform_name(platform_str).upper()
    if len(platform_str) >= 3:
        tw, th = Render.get().measure_text(platform_str, Font.subtitle_font)
        Render.get().text(platform_str, Font.subtitle_font, 1920 - 30 - tw, y,
                          0,
                          shadow=True, color=color)
    return
Пример #4
0
    def get_platform_name(self):
        # FIXME: UNUSED? REMOVE?
        p = self.options[Option.PLATFORM].lower()
        # if p == "atari-7800":
        #     return "Atari 7800"
        # if p == "amiga":
        #     return "Amiga"
        # if p == "cdtv":
        #     return "CDTV"
        # if p == "cd32":
        #     return "CD32"
        # fsgs.platform.
        # return p
        from fsgs.platform import PlatformHandler

        return PlatformHandler.get_platform_name(p)
Пример #5
0
def render_bottom_bar_text(item):
    strength = 0.9
    x = 544
    y = 290

    title = item.title.upper()
    title = title.strip()
    if "[" in title:
        title, subtitle = title.rsplit("[", 1)
        title = title.strip()
        subtitle = subtitle.strip()
        if subtitle.endswith("]"):
            subtitle = subtitle[:-1]
    else:
        subtitle = ""
    if title:
        Render.get().text(
            title,
            Font.title_font,
            x,
            y,
            1920 - x - 170,
            shadow=True,
            color=(1.0, 1.0, 1.0, 1.0 * strength),
        )
        if subtitle:
            color = (0x6E / 0xFF, 0x8B / 0xFF, 0x96 / 0xFF, 0.75)
            tw, th = Render.get().measure_text(title, Font.title_font)
            Render.get().text(
                subtitle,
                Font.title_font,
                x + tw + 20,
                y,
                1920 - x - 170,
                shadow=True,
                color=color,
            )

    color = (0xC4 / 0xFF, 0xD7 / 0xFF, 0xDE / 0xFF, 1.0)
    year_text = str(
        getattr(State.get().current_menu.selected_item, "year", "") or ""
    ).upper()
    if year_text:
        tw, th = Render.get().measure_text(year_text, Font.title_font)
        Render.get().text(
            year_text,
            Font.title_font,
            1920 - 30 - tw,
            y,
            0,
            shadow=True,
            color=color,
        )
    color = (0x6E / 0xFF, 0x8B / 0xFF, 0x96 / 0xFF, 1.0)
    y = 258
    text_str = ""
    companies = set()
    publisher_text = (
        getattr(State.get().current_menu.selected_item, "publisher", "") or ""
    ).upper()
    for text in publisher_text.split("/"):
        text = text.strip()
        if text:
            if text not in companies:
                text_str = text_str + u" \u00b7 " + text
                companies.add(text)
    developer_text = (
        getattr(State.get().current_menu.selected_item, "developer", "") or ""
    ).upper()
    for text in developer_text.split("/"):
        text = text.strip()
        if text:
            if text not in companies:
                text_str = text_str + u" \u00b7 " + text
                companies.add(text)
    if len(text_str) > 3:
        text_str = text_str[3:]  # remove initial middle dot
        tw, th = Render.get().measure_text(text_str, Font.subtitle_font)
        Render.get().text(
            text_str,
            Font.subtitle_font,
            1920 - 30 - tw,
            y,
            0,
            shadow=True,
            color=color,
        )

    platform_str = str(
        getattr(State.get().current_menu.selected_item, "platform", "") or ""
    )
    if platform_str:
        platform_str = PlatformHandler.get_platform_name(platform_str).upper()
    if len(platform_str) >= 3:
        # tw, th = Render.get().measure_text(platform_str, Font.subtitle_font)
        Render.get().text(
            platform_str, Font.subtitle_font, x, y, 0, shadow=True, color=color
        )
    return
 def name(self):
     from .platform import PlatformHandler
     return PlatformHandler.get_platform_name(self._id)
Пример #7
0
def render_bottom_bar_text(item):
    strength = 0.9
    x = 544
    y = 290

    title = item.title.upper()
    title = title.strip()
    if "[" in title:
        title, subtitle = title.rsplit("[", 1)
        title = title.strip()
        subtitle = subtitle.strip()
        if subtitle.endswith("]"):
            subtitle = subtitle[:-1]
    else:
        subtitle = ""
    if title:
        Render.get().text(title,
                          Font.title_font,
                          x,
                          y,
                          1920 - x - 170,
                          shadow=True,
                          color=(1.0, 1.0, 1.0, 1.0 * strength))
        if subtitle:
            color = (0x6e / 0xff, 0x8b / 0xff, 0x96 / 0xff, 0.75)
            tw, th = Render.get().measure_text(title, Font.title_font)
            Render.get().text(subtitle,
                              Font.title_font,
                              x + tw + 20,
                              y,
                              1920 - x - 170,
                              shadow=True,
                              color=color)

    color = (0xc4 / 0xff, 0xd7 / 0xff, 0xde / 0xff, 1.0)
    year_text = str(
        getattr(State.get().current_menu.selected_item, "year", "")
        or "").upper()
    if year_text:
        tw, th = Render.get().measure_text(year_text, Font.title_font)
        Render.get().text(year_text,
                          Font.title_font,
                          1920 - 30 - tw,
                          y,
                          0,
                          shadow=True,
                          color=color)
    color = (0x6e / 0xff, 0x8b / 0xff, 0x96 / 0xff, 1.0)
    y = 258
    text_str = ""
    companies = set()
    publisher_text = (getattr(State.get().current_menu.selected_item,
                              "publisher", "") or "").upper()
    for text in publisher_text.split("/"):
        text = text.strip()
        if text:
            if text not in companies:
                text_str = text_str + u" \u00b7 " + text
                companies.add(text)
    developer_text = (getattr(State.get().current_menu.selected_item,
                              "developer", "") or "").upper()
    for text in developer_text.split("/"):
        text = text.strip()
        if text:
            if text not in companies:
                text_str = text_str + u" \u00b7 " + text
                companies.add(text)
    if len(text_str) > 3:
        text_str = text_str[3:]  # remove initial middle dot
        tw, th = Render.get().measure_text(text_str, Font.subtitle_font)
        Render.get().text(text_str,
                          Font.subtitle_font,
                          1920 - 30 - tw,
                          y,
                          0,
                          shadow=True,
                          color=color)

    platform_str = str(
        getattr(State.get().current_menu.selected_item, "platform", "") or "")
    if platform_str:
        platform_str = PlatformHandler.get_platform_name(platform_str).upper()
    if len(platform_str) >= 3:
        # tw, th = Render.get().measure_text(platform_str, Font.subtitle_font)
        Render.get().text(platform_str,
                          Font.subtitle_font,
                          x,
                          y,
                          0,
                          shadow=True,
                          color=color)
    return
Пример #8
0
 def name(self):
     from .platform import PlatformHandler
     return PlatformHandler.get_platform_name(self._id)
Пример #9
0
    def __init__(self, platform):
        AutoExpandItem.__init__(self)
        self._platform = platform
        # using self.platform for "description"

        # self.sort_title = ""
        # try:
        #    self.title, self.subtitle, self.sort_title = {
        #        "Amiga": (
        #            "Amiga",
        #            "Commodore Amiga",
        #            "Commodore 2"),
        #        "amstrad-cpc": (
        #            "Amstrad CPC",
        #            "Color Personal Computer",
        #            ""),
        #        "apple-II": (
        #            "Apple II",
        #            "II/Plus/e/c",
        #            ""),
        #        "arcade": (
        #            "Arcade Video Games",
        #            "Multiple Arcade Machines",
        #            ""),
        #        "atari-2600": (
        #            "Atari 2600",
        #            "Video Computer System",
        #            "Atari 1"),
        #        "atari-8-bit": (
        #            "Atari 8-Bit",
        #            "Atari 400/800/XL/XE",
        #            "Atari 2"),
        #        "atari-5200": (
        #            "Atari 5200",
        #            "Atari 5200 SuperSystem",
        #            "Atari 3"),
        #        "atari-7800": (
        #            "Atari 7800",
        #            "Atari 7800 ProSystem",
        #            "Atari 4"),
        #        "atari-st": (
        #            "Atari ST",
        #            "Atari ST/STE",
        #            "Atari 5"),
        #        "bbc-micro": (
        #            "BBC Micro",
        #            "Acorn BCC Micro",
        #            ""),
        #        "commodore-64": (
        #            "Commodore 64",
        #            "",
        #            "Commodore 1"),
        #        "game-boy": (
        #            "Game Boy",
        #            "",
        #            "Nintendo 2"),
        #        "game-boy-color": (
        #            "Game Boy Color",
        #            "",
        #            "Nintendo 5"),
        #        "game-boy-advance": (
        #            "Game Boy Advance",
        #            "",
        #            "Nintendo 6"),
        #        "game-cube": (
        #            "GameCube",
        #            "Nintendo GameCube",
        #            "Nintendo 7"),
        #        "game-gear": (
        #            "Game Gear",
        #            "Sega Game Gear",
        #            "Sega 3"),
        #        "lynx": (
        #            "Atari Lynx",
        #            "",
        #            "Atari 6"),
        #        "nintendo": (
        #            "Nintendo",
        #            "",
        #            "Nintendo 1"),
        #        "nintendo-64": (
        #            "Nintendo 64",
        #            "",
        #            "Nintendo 4"),
        #        "DOS": (
        #            "DOS",
        #            "IBM PC Compatible",
        #            "PC 1"),
        #        "master-system": (
        #            "Master System",
        #            "Sega Master System / Mark III",
        #            "Sega 1"),
        #        "mega-drive": (
        #            "Mega Drive",
        #            "Sega Mega Drive / Genesis",
        #            "Sega 2"),
        #        "playstation": (
        #            "PlayStation",
        #            "Sony PlayStation",
        #            ""),
        #        "playstation-2": (
        #            "PlayStation 2",
        #            "Sony PlayStation 2",
        #            ""),
        #        "super-nintendo": (
        #            "Super Nintendo",
        #            "Entertainment System",
        #            "Nintendo 3"),
        #        "turbografx-16": (
        #            "TurboGrafx-16",
        #            "Entertainment SuperSystem",
        #            ""),
        #        "wii": (
        #            "Wii",
        #            "Nintendo Wii",
        #            "Nintendo 8"),
        #        "windows": (
        #            "Windows",
        #            "IBM PC Compatible",
        #            "PC 2"),
        #        "zx-spectrum": (
        #            "ZX Spectrum",
        #            "Sinclair ZX Spectrum",
        #            ""),
        #    }[platform]
        # except KeyError:
        #    self.title = platform
        self.platform = platform
        self.path_title = platform

        self.title = PlatformHandler.get_platform_name(platform)
        self.path_title = self.title

        # self.title = ""
        # self.title = "CHOOSE PLATFORM: " + self.title
        # self.subtitle = ""
        self.subtitle = "CHOOSE PLATFORM"

        # if not self.sort_title:
        #     self.sort_title = self.title

        # FIXME: for now, test using just title as sort title
        self.sort_title = self.title
Пример #10
0
    def __init__(self, platform):
        AutoExpandItem.__init__(self)
        self._platform = platform
        # using self.platform for "description"

        # self.sort_title = ""
        # try:
        #    self.title, self.subtitle, self.sort_title = {
        #        "Amiga": (
        #            "Amiga",
        #            "Commodore Amiga",
        #            "Commodore 2"),
        #        "amstrad-cpc": (
        #            "Amstrad CPC",
        #            "Color Personal Computer",
        #            ""),
        #        "apple-II": (
        #            "Apple II",
        #            "II/Plus/e/c",
        #            ""),
        #        "arcade": (
        #            "Arcade Video Games",
        #            "Multiple Arcade Machines",
        #            ""),
        #        "atari-2600": (
        #            "Atari 2600",
        #            "Video Computer System",
        #            "Atari 1"),
        #        "atari-8-bit": (
        #            "Atari 8-Bit",
        #            "Atari 400/800/XL/XE",
        #            "Atari 2"),
        #        "atari-5200": (
        #            "Atari 5200",
        #            "Atari 5200 SuperSystem",
        #            "Atari 3"),
        #        "atari-7800": (
        #            "Atari 7800",
        #            "Atari 7800 ProSystem",
        #            "Atari 4"),
        #        "atari-st": (
        #            "Atari ST",
        #            "Atari ST/STE",
        #            "Atari 5"),
        #        "bbc-micro": (
        #            "BBC Micro",
        #            "Acorn BCC Micro",
        #            ""),
        #        "commodore-64": (
        #            "Commodore 64",
        #            "",
        #            "Commodore 1"),
        #        "game-boy": (
        #            "Game Boy",
        #            "",
        #            "Nintendo 2"),
        #        "game-boy-color": (
        #            "Game Boy Color",
        #            "",
        #            "Nintendo 5"),
        #        "game-boy-advance": (
        #            "Game Boy Advance",
        #            "",
        #            "Nintendo 6"),
        #        "game-cube": (
        #            "GameCube",
        #            "Nintendo GameCube",
        #            "Nintendo 7"),
        #        "game-gear": (
        #            "Game Gear",
        #            "Sega Game Gear",
        #            "Sega 3"),
        #        "lynx": (
        #            "Atari Lynx",
        #            "",
        #            "Atari 6"),
        #        "nintendo": (
        #            "Nintendo",
        #            "",
        #            "Nintendo 1"),
        #        "nintendo-64": (
        #            "Nintendo 64",
        #            "",
        #            "Nintendo 4"),
        #        "DOS": (
        #            "DOS",
        #            "IBM PC Compatible",
        #            "PC 1"),
        #        "master-system": (
        #            "Master System",
        #            "Sega Master System / Mark III",
        #            "Sega 1"),
        #        "mega-drive": (
        #            "Mega Drive",
        #            "Sega Mega Drive / Genesis",
        #            "Sega 2"),
        #        "playstation": (
        #            "PlayStation",
        #            "Sony PlayStation",
        #            ""),
        #        "playstation-2": (
        #            "PlayStation 2",
        #            "Sony PlayStation 2",
        #            ""),
        #        "super-nintendo": (
        #            "Super Nintendo",
        #            "Entertainment System",
        #            "Nintendo 3"),
        #        "turbografx-16": (
        #            "TurboGrafx-16",
        #            "Entertainment SuperSystem",
        #            ""),
        #        "wii": (
        #            "Wii",
        #            "Nintendo Wii",
        #            "Nintendo 8"),
        #        "windows": (
        #            "Windows",
        #            "IBM PC Compatible",
        #            "PC 2"),
        #        "zx-spectrum": (
        #            "ZX Spectrum",
        #            "Sinclair ZX Spectrum",
        #            ""),
        #    }[platform]
        # except KeyError:
        #    self.title = platform
        self.platform = platform
        self.path_title = platform

        self.title = PlatformHandler.get_platform_name(platform)
        self.path_title = self.title

        # self.title = ""
        # self.title = "CHOOSE PLATFORM: " + self.title
        # self.subtitle = ""
        self.subtitle = "CHOOSE PLATFORM"

        # if not self.sort_title:
        #     self.sort_title = self.title

        # FIXME: for now, test using just title as sort title
        self.sort_title = self.title