def main_frame_panel() -> list:
    """
    游戏主菜单
    """
    cmd_list = []
    character_id = cache_contorl.character_data[0].target_character_id
    character_data = cache_contorl.character_data[character_id]
    title_text = text_loading.get_text_data(constant.FilePath.STAGE_WORD_PATH,
                                            "64")
    era_print.little_title_print(title_text)
    date_text = game_time.get_date_text()
    era_print.normal_print(date_text)
    era_print.normal_print(" ")
    week_date_text = game_time.get_week_day_text()
    era_print.normal_print(week_date_text)
    era_print.normal_print(" ")
    character_name = character_data.name
    py_cmd.pcmd(character_name, character_name, None)
    cmd_list.append(character_name)
    era_print.normal_print(" ")
    gold_text = attr_text.get_gold_text(character_id)
    era_print.line_feed_print(gold_text)
    attr_print.print_hp_and_mp_bar(character_id)
    main_menu_text = text_loading.get_text_data(
        constant.FilePath.STAGE_WORD_PATH, "68")
    era_print.son_title_print(main_menu_text)
    era_print.line_feed_print("\n")
    ask_for_main_menu = cmd_button_queue.option_int(constant.CmdMenu.MAIN_MENU,
                                                    3,
                                                    "left",
                                                    askfor=False,
                                                    cmd_size="center")
    cmd_list = cmd_list + ask_for_main_menu
    system_menu_text = text_loading.get_text_data(
        constant.FilePath.STAGE_WORD_PATH, "69")
    era_print.son_title_print(system_menu_text)
    era_print.line_feed_print()
    system_menu_start_id = len(ask_for_main_menu)
    ask_for_system_menu = cmd_button_queue.option_int(
        constant.CmdMenu.SYSTEM_MENU,
        4,
        "left",
        askfor=False,
        cmd_size="center",
        start_id=system_menu_start_id,
    )
    cmd_list = cmd_list + ask_for_system_menu
    return cmd_list
Exemple #2
0
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
    )
Exemple #3
0
def change_scene_character_list_panel(start_id: int) -> list:
    """
    当前场景角色列表页切换控制面板
    Keyword arguments:
    start_id -- 指令的起始id
    """
    name_list_max = int(game_config.in_scene_see_player_max)
    now_page = int(cache_contorl.panel_state["SeeSceneCharacterListPanel"])
    scene_path = cache_contorl.character_data[0].position
    scene_path_str = map_handle.get_map_system_path_str_for_list(scene_path)
    scene_character_name_list = map_handle.get_scene_character_name_list(
        scene_path_str
    )
    character_max = len(scene_character_name_list)
    page_max = math.floor(character_max / name_list_max)
    page_text = "(" + str(now_page) + "/" + str(page_max) + ")"
    input_s = cmd_button_queue.option_int(
        constant.CmdMenu.CHANGE_SCENE_CHARACTER_LIST,
        cmd_column=5,
        askfor=False,
        cmd_size="center",
        start_id=start_id,
    )
    era_print.page_line_print(sample="-", string=page_text)
    era_print.line_feed_print()
    return input_s
Exemple #4
0
def see_food_shop_tail_cmd(
    start_id: int, max_page: int, type_judge: bool
) -> list:
    """
    食物商店底部控制面板
    Keyword arguments:
    start_id -- 按钮的id的开始位置
    max_page -- 最大页数
    type_judge -- 是否是食物类型列表
    Return arguments:
    list -- 监听的按钮列表
    """
    now_page_id = int(cache_contorl.panel_state["SeeFoodShopListByFoodPanel"])
    if type_judge:
        now_page_id = int(
            cache_contorl.panel_state["SeeFoodShopListByFoodTypePanel"]
        )
    page_text = f"({now_page_id}/{max_page})"
    era_print.page_line_print("-", page_text)
    era_print.normal_print("\n")
    cmd_list = text_loading.get_text_data(
        constant.FilePath.CMD_PATH, "changeSavePage"
    )
    yrn = cmd_button_queue.option_int(
        None,
        3,
        askfor=False,
        cmd_size="center",
        start_id=start_id,
        cmd_list_data=cmd_list,
    )
    return yrn
