| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- 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 os
- import tkinter as tk
- from game.const import game as G
- from game.const import rouge as R
- from datetime import datetime
- import roguetest
- current_folder_path = os.getcwd()
- class Task:
- def __init__(self, master):
- self.master = master
- master.geometry("1000x700")
- master.configure(bg='#7E587E')
- master.title(f"QQTRogue二测β{G.VERSION}(底层逻辑:永恒; 地牢设计:100の雨女; 唯一官方群756422783免费下载; 擅自售卖皆属剽窃!")
- master.attributes('-topmost', True)
- now = datetime.now()
- user_documents_folder = os.path.expanduser("~\\Documents") # 获取用户的"文档"文件夹路径
- qqtpve_folder = os.path.join(user_documents_folder, "QQTPVE") # 构建QQTPVE文件夹路径
- os.makedirs(qqtpve_folder, exist_ok=True) # 确保QQTPVE文件夹存在,如果不存在则创建
- rouge_task_file_path = os.path.join(qqtpve_folder, "rougeOB_task.rougedata") # 构建任务文件路径
- # 第一次打开
- if not os.path.exists(rouge_task_file_path):
- rougeOB_task_data = {"1": {"task": "击杀5只命运维系者", "reward": "800经验", "process": 0, "finish": 5, "last_finish": 1970, "reward_exp": 800, "hero": "Fox", "rewarded": True},
- "2": {"task": "击杀3只渊烬龙王", "reward": "800经验", "process": 0, "finish": 3, "last_finish": 1970, "reward_exp": 800, "hero": "Fox", "rewarded": True},
- "3": {"task": "到达3-1十次", "reward": "800经验", "process": 0, "finish": 10, "last_finish": 1970, "reward_exp": 800, "hero": "Fox", "rewarded": True},
- "4": {"task": "击杀5只因果阅律者", "reward": "800经验", "process": 0, "finish": 5, "last_finish": 1970, "reward_exp": 800, "hero": "Fox", "rewarded": True},
- "5": {"task": "完成20次挑衅敌人", "reward": "800经验", "process": 0, "finish": 20, "last_finish": 1970, "reward_exp": 800, "hero": "Fox", "rewarded": True},
- "6": {"task": "使用小倩到达3-5三次", "reward": "800经验", "process": 0, "finish": 3, "last_finish": 1970, "reward_exp": 800, "hero": "Fox", "rewarded": True},
- "7": {"task": "使用波波丽到达3-5三次", "reward": "800经验", "process": 0, "finish": 3, "last_finish": 1970, "reward_exp": 800, "hero": "Fox", "rewarded": True},
- "8": {"task": "使用火影到达3-5三次", "reward": "800经验", "process": 0, "finish": 3, "last_finish": 1970, "reward_exp": 800, "hero": "Fox", "rewarded": True},
- "9": {"task": "使用阿莎到达3-5三次", "reward": "800经验", "process": 0, "finish": 3, "last_finish": 1970, "reward_exp": 800, "hero": "Fox", "rewarded": True},
- "10": {"task": "使用玛莉亚到达3-5三次", "reward": "800经验", "process": 0, "finish": 3, "last_finish": 1970, "reward_exp": 800, "hero": "Fox", "rewarded": True},
- "11": {"task": "到达4-1一次", "reward": "800经验", "process": 0, "finish": 1, "last_finish": 1970, "reward_exp": 800, "hero": "Fox", "rewarded": True},
- "12": {"task": "累积使用20次复活卡", "reward": "800经验", "process": 0, "finish": 20, "last_finish": 1970, "reward_exp": 800, "hero": "Fox", "rewarded": True},
- "today": {"task": "进行一盘游戏并到达2-1", "reward": "50经验", "process": 0, "finish": 1, "last_finish": "1970-1-1", "reward_exp": 50, "hero": "Fox", "rewarded": True}}
- save_encrypt_single_rouge_file(rougeOB_task_data, "rougeOB_task")
- # 正常打开
- else:
- rougeOB_task_data = load_rouge_data(rouge_task_file_path)
- # 格式化年月日
- year = now.strftime("%Y")
- month = now.strftime("%m")
- day = now.strftime("%d")
- # 移除月份和日期的前导零(如果有)
- month = month.lstrip("0")
- day = day.lstrip("0")
- if int(rougeOB_task_data[str(month)]["last_finish"]) < int(year):
- rougeOB_task_data[str(month)]["process"] = 0
- rougeOB_task_data[str(month)]["last_finish"] = year
- rougeOB_task_data[str(month)]["rewarded"] = False
- if rougeOB_task_data["today"]["last_finish"] != year + "-" + month + "-" + day:
- rougeOB_task_data["today"]["process"] = 0
- rougeOB_task_data["today"]["last_finish"] = year + "-" + month + "-" + day
- rougeOB_task_data["today"]["rewarded"] = False
- save_encrypt_single_rouge_file(rougeOB_task_data, "rougeOB_task")
- # 月常任务
- self.button0 = tk.Button(master, text= "本月任务: " + rougeOB_task_data[str(month)]["task"] + " \n (" + "奖励:" + rougeOB_task_data[str(month)]["reward"] + ")", bg="#C47451", font=("Microsoft YaHei", 20))
- self.button0.place(relx=0.1, rely=0.25, anchor='w')
- if rougeOB_task_data[str(month)]["process"] < rougeOB_task_data[str(month)]["finish"]:
- self.button1 = tk.Button(master, text= "进度: " + str(rougeOB_task_data[str(month)]["process"]) + "/" + str(rougeOB_task_data[str(month)]["finish"]) + " (未完成)", bg="#C47451", font=("Microsoft YaHei", 20))
- self.button1.place(relx=0.6, rely=0.25, anchor='w')
- else:
- self.button1 = tk.Button(master, text= "进度: " + str(rougeOB_task_data[str(month)]["process"]) + "/" + str(rougeOB_task_data[str(month)]["finish"]) + " \n (已使用" + R.hero_name[rougeOB_task_data["today"]["hero"]] + "领取奖励)", bg="#C47451", font=("Microsoft YaHei", 20))
- self.button1.place(relx=0.6, rely=0.25, anchor='w')
- # 日常任务
- self.button2 = tk.Button(master, text= "每日任务: " + rougeOB_task_data["today"]["task"] + " \n (" + "奖励:" + rougeOB_task_data["today"]["reward"] + ")", bg="#E6A9EC", font=("Microsoft YaHei", 20))
- self.button2.place(relx=0.1, rely=0.5, anchor='w')
- if rougeOB_task_data["today"]["process"] < rougeOB_task_data["today"]["finish"]:
- self.button3 = tk.Button(master, text= "进度: " + str(rougeOB_task_data["today"]["process"]) + "/" + str(rougeOB_task_data["today"]["finish"]) + " (未完成)", bg="#E6A9EC", font=("Microsoft YaHei", 20))
- self.button3.place(relx=0.6, rely=0.5, anchor='w')
- else:
- self.button3 = tk.Button(master, text= "进度: " + str(rougeOB_task_data["today"]["process"]) + "/" + str(rougeOB_task_data["today"]["finish"]) + " \n (已使用" + R.hero_name[rougeOB_task_data["today"]["hero"]] + "领取奖励)", bg="#E6A9EC", font=("Microsoft YaHei", 20))
- self.button3.place(relx=0.6, rely=0.5, anchor='w')
- # 返回主界面
- self.button0 = tk.Button(master, text= "返回主界面", command=lambda: self.button_return(), bg="#C68E17", font=("Microsoft YaHei", 24))
- self.button0.place(relx=0.5, rely=0.7, anchor='center')
- def button_return(self):
- self.master.destroy()
- def task():
- """
- Pygame 里直接做:
- from rougetask import Task
- Task()
- 就能跑出这个 Setting 界面。
- """
- root = tk.Tk()
- app = Task(root)
- root.mainloop()
- # if __name__ == "__main__":
- # root = tk.Tk()
- # app = Task(root)
- # root.mainloop()
|