|
@@ -1,18 +1,41 @@
|
|
|
-from game import control
|
|
|
|
|
-from game.algo import rougeGen
|
|
|
|
|
-from game.file_loader.fileLoader import load_json, load_png, save_encrypt_single_rouge_file, load_rouge_data
|
|
|
|
|
import json
|
|
import json
|
|
|
import os
|
|
import os
|
|
|
|
|
+from datetime import datetime
|
|
|
import tkinter as tk
|
|
import tkinter as tk
|
|
|
from game.const import game as G
|
|
from game.const import game as G
|
|
|
from game.const import window as W
|
|
from game.const import window as W
|
|
|
from game.const import rouge as R
|
|
from game.const import rouge as R
|
|
|
-from datetime import datetime
|
|
|
|
|
-from game.ui.menu.component import PygameButton, PygameButtonBackIMG, Particle
|
|
|
|
|
|
|
+from game.sound import sound_player
|
|
|
from game.utils import local_data_manager as DM
|
|
from game.utils import local_data_manager as DM
|
|
|
|
|
+from game import control
|
|
|
|
|
+from game.algo import rougeGen
|
|
|
|
|
+from game.file_loader.fileLoader import load_json, load_png, save_encrypt_single_rouge_file, load_rouge_data
|
|
|
|
|
+from game.ui.menu.component import PygameButton, PygameButtonBackIMG, PygameButtonBackIMGRoll, Particle
|
|
|
|
|
|
|
|
current_folder_path = os.getcwd()
|
|
current_folder_path = os.getcwd()
|
|
|
|
|
|
|
|
|
|
+cursor_cn = {
|
|
|
|
|
+ "引路人-黄色荧火": "fire_cursor1",
|
|
|
|
|
+ "引路人-森绿荧火": "fire_cursor2",
|
|
|
|
|
+ "引路人-小酷比": "fire_cursor_kubi",
|
|
|
|
|
+ "引路人-金酷比": "fire_cursor_gold_kubi",
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+cursor_dict = {
|
|
|
|
|
+ "fire_cursor1": {"own": True, "name": "引路人-黄色荧火", "info": "原初的黄色荧火,为旅者指引前路", "condition": "初始拥有"},
|
|
|
|
|
+ "fire_cursor2": {"own": False, "name": "引路人-森绿荧火", "info": "俏皮的森绿荧火,为旅者指引前路", "condition": "通关简单难度获得"},
|
|
|
|
|
+ "fire_cursor_kubi": {"own": False, "name": "引路人-小酷比", "info": "顽皮的小酷比,为旅者指引前路", "condition": "通关困难难度获得"},
|
|
|
|
|
+ "fire_cursor_gold_kubi": {"own": False, "name": "引路人-金酷比", "info": "稀有的金酷比,为旅者指引前路", "condition": "通关炼狱难度获得"},
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+cursor_list = ["引路人-黄色荧火", "引路人-森绿荧火", "引路人-小酷比", "引路人-金酷比"]
|
|
|
|
|
+
|
|
|
|
|
+bomb_dict = {
|
|
|
|
|
+ "bomb1": True,
|
|
|
|
|
+ "bomb60": False,
|
|
|
|
|
+ "bomb1436": False,
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
|
|
|
class SkinPage:
|
|
class SkinPage:
|
|
|
def __init__(self):
|
|
def __init__(self):
|
|
@@ -26,21 +49,16 @@ class SkinPage:
|
|
|
self.rougeOB_other_data = {}
|
|
self.rougeOB_other_data = {}
|
|
|
self.cursor_map = {}
|
|
self.cursor_map = {}
|
|
|
self.current_cursor = None
|
|
self.current_cursor = None
|
|
|
|
|
+ self.view_cursor = None
|
|
|
self.current_bomb = None
|
|
self.current_bomb = None
|
|
|
self.init_skin_page()
|
|
self.init_skin_page()
|
|
|
|
|
|
|
|
def init_skin_page(self):
|
|
def init_skin_page(self):
|
|
|
- has_fire_cursor1 = True
|
|
|
|
|
- has_fire_cursor2 = False
|
|
|
|
|
- has_fire_cursor_kubi = False
|
|
|
|
|
- has_fire_cursor_gold_kubi = False
|
|
|
|
|
- has_bomb1 = True
|
|
|
|
|
- has_bomb60 = False
|
|
|
|
|
- has_bomb1436 = False
|
|
|
|
|
DM.init_achievement()
|
|
DM.init_achievement()
|
|
|
self.rougeOB_achievements = load_rouge_data(self.rouge_achivements_file_path)
|
|
self.rougeOB_achievements = load_rouge_data(self.rouge_achivements_file_path)
|
|
|
|
|
|
|
|
def load_achievements_data(self):
|
|
def load_achievements_data(self):
|
|
|
|
|
+ global cursor_dict
|
|
|
max_level = 0
|
|
max_level = 0
|
|
|
max_diff = "Easy"
|
|
max_diff = "Easy"
|
|
|
max_diff_num = 1
|
|
max_diff_num = 1
|
|
@@ -50,13 +68,10 @@ class SkinPage:
|
|
|
max_level_hero = self.rougeOB_achievements["Highest"]["hero"]
|
|
max_level_hero = self.rougeOB_achievements["Highest"]["hero"]
|
|
|
max_diff = self.rougeOB_achievements["Highest"]["diff"]
|
|
max_diff = self.rougeOB_achievements["Highest"]["diff"]
|
|
|
|
|
|
|
|
- self.cursor_map = {
|
|
|
|
|
- "gold_kubi": (diff_num[max_diff] >= 4 or (diff_num[max_diff] == 3 and max_level >= 15)),
|
|
|
|
|
- "kubi": (diff_num[max_diff] >= 3 or (diff_num[max_diff] == 2 and max_level >= 15)),
|
|
|
|
|
- "cursor2": (diff_num[max_diff] >= 2 or (diff_num[max_diff] == 1 and max_level >= 15)),
|
|
|
|
|
- "cursor1": True,
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+ cursor_dict["fire_cursor_gold_kubi"]["own"] = (diff_num[max_diff] >= 4 or (diff_num[max_diff] == 3 and max_level >= 15))
|
|
|
|
|
+ cursor_dict["fire_cursor_kubi"]["own"] = (diff_num[max_diff] >= 3 or (diff_num[max_diff] == 2 and max_level >= 15))
|
|
|
|
|
+ cursor_dict["fire_cursor2"]["own"] = (diff_num[max_diff] >= 2 or (diff_num[max_diff] == 1 and max_level >= 15))
|
|
|
|
|
+ cursor_dict["fire_cursor1"]["own"] = True
|
|
|
|
|
|
|
|
def load_other_data(self):
|
|
def load_other_data(self):
|
|
|
# 杂项第一次打开
|
|
# 杂项第一次打开
|
|
@@ -73,13 +88,16 @@ class SkinPage:
|
|
|
else:
|
|
else:
|
|
|
self.rougeOB_other_data = load_rouge_data(self.other_file_path)
|
|
self.rougeOB_other_data = load_rouge_data(self.other_file_path)
|
|
|
|
|
|
|
|
|
|
+ # 读取引路人
|
|
|
if 'Cursor_Skin' not in self.rougeOB_other_data.keys():
|
|
if 'Cursor_Skin' not in self.rougeOB_other_data.keys():
|
|
|
self.rougeOB_other_data['Cursor_Skin'] = "fire_cursor"
|
|
self.rougeOB_other_data['Cursor_Skin'] = "fire_cursor"
|
|
|
self.current_cursor = "fire_cursor"
|
|
self.current_cursor = "fire_cursor"
|
|
|
save_encrypt_single_rouge_file(self.rougeOB_other_data, "rougeOBOther")
|
|
save_encrypt_single_rouge_file(self.rougeOB_other_data, "rougeOBOther")
|
|
|
else:
|
|
else:
|
|
|
self.current_cursor = self.rougeOB_other_data['Cursor_Skin']
|
|
self.current_cursor = self.rougeOB_other_data['Cursor_Skin']
|
|
|
|
|
+ self.view_cursor = self.current_cursor
|
|
|
|
|
|
|
|
|
|
+ # 读取糖泡皮肤
|
|
|
if 'Bomb_Skin' not in self.rougeOB_other_data.keys():
|
|
if 'Bomb_Skin' not in self.rougeOB_other_data.keys():
|
|
|
self.rougeOB_other_data['Bomb_Skin'] = "bomb1"
|
|
self.rougeOB_other_data['Bomb_Skin'] = "bomb1"
|
|
|
self.current_bomb = "bomb1"
|
|
self.current_bomb = "bomb1"
|
|
@@ -87,9 +105,7 @@ class SkinPage:
|
|
|
else:
|
|
else:
|
|
|
self.current_bomb = self.rougeOB_other_data['Bomb_Skin']
|
|
self.current_bomb = self.rougeOB_other_data['Bomb_Skin']
|
|
|
|
|
|
|
|
- self.rougeOB_other_data = self.rougeOB_other_data
|
|
|
|
|
-
|
|
|
|
|
- print(f"通关次数: {len(self.rougeOB_other_data)}")
|
|
|
|
|
|
|
+ print(f"rougeOB_other_data: {self.rougeOB_other_data}")
|
|
|
|
|
|
|
|
if "bomb60" in self.rougeOB_other_data['Bomb']:
|
|
if "bomb60" in self.rougeOB_other_data['Bomb']:
|
|
|
has_bomb60 = True
|
|
has_bomb60 = True
|
|
@@ -115,9 +131,49 @@ class SkinPage:
|
|
|
def draw_cursor(self):
|
|
def draw_cursor(self):
|
|
|
self.screen.buttons.clear()
|
|
self.screen.buttons.clear()
|
|
|
self.load_achievements_data()
|
|
self.load_achievements_data()
|
|
|
- # 返回主界面
|
|
|
|
|
|
|
+ self.load_other_data()
|
|
|
|
|
+ # ================================= 信息展示 =================================
|
|
|
|
|
+ info_button = PygameButton(
|
|
|
|
|
+ self.screen.screen, "", 0.5, 0.56, 18, "#2a2a2a",
|
|
|
|
|
+ fg_color=(215,220,217), action=None,
|
|
|
|
|
+ anchor="center", is_bold=True, fix_shape=(320,80), bg_alpha=159,
|
|
|
|
|
+ frosted_glass=True, blur_radius=8, glass_alpha=8, background=self.screen
|
|
|
|
|
+ )
|
|
|
|
|
+ # ================================= 选择 =================================
|
|
|
|
|
+ choose_button = PygameButtonBackIMG(
|
|
|
|
|
+ self.screen, self.screen.screen, 0.34, 0.72, "res/ui/button/choose.png", "res/ui/button/choose_press.png",
|
|
|
|
|
+ action=None, anchor='center'
|
|
|
|
|
+ )
|
|
|
|
|
+ # ================================= 展示框 =================================
|
|
|
|
|
+ cy = 0.29
|
|
|
|
|
+ button_blank = 0.13
|
|
|
|
|
+ roll_button = PygameButtonBackIMGRoll(
|
|
|
|
|
+ self.screen, self.screen.screen, 0.5, cy, "res/ui/button/cursor_board.png", cursor_list,
|
|
|
|
|
+ action=None, roll_action=None, hover_in_action=None, hover_out_action=None,
|
|
|
|
|
+ anchor='center', font_name="hk4e_zh-cn.ttf", font_size=24, small_scale=0.7, small_alpha=159, color=(0, 0, 0), shiny_spark=False,
|
|
|
|
|
+ related_button=[info_button, choose_button],
|
|
|
|
|
+ notify_action=[lambda x: cursor_update_notify(roll_button, x, self.current_cursor), lambda _: self.update_choose_btn(roll_button, choose_button, info_button)]
|
|
|
|
|
+ )
|
|
|
|
|
+ # ================================= 初始化 =================================
|
|
|
|
|
+ choose_button.action = lambda: self.choose_cursor(roll_button, info_button, choose_button) # 追加action
|
|
|
|
|
+ roll_button.set_current_text(cursor_dict[self.current_cursor]["name"])
|
|
|
|
|
+ cursor_update_notify(roll_button, info_button, self.current_cursor)
|
|
|
|
|
+ self.update_choose_btn(roll_button, choose_button, info_button)
|
|
|
|
|
+ # ================================= 添加按钮 =================================
|
|
|
|
|
+ self.screen.buttons.append(info_button)
|
|
|
|
|
+ self.screen.buttons.append(choose_button)
|
|
|
|
|
+ self.screen.buttons.append(roll_button)
|
|
|
|
|
+ # ================================= 上翻页 =================================
|
|
|
self.screen.buttons.append(PygameButtonBackIMG(
|
|
self.screen.buttons.append(PygameButtonBackIMG(
|
|
|
- self.screen, self.screen.screen, 0.5, 0.6, "res/ui/button/return.png", "res/ui/button/return_press.png", action=self.screen.refresh, anchor='center')
|
|
|
|
|
|
|
+ self.screen, self.screen.screen, 0.5, cy-button_blank, "res/ui/button/up.png", "res/ui/button/up_press.png", action=roll_button.roll_up, anchor='center', shiny_spark=False)
|
|
|
|
|
+ )
|
|
|
|
|
+ # ================================= 下翻页 =================================
|
|
|
|
|
+ self.screen.buttons.append(PygameButtonBackIMG(
|
|
|
|
|
+ self.screen, self.screen.screen, 0.5, cy+button_blank, "res/ui/button/down.png", "res/ui/button/down_press.png", action=roll_button.roll_down, anchor='center', shiny_spark=False)
|
|
|
|
|
+ )
|
|
|
|
|
+ # ================================= 返回上一级 =================================
|
|
|
|
|
+ self.screen.buttons.append(PygameButtonBackIMG(
|
|
|
|
|
+ self.screen, self.screen.screen, 0.66, 0.72, "res/ui/button/return.png", "res/ui/button/return_press.png", action=self.screen.open_setting, anchor='center')
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
def draw_treasure(self):
|
|
def draw_treasure(self):
|
|
@@ -125,7 +181,7 @@ class SkinPage:
|
|
|
self.load_other_data()
|
|
self.load_other_data()
|
|
|
# 返回主界面
|
|
# 返回主界面
|
|
|
self.screen.buttons.append(PygameButtonBackIMG(
|
|
self.screen.buttons.append(PygameButtonBackIMG(
|
|
|
- self.screen, self.screen.screen, 0.5, 0.6, "res/ui/button/return.png", "res/ui/button/return_press.png", action=self.screen.refresh, anchor='center')
|
|
|
|
|
|
|
+ self.screen, self.screen.screen, 0.66, 0.72, "res/ui/button/return.png", "res/ui/button/return_press.png", action=self.screen.open_setting, anchor='center')
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
"""
|
|
"""
|
|
@@ -159,84 +215,6 @@ class SkinPage:
|
|
|
self.button1436.place(relx=0.5, rely=0.26, anchor='w')
|
|
self.button1436.place(relx=0.5, rely=0.26, anchor='w')
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- if self.current_cursor == "fire_cursor":
|
|
|
|
|
- self.button_total = tk.Button(master, text= "(当前选择) \n 引路人-黄色荧火", bg="#C68E17", font=("Microsoft YaHei", 20))
|
|
|
|
|
- self.button_total.place(relx=0.25, rely=0.15, anchor='w')
|
|
|
|
|
- elif self.current_cursor == "fire_cursor2":
|
|
|
|
|
- self.button_total = tk.Button(master, text= "(当前选择) \n 引路人-森绿荧火", bg="#C68E17", font=("Microsoft YaHei", 20))
|
|
|
|
|
- self.button_total.place(relx=0.25, rely=0.15, anchor='w')
|
|
|
|
|
- elif self.current_cursor == "fire_cursor_kubi":
|
|
|
|
|
- self.button_total = tk.Button(master, text= "(当前选择) \n 引路人-小酷比", bg="#C68E17", font=("Microsoft YaHei", 20))
|
|
|
|
|
- self.button_total.place(relx=0.25, rely=0.15, anchor='w')
|
|
|
|
|
- elif self.current_cursor == "fire_cursor_gold_kubi":
|
|
|
|
|
- self.button_total = tk.Button(master, text= "(当前选择) \n 引路人-金酷比", bg="#C68E17", font=("Microsoft YaHei", 20))
|
|
|
|
|
- self.button_total.place(relx=0.25, rely=0.15, anchor='w')
|
|
|
|
|
-
|
|
|
|
|
- self.button0 = tk.Button(master, text= "▶引路人-黄色荧火", command=self.choose_cursor1, bg="#A23BEC", font=("Microsoft YaHei", 12))
|
|
|
|
|
- self.button0.place(relx=0.05, rely=0.08, anchor='w')
|
|
|
|
|
-
|
|
|
|
|
- if has_fire_cursor2:
|
|
|
|
|
- self.button1 = tk.Button(master, text= "▶引路人-森绿荧火", command=self.choose_cursor2, bg="#A23BEC", font=("Microsoft YaHei", 12))
|
|
|
|
|
- self.button1.place(relx=0.05, rely=0.15, anchor='w')
|
|
|
|
|
- else:
|
|
|
|
|
- self.button1 = tk.Button(master, text= "(暂未获得)引路人-森绿荧火(通关简单难度获得)", bg="#C6AEC7", font=("Microsoft YaHei", 12))
|
|
|
|
|
- self.button1.place(relx=0.05, rely=0.15, anchor='w')
|
|
|
|
|
-
|
|
|
|
|
- if has_fire_cursor_kubi:
|
|
|
|
|
- self.button2 = tk.Button(master, text= "▶引路人-小酷比", command=self.choose_cursor3, bg="#A23BEC", font=("Microsoft YaHei", 12))
|
|
|
|
|
- self.button2.place(relx=0.05, rely=0.22, anchor='w')
|
|
|
|
|
- else:
|
|
|
|
|
- self.button2 = tk.Button(master, text= "(暂未获得)引路人-小酷比(通关困难难度获得)", bg="#C6AEC7", font=("Microsoft YaHei", 12))
|
|
|
|
|
- self.button2.place(relx=0.05, rely=0.22, anchor='w')
|
|
|
|
|
-
|
|
|
|
|
- if has_fire_cursor_gold_kubi:
|
|
|
|
|
- self.button3 = tk.Button(master, text= "▶引路人-金酷比", command=self.choose_cursor4, bg="#A23BEC", font=("Microsoft YaHei", 12))
|
|
|
|
|
- self.button3.place(relx=0.05, rely=0.29, anchor='w')
|
|
|
|
|
- else:
|
|
|
|
|
- self.button3 = tk.Button(master, text= "(暂未获得)引路人-金酷比(通关炼狱难度获得)", bg="#C6AEC7", font=("Microsoft YaHei", 12))
|
|
|
|
|
- self.button3.place(relx=0.05, rely=0.29, anchor='w')
|
|
|
|
|
-
|
|
|
|
|
- # 返回主界面
|
|
|
|
|
- self.button000 = tk.Button(master, text= "返回主界面", command=lambda: self.button_return(), bg="#C68E17", font=("Microsoft YaHei", 24))
|
|
|
|
|
- self.button000.place(relx=0.5, rely=0.8, anchor='center')
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- # 返回主菜单
|
|
|
|
|
- def button_return(self):
|
|
|
|
|
- self.master.destroy()
|
|
|
|
|
-
|
|
|
|
|
- def choose_cursor1(self):
|
|
|
|
|
- self.current_cursor = "fire_cursor"
|
|
|
|
|
- R.cursor_skin = "fire_cursor"
|
|
|
|
|
- self.rougeOB_other_data['Cursor_Skin'] = "fire_cursor"
|
|
|
|
|
- save_encrypt_single_rouge_file(self.rougeOB_other_data, "rougeOBOther")
|
|
|
|
|
- self.button_total.config(text = "(当前选择) \n 引路人-黄色荧火")
|
|
|
|
|
-
|
|
|
|
|
- def choose_cursor2(self):
|
|
|
|
|
- self.current_cursor = "fire_cursor2"
|
|
|
|
|
- R.cursor_skin = "fire_cursor2"
|
|
|
|
|
- self.rougeOB_other_data['Cursor_Skin'] = "fire_cursor2"
|
|
|
|
|
- save_encrypt_single_rouge_file(self.rougeOB_other_data, "rougeOBOther")
|
|
|
|
|
- self.button_total.config(text = "(当前选择) \n 引路人-森绿荧火")
|
|
|
|
|
-
|
|
|
|
|
- def choose_cursor3(self):
|
|
|
|
|
- self.current_cursor = "fire_cursor_kubi"
|
|
|
|
|
- R.cursor_skin = "fire_cursor_kubi"
|
|
|
|
|
- self.rougeOB_other_data['Cursor_Skin'] = "fire_cursor_kubi"
|
|
|
|
|
- save_encrypt_single_rouge_file(self.rougeOB_other_data, "rougeOBOther")
|
|
|
|
|
- self.button_total.config(text = "(当前选择) \n 引路人-小酷比")
|
|
|
|
|
-
|
|
|
|
|
- def choose_cursor4(self):
|
|
|
|
|
- self.current_cursor = "fire_cursor_gold_kubi"
|
|
|
|
|
- R.cursor_skin = "fire_cursor_gold_kubi"
|
|
|
|
|
- self.rougeOB_other_data['Cursor_Skin'] = "fire_cursor_gold_kubi"
|
|
|
|
|
- save_encrypt_single_rouge_file(self.rougeOB_other_data, "rougeOBOther")
|
|
|
|
|
- self.button_total.config(text = "(当前选择) \n 引路人-金酷比")
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
def choose_bomb1(self):
|
|
def choose_bomb1(self):
|
|
|
self.current_bomb = "bomb1"
|
|
self.current_bomb = "bomb1"
|
|
|
R.bomb_skin = "bomb1"
|
|
R.bomb_skin = "bomb1"
|
|
@@ -259,3 +237,47 @@ class SkinPage:
|
|
|
self.button_bomb.config(text = "(当前选择) \n 糖泡-深林(生命+150)")
|
|
self.button_bomb.config(text = "(当前选择) \n 糖泡-深林(生命+150)")
|
|
|
"""
|
|
"""
|
|
|
|
|
|
|
|
|
|
+ def choose_cursor(self, roll_btn: PygameButtonBackIMGRoll, info_button, choose_btn):
|
|
|
|
|
+ cn_name = roll_btn.get_current_text()
|
|
|
|
|
+ current = cursor_cn[cn_name]
|
|
|
|
|
+ self.current_cursor = current
|
|
|
|
|
+ R.cursor_skin = current
|
|
|
|
|
+ self.rougeOB_other_data['Cursor_Skin'] = current
|
|
|
|
|
+ save_encrypt_single_rouge_file(self.rougeOB_other_data, "rougeOBOther")
|
|
|
|
|
+ roll_btn.set_current_text(cursor_dict[self.current_cursor]["name"])
|
|
|
|
|
+ cursor_update_notify(roll_btn, info_button, self.current_cursor)
|
|
|
|
|
+ choose_btn.update_image("res/ui/button/chosen.png", "res/ui/button/chosen.png")
|
|
|
|
|
+ choose_btn.shiny_spark = False
|
|
|
|
|
+ choose_btn.action = None
|
|
|
|
|
+
|
|
|
|
|
+ def update_choose_btn(self, roll_button, choose_btn, info_button):
|
|
|
|
|
+ # 拿到当前展示的中文名
|
|
|
|
|
+ cn_name = roll_button.get_current_text()
|
|
|
|
|
+ # 拿到内部 key
|
|
|
|
|
+ key = cursor_cn[cn_name]
|
|
|
|
|
+ # 拿到是否已解锁
|
|
|
|
|
+ owned = cursor_dict[key]["own"]
|
|
|
|
|
+ if owned:
|
|
|
|
|
+ if self.current_cursor == key:
|
|
|
|
|
+ choose_btn.update_image("res/ui/button/chosen.png", "res/ui/button/chosen.png")
|
|
|
|
|
+ choose_btn.shiny_spark = False
|
|
|
|
|
+ choose_btn.action = None
|
|
|
|
|
+ else:
|
|
|
|
|
+ choose_btn.update_image("res/ui/button/choose.png", "res/ui/button/choose_press.png")
|
|
|
|
|
+ choose_btn.shiny_spark = True
|
|
|
|
|
+ choose_btn.action = lambda cn=cn_name: self.choose_cursor(roll_button, info_button, choose_btn)
|
|
|
|
|
+ else:
|
|
|
|
|
+ choose_btn.update_image("res/ui/button/unlock.png", "res/ui/button/unlock.png")
|
|
|
|
|
+ choose_btn.shiny_spark = False
|
|
|
|
|
+ choose_btn.action = None
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+def cursor_update_notify(board: PygameButtonBackIMGRoll, observer: PygameButton, chosen):
|
|
|
|
|
+ cn_name = board.get_current_text()
|
|
|
|
|
+ current = cursor_cn[cn_name]
|
|
|
|
|
+ is_chosen = "<当前选择>" if (current == chosen) else ""
|
|
|
|
|
+ owned = "已拥有" if cursor_dict[current]["own"] else "未解锁"
|
|
|
|
|
+ info = cursor_dict[current]["info"]
|
|
|
|
|
+ condition = cursor_dict[current]["condition"]
|
|
|
|
|
+ observer.set_text(f" {is_chosen}{cn_name} \n {info} \n {condition}({owned}) ")
|
|
|
|
|
+
|