|
@@ -24,7 +24,7 @@ from game.const import window as W, color as C, game as G
|
|
|
from game.const import rouge as R
|
|
from game.const import rouge as R
|
|
|
from game.music import music_loader
|
|
from game.music import music_loader
|
|
|
from game.sound import sound_player
|
|
from game.sound import sound_player
|
|
|
-from game.ui.menu.component import PygameButton, PygameButtonBackIMG, Particle
|
|
|
|
|
|
|
+from game.ui.menu.component import PygameButton, PygameButtonBackIMG, Particle, PygameIMG
|
|
|
from game.utils import local_data_manager as DM
|
|
from game.utils import local_data_manager as DM
|
|
|
|
|
|
|
|
current_folder_path = os.getcwd()
|
|
current_folder_path = os.getcwd()
|
|
@@ -93,11 +93,13 @@ class Menu:
|
|
|
|
|
|
|
|
# 杂项第一次打开
|
|
# 杂项第一次打开
|
|
|
if not os.path.exists(other_file_path):
|
|
if not os.path.exists(other_file_path):
|
|
|
- rougeOB_other_data = {"Bomb": [],
|
|
|
|
|
- "Pet": [],
|
|
|
|
|
- "Hat": [],
|
|
|
|
|
- "LastRandom": 0,
|
|
|
|
|
- "Other": []}
|
|
|
|
|
|
|
+ rougeOB_other_data = {
|
|
|
|
|
+ "Bomb": [],
|
|
|
|
|
+ "Pet": [],
|
|
|
|
|
+ "Hat": [],
|
|
|
|
|
+ "LastRandom": 0,
|
|
|
|
|
+ "Other": []
|
|
|
|
|
+ }
|
|
|
save_encrypt_single_rouge_file(rougeOB_other_data, "rougeOBOther")
|
|
save_encrypt_single_rouge_file(rougeOB_other_data, "rougeOBOther")
|
|
|
# 正常打开
|
|
# 正常打开
|
|
|
else:
|
|
else:
|
|
@@ -165,8 +167,8 @@ class Menu:
|
|
|
try:
|
|
try:
|
|
|
if len(rougeOB_task_data[str(month)]["last_finish"]) > 4: # 防一手格式错误
|
|
if len(rougeOB_task_data[str(month)]["last_finish"]) > 4: # 防一手格式错误
|
|
|
rougeOB_task_data[str(month)]["last_finish"] = rougeOB_task_data[str(month)]["last_finish"][0:4]
|
|
rougeOB_task_data[str(month)]["last_finish"] = rougeOB_task_data[str(month)]["last_finish"][0:4]
|
|
|
- except:
|
|
|
|
|
- pass
|
|
|
|
|
|
|
+ except Exception as e:
|
|
|
|
|
+ print(e)
|
|
|
if int(rougeOB_task_data[str(month)]["last_finish"]) < int(year):
|
|
if int(rougeOB_task_data[str(month)]["last_finish"]) < int(year):
|
|
|
rougeOB_task_data[str(month)]["process"] = 0
|
|
rougeOB_task_data[str(month)]["process"] = 0
|
|
|
rougeOB_task_data[str(month)]["last_finish"] = year
|
|
rougeOB_task_data[str(month)]["last_finish"] = year
|
|
@@ -183,12 +185,14 @@ class Menu:
|
|
|
if os.path.exists(old_file_path):
|
|
if os.path.exists(old_file_path):
|
|
|
# 备份旧文件
|
|
# 备份旧文件
|
|
|
old_json = load_json(old_file_path)
|
|
old_json = load_json(old_file_path)
|
|
|
- rougeOB_data = {"Fox": {"exp": old_json["Fox"]["exp"], "lv": old_json["Fox"]["lv"]},
|
|
|
|
|
- "Boboli": {"exp": old_json["Boboli"]["exp"], "lv": old_json["Boboli"]["exp"]},
|
|
|
|
|
- "Naruto_old": {"exp": 0, "lv": 1},
|
|
|
|
|
- "Asha": {"exp": old_json["Naruto_old"]["exp"], "lv": old_json["Naruto_old"]["exp"]},
|
|
|
|
|
- "Maria": {"exp": 0, "lv": 1},
|
|
|
|
|
- "Surprise": {"exp": 0, "lv": 1}}
|
|
|
|
|
|
|
+ rougeOB_data = {
|
|
|
|
|
+ "Fox": {"exp": old_json["Fox"]["exp"], "lv": old_json["Fox"]["lv"]},
|
|
|
|
|
+ "Boboli": {"exp": old_json["Boboli"]["exp"], "lv": old_json["Boboli"]["exp"]},
|
|
|
|
|
+ "Naruto_old": {"exp": 0, "lv": 1},
|
|
|
|
|
+ "Asha": {"exp": old_json["Naruto_old"]["exp"], "lv": old_json["Naruto_old"]["exp"]},
|
|
|
|
|
+ "Maria": {"exp": 0, "lv": 1},
|
|
|
|
|
+ "Surprise": {"exp": 0, "lv": 1}
|
|
|
|
|
+ }
|
|
|
print("等级数据继承成功")
|
|
print("等级数据继承成功")
|
|
|
else:
|
|
else:
|
|
|
rougeOB_data = {
|
|
rougeOB_data = {
|
|
@@ -203,24 +207,25 @@ class Menu:
|
|
|
# 正常打开
|
|
# 正常打开
|
|
|
else:
|
|
else:
|
|
|
rougeOB_data = load_rouge_data(rouge_file_path)
|
|
rougeOB_data = load_rouge_data(rouge_file_path)
|
|
|
|
|
+ print(f"local rougeOB_data: {rougeOB_data}")
|
|
|
|
|
|
|
|
# =========================================================================================
|
|
# =========================================================================================
|
|
|
- util.load_online_config()
|
|
|
|
|
- if G.UID == "" and G.USERNAME == "":
|
|
|
|
|
- # username = input("请输入昵称: ").strip()
|
|
|
|
|
- # password = input("请输入密码: ").strip()
|
|
|
|
|
- util.register()
|
|
|
|
|
- new_info = rougeOB_data
|
|
|
|
|
- new_info["record"] = "null"
|
|
|
|
|
- result = util.update_profile(G.UID, new_info, G.PASSWORD)
|
|
|
|
|
- print(result.get('message', '未知错误'))
|
|
|
|
|
- is_online = util.try_login()
|
|
|
|
|
|
|
+ is_online = util.load_online_config()
|
|
|
if is_online:
|
|
if is_online:
|
|
|
- rougeOB_data = util.get_online_data()
|
|
|
|
|
|
|
+ if G.UID == "" and G.USERNAME == "":
|
|
|
|
|
+ util.register()
|
|
|
|
|
+ new_info = rougeOB_data
|
|
|
|
|
+ new_info["record"] = "null"
|
|
|
|
|
+ result = util.update_profile(G.UID, new_info, G.PASSWORD)
|
|
|
|
|
+ print(result.get('message', '未知错误'))
|
|
|
|
|
+ is_online = util.try_login()
|
|
|
|
|
+ online_data = util.get_online_data()
|
|
|
|
|
+ if online_data is not None:
|
|
|
|
|
+ rougeOB_data = online_data
|
|
|
# =========================================================================================
|
|
# =========================================================================================
|
|
|
|
|
|
|
|
check_rouge_ob_data(rougeOB_data)
|
|
check_rouge_ob_data(rougeOB_data)
|
|
|
- print(rougeOB_data)
|
|
|
|
|
|
|
+ print(f"online rougeOB_data: {rougeOB_data}")
|
|
|
|
|
|
|
|
for hero in ["Fox", "Boboli", "Naruto_old", "Asha", "Maria"]:
|
|
for hero in ["Fox", "Boboli", "Naruto_old", "Asha", "Maria"]:
|
|
|
rougeOB_data[hero]["lv"] = R.current_lv(rougeOB_data[hero]["exp"])
|
|
rougeOB_data[hero]["lv"] = R.current_lv(rougeOB_data[hero]["exp"])
|
|
@@ -248,8 +253,7 @@ class Menu:
|
|
|
max_level_hero = "Fox"
|
|
max_level_hero = "Fox"
|
|
|
max_diff = "Easy"
|
|
max_diff = "Easy"
|
|
|
max_diff_num = 1
|
|
max_diff_num = 1
|
|
|
- self.hero_dic = {"Fox": "小倩", "Boboli": "波波丽", "Naruto_old": "火影", "Asha": "阿莎", "Maria": "玛莉亚",
|
|
|
|
|
- "Surprise": "???"}
|
|
|
|
|
|
|
+ self.hero_dic = {"Fox": "小倩", "Boboli": "波波丽", "Naruto_old": "火影", "Asha": "阿莎", "Maria": "玛莉亚", "Surprise": "???"}
|
|
|
self.diff_dic = {"Easy": "简单", "Normal": "困难", "Hell": "炼狱", "Hell+": "炼狱+"}
|
|
self.diff_dic = {"Easy": "简单", "Normal": "困难", "Hell": "炼狱", "Hell+": "炼狱+"}
|
|
|
diff_num = {"Easy": 1, "Normal": 2, "Hell": 3, "Hell+": 4}
|
|
diff_num = {"Easy": 1, "Normal": 2, "Hell": 3, "Hell+": 4}
|
|
|
diff_status = {"Easy": 0, "Normal": 0, "Hell": 0, "Hell+": 0}
|
|
diff_status = {"Easy": 0, "Normal": 0, "Hell": 0, "Hell+": 0}
|
|
@@ -297,67 +301,72 @@ class Menu:
|
|
|
self.buttons.clear()
|
|
self.buttons.clear()
|
|
|
# "进入游戏"
|
|
# "进入游戏"
|
|
|
# self.buttons.append(PygameButton(self.screen, "进入游戏", 0.5, 0.29, 32, "#e1bd48", action=self._start_game, is_bold=True))
|
|
# self.buttons.append(PygameButton(self.screen, "进入游戏", 0.5, 0.29, 32, "#e1bd48", action=self._start_game, is_bold=True))
|
|
|
- self.buttons.append(PygameButtonBackIMG(self, self.screen, 0.5, 0.3, "res/ui/button/start.png", "res/ui/button/start_press.png", action=self._start_game, anchor='center'))
|
|
|
|
|
|
|
+ self.buttons.append(PygameButtonBackIMG(self, self.screen, 0.5, 0.33, "res/ui/button/start.png", "res/ui/button/start_press.png", action=self._start_game, anchor='center'))
|
|
|
# "继续游戏"
|
|
# "继续游戏"
|
|
|
if os.path.exists(os.path.join(os.path.expanduser("~\\Documents"), "QQTPVE", "rougeOBLastGame.rougedata")):
|
|
if os.path.exists(os.path.join(os.path.expanduser("~\\Documents"), "QQTPVE", "rougeOBLastGame.rougedata")):
|
|
|
- self.buttons.append(PygameButtonBackIMG(self, self.screen, 0.5, 0.44, "res/ui/button/continue.png", "res/ui/button/continue_press.png", action=lambda: self._continue_game(), anchor='center'))
|
|
|
|
|
|
|
+ self.buttons.append(PygameButtonBackIMG(self, self.screen, 0.5, 0.5, "res/ui/button/continue.png", "res/ui/button/continue_press.png", action=lambda: self._continue_game(), anchor='center'))
|
|
|
# 任务系统
|
|
# 任务系统
|
|
|
- self.buttons.append(PygameButtonBackIMG(self, self.screen, 0.16, 0.16, "res/ui/button/task.png", "res/ui/button/task_press.png", action=self._open_task, anchor='center'))
|
|
|
|
|
|
|
+ self.buttons.append(PygameButtonBackIMG(self, self.screen, 0.22, 0.42, "res/ui/button/task.png", "res/ui/button/task_press.png", action=self._open_task, anchor='center'))
|
|
|
# 陈列馆
|
|
# 陈列馆
|
|
|
- self.buttons.append(PygameButtonBackIMG(self, self.screen, 0.16, 0.32, "res/ui/button/memory.png", "res/ui/button/memory_press.png", action=self._open_setting, anchor='center'))
|
|
|
|
|
- # 难度选择
|
|
|
|
|
- last_diff = {"Easy": "Easy", "Normal": "Easy", "Hell": "Normal", "Hell+": "Hell"}
|
|
|
|
|
- for diff, rel in [("Easy", 0.1), ("Normal", 0.18), ("Hell", 0.26), ("Hell+", 0.34)]:
|
|
|
|
|
- if diff == R.difficulty:
|
|
|
|
|
- text = f"★ 当前难度: {self.diff_dic[diff]}"
|
|
|
|
|
- color = "#c7a44f"
|
|
|
|
|
- self.buttons.append(PygameButton(self.screen, text, 0.75, rel, 13, color, anchor="topleft", is_bold=True, fix_shape=(120,15), bg_alpha=191))
|
|
|
|
|
- else:
|
|
|
|
|
- enabled = R.pass_status.get(last_diff[diff], 0) > 0
|
|
|
|
|
- if diff == "Easy":
|
|
|
|
|
- text = f"● 选择{self.diff_dic[diff]}难度"
|
|
|
|
|
- color = "#99be7f"
|
|
|
|
|
- action = lambda d=diff: self._choose_diff(d)
|
|
|
|
|
- self.buttons.append(
|
|
|
|
|
- PygameButton(self.screen, text, 0.75, rel, 13, color, action=action, anchor="topleft", is_bold=True, fix_shape=(120,15), bg_alpha=191))
|
|
|
|
|
- else:
|
|
|
|
|
- text = f"● 选择{self.diff_dic[diff]}难度" if enabled else f"○ {self.diff_dic[diff]}难度(未解锁)"
|
|
|
|
|
- color = "#99be7f" if enabled else "#55516d"
|
|
|
|
|
- if enabled:
|
|
|
|
|
- action = lambda d=diff: self._choose_diff(d)
|
|
|
|
|
- self.buttons.append(PygameButton(self.screen, text, 0.75, rel, 13, color, action=action, anchor="topleft", is_bold=True, fix_shape=(120,15), bg_alpha=191))
|
|
|
|
|
- else:
|
|
|
|
|
- self.buttons.append(PygameButton(self.screen, text, 0.75, rel, 13, color, fg_color=(255, 255, 255), anchor="topleft", is_bold=False, fix_shape=(120,15), bg_alpha=63))
|
|
|
|
|
- # ================================= 英雄选择 =================================
|
|
|
|
|
- heroes = ["Fox", "Boboli", "Naruto_old", "Asha", "Maria", "Surprise"]
|
|
|
|
|
- x_position = 0.1
|
|
|
|
|
- y_positions = [0.64, 0.70, 0.76, 0.82, 0.88, 0.49]
|
|
|
|
|
- for hero, y in zip(heroes, y_positions):
|
|
|
|
|
- if not self.is_random and hero == R.rouge_hero:
|
|
|
|
|
- text = f"★ 使用{self.hero_dic[hero]}"
|
|
|
|
|
- self.buttons.append(PygameButton(self.screen, text, x_position, y, 12, "#c7a44f", action=lambda h=hero: self._choose_hero(h), anchor="topleft", is_bold=True, fix_shape=(80,15), bg_alpha=191))
|
|
|
|
|
- else:
|
|
|
|
|
- text = f"● 选择{self.hero_dic[hero]}"
|
|
|
|
|
- self.buttons.append(PygameButton(self.screen, text, x_position, y, 12, "#99be7f", action=lambda h=hero: self._choose_hero(h), anchor="topleft", is_bold=True, fix_shape=(80,15), bg_alpha=127))
|
|
|
|
|
- # 随机开局
|
|
|
|
|
- if self.is_random:
|
|
|
|
|
- self.buttons.append(PygameButton(self.screen, "★ 使用随机", x_position, 0.94, 12, "#c7a44f", action=lambda: self._choose_hero("Random"), anchor="topleft", is_bold=True, fix_shape=(80,15), bg_alpha=127))
|
|
|
|
|
- else:
|
|
|
|
|
- self.buttons.append(PygameButton(self.screen, "● 随机开局", x_position, 0.94, 12, "#99be7f", action=lambda: self._choose_hero("Random"), anchor="topleft", is_bold=True, fix_shape=(80,15), bg_alpha=127))
|
|
|
|
|
- # 英雄信息提示
|
|
|
|
|
- infos = [getattr(self, attr) for attr in ['Fox_info', 'Boboli_info', 'Naruto_old_info', 'Asha_info', 'Maria_info']]
|
|
|
|
|
- base_heroes = ["Fox", "Boboli", "Naruto_old", "Asha", "Maria"]
|
|
|
|
|
- if not self.is_random:
|
|
|
|
|
- for hero, info, y in zip(base_heroes, infos, y_positions):
|
|
|
|
|
- if hero == R.rouge_hero:
|
|
|
|
|
- self.buttons.append(PygameButton(self.screen, info, 0.32, y-0.03, 14, "#d7b8da", fg_color=(0, 0, 0), anchor="topleft", bg_alpha=127))
|
|
|
|
|
- # ==========================================================================
|
|
|
|
|
|
|
+ self.buttons.append(PygameButtonBackIMG(self, self.screen, 0.22, 0.58, "res/ui/button/memory.png", "res/ui/button/memory_press.png", action=self._open_setting, anchor='center'))
|
|
|
|
|
+ # # 难度选择
|
|
|
|
|
+ # last_diff = {"Easy": "Easy", "Normal": "Easy", "Hell": "Normal", "Hell+": "Hell"}
|
|
|
|
|
+ # for diff, rel in [("Easy", 0.1), ("Normal", 0.18), ("Hell", 0.26), ("Hell+", 0.34)]:
|
|
|
|
|
+ # if diff == R.difficulty:
|
|
|
|
|
+ # text = f"★ 当前难度: {self.diff_dic[diff]}"
|
|
|
|
|
+ # color = "#c7a44f"
|
|
|
|
|
+ # self.buttons.append(PygameButton(self.screen, text, 0.75, rel, 13, color, anchor="topleft", is_bold=True, fix_shape=(120,15), bg_alpha=191))
|
|
|
|
|
+ # else:
|
|
|
|
|
+ # enabled = R.pass_status.get(last_diff[diff], 0) > 0
|
|
|
|
|
+ # if diff == "Easy":
|
|
|
|
|
+ # text = f"● 选择{self.diff_dic[diff]}难度"
|
|
|
|
|
+ # color = "#99be7f"
|
|
|
|
|
+ # action = lambda d=diff: self._choose_diff(d)
|
|
|
|
|
+ # self.buttons.append(
|
|
|
|
|
+ # PygameButton(self.screen, text, 0.75, rel, 13, color, action=action, anchor="topleft", is_bold=True, fix_shape=(120,15), bg_alpha=191))
|
|
|
|
|
+ # else:
|
|
|
|
|
+ # text = f"● 选择{self.diff_dic[diff]}难度" if enabled else f"○ {self.diff_dic[diff]}难度(未解锁)"
|
|
|
|
|
+ # color = "#99be7f" if enabled else "#55516d"
|
|
|
|
|
+ # if enabled:
|
|
|
|
|
+ # action = lambda d=diff: self._choose_diff(d)
|
|
|
|
|
+ # self.buttons.append(PygameButton(self.screen, text, 0.75, rel, 13, color, action=action, anchor="topleft", is_bold=True, fix_shape=(120,15), bg_alpha=191))
|
|
|
|
|
+ # else:
|
|
|
|
|
+ # self.buttons.append(PygameButton(self.screen, text, 0.75, rel, 13, color, fg_color=(255, 255, 255), anchor="topleft", is_bold=False, fix_shape=(120,15), bg_alpha=63))
|
|
|
|
|
+ # # ================================= 英雄选择 =================================
|
|
|
|
|
+ # heroes = ["Fox", "Boboli", "Naruto_old", "Asha", "Maria", "Surprise"]
|
|
|
|
|
+ # x_position = 0.1
|
|
|
|
|
+ # y_positions = [0.64, 0.70, 0.76, 0.82, 0.88, 0.49]
|
|
|
|
|
+ # for hero, y in zip(heroes, y_positions):
|
|
|
|
|
+ # if not self.is_random and hero == R.rouge_hero:
|
|
|
|
|
+ # text = f"★ 使用{self.hero_dic[hero]}"
|
|
|
|
|
+ # self.buttons.append(PygameButton(self.screen, text, x_position, y, 12, "#c7a44f", action=lambda h=hero: self._choose_hero(h), anchor="topleft", is_bold=True, fix_shape=(80,15), bg_alpha=191))
|
|
|
|
|
+ # else:
|
|
|
|
|
+ # text = f"● 选择{self.hero_dic[hero]}"
|
|
|
|
|
+ # self.buttons.append(PygameButton(self.screen, text, x_position, y, 12, "#99be7f", action=lambda h=hero: self._choose_hero(h), anchor="topleft", is_bold=True, fix_shape=(80,15), bg_alpha=127))
|
|
|
|
|
+ # # 随机开局
|
|
|
|
|
+ # if self.is_random:
|
|
|
|
|
+ # self.buttons.append(PygameButton(self.screen, "★ 使用随机", x_position, 0.94, 12, "#c7a44f", action=lambda: self._choose_hero("Random"), anchor="topleft", is_bold=True, fix_shape=(80,15), bg_alpha=127))
|
|
|
|
|
+ # else:
|
|
|
|
|
+ # self.buttons.append(PygameButton(self.screen, "● 随机开局", x_position, 0.94, 12, "#99be7f", action=lambda: self._choose_hero("Random"), anchor="topleft", is_bold=True, fix_shape=(80,15), bg_alpha=127))
|
|
|
|
|
+ # # 英雄信息提示
|
|
|
|
|
+ # infos = [getattr(self, attr) for attr in ['Fox_info', 'Boboli_info', 'Naruto_old_info', 'Asha_info', 'Maria_info']]
|
|
|
|
|
+ # base_heroes = ["Fox", "Boboli", "Naruto_old", "Asha", "Maria"]
|
|
|
|
|
+ # if not self.is_random:
|
|
|
|
|
+ # for hero, info, y in zip(base_heroes, infos, y_positions):
|
|
|
|
|
+ # if hero == R.rouge_hero:
|
|
|
|
|
+ # self.buttons.append(PygameButton(self.screen, info, 0.32, y-0.03, 14, "#d7b8da", fg_color=(0, 0, 0), anchor="topleft", bg_alpha=127))
|
|
|
|
|
+ # # ==========================================================================
|
|
|
# 最高记录
|
|
# 最高记录
|
|
|
- record = getattr(self, 'record_text', "暂无挑战记录")
|
|
|
|
|
- self.buttons.append(PygameButton(self.screen, record, 0.5, 0.56, 14, "#7E354D", fg_color=(255, 255, 255), bg_alpha=191))
|
|
|
|
|
|
|
+ self.buttons.append(PygameButtonBackIMG(self, self.screen, 0.5, 0.67, "res/ui/button/record.png", "res/ui/button/record_press.png", action=self._open_record, anchor='center'))
|
|
|
|
|
+ # 关于我们
|
|
|
|
|
+ self.buttons.append(PygameButtonBackIMG(self, self.screen, 0.78, 0.42, "res/ui/button/about.png", "res/ui/button/about_press.png", action=self._open_about_us, anchor='center'))
|
|
|
|
|
+ # 探险指南
|
|
|
|
|
+ self.buttons.append(PygameButtonBackIMG(self, self.screen, 0.78, 0.58, "res/ui/button/help.png", "res/ui/button/help_press.png", action=self._open_help, anchor='center'))
|
|
|
|
|
|
|
|
def refresh(self):
|
|
def refresh(self):
|
|
|
""" 外部接口 """
|
|
""" 外部接口 """
|
|
|
|
|
+ if W.PAGE == W.Page.GAME:
|
|
|
|
|
+ self._init_data()
|
|
|
self._create_buttons()
|
|
self._create_buttons()
|
|
|
|
|
|
|
|
def open_setting(self):
|
|
def open_setting(self):
|
|
@@ -365,6 +374,13 @@ class Menu:
|
|
|
|
|
|
|
|
# 各个按钮动作方法
|
|
# 各个按钮动作方法
|
|
|
def _start_game(self):
|
|
def _start_game(self):
|
|
|
|
|
+ self.buttons.clear()
|
|
|
|
|
+ from game.ui.menu.choose_hero_menu import ChoosePage
|
|
|
|
|
+ page = ChoosePage()
|
|
|
|
|
+ page.draw()
|
|
|
|
|
+ del page
|
|
|
|
|
+
|
|
|
|
|
+ def start(self):
|
|
|
rougeGen.main_func()
|
|
rougeGen.main_func()
|
|
|
game = Control(
|
|
game = Control(
|
|
|
screen=self.screen,
|
|
screen=self.screen,
|
|
@@ -405,18 +421,59 @@ class Menu:
|
|
|
|
|
|
|
|
def _open_setting(self):
|
|
def _open_setting(self):
|
|
|
self.buttons.clear()
|
|
self.buttons.clear()
|
|
|
- # try:
|
|
|
|
|
- # print("启动 Setting...")
|
|
|
|
|
- # from rougesetting import setting
|
|
|
|
|
- # t = threading.Thread(target=setting, daemon=True)
|
|
|
|
|
- # t.start()
|
|
|
|
|
- # except Exception as e:
|
|
|
|
|
- # print("启动 Setting 时出错:", e)
|
|
|
|
|
from game.ui.menu.skin_menu import SkinPage
|
|
from game.ui.menu.skin_menu import SkinPage
|
|
|
page = SkinPage()
|
|
page = SkinPage()
|
|
|
page.draw()
|
|
page.draw()
|
|
|
del page
|
|
del page
|
|
|
|
|
|
|
|
|
|
+ def _open_record(self):
|
|
|
|
|
+ self.buttons.clear()
|
|
|
|
|
+ from game.ui.menu.record_menu import RecordPage
|
|
|
|
|
+ page = RecordPage()
|
|
|
|
|
+ page.draw()
|
|
|
|
|
+ del page
|
|
|
|
|
+
|
|
|
|
|
+ def _open_about_us(self):
|
|
|
|
|
+ self.buttons.clear()
|
|
|
|
|
+ text = f"\n QQTRogue是100の雨女基于永恒QQTPVE底座 " \
|
|
|
|
|
+ f"\n 开发的全新roguelike地牢游戏。玩家可以选" \
|
|
|
|
|
+ f"\n 择各有特色的英雄进行每一次都不同的探险。" \
|
|
|
|
|
+ f"\n" \
|
|
|
|
|
+ f"\n 本作品为免费游戏,唯一官方群689297964" \
|
|
|
|
|
+ f"\n 免费下载; 擅自售卖皆属剽窃!" \
|
|
|
|
|
+ f"\n" \
|
|
|
|
|
+ f"\n 特约赞助" \
|
|
|
|
|
+ f"\n QQTPVE, 永恒, KY系应届生, 各位玩家" \
|
|
|
|
|
+ f"\n 打赏支持请通过以下二维码(备注: 打赏+昵称)" \
|
|
|
|
|
+ f"\n 感谢您的赞助, 我们将会在官网进行展示"
|
|
|
|
|
+ self.buttons.append(
|
|
|
|
|
+ PygameButton(
|
|
|
|
|
+ self.screen, text, 0.5, 0.35, 18, "#2a2a2a",
|
|
|
|
|
+ fg_color=(215,220,217), anchor="center", is_bold=True, fix_shape=(480,330), bg_alpha=159,
|
|
|
|
|
+ frosted_glass=True, blur_radius=12, glass_alpha=127, frame_radius=4, glass_surf_color=(41,34,21),
|
|
|
|
|
+ background=self
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
|
|
+ self.buttons.append(
|
|
|
|
|
+ PygameIMG(self, self.screen, 0.38, 0.78, py_img=pygame.image.load(r"res/ui/button/support_us.png"), anchor='center')
|
|
|
|
|
+ )
|
|
|
|
|
+ self.buttons.append(PygameButtonBackIMG(self, self.screen, 0.66, 0.72, "res/ui/button/return.png", "res/ui/button/return_press.png", action=self._create_buttons, anchor='center'))
|
|
|
|
|
+
|
|
|
|
|
+ def _open_help(self):
|
|
|
|
|
+ self.buttons.clear()
|
|
|
|
|
+ text = f"\n wiki官网 " \
|
|
|
|
|
+ f"\n http://qqtwiki.free.nf/" \
|
|
|
|
|
+ f"\n 基础探险请练习QQTPVE新手教程"
|
|
|
|
|
+ self.buttons.append(
|
|
|
|
|
+ PygameButton(
|
|
|
|
|
+ self.screen, text, 0.5, 0.35, 18, "#2a2a2a",
|
|
|
|
|
+ fg_color=(215,220,217), anchor="center", is_bold=True, fix_shape=(480,240), bg_alpha=159,
|
|
|
|
|
+ frosted_glass=True, blur_radius=12, glass_alpha=127, frame_radius=4, glass_surf_color=(41,34,21),
|
|
|
|
|
+ background=self
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
|
|
+ self.buttons.append(PygameButtonBackIMG(self, self.screen, 0.66, 0.72, "res/ui/button/return.png", "res/ui/button/return_press.png", action=self._create_buttons, anchor='center'))
|
|
|
|
|
+
|
|
|
def _choose_diff(self, diff):
|
|
def _choose_diff(self, diff):
|
|
|
R.difficulty = diff
|
|
R.difficulty = diff
|
|
|
with open("config.json", "r", encoding="utf-8") as json_file:
|
|
with open("config.json", "r", encoding="utf-8") as json_file:
|