def input_attr_over_panel():
    """
    创建角色完成时确认角色属性输入处理面板
    """
    yrn = cmd_button_queue.option_int(
        constant.CmdMenu.ACKNOWLEDGEMENT_ATTRIBUTE, askfor=False)
    return yrn
Exemple #6
0
def back_scene_panel(start_id: str) -> list:
    """
    查看场景页面基础命令绘制面板
    Keyword arguments:
    start_id -- 面板命令起始id
    """
    see_map_cmd = []
    now_position = cache_contorl.character_data[0].position
    now_map = map_handle.get_map_for_path(now_position)
    cmd_data = text_loading.get_text_data(constant.FilePath.CMD_PATH,
                                          constant.CmdMenu.SEE_MAP)
    see_map_cmd.append(cmd_data[0])
    if now_map != [] and cache_contorl.now_map != []:
        see_map_cmd.append(cmd_data[1])
    if now_map != cache_contorl.now_map:
        see_map_cmd.append(cmd_data[2])
    map_cmd_list = cmd_button_queue.option_int(
        cmd_list=None,
        cmd_list_data=see_map_cmd,
        cmd_column=3,
        askfor=False,
        cmd_size="center",
        start_id=start_id,
    )
    return map_cmd_list
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
Exemple #8
0
def see_character_clothes_cmd(start_id: int, now_clothing_type: str) -> str:
    """
    用于控制查看角色服装列表面板的命令菜单
    Keyword arguments:
    start_id -- cmd命令的初始Id
    now_clothing_type -- 当前列表的服装类型
    """
    era_print.line_feed_print()
    clothing_type_list = list(clothing.clothing_type_text_list.keys())
    cmd_list = text_loading.get_text_data(
        constant.FilePath.CMD_PATH, constant.CmdMenu.SEE_CHARACYTER_CLOTHES
    )
    now_clothing_type_index = clothing_type_list.index(now_clothing_type)
    up_type_id = now_clothing_type_index - 1
    if now_clothing_type_index == 0:
        up_type_id = len(clothing_type_list) - 1
    next_type_id = now_clothing_type_index + 1
    if now_clothing_type_index == len(clothing_type_list) - 1:
        next_type_id = 0
    up_type_text = [
        clothing.clothing_type_text_list[clothing_type_list[up_type_id]]
    ]
    next_type_text = [
        clothing.clothing_type_text_list[clothing_type_list[next_type_id]]
    ]
    cmd_list = up_type_text + cmd_list + next_type_text
    yrn = cmd_button_queue.option_int(
        None,
        5,
        cmd_size="center",
        askfor=False,
        start_id=start_id,
        cmd_list_data=cmd_list,
    )
    return yrn
def input_nick_name_panel() -> str:
    """
    请求玩家输入昵称面板
    """
    era_print.line_feed_print(
        text_loading.get_text_data(constant.FilePath.MESSAGE_PATH, "6"))
    yrn = cmd_button_queue.option_int(constant.CmdMenu.INPUT_NICK_NAME)
    return yrn
def detailed_setting_8_panel() -> str:
    """
    询问玩家肥胖程度面板
    """
    era_print.line_feed_print(
        text_loading.get_text_data(constant.FilePath.MESSAGE_PATH, "29"))
    yrn = cmd_button_queue.option_int(constant.CmdMenu.DETAILED_SETTING8)
    return yrn
def input_name_panel() -> str:
    """
    请求玩家输入姓名面板
    """
    era_print.line_feed_print(
        text_loading.get_text_data(constant.FilePath.MESSAGE_PATH, "4"))
    yrn = cmd_button_queue.option_int(constant.CmdMenu.CURRENCY_MENU)
    return yrn
