Exemplo 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)
Exemplo n.º 2
0
 def __init__(self, width: int):
     """ 初始化绘制对象 """
     self.width = width
     """ 面板的最大宽度 """
     now_width = 0
     now_draw = draw.CenterMergeDraw(self.width)
     date_draw = draw.NormalDraw()
     date_draw.width = self.width
     date_draw.text = f"{game_time.get_date_text()} {game_time.get_week_day_text()} "
     now_draw.draw_list.append(date_draw)
     now_width += len(date_draw)
     solar_period = game_time.get_solar_period(cache.game_time)
     season = game_config.config_solar_period[solar_period].season
     season_config = game_config.config_season[season]
     season_draw = draw.NormalDraw()
     season_draw.text = f"{season_config.name} "
     season_draw.style = "season"
     season_draw.width = self.width - now_width
     now_draw.draw_list.append(season_draw)
     now_width += len(season_draw)
     judge, solar_period = game_time.judge_datetime_solar_period(
         cache.game_time)
     if judge:
         solar_period_config = game_config.config_solar_period[solar_period]
         solar_period_draw = draw.NormalDraw()
         solar_period_draw.text = f"{solar_period_config.name} "
         solar_period_draw.width = self.width - now_width
         solar_period_draw.style = "solarperiod"
         now_draw.draw_list.append(solar_period_draw)
         now_width += len(solar_period_draw)
     sun_time = game_time.get_sun_time(cache.game_time)
     sun_time_config = game_config.config_sun_time[sun_time]
     sun_time_draw = draw.NormalDraw()
     sun_time_draw.text = f"{sun_time_config.name} "
     sun_time_draw.width = self.width - now_width
     now_draw.draw_list.append(sun_time_draw)
     now_width += len(sun_time_draw)
     if sun_time <= 2 or sun_time >= 10:
         moon_phase = game_time.get_moon_phase(cache.game_time)
         moon_phase_config = game_config.config_moon[moon_phase]
         moon_phase_draw = draw.NormalDraw()
         moon_phase_draw.text = f"{moon_phase_config.name} "
         moon_phase_draw.width = self.width - now_width
         moon_phase_draw.style = "moon"
         now_draw.draw_list.append(moon_phase_draw)
         now_width += len(moon_phase_draw)
     self.width = now_width
     now_draw.width = self.width
     self.now_draw: draw.NormalDraw = now_draw
     """ 当前面板绘制对象 """
Exemplo 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)
Exemplo n.º 4
0
 def draw(self):
     """ 绘制对象 """
     now_draw = draw.CenterMergeDraw(self.width)
     now_draw.draw_list = self.draw_list
     now_draw.draw()