本文整理汇总了Python中fsgs.platform.PlatformHandler.get_platform_name方法的典型用法代码示例。如果您正苦于以下问题:Python PlatformHandler.get_platform_name方法的具体用法?Python PlatformHandler.get_platform_name怎么用?Python PlatformHandler.get_platform_name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fsgs.platform.PlatformHandler
的用法示例。
在下文中一共展示了PlatformHandler.get_platform_name方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_item_text
# 需要导入模块: from fsgs.platform import PlatformHandler [as 别名]
# 或者: from fsgs.platform.PlatformHandler import get_platform_name [as 别名]
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
示例2: render_bottom_bar_text
# 需要导入模块: from fsgs.platform import PlatformHandler [as 别名]
# 或者: from fsgs.platform.PlatformHandler import get_platform_name [as 别名]
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
示例3: render_bottom_bar_text
# 需要导入模块: from fsgs.platform import PlatformHandler [as 别名]
# 或者: from fsgs.platform.PlatformHandler import get_platform_name [as 别名]
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
示例4: name
# 需要导入模块: from fsgs.platform import PlatformHandler [as 别名]
# 或者: from fsgs.platform.PlatformHandler import get_platform_name [as 别名]
def name(self):
from .platform import PlatformHandler
return PlatformHandler.get_platform_name(self._id)
示例5: __init__
# 需要导入模块: from fsgs.platform import PlatformHandler [as 别名]
# 或者: from fsgs.platform.PlatformHandler import get_platform_name [as 别名]
#.........这里部分代码省略.........
# "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