Esempio n. 1
0
 def __init__(self, character_id: int, width: int):
     """ 初始化绘制对象 """
     self.character_id = character_id
     """ 绘制的角色id """
     self.width = width
     """ 当前最大可绘制宽度 """
     character_data = cache.character_data[self.character_id]
     self.experience_text_data = {
         0: _("嘴部开发度:"),
         1: _("胸部开发度:"),
         2: _("阴蒂开发度:"),
         3: _("阴茎开发度:"),
         4: _("阴道开发度:"),
         5: _("肛门开发度:"),
     }
     """ 性器官开发度描述 """
     self.draw_list: List[draw.NormalDraw()] = []
     """ 绘制对象列表 """
     sex_tem = character_data.sex in (0, 3)
     organ_list = game_config.config_organ_data[
         sex_tem] | game_config.config_organ_data[2]
     for organ in organ_list:
         now_draw = draw.NormalDraw()
         now_draw.text = self.experience_text_data[organ]
         now_draw.width = width / len(organ_list)
         now_exp = 0
         if organ in character_data.sex_experience:
             now_exp = character_data.sex_experience[organ]
         level_draw = draw.ExpLevelDraw(now_exp)
         new_draw = draw.CenterMergeDraw(width / len(organ_list))
         new_draw.draw_list.append(now_draw)
         new_draw.draw_list.append(level_draw)
         self.draw_list.append(new_draw)
Esempio n. 2
0
 def __init__(self, text: str, width: int, is_button: bool,
              num_button: bool, button_id: int):
     """ 初始化绘制对象 """
     self.language_id: int = text[0]
     """ 语言id """
     self.language_exp: int = text[1]
     """ 语言经验 """
     self.draw_text: str = ""
     """ 语言名绘制文本 """
     self.width: int = width
     """ 最大宽度 """
     self.is_button: bool = is_button
     """ 绘制按钮 """
     self.num_button: bool = num_button
     """ 绘制数字按钮 """
     self.button_id: int = button_id
     """ 数字按钮的id """
     self.button_return: str = str(button_id)
     """ 按钮返回值 """
     self.draw_list: List[draw.NormalDraw] = []
     """ 绘制的对象列表 """
     language_config = game_config.config_language[self.language_id]
     language_name = language_config.name
     name_draw = draw.NormalDraw()
     name_draw.width = self.width
     if is_button:
         button_text = ""
         if num_button:
             index_text = text_handle.id_index(button_id)
             button_text = f"{index_text} {language_name}:"
             name_draw = draw.Button(button_text,
                                     self.button_return,
                                     cmd_func=self.see_language_info)
         else:
             button_text = f"{language_name}:"
             name_draw = draw.Button(button_text,
                                     language_name,
                                     cmd_func=self.see_language_info)
             self.button_return = language_name
     else:
         name_draw.text = f"{language_name}:"
     level_draw = draw.ExpLevelDraw(self.language_exp)
     name_draw.width = self.width - len(level_draw)
     self.draw_list = [name_draw, level_draw]
Esempio n. 3
0
 def __init__(self, character_id: int, width: int):
     """ 初始化绘制对象 """
     self.character_id = character_id
     """ 要绘制的角色id """
     self.width = width
     """ 面板最大宽度 """
     self.draw_list: List[draw.NormalDraw] = []
     """ 绘制的文本列表 """
     self.return_list: List[str] = []
     """ 当前面板监听的按钮列表 """
     character_data = cache.character_data[character_id]
     for skill_type in game_config.config_knowledge_type_data:
         skill_set = game_config.config_knowledge_type_data[skill_type]
         type_config = game_config.config_knowledge_type[skill_type]
         type_draw = draw.LittleTitleLineDraw(type_config.name, self.width,
                                              ":")
         self.draw_list.append(type_draw)
         now_list = []
         skill_group = value_handle.list_of_groups(list(skill_set), 3)
         for skill_list in skill_group:
             for skill in skill_list:
                 skill_config = game_config.config_knowledge[skill]
                 skill_draw = draw.CenterMergeDraw(
                     int(self.width / len(skill_group)))
                 now_text_draw = draw.NormalDraw()
                 now_text_draw.text = skill_config.name
                 now_text_draw.width = text_handle.get_text_index(
                     skill_config.name)
                 now_exp = 0
                 if skill in character_data.knowledge:
                     now_exp = character_data.knowledge[skill]
                 now_level_draw = draw.ExpLevelDraw(now_exp)
                 skill_draw.draw_list.append(now_text_draw)
                 skill_draw.draw_list.append(now_level_draw)
                 skill_draw.width = int(self.width / len(skill_group))
                 now_list.append(skill_draw)
         self.draw_list.append(now_list)