Merge commit '54917fbe6de3ca5ac4a07bc88cdf0178a23f88dc' into dev
This commit is contained in:
@@ -408,7 +408,7 @@ class MaaUserConfig(LQConfig):
|
|||||||
self.Info_Mode = OptionsConfigItem(
|
self.Info_Mode = OptionsConfigItem(
|
||||||
"Info", "Mode", "简洁", OptionsValidator(["简洁", "详细"])
|
"Info", "Mode", "简洁", OptionsValidator(["简洁", "详细"])
|
||||||
)
|
)
|
||||||
self.Info_GameIdMode = ConfigItem("Info", "GameIdMode", "固定")
|
self.Info_StageMode = ConfigItem("Info", "StageMode", "固定")
|
||||||
self.Info_Server = OptionsConfigItem(
|
self.Info_Server = OptionsConfigItem(
|
||||||
"Info", "Server", "Official", OptionsValidator(["Official", "Bilibili"])
|
"Info", "Server", "Official", OptionsValidator(["Official", "Bilibili"])
|
||||||
)
|
)
|
||||||
@@ -437,10 +437,11 @@ class MaaUserConfig(LQConfig):
|
|||||||
"0",
|
"0",
|
||||||
OptionsValidator(["0", "6", "5", "4", "3", "2", "1", "-1"]),
|
OptionsValidator(["0", "6", "5", "4", "3", "2", "1", "-1"]),
|
||||||
)
|
)
|
||||||
self.Info_GameId = ConfigItem("Info", "GameId", "-")
|
self.Info_Stage = ConfigItem("Info", "Stage", "-")
|
||||||
self.Info_GameId_1 = ConfigItem("Info", "GameId_1", "-")
|
self.Info_Stage_1 = ConfigItem("Info", "Stage_1", "-")
|
||||||
self.Info_GameId_2 = ConfigItem("Info", "GameId_2", "-")
|
self.Info_Stage_2 = ConfigItem("Info", "Stage_2", "-")
|
||||||
self.Info_GameId_Remain = ConfigItem("Info", "GameId_Remain", "-")
|
self.Info_Stage_3 = ConfigItem("Info", "Stage_3", "-")
|
||||||
|
self.Info_Stage_Remain = ConfigItem("Info", "Stage_Remain", "-")
|
||||||
self.Info_IfSkland = ConfigItem("Info", "IfSkland", False, BoolValidator())
|
self.Info_IfSkland = ConfigItem("Info", "IfSkland", False, BoolValidator())
|
||||||
self.Info_SklandToken = ConfigItem("Info", "SklandToken", "")
|
self.Info_SklandToken = ConfigItem("Info", "SklandToken", "")
|
||||||
|
|
||||||
@@ -499,24 +500,26 @@ class MaaUserConfig(LQConfig):
|
|||||||
def get_plan_info(self) -> Dict[str, Union[str, int]]:
|
def get_plan_info(self) -> Dict[str, Union[str, int]]:
|
||||||
"""获取当前的计划下信息"""
|
"""获取当前的计划下信息"""
|
||||||
|
|
||||||
if self.get(self.Info_GameIdMode) == "固定":
|
if self.get(self.Info_StageMode) == "固定":
|
||||||
return {
|
return {
|
||||||
"MedicineNumb": self.get(self.Info_MedicineNumb),
|
"MedicineNumb": self.get(self.Info_MedicineNumb),
|
||||||
"SeriesNumb": self.get(self.Info_SeriesNumb),
|
"SeriesNumb": self.get(self.Info_SeriesNumb),
|
||||||
"GameId": self.get(self.Info_GameId),
|
"Stage": self.get(self.Info_Stage),
|
||||||
"GameId_1": self.get(self.Info_GameId_1),
|
"Stage_1": self.get(self.Info_Stage_1),
|
||||||
"GameId_2": self.get(self.Info_GameId_2),
|
"Stage_2": self.get(self.Info_Stage_2),
|
||||||
"GameId_Remain": self.get(self.Info_GameId_Remain),
|
"Stage_3": self.get(self.Info_Stage_3),
|
||||||
|
"Stage_Remain": self.get(self.Info_Stage_Remain),
|
||||||
}
|
}
|
||||||
elif "计划" in self.get(self.Info_GameIdMode):
|
elif "计划" in self.get(self.Info_StageMode):
|
||||||
plan = Config.plan_dict[self.get(self.Info_GameIdMode)]["Config"]
|
plan = Config.plan_dict[self.get(self.Info_StageMode)]["Config"]
|
||||||
return {
|
return {
|
||||||
"MedicineNumb": plan.get(plan.get_current_info("MedicineNumb")),
|
"MedicineNumb": plan.get(plan.get_current_info("MedicineNumb")),
|
||||||
"SeriesNumb": plan.get(plan.get_current_info("SeriesNumb")),
|
"SeriesNumb": plan.get(plan.get_current_info("SeriesNumb")),
|
||||||
"GameId": plan.get(plan.get_current_info("GameId")),
|
"Stage": plan.get(plan.get_current_info("Stage")),
|
||||||
"GameId_1": plan.get(plan.get_current_info("GameId_1")),
|
"Stage_1": plan.get(plan.get_current_info("Stage_1")),
|
||||||
"GameId_2": plan.get(plan.get_current_info("GameId_2")),
|
"Stage_2": plan.get(plan.get_current_info("Stage_2")),
|
||||||
"GameId_Remain": plan.get(plan.get_current_info("GameId_Remain")),
|
"Stage_3": plan.get(plan.get_current_info("Stage_3")),
|
||||||
|
"Stage_Remain": plan.get(plan.get_current_info("Stage_Remain")),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -554,24 +557,22 @@ class MaaPlanConfig(LQConfig):
|
|||||||
"0",
|
"0",
|
||||||
OptionsValidator(["0", "6", "5", "4", "3", "2", "1", "-1"]),
|
OptionsValidator(["0", "6", "5", "4", "3", "2", "1", "-1"]),
|
||||||
)
|
)
|
||||||
self.config_item_dict[group]["GameId"] = ConfigItem(group, "GameId", "-")
|
self.config_item_dict[group]["Stage"] = ConfigItem(group, "Stage", "-")
|
||||||
self.config_item_dict[group]["GameId_1"] = ConfigItem(
|
self.config_item_dict[group]["Stage_1"] = ConfigItem(group, "Stage_1", "-")
|
||||||
group, "GameId_1", "-"
|
self.config_item_dict[group]["Stage_2"] = ConfigItem(group, "Stage_2", "-")
|
||||||
)
|
self.config_item_dict[group]["Stage_3"] = ConfigItem(group, "Stage_3", "-")
|
||||||
self.config_item_dict[group]["GameId_2"] = ConfigItem(
|
self.config_item_dict[group]["Stage_Remain"] = ConfigItem(
|
||||||
group, "GameId_2", "-"
|
group, "Stage_Remain", "-"
|
||||||
)
|
|
||||||
self.config_item_dict[group]["GameId_Remain"] = ConfigItem(
|
|
||||||
group, "GameId_Remain", "-"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
for name in [
|
for name in [
|
||||||
"MedicineNumb",
|
"MedicineNumb",
|
||||||
"SeriesNumb",
|
"SeriesNumb",
|
||||||
"GameId",
|
"Stage",
|
||||||
"GameId_1",
|
"Stage_1",
|
||||||
"GameId_2",
|
"Stage_2",
|
||||||
"GameId_Remain",
|
"Stage_3",
|
||||||
|
"Stage_Remain",
|
||||||
]:
|
]:
|
||||||
setattr(self, f"{group}_{name}", self.config_item_dict[group][name])
|
setattr(self, f"{group}_{name}", self.config_item_dict[group][name])
|
||||||
|
|
||||||
@@ -600,6 +601,9 @@ class GeneralConfig(LQConfig):
|
|||||||
"Script", "ScriptPath", ".", FileValidator()
|
"Script", "ScriptPath", ".", FileValidator()
|
||||||
)
|
)
|
||||||
self.Script_Arguments = ConfigItem("Script", "Arguments", "")
|
self.Script_Arguments = ConfigItem("Script", "Arguments", "")
|
||||||
|
self.Script_IfTrackProcess = ConfigItem(
|
||||||
|
"Script", "IfTrackProcess", False, BoolValidator()
|
||||||
|
)
|
||||||
self.Script_ConfigPath = ConfigItem(
|
self.Script_ConfigPath = ConfigItem(
|
||||||
"Script", "ConfigPath", ".", FileValidator()
|
"Script", "ConfigPath", ".", FileValidator()
|
||||||
)
|
)
|
||||||
@@ -702,9 +706,9 @@ class GeneralSubConfig(LQConfig):
|
|||||||
|
|
||||||
class AppConfig(GlobalConfig):
|
class AppConfig(GlobalConfig):
|
||||||
|
|
||||||
VERSION = "4.4.0.2"
|
VERSION = "4.4.0.3"
|
||||||
|
|
||||||
gameid_refreshed = Signal()
|
stage_refreshed = Signal()
|
||||||
PASSWORD_refreshed = Signal()
|
PASSWORD_refreshed = Signal()
|
||||||
sub_info_changed = Signal()
|
sub_info_changed = Signal()
|
||||||
power_sign_changed = Signal()
|
power_sign_changed = Signal()
|
||||||
@@ -719,15 +723,13 @@ class AppConfig(GlobalConfig):
|
|||||||
self.database_path = self.app_path / "data/data.db"
|
self.database_path = self.app_path / "data/data.db"
|
||||||
self.config_path = self.app_path / "config/config.json"
|
self.config_path = self.app_path / "config/config.json"
|
||||||
self.key_path = self.app_path / "data/key"
|
self.key_path = self.app_path / "data/key"
|
||||||
self.gameid_path = self.app_path / "data/gameid.txt"
|
|
||||||
self.version_path = self.app_path / "resources/version.json"
|
|
||||||
|
|
||||||
self.main_window = None
|
self.main_window = None
|
||||||
self.PASSWORD = ""
|
self.PASSWORD = ""
|
||||||
self.running_list = []
|
self.running_list = []
|
||||||
self.silence_list = []
|
self.silence_list = []
|
||||||
self.info_bar_list = []
|
self.info_bar_list = []
|
||||||
self.gameid_dict = {
|
self.stage_dict = {
|
||||||
"ALL": {"value": [], "text": []},
|
"ALL": {"value": [], "text": []},
|
||||||
"Monday": {"value": [], "text": []},
|
"Monday": {"value": [], "text": []},
|
||||||
"Tuesday": {"value": [], "text": []},
|
"Tuesday": {"value": [], "text": []},
|
||||||
@@ -778,15 +780,12 @@ class AppConfig(GlobalConfig):
|
|||||||
|
|
||||||
self.init_logger()
|
self.init_logger()
|
||||||
self.check_data()
|
self.check_data()
|
||||||
self.get_gameid()
|
self.get_stage()
|
||||||
logger.info("程序初始化完成")
|
logger.info("程序初始化完成")
|
||||||
|
|
||||||
def init_logger(self) -> None:
|
def init_logger(self) -> None:
|
||||||
"""初始化日志记录器"""
|
"""初始化日志记录器"""
|
||||||
|
|
||||||
if self.args.mode != "cli":
|
|
||||||
logger.remove(0)
|
|
||||||
|
|
||||||
logger.add(
|
logger.add(
|
||||||
sink=self.log_path,
|
sink=self.log_path,
|
||||||
level="DEBUG",
|
level="DEBUG",
|
||||||
@@ -810,7 +809,7 @@ class AppConfig(GlobalConfig):
|
|||||||
|
|
||||||
logger.info("日志记录器初始化完成")
|
logger.info("日志记录器初始化完成")
|
||||||
|
|
||||||
def get_gameid(self) -> None:
|
def get_stage(self) -> None:
|
||||||
|
|
||||||
# 从MAA服务器获取活动关卡信息
|
# 从MAA服务器获取活动关卡信息
|
||||||
network = Network.add_task(
|
network = Network.add_task(
|
||||||
@@ -820,33 +819,33 @@ class AppConfig(GlobalConfig):
|
|||||||
network.loop.exec()
|
network.loop.exec()
|
||||||
network_result = Network.get_result(network)
|
network_result = Network.get_result(network)
|
||||||
if network_result["status_code"] == 200:
|
if network_result["status_code"] == 200:
|
||||||
gameid_infos: List[Dict[str, Union[str, Dict[str, Union[str, int]]]]] = (
|
stage_infos: List[Dict[str, Union[str, Dict[str, Union[str, int]]]]] = (
|
||||||
network_result["response_json"]["Official"]["sideStoryStage"]
|
network_result["response_json"]["Official"]["sideStoryStage"]
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
logger.warning(
|
logger.warning(
|
||||||
f"无法从MAA服务器获取活动关卡信息:{network_result['error_message']}"
|
f"无法从MAA服务器获取活动关卡信息:{network_result['error_message']}"
|
||||||
)
|
)
|
||||||
gameid_infos = []
|
stage_infos = []
|
||||||
|
|
||||||
ss_gameid_dict = {"value": [], "text": []}
|
ss_stage_dict = {"value": [], "text": []}
|
||||||
|
|
||||||
for gameid_info in gameid_infos:
|
for stage_info in stage_infos:
|
||||||
|
|
||||||
if (
|
if (
|
||||||
datetime.strptime(
|
datetime.strptime(
|
||||||
gameid_info["Activity"]["UtcStartTime"], "%Y/%m/%d %H:%M:%S"
|
stage_info["Activity"]["UtcStartTime"], "%Y/%m/%d %H:%M:%S"
|
||||||
)
|
)
|
||||||
< datetime.now()
|
< datetime.now()
|
||||||
< datetime.strptime(
|
< datetime.strptime(
|
||||||
gameid_info["Activity"]["UtcExpireTime"], "%Y/%m/%d %H:%M:%S"
|
stage_info["Activity"]["UtcExpireTime"], "%Y/%m/%d %H:%M:%S"
|
||||||
)
|
)
|
||||||
):
|
):
|
||||||
ss_gameid_dict["value"].append(gameid_info["Value"])
|
ss_stage_dict["value"].append(stage_info["Value"])
|
||||||
ss_gameid_dict["text"].append(gameid_info["Value"])
|
ss_stage_dict["text"].append(stage_info["Value"])
|
||||||
|
|
||||||
# 生成每日关卡信息
|
# 生成每日关卡信息
|
||||||
gameid_daily_info = [
|
stage_daily_info = [
|
||||||
{"value": "-", "text": "当前/上次", "days": [1, 2, 3, 4, 5, 6, 7]},
|
{"value": "-", "text": "当前/上次", "days": [1, 2, 3, 4, 5, 6, 7]},
|
||||||
{"value": "1-7", "text": "1-7", "days": [1, 2, 3, 4, 5, 6, 7]},
|
{"value": "1-7", "text": "1-7", "days": [1, 2, 3, 4, 5, 6, 7]},
|
||||||
{"value": "R8-11", "text": "R8-11", "days": [1, 2, 3, 4, 5, 6, 7]},
|
{"value": "R8-11", "text": "R8-11", "days": [1, 2, 3, 4, 5, 6, 7]},
|
||||||
@@ -872,20 +871,20 @@ class AppConfig(GlobalConfig):
|
|||||||
|
|
||||||
for day in range(0, 8):
|
for day in range(0, 8):
|
||||||
|
|
||||||
today_gameid_dict = {"value": [], "text": []}
|
today_stage_dict = {"value": [], "text": []}
|
||||||
|
|
||||||
for gameid_info in gameid_daily_info:
|
for stage_info in stage_daily_info:
|
||||||
|
|
||||||
if day in gameid_info["days"] or day == 0:
|
if day in stage_info["days"] or day == 0:
|
||||||
today_gameid_dict["value"].append(gameid_info["value"])
|
today_stage_dict["value"].append(stage_info["value"])
|
||||||
today_gameid_dict["text"].append(gameid_info["text"])
|
today_stage_dict["text"].append(stage_info["text"])
|
||||||
|
|
||||||
self.gameid_dict[calendar.day_name[day - 1] if day > 0 else "ALL"] = {
|
self.stage_dict[calendar.day_name[day - 1] if day > 0 else "ALL"] = {
|
||||||
"value": today_gameid_dict["value"] + ss_gameid_dict["value"],
|
"value": today_stage_dict["value"] + ss_stage_dict["value"],
|
||||||
"text": today_gameid_dict["text"] + ss_gameid_dict["text"],
|
"text": today_stage_dict["text"] + ss_stage_dict["text"],
|
||||||
}
|
}
|
||||||
|
|
||||||
self.gameid_refreshed.emit()
|
self.stage_refreshed.emit()
|
||||||
|
|
||||||
def server_date(self) -> date:
|
def server_date(self) -> date:
|
||||||
"""获取当前的服务器日期"""
|
"""获取当前的服务器日期"""
|
||||||
@@ -903,7 +902,7 @@ class AppConfig(GlobalConfig):
|
|||||||
db = sqlite3.connect(self.database_path)
|
db = sqlite3.connect(self.database_path)
|
||||||
cur = db.cursor()
|
cur = db.cursor()
|
||||||
cur.execute("CREATE TABLE version(v text)")
|
cur.execute("CREATE TABLE version(v text)")
|
||||||
cur.execute("INSERT INTO version VALUES(?)", ("v1.6",))
|
cur.execute("INSERT INTO version VALUES(?)", ("v1.7",))
|
||||||
db.commit()
|
db.commit()
|
||||||
cur.close()
|
cur.close()
|
||||||
db.close()
|
db.close()
|
||||||
@@ -914,7 +913,7 @@ class AppConfig(GlobalConfig):
|
|||||||
cur.execute("SELECT * FROM version WHERE True")
|
cur.execute("SELECT * FROM version WHERE True")
|
||||||
version = cur.fetchall()
|
version = cur.fetchall()
|
||||||
|
|
||||||
if version[0][0] != "v1.6":
|
if version[0][0] != "v1.7":
|
||||||
logger.info("数据文件版本更新开始")
|
logger.info("数据文件版本更新开始")
|
||||||
if_streaming = False
|
if_streaming = False
|
||||||
# v1.4-->v1.5
|
# v1.4-->v1.5
|
||||||
@@ -922,10 +921,6 @@ class AppConfig(GlobalConfig):
|
|||||||
logger.info("数据文件版本更新:v1.4-->v1.5")
|
logger.info("数据文件版本更新:v1.4-->v1.5")
|
||||||
if_streaming = True
|
if_streaming = True
|
||||||
|
|
||||||
cur.execute("DELETE FROM version WHERE v = ?", ("v1.4",))
|
|
||||||
cur.execute("INSERT INTO version VALUES(?)", ("v1.5",))
|
|
||||||
db.commit()
|
|
||||||
|
|
||||||
member_dict: Dict[str, Dict[str, Union[str, Path]]] = {}
|
member_dict: Dict[str, Dict[str, Union[str, Path]]] = {}
|
||||||
if (self.app_path / "config/MaaConfig").exists():
|
if (self.app_path / "config/MaaConfig").exists():
|
||||||
for maa_dir in (self.app_path / "config/MaaConfig").iterdir():
|
for maa_dir in (self.app_path / "config/MaaConfig").iterdir():
|
||||||
@@ -1044,6 +1039,11 @@ class AppConfig(GlobalConfig):
|
|||||||
shutil.rmtree(config["Path"] / f"simple")
|
shutil.rmtree(config["Path"] / f"simple")
|
||||||
if (config["Path"] / f"beta").exists():
|
if (config["Path"] / f"beta").exists():
|
||||||
shutil.rmtree(config["Path"] / f"beta")
|
shutil.rmtree(config["Path"] / f"beta")
|
||||||
|
|
||||||
|
cur.execute("DELETE FROM version WHERE v = ?", ("v1.4",))
|
||||||
|
cur.execute("INSERT INTO version VALUES(?)", ("v1.5",))
|
||||||
|
db.commit()
|
||||||
|
|
||||||
# v1.5-->v1.6
|
# v1.5-->v1.6
|
||||||
if version[0][0] == "v1.5" or if_streaming:
|
if version[0][0] == "v1.5" or if_streaming:
|
||||||
logger.info("数据文件版本更新:v1.5-->v1.6")
|
logger.info("数据文件版本更新:v1.5-->v1.6")
|
||||||
@@ -1076,6 +1076,67 @@ class AppConfig(GlobalConfig):
|
|||||||
winreg.CloseKey(key)
|
winreg.CloseKey(key)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
pass
|
pass
|
||||||
|
# v1.6-->v1.7
|
||||||
|
if version[0][0] == "v1.6" or if_streaming:
|
||||||
|
logger.info("数据文件版本更新:v1.6-->v1.7")
|
||||||
|
if_streaming = True
|
||||||
|
|
||||||
|
for MaaConfig in (self.app_path / "config/MaaConfig").iterdir():
|
||||||
|
if MaaConfig.is_dir():
|
||||||
|
for user in (MaaConfig / "UserData").iterdir():
|
||||||
|
if user.is_dir():
|
||||||
|
if (user / "config.json").exists():
|
||||||
|
with (user / "config.json").open(
|
||||||
|
encoding="utf-8"
|
||||||
|
) as f:
|
||||||
|
user_config = json.load(f)
|
||||||
|
user_config["Info"]["Stage"] = user_config["Info"][
|
||||||
|
"GameId"
|
||||||
|
]
|
||||||
|
user_config["Info"]["StageMode"] = user_config[
|
||||||
|
"Info"
|
||||||
|
]["GameIdMode"]
|
||||||
|
user_config["Info"]["Stage_1"] = user_config[
|
||||||
|
"Info"
|
||||||
|
]["GameId_1"]
|
||||||
|
user_config["Info"]["Stage_2"] = user_config[
|
||||||
|
"Info"
|
||||||
|
]["GameId_2"]
|
||||||
|
user_config["Info"]["Stage_Remain"] = user_config[
|
||||||
|
"Info"
|
||||||
|
]["GameId_Remain"]
|
||||||
|
with (user / "config.json").open(
|
||||||
|
"w", encoding="utf-8"
|
||||||
|
) as f:
|
||||||
|
json.dump(
|
||||||
|
user_config, f, ensure_ascii=False, indent=4
|
||||||
|
)
|
||||||
|
for MaaPlanConfig in (self.app_path / "config/MaaPlanConfig").iterdir():
|
||||||
|
if (
|
||||||
|
MaaPlanConfig.is_dir()
|
||||||
|
and (MaaPlanConfig / "config.json").exists()
|
||||||
|
):
|
||||||
|
with (MaaPlanConfig / "config.json").open(
|
||||||
|
encoding="utf-8"
|
||||||
|
) as f:
|
||||||
|
plan_config = json.load(f)
|
||||||
|
|
||||||
|
for k in self.stage_dict.keys():
|
||||||
|
plan_config[k]["Stage"] = plan_config[k]["GameId"]
|
||||||
|
plan_config[k]["Stage_1"] = plan_config[k]["GameId_1"]
|
||||||
|
plan_config[k]["Stage_2"] = plan_config[k]["GameId_2"]
|
||||||
|
plan_config[k]["Stage_Remain"] = plan_config[k][
|
||||||
|
"GameId_Remain"
|
||||||
|
]
|
||||||
|
with (MaaPlanConfig / "config.json").open(
|
||||||
|
"w", encoding="utf-8"
|
||||||
|
) as f:
|
||||||
|
json.dump(plan_config, f, ensure_ascii=False, indent=4)
|
||||||
|
|
||||||
|
cur.execute("DELETE FROM version WHERE v = ?", ("v1.6",))
|
||||||
|
cur.execute("INSERT INTO version VALUES(?)", ("v1.7",))
|
||||||
|
db.commit()
|
||||||
|
|
||||||
cur.close()
|
cur.close()
|
||||||
db.close()
|
db.close()
|
||||||
logger.info("数据文件版本更新完成")
|
logger.info("数据文件版本更新完成")
|
||||||
@@ -1236,8 +1297,8 @@ class AppConfig(GlobalConfig):
|
|||||||
|
|
||||||
for user in member["UserData"].values():
|
for user in member["UserData"].values():
|
||||||
|
|
||||||
if user["Config"].get(user["Config"].Info_GameIdMode) == old:
|
if user["Config"].get(user["Config"].Info_StageMode) == old:
|
||||||
user["Config"].set(user["Config"].Info_GameIdMode, new)
|
user["Config"].set(user["Config"].Info_StageMode, new)
|
||||||
|
|
||||||
def change_maa_user_info(
|
def change_maa_user_info(
|
||||||
self, name: str, user_data: Dict[str, Dict[str, Union[str, Path, dict]]]
|
self, name: str, user_data: Dict[str, Dict[str, Union[str, Path, dict]]]
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class _MainTimer(QObject):
|
|||||||
def long_timed_task(self):
|
def long_timed_task(self):
|
||||||
"""长时间定期检定任务"""
|
"""长时间定期检定任务"""
|
||||||
|
|
||||||
Config.get_gameid()
|
Config.get_stage()
|
||||||
Config.main_window.setting.show_notice()
|
Config.main_window.setting.show_notice()
|
||||||
if Config.get(Config.update_IfAutoUpdate):
|
if Config.get(Config.update_IfAutoUpdate):
|
||||||
Config.main_window.setting.check_update()
|
Config.main_window.setting.check_update()
|
||||||
|
|||||||
@@ -1450,23 +1450,28 @@ class MaaManager(QObject):
|
|||||||
user_data["Info"]["MedicineNumb"]
|
user_data["Info"]["MedicineNumb"]
|
||||||
) # 吃理智药数量
|
) # 吃理智药数量
|
||||||
data["Configurations"]["Default"]["MainFunction.Stage1"] = (
|
data["Configurations"]["Default"]["MainFunction.Stage1"] = (
|
||||||
user_data["Info"]["GameId"]
|
user_data["Info"]["Stage"]
|
||||||
if user_data["Info"]["GameId"] != "-"
|
if user_data["Info"]["Stage"] != "-"
|
||||||
else ""
|
else ""
|
||||||
) # 主关卡
|
) # 主关卡
|
||||||
data["Configurations"]["Default"]["MainFunction.Stage2"] = (
|
data["Configurations"]["Default"]["MainFunction.Stage2"] = (
|
||||||
user_data["Info"]["GameId_1"]
|
user_data["Info"]["Stage_1"]
|
||||||
if user_data["Info"]["GameId_1"] != "-"
|
if user_data["Info"]["Stage_1"] != "-"
|
||||||
else ""
|
else ""
|
||||||
) # 备选关卡1
|
) # 备选关卡1
|
||||||
data["Configurations"]["Default"]["MainFunction.Stage3"] = (
|
data["Configurations"]["Default"]["MainFunction.Stage3"] = (
|
||||||
user_data["Info"]["GameId_2"]
|
user_data["Info"]["Stage_2"]
|
||||||
if user_data["Info"]["GameId_2"] != "-"
|
if user_data["Info"]["Stage_2"] != "-"
|
||||||
else ""
|
else ""
|
||||||
) # 备选关卡2
|
) # 备选关卡2
|
||||||
|
data["Configurations"]["Default"]["MainFunction.Stage4"] = (
|
||||||
|
user_data["Info"]["Stage_3"]
|
||||||
|
if user_data["Info"]["Stage_3"] != "-"
|
||||||
|
else ""
|
||||||
|
) # 备选关卡3
|
||||||
data["Configurations"]["Default"]["Fight.RemainingSanityStage"] = (
|
data["Configurations"]["Default"]["Fight.RemainingSanityStage"] = (
|
||||||
user_data["Info"]["GameId_Remain"]
|
user_data["Info"]["Stage_Remain"]
|
||||||
if user_data["Info"]["GameId_Remain"] != "-"
|
if user_data["Info"]["Stage_Remain"] != "-"
|
||||||
else ""
|
else ""
|
||||||
) # 剩余理智关卡
|
) # 剩余理智关卡
|
||||||
data["Configurations"]["Default"][
|
data["Configurations"]["Default"][
|
||||||
@@ -1486,7 +1491,7 @@ class MaaManager(QObject):
|
|||||||
data["Configurations"]["Default"][
|
data["Configurations"]["Default"][
|
||||||
"Fight.UseRemainingSanityStage"
|
"Fight.UseRemainingSanityStage"
|
||||||
] = (
|
] = (
|
||||||
"True" if user_data["Info"]["GameId_Remain"] != "-" else "False"
|
"True" if user_data["Info"]["Stage_Remain"] != "-" else "False"
|
||||||
) # 使用剩余理智
|
) # 使用剩余理智
|
||||||
data["Configurations"]["Default"][
|
data["Configurations"]["Default"][
|
||||||
"Fight.UseExpiringMedicine"
|
"Fight.UseExpiringMedicine"
|
||||||
@@ -1556,23 +1561,28 @@ class MaaManager(QObject):
|
|||||||
user_data["Info"]["MedicineNumb"]
|
user_data["Info"]["MedicineNumb"]
|
||||||
) # 吃理智药数量
|
) # 吃理智药数量
|
||||||
data["Configurations"]["Default"]["MainFunction.Stage1"] = (
|
data["Configurations"]["Default"]["MainFunction.Stage1"] = (
|
||||||
user_data["Info"]["GameId"]
|
user_data["Info"]["Stage"]
|
||||||
if user_data["Info"]["GameId"] != "-"
|
if user_data["Info"]["Stage"] != "-"
|
||||||
else ""
|
else ""
|
||||||
) # 主关卡
|
) # 主关卡
|
||||||
data["Configurations"]["Default"]["MainFunction.Stage2"] = (
|
data["Configurations"]["Default"]["MainFunction.Stage2"] = (
|
||||||
user_data["Info"]["GameId_1"]
|
user_data["Info"]["Stage_1"]
|
||||||
if user_data["Info"]["GameId_1"] != "-"
|
if user_data["Info"]["Stage_1"] != "-"
|
||||||
else ""
|
else ""
|
||||||
) # 备选关卡1
|
) # 备选关卡1
|
||||||
data["Configurations"]["Default"]["MainFunction.Stage3"] = (
|
data["Configurations"]["Default"]["MainFunction.Stage3"] = (
|
||||||
user_data["Info"]["GameId_2"]
|
user_data["Info"]["Stage_2"]
|
||||||
if user_data["Info"]["GameId_2"] != "-"
|
if user_data["Info"]["Stage_2"] != "-"
|
||||||
else ""
|
else ""
|
||||||
) # 备选关卡2
|
) # 备选关卡2
|
||||||
|
data["Configurations"]["Default"]["MainFunction.Stage4"] = (
|
||||||
|
user_data["Info"]["Stage_3"]
|
||||||
|
if user_data["Info"]["Stage_3"] != "-"
|
||||||
|
else ""
|
||||||
|
) # 备选关卡3
|
||||||
data["Configurations"]["Default"]["Fight.RemainingSanityStage"] = (
|
data["Configurations"]["Default"]["Fight.RemainingSanityStage"] = (
|
||||||
user_data["Info"]["GameId_Remain"]
|
user_data["Info"]["Stage_Remain"]
|
||||||
if user_data["Info"]["GameId_Remain"] != "-"
|
if user_data["Info"]["Stage_Remain"] != "-"
|
||||||
else ""
|
else ""
|
||||||
) # 剩余理智关卡
|
) # 剩余理智关卡
|
||||||
data["Configurations"]["Default"][
|
data["Configurations"]["Default"][
|
||||||
@@ -1586,7 +1596,7 @@ class MaaManager(QObject):
|
|||||||
data["Configurations"]["Default"][
|
data["Configurations"]["Default"][
|
||||||
"Fight.UseRemainingSanityStage"
|
"Fight.UseRemainingSanityStage"
|
||||||
] = (
|
] = (
|
||||||
"True" if user_data["Info"]["GameId_Remain"] != "-" else "False"
|
"True" if user_data["Info"]["Stage_Remain"] != "-" else "False"
|
||||||
) # 使用剩余理智
|
) # 使用剩余理智
|
||||||
|
|
||||||
# 基建模式
|
# 基建模式
|
||||||
|
|||||||
@@ -152,9 +152,11 @@ class GeneralManager(QObject):
|
|||||||
self.set["Script"]["LogTimeStart"] - 1,
|
self.set["Script"]["LogTimeStart"] - 1,
|
||||||
self.set["Script"]["LogTimeEnd"],
|
self.set["Script"]["LogTimeEnd"],
|
||||||
]
|
]
|
||||||
self.success_log = [
|
self.success_log = (
|
||||||
_.strip() for _ in self.set["Script"]["SuccessLog"].split("|")
|
[_.strip() for _ in self.set["Script"]["SuccessLog"].split("|")]
|
||||||
]
|
if self.set["Script"]["SuccessLog"]
|
||||||
|
else []
|
||||||
|
)
|
||||||
self.error_log = [_.strip() for _ in self.set["Script"]["ErrorLog"].split("|")]
|
self.error_log = [_.strip() for _ in self.set["Script"]["ErrorLog"].split("|")]
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
@@ -304,9 +306,13 @@ class GeneralManager(QObject):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# 运行脚本任务
|
# 运行脚本任务
|
||||||
|
logger.info(
|
||||||
|
f"{self.name} | 运行脚本任务:{self.script_exe_path},参数:{self.set['Script']['Arguments']}"
|
||||||
|
)
|
||||||
self.script_process_manager.open_process(
|
self.script_process_manager.open_process(
|
||||||
self.script_exe_path,
|
self.script_exe_path,
|
||||||
str(self.set["Script"]["Arguments"]).split(" "),
|
str(self.set["Script"]["Arguments"]).split(" "),
|
||||||
|
tracking_time=60 if self.set["Script"]["IfTrackProcess"] else 0,
|
||||||
)
|
)
|
||||||
|
|
||||||
# 监测运行状态
|
# 监测运行状态
|
||||||
@@ -430,7 +436,10 @@ class GeneralManager(QObject):
|
|||||||
try:
|
try:
|
||||||
# 创建通用脚本任务
|
# 创建通用脚本任务
|
||||||
logger.info(f"{self.name} | 无参数启动通用脚本:{self.script_exe_path}")
|
logger.info(f"{self.name} | 无参数启动通用脚本:{self.script_exe_path}")
|
||||||
self.script_process_manager.open_process(self.script_exe_path)
|
self.script_process_manager.open_process(
|
||||||
|
self.script_exe_path,
|
||||||
|
tracking_time=60 if self.set["Script"]["IfTrackProcess"] else 0,
|
||||||
|
)
|
||||||
|
|
||||||
# 记录当前时间
|
# 记录当前时间
|
||||||
start_time = datetime.now()
|
start_time = datetime.now()
|
||||||
|
|||||||
@@ -547,14 +547,14 @@ class MemberManager(QWidget):
|
|||||||
|
|
||||||
for user_setting in member.user_setting.user_manager.script_list:
|
for user_setting in member.user_setting.user_manager.script_list:
|
||||||
|
|
||||||
user_setting.card_GameIdMode.comboBox.currentIndexChanged.disconnect(
|
user_setting.card_StageMode.comboBox.currentIndexChanged.disconnect(
|
||||||
user_setting.switch_gameid_mode
|
user_setting.switch_stage_mode
|
||||||
)
|
)
|
||||||
user_setting.card_GameIdMode.reLoadOptions(
|
user_setting.card_StageMode.reLoadOptions(
|
||||||
plan_list[0], plan_list[1]
|
plan_list[0], plan_list[1]
|
||||||
)
|
)
|
||||||
user_setting.card_GameIdMode.comboBox.currentIndexChanged.connect(
|
user_setting.card_StageMode.comboBox.currentIndexChanged.connect(
|
||||||
user_setting.switch_gameid_mode
|
user_setting.switch_stage_mode
|
||||||
)
|
)
|
||||||
|
|
||||||
self.refresh_plan_info()
|
self.refresh_plan_info()
|
||||||
@@ -578,7 +578,7 @@ class MemberManager(QWidget):
|
|||||||
|
|
||||||
member.user_setting.user_manager.user_dashboard.load_info()
|
member.user_setting.user_manager.user_dashboard.load_info()
|
||||||
for user_setting in member.user_setting.user_manager.script_list:
|
for user_setting in member.user_setting.user_manager.script_list:
|
||||||
user_setting.switch_gameid_mode()
|
user_setting.switch_stage_mode()
|
||||||
|
|
||||||
class MemberSettingBox(QWidget):
|
class MemberSettingBox(QWidget):
|
||||||
"""脚本管理子页面组"""
|
"""脚本管理子页面组"""
|
||||||
@@ -1217,8 +1217,8 @@ class MemberManager(QWidget):
|
|||||||
"""清空所有子界面"""
|
"""清空所有子界面"""
|
||||||
|
|
||||||
for sub_interface in self.script_list:
|
for sub_interface in self.script_list:
|
||||||
Config.gameid_refreshed.disconnect(
|
Config.stage_refreshed.disconnect(
|
||||||
sub_interface.refresh_gameid
|
sub_interface.refresh_stage
|
||||||
)
|
)
|
||||||
Config.PASSWORD_refreshed.disconnect(
|
Config.PASSWORD_refreshed.disconnect(
|
||||||
sub_interface.refresh_password
|
sub_interface.refresh_password
|
||||||
@@ -1254,7 +1254,7 @@ class MemberManager(QWidget):
|
|||||||
self.name = name
|
self.name = name
|
||||||
|
|
||||||
self.dashboard = TableWidget(self)
|
self.dashboard = TableWidget(self)
|
||||||
self.dashboard.setColumnCount(11)
|
self.dashboard.setColumnCount(12)
|
||||||
self.dashboard.setHorizontalHeaderLabels(
|
self.dashboard.setHorizontalHeaderLabels(
|
||||||
[
|
[
|
||||||
"用户名",
|
"用户名",
|
||||||
@@ -1266,6 +1266,7 @@ class MemberManager(QWidget):
|
|||||||
"关卡选择",
|
"关卡选择",
|
||||||
"备选 - 1",
|
"备选 - 1",
|
||||||
"备选 - 2",
|
"备选 - 2",
|
||||||
|
"备选 - 3",
|
||||||
"剩余理智",
|
"剩余理智",
|
||||||
"详",
|
"详",
|
||||||
]
|
]
|
||||||
@@ -1276,14 +1277,14 @@ class MemberManager(QWidget):
|
|||||||
self.dashboard.horizontalHeader().setSectionResizeMode(
|
self.dashboard.horizontalHeader().setSectionResizeMode(
|
||||||
col, QHeaderView.ResizeMode.ResizeToContents
|
col, QHeaderView.ResizeMode.ResizeToContents
|
||||||
)
|
)
|
||||||
for col in range(6, 10):
|
for col in range(6, 11):
|
||||||
self.dashboard.horizontalHeader().setSectionResizeMode(
|
self.dashboard.horizontalHeader().setSectionResizeMode(
|
||||||
col, QHeaderView.ResizeMode.Stretch
|
col, QHeaderView.ResizeMode.Stretch
|
||||||
)
|
)
|
||||||
self.dashboard.horizontalHeader().setSectionResizeMode(
|
self.dashboard.horizontalHeader().setSectionResizeMode(
|
||||||
10, QHeaderView.ResizeMode.Fixed
|
11, QHeaderView.ResizeMode.Fixed
|
||||||
)
|
)
|
||||||
self.dashboard.setColumnWidth(10, 32)
|
self.dashboard.setColumnWidth(11, 32)
|
||||||
|
|
||||||
self.viewLayout.addWidget(self.dashboard)
|
self.viewLayout.addWidget(self.dashboard)
|
||||||
self.viewLayout.setContentsMargins(3, 0, 3, 3)
|
self.viewLayout.setContentsMargins(3, 0, 3, 3)
|
||||||
@@ -1319,7 +1320,7 @@ class MemberManager(QWidget):
|
|||||||
else "本周剿灭未完成"
|
else "本周剿灭未完成"
|
||||||
)
|
)
|
||||||
|
|
||||||
gameid_info = config.get_plan_info()
|
stage_info = config.get_plan_info()
|
||||||
|
|
||||||
button = PrimaryToolButton(
|
button = PrimaryToolButton(
|
||||||
FluentIcon.CHEVRON_RIGHT, self
|
FluentIcon.CHEVRON_RIGHT, self
|
||||||
@@ -1369,74 +1370,86 @@ class MemberManager(QWidget):
|
|||||||
self.dashboard.setItem(
|
self.dashboard.setItem(
|
||||||
int(name[3:]) - 1,
|
int(name[3:]) - 1,
|
||||||
5,
|
5,
|
||||||
QTableWidgetItem(str(gameid_info["MedicineNumb"])),
|
QTableWidgetItem(str(stage_info["MedicineNumb"])),
|
||||||
)
|
)
|
||||||
self.dashboard.setItem(
|
self.dashboard.setItem(
|
||||||
int(name[3:]) - 1,
|
int(name[3:]) - 1,
|
||||||
6,
|
6,
|
||||||
QTableWidgetItem(
|
QTableWidgetItem(
|
||||||
Config.gameid_dict["ALL"]["text"][
|
Config.stage_dict["ALL"]["text"][
|
||||||
Config.gameid_dict["ALL"]["value"].index(
|
Config.stage_dict["ALL"]["value"].index(
|
||||||
gameid_info["GameId"]
|
stage_info["Stage"]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
if gameid_info["GameId"]
|
if stage_info["Stage"]
|
||||||
in Config.gameid_dict["ALL"]["value"]
|
in Config.stage_dict["ALL"]["value"]
|
||||||
else gameid_info["GameId"]
|
else stage_info["Stage"]
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
self.dashboard.setItem(
|
self.dashboard.setItem(
|
||||||
int(name[3:]) - 1,
|
int(name[3:]) - 1,
|
||||||
7,
|
7,
|
||||||
QTableWidgetItem(
|
QTableWidgetItem(
|
||||||
Config.gameid_dict["ALL"]["text"][
|
Config.stage_dict["ALL"]["text"][
|
||||||
Config.gameid_dict["ALL"]["value"].index(
|
Config.stage_dict["ALL"]["value"].index(
|
||||||
gameid_info["GameId_1"]
|
stage_info["Stage"]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
if gameid_info["GameId_1"]
|
if stage_info["Stage"]
|
||||||
in Config.gameid_dict["ALL"]["value"]
|
in Config.stage_dict["ALL"]["value"]
|
||||||
else gameid_info["GameId_1"]
|
else stage_info["Stage"]
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
self.dashboard.setItem(
|
self.dashboard.setItem(
|
||||||
int(name[3:]) - 1,
|
int(name[3:]) - 1,
|
||||||
8,
|
8,
|
||||||
QTableWidgetItem(
|
QTableWidgetItem(
|
||||||
Config.gameid_dict["ALL"]["text"][
|
Config.stage_dict["ALL"]["text"][
|
||||||
Config.gameid_dict["ALL"]["value"].index(
|
Config.stage_dict["ALL"]["value"].index(
|
||||||
gameid_info["GameId_2"]
|
stage_info["Stage_2"]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
if gameid_info["GameId_2"]
|
if stage_info["Stage_2"]
|
||||||
in Config.gameid_dict["ALL"]["value"]
|
in Config.stage_dict["ALL"]["value"]
|
||||||
else gameid_info["GameId_2"]
|
else stage_info["Stage_2"]
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
self.dashboard.setItem(
|
self.dashboard.setItem(
|
||||||
int(name[3:]) - 1,
|
int(name[3:]) - 1,
|
||||||
9,
|
9,
|
||||||
|
QTableWidgetItem(
|
||||||
|
Config.stage_dict["ALL"]["text"][
|
||||||
|
Config.stage_dict["ALL"]["value"].index(
|
||||||
|
stage_info["Stage_3"]
|
||||||
|
)
|
||||||
|
]
|
||||||
|
if stage_info["Stage_3"]
|
||||||
|
in Config.stage_dict["ALL"]["value"]
|
||||||
|
else stage_info["Stage_3"]
|
||||||
|
),
|
||||||
|
)
|
||||||
|
self.dashboard.setItem(
|
||||||
|
int(name[3:]) - 1,
|
||||||
|
10,
|
||||||
QTableWidgetItem(
|
QTableWidgetItem(
|
||||||
"不使用"
|
"不使用"
|
||||||
if gameid_info["GameId_Remain"] == "-"
|
if stage_info["Stage_Remain"] == "-"
|
||||||
else (
|
else (
|
||||||
(
|
(
|
||||||
Config.gameid_dict["ALL"]["text"][
|
Config.stage_dict["ALL"]["text"][
|
||||||
Config.gameid_dict["ALL"][
|
Config.stage_dict["ALL"][
|
||||||
"value"
|
"value"
|
||||||
].index(
|
].index(stage_info["Stage_Remain"])
|
||||||
gameid_info["GameId_Remain"]
|
|
||||||
)
|
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
if gameid_info["GameId_Remain"]
|
if stage_info["Stage_Remain"]
|
||||||
in Config.gameid_dict["ALL"]["value"]
|
in Config.stage_dict["ALL"]["value"]
|
||||||
else gameid_info["GameId_Remain"]
|
else stage_info["Stage_Remain"]
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
self.dashboard.setCellWidget(
|
self.dashboard.setCellWidget(
|
||||||
int(name[3:]) - 1, 10, button
|
int(name[3:]) - 1, 11, button
|
||||||
)
|
)
|
||||||
|
|
||||||
class UserMemberSettingBox(HeaderCardWidget):
|
class UserMemberSettingBox(HeaderCardWidget):
|
||||||
@@ -1495,17 +1508,6 @@ class MemberManager(QWidget):
|
|||||||
configItem=self.config.Info_Mode,
|
configItem=self.config.Info_Mode,
|
||||||
parent=self,
|
parent=self,
|
||||||
)
|
)
|
||||||
self.card_GameIdMode = NoOptionComboBoxSettingCard(
|
|
||||||
icon=FluentIcon.DICTIONARY,
|
|
||||||
title="关卡配置模式",
|
|
||||||
content="刷理智关卡号的配置模式",
|
|
||||||
value=plan_list[0],
|
|
||||||
texts=plan_list[1],
|
|
||||||
qconfig=self.config,
|
|
||||||
configItem=self.config.Info_GameIdMode,
|
|
||||||
parent=self,
|
|
||||||
)
|
|
||||||
self.card_GameIdMode.comboBox.setMinimumWidth(0)
|
|
||||||
self.card_Server = ComboBoxSettingCard(
|
self.card_Server = ComboBoxSettingCard(
|
||||||
icon=FluentIcon.PROJECTOR,
|
icon=FluentIcon.PROJECTOR,
|
||||||
title="服务器",
|
title="服务器",
|
||||||
@@ -1602,48 +1604,69 @@ class MemberManager(QWidget):
|
|||||||
parent=self,
|
parent=self,
|
||||||
)
|
)
|
||||||
self.card_SeriesNumb.comboBox.setMinimumWidth(150)
|
self.card_SeriesNumb.comboBox.setMinimumWidth(150)
|
||||||
self.card_GameId = EditableComboBoxWithPlanSettingCard(
|
self.card_StageMode = NoOptionComboBoxSettingCard(
|
||||||
|
icon=FluentIcon.DICTIONARY,
|
||||||
|
title="关卡配置模式",
|
||||||
|
content="刷理智关卡号的配置模式",
|
||||||
|
value=plan_list[0],
|
||||||
|
texts=plan_list[1],
|
||||||
|
qconfig=self.config,
|
||||||
|
configItem=self.config.Info_StageMode,
|
||||||
|
parent=self,
|
||||||
|
)
|
||||||
|
self.card_StageMode.comboBox.setMinimumWidth(150)
|
||||||
|
self.card_Stage = EditableComboBoxWithPlanSettingCard(
|
||||||
icon=FluentIcon.GAME,
|
icon=FluentIcon.GAME,
|
||||||
title="关卡选择",
|
title="关卡选择",
|
||||||
content="按下回车以添加自定义关卡号",
|
content="按下回车以添加自定义关卡号",
|
||||||
value=Config.gameid_dict["ALL"]["value"],
|
value=Config.stage_dict["ALL"]["value"],
|
||||||
texts=Config.gameid_dict["ALL"]["text"],
|
texts=Config.stage_dict["ALL"]["text"],
|
||||||
qconfig=self.config,
|
qconfig=self.config,
|
||||||
configItem=self.config.Info_GameId,
|
configItem=self.config.Info_Stage,
|
||||||
parent=self,
|
parent=self,
|
||||||
)
|
)
|
||||||
self.card_GameId_1 = EditableComboBoxWithPlanSettingCard(
|
self.card_Stage_1 = EditableComboBoxWithPlanSettingCard(
|
||||||
icon=FluentIcon.GAME,
|
icon=FluentIcon.GAME,
|
||||||
title="备选关卡 - 1",
|
title="备选关卡 - 1",
|
||||||
content="按下回车以添加自定义关卡号",
|
content="按下回车以添加自定义关卡号",
|
||||||
value=Config.gameid_dict["ALL"]["value"],
|
value=Config.stage_dict["ALL"]["value"],
|
||||||
texts=Config.gameid_dict["ALL"]["text"],
|
texts=Config.stage_dict["ALL"]["text"],
|
||||||
qconfig=self.config,
|
qconfig=self.config,
|
||||||
configItem=self.config.Info_GameId_1,
|
configItem=self.config.Info_Stage_1,
|
||||||
parent=self,
|
parent=self,
|
||||||
)
|
)
|
||||||
self.card_GameId_2 = EditableComboBoxWithPlanSettingCard(
|
self.card_Stage_2 = EditableComboBoxWithPlanSettingCard(
|
||||||
icon=FluentIcon.GAME,
|
icon=FluentIcon.GAME,
|
||||||
title="备选关卡 - 2",
|
title="备选关卡 - 2",
|
||||||
content="按下回车以添加自定义关卡号",
|
content="按下回车以添加自定义关卡号",
|
||||||
value=Config.gameid_dict["ALL"]["value"],
|
value=Config.stage_dict["ALL"]["value"],
|
||||||
texts=Config.gameid_dict["ALL"]["text"],
|
texts=Config.stage_dict["ALL"]["text"],
|
||||||
qconfig=self.config,
|
qconfig=self.config,
|
||||||
configItem=self.config.Info_GameId_2,
|
configItem=self.config.Info_Stage_2,
|
||||||
parent=self,
|
parent=self,
|
||||||
)
|
)
|
||||||
self.card_GameId_Remain = (
|
self.card_Stage_3 = EditableComboBoxWithPlanSettingCard(
|
||||||
|
icon=FluentIcon.GAME,
|
||||||
|
title="备选关卡 - 3",
|
||||||
|
content="按下回车以添加自定义关卡号",
|
||||||
|
value=Config.stage_dict["ALL"]["value"],
|
||||||
|
texts=Config.stage_dict["ALL"]["text"],
|
||||||
|
qconfig=self.config,
|
||||||
|
configItem=self.config.Info_Stage_3,
|
||||||
|
parent=self,
|
||||||
|
)
|
||||||
|
self.card_Stage_Remain = (
|
||||||
EditableComboBoxWithPlanSettingCard(
|
EditableComboBoxWithPlanSettingCard(
|
||||||
icon=FluentIcon.GAME,
|
icon=FluentIcon.GAME,
|
||||||
title="剩余理智关卡",
|
title="剩余理智关卡",
|
||||||
content="按下回车以添加自定义关卡号",
|
content="按下回车以添加自定义关卡号",
|
||||||
value=Config.gameid_dict["ALL"]["value"],
|
value=Config.stage_dict["ALL"]["value"],
|
||||||
texts=[
|
texts=[
|
||||||
"不使用" if _ == "当前/上次" else _
|
"不使用" if _ == "当前/上次" else _
|
||||||
for _ in Config.gameid_dict["ALL"]["text"]
|
for _ in Config.stage_dict["ALL"]["text"]
|
||||||
],
|
],
|
||||||
qconfig=self.config,
|
qconfig=self.config,
|
||||||
configItem=self.config.Info_GameId_Remain,
|
configItem=self.config.Info_Stage_Remain,
|
||||||
parent=self,
|
parent=self,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -1822,7 +1845,6 @@ class MemberManager(QWidget):
|
|||||||
h1_layout.addWidget(self.card_Id)
|
h1_layout.addWidget(self.card_Id)
|
||||||
h2_layout = QHBoxLayout()
|
h2_layout = QHBoxLayout()
|
||||||
h2_layout.addWidget(self.card_Mode)
|
h2_layout.addWidget(self.card_Mode)
|
||||||
h2_layout.addWidget(self.card_GameIdMode)
|
|
||||||
h2_layout.addWidget(self.card_Server)
|
h2_layout.addWidget(self.card_Server)
|
||||||
h3_layout = QHBoxLayout()
|
h3_layout = QHBoxLayout()
|
||||||
h3_layout.addWidget(self.card_Status)
|
h3_layout.addWidget(self.card_Status)
|
||||||
@@ -1838,11 +1860,14 @@ class MemberManager(QWidget):
|
|||||||
h6_layout.addWidget(self.card_MedicineNumb)
|
h6_layout.addWidget(self.card_MedicineNumb)
|
||||||
h6_layout.addWidget(self.card_SeriesNumb)
|
h6_layout.addWidget(self.card_SeriesNumb)
|
||||||
h7_layout = QHBoxLayout()
|
h7_layout = QHBoxLayout()
|
||||||
h7_layout.addWidget(self.card_GameId)
|
h7_layout.addWidget(self.card_StageMode)
|
||||||
h7_layout.addWidget(self.card_GameId_1)
|
h7_layout.addWidget(self.card_Stage)
|
||||||
h8_layout = QHBoxLayout()
|
h8_layout = QHBoxLayout()
|
||||||
h8_layout.addWidget(self.card_GameId_2)
|
h8_layout.addWidget(self.card_Stage_1)
|
||||||
h8_layout.addWidget(self.card_GameId_Remain)
|
h8_layout.addWidget(self.card_Stage_2)
|
||||||
|
h9_layout = QHBoxLayout()
|
||||||
|
h9_layout.addWidget(self.card_Stage_3)
|
||||||
|
h9_layout.addWidget(self.card_Stage_Remain)
|
||||||
|
|
||||||
Layout = QVBoxLayout()
|
Layout = QVBoxLayout()
|
||||||
Layout.addLayout(h1_layout)
|
Layout.addLayout(h1_layout)
|
||||||
@@ -1854,6 +1879,7 @@ class MemberManager(QWidget):
|
|||||||
Layout.addLayout(h6_layout)
|
Layout.addLayout(h6_layout)
|
||||||
Layout.addLayout(h7_layout)
|
Layout.addLayout(h7_layout)
|
||||||
Layout.addLayout(h8_layout)
|
Layout.addLayout(h8_layout)
|
||||||
|
Layout.addLayout(h9_layout)
|
||||||
Layout.addWidget(self.card_Skland)
|
Layout.addWidget(self.card_Skland)
|
||||||
Layout.addWidget(self.card_TaskSet)
|
Layout.addWidget(self.card_TaskSet)
|
||||||
Layout.addWidget(self.card_NotifySet)
|
Layout.addWidget(self.card_NotifySet)
|
||||||
@@ -1878,14 +1904,14 @@ class MemberManager(QWidget):
|
|||||||
)
|
)
|
||||||
self.card_TaskSet.clicked.connect(self.set_task)
|
self.card_TaskSet.clicked.connect(self.set_task)
|
||||||
self.card_NotifySet.clicked.connect(self.set_notify)
|
self.card_NotifySet.clicked.connect(self.set_notify)
|
||||||
self.card_GameIdMode.comboBox.currentIndexChanged.connect(
|
self.card_StageMode.comboBox.currentIndexChanged.connect(
|
||||||
self.switch_gameid_mode
|
self.switch_stage_mode
|
||||||
)
|
)
|
||||||
Config.gameid_refreshed.connect(self.refresh_gameid)
|
Config.stage_refreshed.connect(self.refresh_stage)
|
||||||
Config.PASSWORD_refreshed.connect(self.refresh_password)
|
Config.PASSWORD_refreshed.connect(self.refresh_password)
|
||||||
|
|
||||||
self.switch_mode()
|
self.switch_mode()
|
||||||
self.switch_gameid_mode()
|
self.switch_stage_mode()
|
||||||
self.switch_infrastructure()
|
self.switch_infrastructure()
|
||||||
|
|
||||||
def switch_mode(self) -> None:
|
def switch_mode(self) -> None:
|
||||||
@@ -1904,37 +1930,39 @@ class MemberManager(QWidget):
|
|||||||
self.card_Annihilation.button.setVisible(True)
|
self.card_Annihilation.button.setVisible(True)
|
||||||
self.card_Routine.setVisible(True)
|
self.card_Routine.setVisible(True)
|
||||||
|
|
||||||
def switch_gameid_mode(self) -> None:
|
def switch_stage_mode(self) -> None:
|
||||||
|
|
||||||
for card, name in zip(
|
for card, name in zip(
|
||||||
[
|
[
|
||||||
self.card_MedicineNumb,
|
self.card_MedicineNumb,
|
||||||
self.card_SeriesNumb,
|
self.card_SeriesNumb,
|
||||||
self.card_GameId,
|
self.card_Stage,
|
||||||
self.card_GameId_1,
|
self.card_Stage_1,
|
||||||
self.card_GameId_2,
|
self.card_Stage_2,
|
||||||
self.card_GameId_Remain,
|
self.card_Stage_3,
|
||||||
|
self.card_Stage_Remain,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"MedicineNumb",
|
"MedicineNumb",
|
||||||
"SeriesNumb",
|
"SeriesNumb",
|
||||||
"GameId",
|
"Stage",
|
||||||
"GameId_1",
|
"Stage_1",
|
||||||
"GameId_2",
|
"Stage_2",
|
||||||
"GameId_Remain",
|
"Stage_3",
|
||||||
|
"Stage_Remain",
|
||||||
],
|
],
|
||||||
):
|
):
|
||||||
|
|
||||||
card.switch_mode(
|
card.switch_mode(
|
||||||
self.config.get(self.config.Info_GameIdMode)[:2]
|
self.config.get(self.config.Info_StageMode)[:2]
|
||||||
)
|
)
|
||||||
if (
|
if (
|
||||||
self.config.get(self.config.Info_GameIdMode)
|
self.config.get(self.config.Info_StageMode)
|
||||||
!= "固定"
|
!= "固定"
|
||||||
):
|
):
|
||||||
card.change_plan(
|
card.change_plan(
|
||||||
Config.plan_dict[
|
Config.plan_dict[
|
||||||
self.config.get(self.config.Info_GameIdMode)
|
self.config.get(self.config.Info_StageMode)
|
||||||
]["Config"].get_current_info(name)
|
]["Config"].get_current_info(name)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1959,26 +1987,27 @@ class MemberManager(QWidget):
|
|||||||
"自定义基建配置文件未生效"
|
"自定义基建配置文件未生效"
|
||||||
)
|
)
|
||||||
|
|
||||||
def refresh_gameid(self):
|
def refresh_stage(self):
|
||||||
|
|
||||||
self.card_GameId.reLoadOptions(
|
self.card_Stage.reLoadOptions(
|
||||||
Config.gameid_dict["ALL"]["value"],
|
Config.stage_dict["ALL"]["value"],
|
||||||
Config.gameid_dict["ALL"]["text"],
|
Config.stage_dict["ALL"]["text"],
|
||||||
)
|
)
|
||||||
self.card_GameId_1.reLoadOptions(
|
self.card_Stage_1.reLoadOptions(
|
||||||
Config.gameid_dict["ALL"]["value"],
|
Config.stage_dict["ALL"]["value"],
|
||||||
Config.gameid_dict["ALL"]["text"],
|
Config.stage_dict["ALL"]["text"],
|
||||||
)
|
)
|
||||||
self.card_GameId_2.reLoadOptions(
|
self.card_Stage_2.reLoadOptions(
|
||||||
Config.gameid_dict["ALL"]["value"],
|
Config.stage_dict["ALL"]["value"],
|
||||||
Config.gameid_dict["ALL"]["text"],
|
Config.stage_dict["ALL"]["text"],
|
||||||
)
|
)
|
||||||
self.card_GameId_Remain.reLoadOptions(
|
self.card_Stage_3.reLoadOptions(
|
||||||
Config.gameid_dict["ALL"]["value"],
|
Config.stage_dict["ALL"]["value"],
|
||||||
[
|
Config.stage_dict["ALL"]["text"],
|
||||||
"不使用" if _ == "当前/上次" else _
|
)
|
||||||
for _ in Config.gameid_dict["ALL"]["text"]
|
self.card_Stage_Remain.reLoadOptions(
|
||||||
],
|
Config.stage_dict["ALL"]["value"],
|
||||||
|
Config.stage_dict["ALL"]["text"],
|
||||||
)
|
)
|
||||||
|
|
||||||
def refresh_password(self):
|
def refresh_password(self):
|
||||||
@@ -2310,6 +2339,14 @@ class MemberManager(QWidget):
|
|||||||
configItem=self.config.Script_Arguments,
|
configItem=self.config.Script_Arguments,
|
||||||
parent=self,
|
parent=self,
|
||||||
)
|
)
|
||||||
|
self.card_IfTrackProcess = SwitchSettingCard(
|
||||||
|
icon=FluentIcon.PAGE_RIGHT,
|
||||||
|
title="追踪脚本子进程",
|
||||||
|
content="启用后将在脚本启动后 60s 内追踪其子进程,并仅在所有子进程结束后判定脚本中止",
|
||||||
|
qconfig=self.config,
|
||||||
|
configItem=self.config.Script_IfTrackProcess,
|
||||||
|
parent=self,
|
||||||
|
)
|
||||||
self.card_ConfigPath = PathSettingCard(
|
self.card_ConfigPath = PathSettingCard(
|
||||||
icon=FluentIcon.FOLDER,
|
icon=FluentIcon.FOLDER,
|
||||||
title="脚本配置文件路径 - [必填]",
|
title="脚本配置文件路径 - [必填]",
|
||||||
@@ -2409,6 +2446,7 @@ class MemberManager(QWidget):
|
|||||||
Layout.addWidget(self.card_RootPath)
|
Layout.addWidget(self.card_RootPath)
|
||||||
Layout.addWidget(self.card_ScriptPath)
|
Layout.addWidget(self.card_ScriptPath)
|
||||||
Layout.addWidget(self.card_Arguments)
|
Layout.addWidget(self.card_Arguments)
|
||||||
|
Layout.addWidget(self.card_IfTrackProcess)
|
||||||
Layout.addWidget(self.card_ConfigPath)
|
Layout.addWidget(self.card_ConfigPath)
|
||||||
Layout.addWidget(self.card_LogPath)
|
Layout.addWidget(self.card_LogPath)
|
||||||
Layout.addWidget(self.card_LogPathFormat)
|
Layout.addWidget(self.card_LogPathFormat)
|
||||||
|
|||||||
@@ -324,7 +324,7 @@ class PlanManager(QWidget):
|
|||||||
"""清空所有子界面"""
|
"""清空所有子界面"""
|
||||||
|
|
||||||
for sub_interface in self.script_list:
|
for sub_interface in self.script_list:
|
||||||
Config.gameid_refreshed.disconnect(sub_interface.refresh_gameid)
|
Config.stage_refreshed.disconnect(sub_interface.refresh_stage)
|
||||||
self.stackedWidget.removeWidget(sub_interface)
|
self.stackedWidget.removeWidget(sub_interface)
|
||||||
sub_interface.deleteLater()
|
sub_interface.deleteLater()
|
||||||
self.script_list.clear()
|
self.script_list.clear()
|
||||||
@@ -372,7 +372,7 @@ class PlanManager(QWidget):
|
|||||||
|
|
||||||
self.table = TableWidget(self)
|
self.table = TableWidget(self)
|
||||||
self.table.setColumnCount(8)
|
self.table.setColumnCount(8)
|
||||||
self.table.setRowCount(6)
|
self.table.setRowCount(7)
|
||||||
self.table.setHorizontalHeaderLabels(
|
self.table.setHorizontalHeaderLabels(
|
||||||
["全局", "周一", "周二", "周三", "周四", "周五", "周六", "周日"]
|
["全局", "周一", "周二", "周三", "周四", "周五", "周六", "周日"]
|
||||||
)
|
)
|
||||||
@@ -383,6 +383,7 @@ class PlanManager(QWidget):
|
|||||||
"关卡选择",
|
"关卡选择",
|
||||||
"备选 - 1",
|
"备选 - 1",
|
||||||
"备选 - 2",
|
"备选 - 2",
|
||||||
|
"备选 - 3",
|
||||||
"剩余理智",
|
"剩余理智",
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
@@ -392,7 +393,7 @@ class PlanManager(QWidget):
|
|||||||
self.table.horizontalHeader().setSectionResizeMode(
|
self.table.horizontalHeader().setSectionResizeMode(
|
||||||
col, QHeaderView.ResizeMode.Stretch
|
col, QHeaderView.ResizeMode.Stretch
|
||||||
)
|
)
|
||||||
for row in range(6):
|
for row in range(7):
|
||||||
self.table.verticalHeader().setSectionResizeMode(
|
self.table.verticalHeader().setSectionResizeMode(
|
||||||
row, QHeaderView.ResizeMode.ResizeToContents
|
row, QHeaderView.ResizeMode.ResizeToContents
|
||||||
)
|
)
|
||||||
@@ -427,21 +428,21 @@ class PlanManager(QWidget):
|
|||||||
configItem=configItem,
|
configItem=configItem,
|
||||||
parent=self,
|
parent=self,
|
||||||
)
|
)
|
||||||
elif name == "GameId_Remain":
|
elif name == "Stage_Remain":
|
||||||
self.item_dict[group][name] = EditableComboBoxSetting(
|
self.item_dict[group][name] = EditableComboBoxSetting(
|
||||||
value=Config.gameid_dict[group]["value"],
|
value=Config.stage_dict[group]["value"],
|
||||||
texts=[
|
texts=[
|
||||||
"不使用" if _ == "当前/上次" else _
|
"不使用" if _ == "当前/上次" else _
|
||||||
for _ in Config.gameid_dict[group]["text"]
|
for _ in Config.stage_dict[group]["text"]
|
||||||
],
|
],
|
||||||
qconfig=self.config,
|
qconfig=self.config,
|
||||||
configItem=configItem,
|
configItem=configItem,
|
||||||
parent=self,
|
parent=self,
|
||||||
)
|
)
|
||||||
elif "GameId" in name:
|
elif "Stage" in name:
|
||||||
self.item_dict[group][name] = EditableComboBoxSetting(
|
self.item_dict[group][name] = EditableComboBoxSetting(
|
||||||
value=Config.gameid_dict[group]["value"],
|
value=Config.stage_dict[group]["value"],
|
||||||
texts=Config.gameid_dict[group]["text"],
|
texts=Config.stage_dict[group]["text"],
|
||||||
qconfig=self.config,
|
qconfig=self.config,
|
||||||
configItem=configItem,
|
configItem=configItem,
|
||||||
parent=self,
|
parent=self,
|
||||||
@@ -459,7 +460,7 @@ class PlanManager(QWidget):
|
|||||||
self.viewLayout.setContentsMargins(3, 0, 3, 3)
|
self.viewLayout.setContentsMargins(3, 0, 3, 3)
|
||||||
|
|
||||||
self.card_Mode.comboBox.currentIndexChanged.connect(self.switch_mode)
|
self.card_Mode.comboBox.currentIndexChanged.connect(self.switch_mode)
|
||||||
Config.gameid_refreshed.connect(self.refresh_gameid)
|
Config.stage_refreshed.connect(self.refresh_stage)
|
||||||
|
|
||||||
self.switch_mode()
|
self.switch_mode()
|
||||||
|
|
||||||
@@ -473,25 +474,25 @@ class PlanManager(QWidget):
|
|||||||
== (self.config.get(self.config.Info_Mode) == "ALL")
|
== (self.config.get(self.config.Info_Mode) == "ALL")
|
||||||
)
|
)
|
||||||
|
|
||||||
def refresh_gameid(self):
|
def refresh_stage(self):
|
||||||
|
|
||||||
for group, name_dict in self.item_dict.items():
|
for group, name_dict in self.item_dict.items():
|
||||||
|
|
||||||
for name, setting_item in name_dict.items():
|
for name, setting_item in name_dict.items():
|
||||||
|
|
||||||
if name == "GameId_Remain":
|
if name == "Stage_Remain":
|
||||||
|
|
||||||
setting_item.reLoadOptions(
|
setting_item.reLoadOptions(
|
||||||
Config.gameid_dict[group]["value"],
|
Config.stage_dict[group]["value"],
|
||||||
[
|
[
|
||||||
"不使用" if _ == "当前/上次" else _
|
"不使用" if _ == "当前/上次" else _
|
||||||
for _ in Config.gameid_dict[group]["text"]
|
for _ in Config.stage_dict[group]["text"]
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
elif "GameId" in name:
|
elif "Stage" in name:
|
||||||
|
|
||||||
setting_item.reLoadOptions(
|
setting_item.reLoadOptions(
|
||||||
Config.gameid_dict[group]["value"],
|
Config.stage_dict[group]["value"],
|
||||||
Config.gameid_dict[group]["text"],
|
Config.stage_dict[group]["text"],
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ class ProcessManager(QObject):
|
|||||||
|
|
||||||
process = subprocess.Popen(
|
process = subprocess.Popen(
|
||||||
[path, *args],
|
[path, *args],
|
||||||
|
cwd=path.parent,
|
||||||
creationflags=subprocess.CREATE_NO_WINDOW,
|
creationflags=subprocess.CREATE_NO_WINDOW,
|
||||||
stdin=subprocess.DEVNULL,
|
stdin=subprocess.DEVNULL,
|
||||||
stdout=subprocess.DEVNULL,
|
stdout=subprocess.DEVNULL,
|
||||||
@@ -93,8 +94,9 @@ class ProcessManager(QObject):
|
|||||||
self.tracked_pids.add(self.main_pid)
|
self.tracked_pids.add(self.main_pid)
|
||||||
|
|
||||||
# 递归获取所有子进程
|
# 递归获取所有子进程
|
||||||
for child in main_proc.children(recursive=True):
|
if tracking_time:
|
||||||
self.tracked_pids.add(child.pid)
|
for child in main_proc.children(recursive=True):
|
||||||
|
self.tracked_pids.add(child.pid)
|
||||||
|
|
||||||
except psutil.NoSuchProcess:
|
except psutil.NoSuchProcess:
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
"MainFunction.Stage1": "" #主关卡
|
"MainFunction.Stage1": "" #主关卡
|
||||||
"MainFunction.Stage2": "" #备选关卡1
|
"MainFunction.Stage2": "" #备选关卡1
|
||||||
"MainFunction.Stage3": "" #备选关卡2
|
"MainFunction.Stage3": "" #备选关卡2
|
||||||
|
"MainFunction.Stage4": "" #备选关卡3
|
||||||
"Fight.RemainingSanityStage": "Annihilation" #剩余理智关卡
|
"Fight.RemainingSanityStage": "Annihilation" #剩余理智关卡
|
||||||
"MainFunction.Series.Quantity": "1" #连战次数
|
"MainFunction.Series.Quantity": "1" #连战次数
|
||||||
"Penguin.IsDrGrandet": "True" #博朗台模式
|
"Penguin.IsDrGrandet": "True" #博朗台模式
|
||||||
|
|||||||
@@ -1,6 +1,15 @@
|
|||||||
{
|
{
|
||||||
"main_version": "4.4.0.2",
|
"main_version": "4.4.0.3",
|
||||||
"version_info": {
|
"version_info": {
|
||||||
|
"4.4.0.3": {
|
||||||
|
"修复BUG": [
|
||||||
|
"适配 MAA 备选关卡字段修改",
|
||||||
|
"修复无成功日志时的脚本判定逻辑"
|
||||||
|
],
|
||||||
|
"程序优化": [
|
||||||
|
"`GameId`字段改为 `Stage`,与 MAA 保持一致"
|
||||||
|
]
|
||||||
|
},
|
||||||
"4.4.0.2": {
|
"4.4.0.2": {
|
||||||
"新增功能": [
|
"新增功能": [
|
||||||
"进一步适配三月七相关配置项"
|
"进一步适配三月七相关配置项"
|
||||||
|
|||||||
Reference in New Issue
Block a user