def see_food_shop_list(type_list: dict) -> list: """ 用于查看餐馆出售食物种类的面板 Keyword arguments: type_list -- 种类列表 Return arguments: list -- 监听的按钮列表 """ era_print.restart_line_print("+") now_page_id = int(cache_contorl.panel_state["SeeFoodShopListByFoodPanel"]) now_page_max = game_config.food_shop_type_max now_page_start_id = now_page_id * now_page_max now_page_end_id = now_page_start_id + now_page_max if not len(type_list): era_print.normal_print( text_loading.get_text_data(constant.FilePath.MESSAGE_PATH, "34") ) era_print.line_feed_print() return [] if now_page_end_id > len(type_list): now_page_end_id = len(type_list) text_list = [] tag_text_index = 0 for i in range(now_page_start_id, now_page_end_id): food_name = type_list[list(type_list.keys())[i]] text_list.append(food_name) tag_text_index += 1 return cmd_button_queue.option_int( "", 4, "left", 1, 0, "center", 0, text_list )
def ask_for_see_attr_cmd() -> list: """ 查看属性页显示控制 """ era_print.restart_line_print("~") yrn = cmd_button_queue.option_int( constant.CmdMenu.SEE_ATTR_ON_EVERY_TIME, 3, cmd_size="center", askfor=False, ) return yrn
def see_character_wear_item_cmd_panel(start_id: int) -> list: """ 查看角色已穿戴道具列表的控制面板 Keyword arguments: start_id -- 命令起始Id """ era_print.restart_line_print() yrn = cmd_button_queue.option_int( constant.CmdMenu.SEE_CHARACTER_WEAR_CHOTHES, cmd_size="center", askfor=False, start_id=start_id, ) return yrn
def confirmation_remove_save_panel() -> list: """ 确认删除存档面板 """ era_print.line_feed_print() cmd_list = text_loading.get_text_data(constant.FilePath.CMD_PATH, "confirmationRemoveSave") message_text = text_loading.get_text_data(constant.FilePath.MESSAGE_PATH, "25") era_print.restart_line_print() era_print.line_feed_print(message_text) yrn = cmd_button_queue.option_int(None, askfor=False, cmd_list_data=cmd_list) return yrn
def ask_load_save_panel() -> list: """ 询问读取存档面板 """ era_print.line_feed_print() cmd_list = text_loading.get_text_data(constant.FilePath.CMD_PATH, "loadSaveAsk") message_text = text_loading.get_text_data(constant.FilePath.MESSAGE_PATH, "23") era_print.restart_line_print() era_print.line_feed_print(message_text) yrn = cmd_button_queue.option_int(None, askfor=False, cmd_list_data=cmd_list) return yrn
def in_scene_button_panel(start_id: int) -> list: """ 场景页面基础控制菜单面板 Keyword arguments: start_id -- 基础控制菜单命令起始Id """ era_print.line_feed_print() era_print.restart_line_print(":") input_s = cmd_button_queue.option_int( cmd_list=constant.CmdMenu.IN_SCENE_LIST1, cmd_column=9, askfor=False, cmd_size="center", start_id=start_id, ) return input_s
def ask_for_overlay_save_panel() -> list: """ 询问覆盖存档面板 """ era_print.line_feed_print() cmd_list = text_loading.get_text_data(constant.FilePath.CMD_PATH, "overlay_save") message_text = text_loading.get_text_data(constant.FilePath.MESSAGE_PATH, "21") era_print.restart_line_print() era_print.normal_print(message_text) era_print.line_feed_print() yrn = cmd_button_queue.option_int(None, askfor=False, cmd_list_data=cmd_list) return yrn
def see_character_wear_item_panel_for_player(character_id: int) -> list: """ 用于场景中查看穿戴道具列表的控制面板 Keyword arguments: character_id -- 角色Id change_button -- 将角色穿戴道具列表绘制成按钮的开关 """ era_print.little_title_print( text_loading.get_text_data(constant.FilePath.STAGE_WORD_PATH, "40") ) era_print.normal_print( attr_text.get_see_attr_panel_head_character_info(character_id) ) era_print.restart_line_print(".") if character_id == 0: return see_character_wear_item_panel(character_id, True) else: return see_character_wear_item_panel(character_id, False)
def see_character_item_panel(character_id: int) -> list: """ 查看角色背包道具列表面板 Keyword arguments: character_id -- 角色Id """ era_print.normal_print( attr_text.get_see_attr_panel_head_character_info(character_id)) era_print.restart_line_print(".") if character_id != 0: era_print.line_feed_print( text_loading.get_text_data(constant.FilePath.MESSAGE_PATH, "37")) return [] character_item_data = cache_contorl.character_data["character"][ character_id].item if len(character_item_data) == 0: era_print.line_feed_print( text_loading.get_text_data(constant.FilePath.MESSAGE_PATH, "36")) return [] now_page_id = int(cache_contorl.panel_state["SeeCharacterItemListPanel"]) now_page_max = game_config.see_character_item_max now_page_start_id = now_page_id * now_page_max now_page_end_id = now_page_start_id + now_page_max if now_page_end_id > len(character_item_data.keys()): now_page_end_id = len(character_item_data.keys()) input_s = [] index = 0 for i in range(now_page_start_id, now_page_end_id): item_id = list(character_item_data.keys())[i] item_data = character_item_data[item_id] item_text = (item_data["ItemName"] + " " + text_loading.get_text_data( constant.FilePath.STAGE_WORD_PATH, "136") + str(item_data["ItemNum"])) if character_id == "0": id_info = cmd_button_queue.id_index(index) cmd_text = id_info + item_text py_cmd.pcmd(cmd_text, index, None) else: era_print.normal_print(item_text) index += 1 input_s.append(str(index)) era_print.line_feed_print() return input_s
def see_move_path_panel() -> dict: """ 当前场景可直接通往的移动路径绘制面板 """ input_s = [] now_scene = cache_contorl.character_data[0].position now_map = cache_contorl.now_map now_map_str = map_handle.get_map_system_path_str_for_list(now_map) map_data = cache_contorl.map_data[now_map_str] move_path_info = text_loading.get_text_data(constant.FilePath.MESSAGE_PATH, "27") era_print.normal_print("\n") era_print.line_feed_print(move_path_info) path_edge = map_data["PathEdge"] map_scene_id = map_handle.get_map_scene_id_for_scene_path( now_map, now_scene) scene_path = path_edge[map_scene_id].copy() if map_scene_id in scene_path: del scene_path[map_scene_id] scene_path_list = list(scene_path.keys()) if len(scene_path_list) > 0: scene_cmd = [] for scene in scene_path_list: now_map_str = map_handle.get_map_system_path_str_for_list(now_map) load_scene_data = map_handle.get_scene_data_for_map( now_map_str, scene) scene_name = load_scene_data["SceneName"] scene_cmd.append(scene_name) yrn = cmd_button_queue.option_str( cmd_list=None, cmd_list_data=scene_cmd, cmd_column=4, askfor=False, cmd_size="center", ) input_s = input_s + yrn else: error_move_text = text_loading.get_text_data( constant.FilePath.MESSAGE_PATH, "28") era_print.normal_print(error_move_text) era_print.restart_line_print() return {"input_s": input_s, "scene_path_list": scene_path_list}
def see_character_item_info_panel(character_id: str, item_id: str): """ 用于查看角色道具信息的面板 Keyword arguments: character_id -- 角色Id item_id -- 道具Id """ title_text = text_loading.get_text_data(constant.FilePath.STAGE_WORD_PATH, "38") era_print.little_title_print(title_text) era_print.normal_print( attr_text.get_see_attr_panel_head_character_info(character_id)) era_print.restart_line_print(".") item_data = cache_contorl.character_data[character_id].item[item_id] era_print.line_feed_print( text_loading.get_text_data(constant.FilePath.STAGE_WORD_PATH, 128) + item_data["ItemName"]) era_print.line_feed_print( text_loading.get_text_data(constant.FilePath.STAGE_WORD_PATH, "131") + item_data["ItemInfo"])
def game_main_panel() -> int: """ 游戏标题界面主面板 """ era_print.restart_line_print() era_print.line_feed_print( text_handle.align(game_config.game_name, "center") ) era_print.line_feed_print(text_handle.align(game_config.author, "right")) era_print.line_feed_print(text_handle.align(game_config.verson, "right")) era_print.line_feed_print( text_handle.align(game_config.verson_time, "right") ) era_print.line_feed_print() era_print.restart_line_print() era_print.lines_center_print( 1 / 3, text_loading.get_text_data(constant.FilePath.MESSAGE_PATH, "2") ) time.sleep(1) era_print.line_feed_print() era_print.restart_line_print() time.sleep(1) py_cmd.focus_cmd() menu_int = cmd_button_queue.option_int(constant.CmdMenu.LOGO_MENU) return menu_int
def ask_for_see_attr() -> list: """ 查看角色属性时输入处理面板 """ era_print.restart_line_print() ask_data = text_loading.get_text_data( constant.FilePath.CMD_PATH, constant.CmdMenu.SEE_ATTR_PANEL_HANDLE ).copy() now_panel_id = cache_contorl.panel_state["AttrShowHandlePanel"] ask_list = list(ask_data.values()) cmd_button_queue.option_str( None, 5, "center", False, False, ask_list, now_panel_id, list(ask_data.keys()), ) del ask_data[now_panel_id] return list(ask_data.keys())
def see_character_main_attr_panel(character_id: int): """ 查看角色主属性面板 Keyword arguments: character_id -- 角色Id """ title_1 = text_loading.get_text_data( constant.FilePath.STAGE_WORD_PATH, "1" ) era_print.little_title_print(title_1) character_id_text = f"{text_loading.get_text_data(constant.FilePath.STAGE_WORD_PATH, '0')}{character_id}" character_data = cache_contorl.character_data["character"][character_id] name = character_data.name nick_name = character_data.nick_name character_name = ( text_loading.get_text_data(constant.FilePath.STAGE_WORD_PATH, "13") + name ) character_nick_name = ( text_loading.get_text_data(constant.FilePath.STAGE_WORD_PATH, "12") + nick_name ) sex = character_data.sex sex_text = text_loading.get_text_data( constant.FilePath.STAGE_WORD_PATH, "2" ) + attr_text.get_sex_text(sex) name_text = ( character_id_text + " " + character_name + " " + character_nick_name + " " + sex_text ) hp_bar = attr_print.get_hp_or_mp_bar( character_id, "HitPoint", game_config.text_width / 2 - 4 ) era_print.list_print([name_text, hp_bar], 2, "center") era_print.line_feed_print() state_text = attr_text.get_state_text(character_id) mp_bar = attr_print.get_hp_or_mp_bar( character_id, "ManaPoint", game_config.text_width / 2 - 4 ) era_print.list_print([state_text, mp_bar], 2, "center") era_print.line_feed_print() era_print.little_line_print() stature_text = attr_text.get_stature_text(character_id) era_print.line_feed_print(stature_text) era_print.restart_line_print(".") era_print.line_feed_print( attr_text.get_character_dormitory_path_text(character_id) ) era_print.little_line_print() character_species = f"{text_loading.get_text_data(constant.FilePath.STAGE_WORD_PATH, '15')}{character_data.species}" character_age = f"{text_loading.get_text_data(constant.FilePath.STAGE_WORD_PATH, '3')}{character_data.age}" birthday_text = f"{text_loading.get_text_data(constant.FilePath.STAGE_WORD_PATH,'140')}{character_data.birthday['month']}{text_loading.get_text_data(constant.FilePath.STAGE_WORD_PATH,'60')}{character_data.birthday['day']}{text_loading.get_text_data(constant.FilePath.STAGE_WORD_PATH,'61')}" era_print.list_print( [character_species, character_age, birthday_text], 3, "center" ) era_print.restart_line_print(".") character_intimate = f"{text_loading.get_text_data(constant.FilePath.STAGE_WORD_PATH, '16')}{character_data.intimate}" character_graces = f"{text_loading.get_text_data(constant.FilePath.STAGE_WORD_PATH, '17')}{character_data.graces}" era_print.list_print([character_intimate, character_graces], 2, "center") era_print.restart_line_print(".") character_chest = character_data.chest["NowChest"] chest_group = attr_calculation.judge_chest_group(character_chest) chest_text = ( text_loading.get_text_data(constant.FilePath.STAGE_WORD_PATH, "141") + text_loading.get_text_data(constant.FilePath.STAGE_WORD_PATH, "142")[ chest_group ] ) era_print.list_print([chest_text], 1, "center") era_print.restart_line_print(".") character_height = character_data.height["NowHeight"] character_weight = character_data.weight character_height_text = str(round(character_height, 2)) character_weight_text = str(round(character_weight, 2)) character_height_info = ( text_loading.get_text_data(constant.FilePath.STAGE_WORD_PATH, "80") + character_height_text ) character_weight_info = ( text_loading.get_text_data(constant.FilePath.STAGE_WORD_PATH, "81") + character_weight_text ) era_print.list_print( [character_height_info, character_weight_info], 2, "center" ) era_print.restart_line_print(".") character_measurements = character_data.measurements character_bust = str(round(character_measurements["Bust"], 2)) character_waist = str(round(character_measurements["Waist"], 2)) character_hip = str(round(character_measurements["Hip"], 2)) character_bust_info = ( text_loading.get_text_data(constant.FilePath.STAGE_WORD_PATH, "82") + character_bust ) character_waist_info = ( text_loading.get_text_data(constant.FilePath.STAGE_WORD_PATH, "83") + character_waist ) character_hip_info = ( text_loading.get_text_data(constant.FilePath.STAGE_WORD_PATH, "84") + character_hip ) era_print.list_print( [character_bust_info, character_waist_info, character_hip_info], 3, "center", ) era_print.restart_line_print(".")
def see_food_shop_list_by_food_type(max_page: int, food_list: list) -> list: """ 用于查看餐馆出售食物列表的面板 Keyword arguments: max_page -- 最大页数 Return arguments: list -- 监听的按钮列表 """ era_print.restart_line_print("+") tag_text_index = 0 now_page_id = int( cache_contorl.panel_state["SeeFoodShopListByFoodTypePanel"] ) now_page_max = game_config.food_shop_item_max now_page_start_id = now_page_id * now_page_max now_page_end_id = now_page_start_id + now_page_max if not len(food_list): era_print.normal_print( text_loading.get_text_data(constant.FilePath.MESSAGE_PATH, "34") ) era_print.line_feed_print() return [] if now_page_end_id > len(food_list): now_page_end_id = len(food_list) input_s = [] text_list = [] fix_text = "" for i in range(now_page_start_id, now_page_end_id): now_food = food_list[i] if now_food.recipe == -1: food_config = text_loading.get_text_data( constant.FilePath.FOOD_PATH, now_food.id ) food_name = food_config["Name"] else: food_name = cache_contorl.recipe_data[now_food.recipe].name now_index = cmd_button_queue.id_index(tag_text_index) food_text = now_index + " " + food_name food_text += " " + text_loading.get_text_data( constant.FilePath.STAGE_WORD_PATH, "154" ) if "Hunger" in now_food.feel: food_text += str(round(now_food.feel["Hunger"], 2)) else: food_text += "0" food_text += " " + text_loading.get_text_data( constant.FilePath.STAGE_WORD_PATH, "153" ) if "Thirsty" in now_food.feel: food_text += str(round(now_food.feel["Thirsty"], 2)) else: food_text += "0" food_text += ( " " + text_loading.get_text_data( constant.FilePath.STAGE_WORD_PATH, "155" ) + str(now_food.weight) ) food_text += text_loading.get_text_data( constant.FilePath.STAGE_WORD_PATH, "156" ) food_text += " " + text_loading.get_text_data( constant.FilePath.STAGE_WORD_PATH, "152" ) food_text += text_loading.get_text_data( constant.FilePath.STAGE_WORD_PATH, "151" )[now_food.quality] text_list.append(food_text) now_fix_text = text_handle.align(food_text, "center", True) if fix_text == "": fix_text = now_fix_text if len(now_fix_text) < len(fix_text): fix_text = now_fix_text tag_text_index += 1 for i in range(tag_text_index): now_text = fix_text + text_list[i] now_text = text_handle.align(now_text) py_cmd.pcmd(now_text, i) era_print.normal_print("\n") input_s.append(str(i)) if i < tag_text_index - 1: era_print.restart_line_print("*") return input_s