def input_sex_choice_panel() -> str:
    """
    玩家性别选择面板
    """
    era_print.line_feed_print(
        text_loading.get_text_data(constant.FilePath.MESSAGE_PATH, "7"))
    yrn = cmd_button_queue.option_int(constant.CmdMenu.SEX_MENU)
    return yrn
Exemple #13
0
def see_character_wear_item_panel(
    character_id: int, change_button: bool
) -> list:
    """
    用于查看角色穿戴道具列表的面板
    Keyword arguments:
    character_id -- 角色Id
    change_button -- 将角色穿戴道具列表绘制成按钮的开关
    """
    wear_item_info_text_data = text_loading.get_text_data(
        constant.FilePath.STAGE_WORD_PATH, "49"
    )
    wear_data = cache_contorl.character_data[character_id].wear_item["Wear"]
    wear_item_text_data = {}
    item_data = cache_contorl.character_data[character_id].wear_item["Item"]
    wear_item_button_list = []
    input_s = []
    for wear_type in wear_data:
        now_wear_data = wear_data[wear_type]
        if now_wear_data == {}:
            wear_item_button_list.append(
                wear_item_info_text_data[wear_type]
                + ":"
                + text_loading.get_text_data(
                    constant.FilePath.STAGE_WORD_PATH, "117"
                )
            )
        else:
            wear_text = ""
            for wear_id in now_wear_data:
                wear_text += "[" + item_data[wear_type][wear_id]["Name"] + "]"
            wear_item_button_list.append(
                wear_item_info_text_data[wear_type] + ":" + wear_text
            )
            wear_item_text_data[wear_type] = item_data[wear_type][wear_id][
                "Name"
            ]
    if change_button:
        input_s = [str(i) for i in range(len(wear_data))]
        cmd_button_queue.option_int(
            None, 4, "left", True, False, "center", 0, wear_item_button_list,
        )
    else:
        era_print.list_print(wear_item_button_list, 4, "center")
    return input_s
def enter_character_nature_end() -> list:
    """
    用户确认角色性格的尾部面板
    Return arguments:
    list -- 按钮列表
    """
    era_print.line_feed_print()
    return cmd_button_queue.option_int(constant.CmdMenu.ENTER_CHARACTER_NATURE,
                                       1, "left", True, False)
def attribute_generation_branch_panel() -> str:
    """
    玩家确认进行详细设置面板
    """
    py_cmd.clr_cmd()
    era_print.line_feed_print(
        text_loading.get_text_data(constant.FilePath.MESSAGE_PATH, "9"))
    yrn = cmd_button_queue.option_int(constant.CmdMenu.CURRENCY_MENU)
    return yrn
def input_self_name_panel() -> str:
    """
    请求玩家输入自称面板
    """
    py_cmd.clr_cmd()
    era_print.line_feed_print(
        text_loading.get_text_data(constant.FilePath.MESSAGE_PATH, "14"))
    yrn = cmd_button_queue.option_int(constant.CmdMenu.INPUT_SELF_NEME)
    return yrn
def input_sex_panel() -> str:
    """
    请求玩家选择性别面板
    """
    sex_id = cache_contorl.character_data[0].sex
    era_print.line_feed_print(
        text_loading.get_text_data(constant.FilePath.MESSAGE_PATH,
                                   "8")[sex_id])
    yrn = cmd_button_queue.option_int(constant.CmdMenu.CURRENCY_MENU)
    return yrn
Exemple #18
0
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
Exemple #19
0
def see_character_wear_clothes_cmd(start_id: int) -> str:
    """
    用于控制查看角色已装备服装列表面板的命令菜单
    """
    era_print.little_line_print()
    yrn = cmd_button_queue.option_int(
        constant.CmdMenu.SEE_CHARACTER_WEAR_CHOTHES,
        id_size="center",
        askfor=False,
        start_id=start_id,
    )
    return yrn
