def instract_list_panel() -> list: """ 绘制指令面板 Return arguments: list -- 绘制的按钮列表 """ instruct_list = [ instruct for instruct_type in instruct_data if instruct_type in cache_contorl.instruct_filter and cache_contorl.instruct_filter[instruct_type] for instruct in instruct_data[instruct_type] if judge_instract_available(instruct) ] return_data = [ str(instruct_cmd_id_data[instruct]) for instruct in instruct_list ] cmd_data = [ " " + cmd_button_queue.id_index(return_data[i]) + instruct_text_data[instruct_list[i]] for i in range(len(instruct_list)) ] if len(return_data) > 0: cmd_button_queue.option_str( None, 5, "left", False, False, cmd_data, "", return_data, {}, {}, False, ) return return_data
def see_character(character_id: str, judge: bool) -> list: """ 用于任何时候查看角色性格信息面板 Keyword arguments: character_id -- 角色Id judge -- 绘制按钮校验 Return arguments: list -- 按钮列表 """ nature_text_data = text_loading.get_game_data( constant.FilePath.NATURE_PATH) character_nature = cache_contorl.character_data[character_id].nature cmd_list = [] for nature in nature_text_data: nature_text = nature_text_data[nature]["Name"] if "Good" in nature_text: now_nature_values = [ character_nature[son_nature] for son_nature in nature_text_data[nature]["Factor"] ] now_nature_value = sum(now_nature_values) now_nature_max = len(now_nature_values) * 100 if now_nature_value < now_nature_max / 2: nature_text = nature_text["Bad"] else: nature_text = nature_text["Good"] era_print.son_title_print(nature_text) info_list = [ nature_text_data[nature]["Factor"][son_nature][judge_nature_good( character_nature[son_nature])] for son_nature in nature_text_data[nature]["Factor"] ] if judge: now_son_list = [son for son in nature_text_data[nature]["Factor"]] cmd_list += now_son_list cmd_button_queue.option_str( None, len(now_son_list), "center", False, False, info_list, "", now_son_list, ) else: era_print.list_print(info_list, len(info_list), "center") return cmd_list
def see_scene_character_list_panel() -> list: """ 当前场景角色列表面板 """ input_s = [] see_character_text = text_loading.get_text_data( constant.FilePath.MESSAGE_PATH, "26") era_print.normal_print(see_character_text) era_print.line_feed_print() scene_path = cache_contorl.character_data["character"][0].position scene_path_str = map_handle.get_map_system_path_str_for_list(scene_path) name_list = map_handle.get_scene_character_name_list(scene_path_str, True) name_list = get_now_page_name_list(name_list) character_id = cache_contorl.character_data["character_id"] character_data = cache_contorl.character_data["character"][character_id] character_name = character_data.name input_s = cmd_button_queue.option_str( "", cmd_column=10, cmd_size="center", askfor=False, cmd_list_data=name_list, null_cmd=character_name, ) return input_s
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 show_scene_name_list_panel() -> str: """ 地图下场景名称绘制面板 """ title_text = text_loading.get_text_data(constant.FilePath.STAGE_WORD_PATH, "86") era_print.normal_print(title_text) panel_state = cache_contorl.panel_state["SeeSceneNameListPanel"] if panel_state == "0": py_cmd.pcmd(panel_state_off_text, "SeeSceneNameListPanel") era_print.line_feed_print() now_map = cache_contorl.now_map now_position = cache_contorl.character_data[0].position now_scene = map_handle.get_scene_id_in_map_for_scene_path_on_map_path( now_position, now_map) now_map_map_system_str = map_handle.get_map_system_path_str_for_list( now_map) scene_name_data = map_handle.get_scene_name_list_for_map_path( now_map_map_system_str) scene_name_list = {} null_scene = now_scene for scene in scene_name_data: scene_name_list[scene] = scene + ":" + scene_name_data[scene] cmd_button_queue.option_str( None, 4, "center", False, False, list(scene_name_list.values()), null_scene, list(scene_name_list.keys()), ) else: py_cmd.pcmd(panel_state_on_text, "SeeSceneNameListPanel") era_print.line_feed_print() era_print.little_line_print() return "SeeSceneNameListPanel"
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_instruct_head_panel() -> list: """ 绘制指令面板的头部过滤器面板 Return arguments: list -- 绘制的按钮列表 """ era_print.little_title_print( text_loading.get_text_data(constant.FilePath.STAGE_WORD_PATH, "146")) instruct_data = text_loading.get_text_data( constant.FilePath.CMD_PATH, constant.CmdMenu.INSTRUCT_HEAD_PANEL) if cache_contorl.instruct_filter == {}: cache_contorl.instruct_filter = { instruct: 0 for instruct in instruct_data } cache_contorl.instruct_filter["Dialogue"] = 1 style_data = { instruct_data[instruct]: "selectmenu" for instruct in instruct_data if cache_contorl.instruct_filter[instruct] == 0 } on_style_data = { instruct_data[instruct]: "onselectmenu" for instruct in instruct_data if cache_contorl.instruct_filter[instruct] == 0 } era_print.normal_print( text_loading.get_text_data(constant.FilePath.STAGE_WORD_PATH, "147")) return cmd_button_queue.option_str( None, len(instruct_data), "center", False, False, list(instruct_data.values()), "", list(instruct_data.keys()), style_data, on_style_data, )
def see_food_shop_head_cmd(now_panel: str) -> list: """ 食物商店顶部控制按钮 Keyword arguments: now_panel -- 当前面板id Return arguments: list -- 监听的按钮列表 """ button_data: dict = text_loading.get_text_data( constant.FilePath.CMD_PATH, constant.CmdMenu.BUY_FOOD_HEAD_PANEL ) cmd_list = list(button_data.keys()) return_list = list(button_data.values()) input_s = cmd_button_queue.option_str( "", 6, "center", askfor=False, cmd_list_data=return_list, null_cmd=now_panel, return_data=cmd_list, ) return input_s