本文整理汇总了Python中menu.Menu.addOption方法的典型用法代码示例。如果您正苦于以下问题:Python Menu.addOption方法的具体用法?Python Menu.addOption怎么用?Python Menu.addOption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类menu.Menu
的用法示例。
在下文中一共展示了Menu.addOption方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Createuimenu
# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import addOption [as 别名]
#.........这里部分代码省略.........
TYPECAR_2, _saveConfig,
_launchTrack,
self.config_user,
"TYPECAR", index=2)
self.config_user.setParameter("TEXTURE",
"lr_modern_red")
self.menu_jugar.addSelector(self.langs.get(95),
COLOR_CAR_2_2, _saveConfig,
_launchTrack,
self.config_user,
"TEXTURE", index=3)
elif value == "3":
self.menu_jugar.addSelector(self.langs.get(94),
TYPECAR_3, _saveConfig,
_launchTrack,
self.config_user,
"TYPECAR", index=2)
self.config_user.setParameter("TEXTURE",
"lr_super_cyan")
self.menu_jugar.addSelector(self.langs.get(95),
COLOR_CAR_3_2, _saveConfig,
_launchTrack,
self.config_user,
"TEXTURE", index=3)
self.menu_jugar.actual.size -= 2
args[0].export()
# Si se activa/ desactiva el mostrar el fantasma
if args[1] == "SHOWGHOST":
self.view.update_show_ghost()
# Menu jugar
self.menu_jugar = Menu(self.window, self.font, self.langs.get(61),
draw_region_y=55)
self.menu_jugar.addOption(self.langs.get(104), _launchTrack, "a")
# Se cargan los mapas
tracks = []
actual_map = int(self.config_map.getValue("DEFAULTMAP"))
tracks.append((TRACKS[actual_map], str(actual_map)))
for track in TRACKS.keys():
if track != actual_map:
tracks.append((TRACKS[track], str(track)))
self.menu_jugar.addSelector(self.langs.get(103), tracks,
_saveConfig, None, self.config_map,
"DEFAULTMAP")
if self.config_user.getValue("TYPECAR") == "1":
typecar_values = TYPECAR_1
elif self.config_user.getValue("TYPECAR") == "2":
typecar_values = TYPECAR_2
else:
typecar_values = TYPECAR_3
self.menu_jugar.addSelector(self.langs.get(94), typecar_values,
_saveConfig, None, self.config_user,
"TYPECAR")
if self.config_user.getValue("TYPECAR") == "1":
if self.config_user.getValue("TEXTURE") == "lr_classic_yellow":
self.menu_jugar.addSelector(self.langs.get(95),
COLOR_CAR_1_1, _saveConfig,
_launchTrack,
self.config_user, "TEXTURE")
elif self.config_user.getValue("TEXTURE") == "lr_classic_blue":
self.menu_jugar.addSelector(self.langs.get(95),
COLOR_CAR_1_2, _saveConfig,
_launchTrack,
self.config_user, "TEXTURE")
elif self.config_user.getValue("TEXTURE") == "lr_classic_cyan":
self.menu_jugar.addSelector(self.langs.get(95),
示例2: build_menu
# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import addOption [as 别名]
def build_menu():
# 1P menu
menu_1P = Menu()
menu_1P.addOption("1P mode with auto attack", Game1pNormal().start)
menu_1P.addOption("1P mode with invisible blocks", Game1pInvisible().start)
# practice menu
menu_prac = Menu()
menu_prac.addOption("4-wide practice", Game1p4wide().start)
menu_prac.addOption("dig challenge", Game1pDig().start)
# main menu
menu_main = Menu(isRoot = True)
menu_main.addOption("1 player", menu_1P.start)
menu_main.addOption("Practice", menu_prac.start)
return menu_main