Exemple #20
0
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 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 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 in_scene_button_panel(start_id: int) -> list:
    """
    场景页面基础控制菜单面板
    Keyword arguments:
    start_id -- 基础控制菜单命令起始Id
    """
    era_print.line_feed_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
Exemple #24
0
def ask_for_see_character_list_panel(start_id: str) -> list:
    """
    切换角色列表页面处理面板
    Keyword arguments:
    start_id -- 面板命令起始id
    """
    yrn = cmd_button_queue.option_int(
        constant.CmdMenu.SEE_CHARACTER_LIST,
        3,
        "left",
        askfor=False,
        cmd_size="center",
        start_id=start_id,
    )
    return yrn
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
Exemple #26
0
def ask_see_clothing_info_panel(wear_clothing_judge: bool) -> str:
    """
    用于询问查看或穿戴服装的面板
    Keyword arguments:
    wear_clothing_judge -- 当前服装穿戴状态
    """
    era_print.line_feed_print()
    cmd_data = text_loading.get_text_data(
        constant.FilePath.CMD_PATH,
        constant.CmdMenu.ASK_SEE_CLOTHING_INFO_PANEL,
    ).copy()
    if wear_clothing_judge:
        del cmd_data["0"]
    else:
        del cmd_data["1"]
    cmd_list = list(cmd_data.values())
    return cmd_button_queue.option_int(None, cmd_list_data=cmd_list)
Exemple #27
0
def see_clothing_info_ask_panel(wear_clothing_judge: bool) -> str:
    """
    查看服装详细信息的控制面板
    Keyword arguments:
    wear_clothing_judge -- 服装穿戴状态
    """
    era_print.line_feed_print()
    cmd_data = text_loading.get_text_data(
        constant.FilePath.CMD_PATH,
        constant.CmdMenu.SEE_CLOTHING_INFO_ASK_PANEL,
    ).copy()
    if wear_clothing_judge:
        del cmd_data["1"]
    else:
        del cmd_data["2"]
    cmd_list = list(cmd_data.values())
    return cmd_button_queue.option_int(
        None, 4, cmd_size="center", cmd_list_data=cmd_list
    )
def ask_for_change_save_page_panel(start_id: str) -> list:
    """
    询问切换存档页面面板
    Keyword arguments:
    start_id -- 面板命令的起始id
    """
    cmd_list = text_loading.get_text_data(constant.FilePath.CMD_PATH,
                                          "changeSavePage")
    save_panel_page = str(cache_contorl.panel_state["SeeSaveListPanel"])
    max_save_panel_page = str(cache_contorl.max_save_page)
    save_page_text = "(" + save_panel_page + "/" + max_save_panel_page + ")"
    era_print.page_line_print(sample="-", string=save_page_text)
    era_print.line_feed_print()
    yrn = cmd_button_queue.option_int(
        None,
        3,
        askfor=False,
        cmd_size="center",
        start_id=start_id,
        cmd_list_data=cmd_list,
    )
    return yrn
Exemple #29
0
def buy_food_now_panel(now_food: game_type.Food) -> list:
    """
    玩家确认购买面板
    Keyword arguments:
    now_food -- 食物对象
    Return arguments:
    list -- 监听的按钮列表
    """
    now_text = ""
    if now_food.recipe == -1:
        food_config = text_loading.get_text_data(
            constant.FilePath.FOOD_PATH, now_food.id
        )
        now_text = text_loading.get_text_data(
            constant.FilePath.MESSAGE_PATH, "43"
        ).format(FoodName=food_config["Name"])
    else:
        food_recipe = cache_contorl.recipe_data[now_food.recipe]
        now_text = text_loading.get_text_data(
            constant.FilePath.MESSAGE_PATH, "43"
        ).format(FoodName=food_recipe.name)
    era_print.line_feed_print(now_text)
    return cmd_button_queue.option_int(constant.CmdMenu.BUY_FOOD_NOW_PANEL)