Add gui options

This commit is contained in:
Heng Yu 2024-12-16 16:46:22 +08:00
parent e92ecc9486
commit 9877d1203d
14 changed files with 125 additions and 5 deletions

View File

@ -223,6 +223,10 @@
}, },
"SupportReward": { "SupportReward": {
"Collect": true "Collect": true
},
"GiftofOdyssey": {
"Collect": true,
"GiftofOdysseyClaimed": {}
} }
}, },
"Weekly": { "Weekly": {

View File

@ -1378,6 +1378,18 @@
"type": "checkbox", "type": "checkbox",
"value": true "value": true
} }
},
"GiftofOdyssey": {
"Collect": {
"type": "checkbox",
"value": true
},
"GiftofOdysseyClaimed": {
"type": "stored",
"value": {},
"display": "display",
"stored": "StoredInt"
}
} }
}, },
"Weekly": { "Weekly": {

View File

@ -136,6 +136,11 @@ DungeonStorage:
color: "#8fb5fe" color: "#8fb5fe"
SupportReward: SupportReward:
Collect: true Collect: true
GiftofOdyssey:
Collect: true
GiftofOdysseyClaimed:
stored: StoredInt
display: display
Planner: Planner:
PlannerOverall: PlannerOverall:
stored: StoredPlannerOverall stored: StoredPlannerOverall

View File

@ -951,6 +951,18 @@
"order": 0, "order": 0,
"color": "#777777" "color": "#777777"
}, },
"GiftofOdysseyClaimed": {
"name": "GiftofOdysseyClaimed",
"path": "Freebies.GiftofOdyssey.GiftofOdysseyClaimed",
"i18n": "GiftofOdyssey.GiftofOdysseyClaimed.name",
"stored": "StoredInt",
"attrs": {
"time": "2020-01-01 00:00:00",
"value": 0
},
"order": 0,
"color": "#777777"
},
"SimulatedUniverseFarm": { "SimulatedUniverseFarm": {
"name": "SimulatedUniverseFarm", "name": "SimulatedUniverseFarm",
"path": "Rogue.RogueWorld.SimulatedUniverseFarm", "path": "Rogue.RogueWorld.SimulatedUniverseFarm",

View File

@ -50,6 +50,7 @@ Daily:
Freebies: Freebies:
- Scheduler - Scheduler
- SupportReward - SupportReward
- GiftofOdyssey
# ==================== Weekly ==================== # ==================== Weekly ====================

View File

@ -67,6 +67,10 @@ class GeneratedConfig:
# Group `SupportReward` # Group `SupportReward`
SupportReward_Collect = True SupportReward_Collect = True
# Group `GiftofOdyssey`
GiftofOdyssey_Collect = True
GiftofOdyssey_GiftofOdysseyClaimed = {}
# Group `Planner` # Group `Planner`
Planner_PlannerOverall = {} Planner_PlannerOverall = {}
Planner_Item_Credit = {} Planner_Item_Credit = {}

View File

@ -500,6 +500,20 @@
"help": "" "help": ""
} }
}, },
"GiftofOdyssey": {
"_info": {
"name": "Gift of Odyssey",
"help": ""
},
"Collect": {
"name": "Claim Gift of Odyssey",
"help": ""
},
"GiftofOdysseyClaimed": {
"name": "Claimed X days of reward",
"help": ""
}
},
"Planner": { "Planner": {
"_info": { "_info": {
"name": "Character Planner Progress", "name": "Character Planner Progress",

View File

@ -500,6 +500,20 @@
"help": "" "help": ""
} }
}, },
"GiftofOdyssey": {
"_info": {
"name": "GiftofOdyssey._info.name",
"help": "GiftofOdyssey._info.help"
},
"Collect": {
"name": "GiftofOdyssey.Collect.name",
"help": "GiftofOdyssey.Collect.help"
},
"GiftofOdysseyClaimed": {
"name": "GiftofOdyssey.GiftofOdysseyClaimed.name",
"help": "GiftofOdyssey.GiftofOdysseyClaimed.help"
}
},
"Planner": { "Planner": {
"_info": { "_info": {
"name": "Progreso del planificador de personajes", "name": "Progreso del planificador de personajes",

View File

@ -500,6 +500,20 @@
"help": "" "help": ""
} }
}, },
"GiftofOdyssey": {
"_info": {
"name": "GiftofOdyssey._info.name",
"help": "GiftofOdyssey._info.help"
},
"Collect": {
"name": "GiftofOdyssey.Collect.name",
"help": "GiftofOdyssey.Collect.help"
},
"GiftofOdysseyClaimed": {
"name": "GiftofOdyssey.GiftofOdysseyClaimed.name",
"help": "GiftofOdyssey.GiftofOdysseyClaimed.help"
}
},
"Planner": { "Planner": {
"_info": { "_info": {
"name": "Planner._info.name", "name": "Planner._info.name",

View File

@ -500,6 +500,20 @@
"help": "" "help": ""
} }
}, },
"GiftofOdyssey": {
"_info": {
"name": "巡星之礼(版本十连)",
"help": ""
},
"Collect": {
"name": "领取巡星之礼",
"help": ""
},
"GiftofOdysseyClaimed": {
"name": "已领取 X 天",
"help": ""
}
},
"Planner": { "Planner": {
"_info": { "_info": {
"name": "养成规划进度", "name": "养成规划进度",

View File

@ -500,6 +500,20 @@
"help": "" "help": ""
} }
}, },
"GiftofOdyssey": {
"_info": {
"name": "GiftofOdyssey._info.name",
"help": "GiftofOdyssey._info.help"
},
"Collect": {
"name": "GiftofOdyssey.Collect.name",
"help": "GiftofOdyssey.Collect.help"
},
"GiftofOdysseyClaimed": {
"name": "GiftofOdyssey.GiftofOdysseyClaimed.name",
"help": "GiftofOdyssey.GiftofOdysseyClaimed.help"
}
},
"Planner": { "Planner": {
"_info": { "_info": {
"name": "養成規劃進度", "name": "養成規劃進度",

View File

@ -114,4 +114,5 @@ class StoredGenerated:
CloudRemainSeasonPass = StoredInt("DataUpdate.CloudStorage.CloudRemainSeasonPass") CloudRemainSeasonPass = StoredInt("DataUpdate.CloudStorage.CloudRemainSeasonPass")
CloudRemainPaid = StoredInt("DataUpdate.CloudStorage.CloudRemainPaid") CloudRemainPaid = StoredInt("DataUpdate.CloudStorage.CloudRemainPaid")
CloudRemainFree = StoredInt("DataUpdate.CloudStorage.CloudRemainFree") CloudRemainFree = StoredInt("DataUpdate.CloudStorage.CloudRemainFree")
GiftofOdysseyClaimed = StoredInt("Freebies.GiftofOdyssey.GiftofOdysseyClaimed")
SimulatedUniverseFarm = StoredSimulatedUniverseElite("Rogue.RogueWorld.SimulatedUniverseFarm") SimulatedUniverseFarm = StoredSimulatedUniverseElite("Rogue.RogueWorld.SimulatedUniverseFarm")

View File

@ -1,6 +1,8 @@
from module.logger import logger from module.logger import logger
from module.base.base import ModuleBase from module.base.base import ModuleBase
from tasks.freebies.support_reward import SupportReward from tasks.freebies.support_reward import SupportReward
from tasks.freebies.gift_of_odyssey import GiftofOdyssey
class Freebies(ModuleBase): class Freebies(ModuleBase):
def run(self): def run(self):
@ -10,5 +12,12 @@ class Freebies(ModuleBase):
if self.config.SupportReward_Collect: if self.config.SupportReward_Collect:
logger.hr('Support Reward') logger.hr('Support Reward')
SupportReward(config=self.config, device=self.device).run() SupportReward(config=self.config, device=self.device).run()
if self.config.GiftofOdyssey_Collect:
logger.hr('Gift of Odyssey')
if self.config.stored.GiftofOdysseyClaimed == 7:
logger.hr('All Claimed in this patch')
else:
GiftofOdyssey(config=self.config, device=self.device).run()
self.config.task_delay(server_update=True) self.config.task_delay(server_update=True)

View File

@ -30,7 +30,8 @@ class GiftofOdyssey(UI):
self.device.screenshot() self.device.screenshot()
results = ocr.matched_ocr(self.device.image, GiftOfOdysseyEvent) results = ocr.matched_ocr(self.device.image, GiftOfOdysseyEvent)
if len(results) == 0 and timer.reached(): if len(results) == 0 and timer.reached():
logger.info("Event not found") logger.info("Event not found, probably already been claimed")
self.config.stored.GiftofOdysseyClaimed.value = 7
return False return False
if len(results) == 1: if len(results) == 1:
break break
@ -58,6 +59,7 @@ class GiftofOdyssey(UI):
logger.info(f"Claim status (Claimed, Claim, Awaiting check in): {status}") logger.info(f"Claim status (Claimed, Claim, Awaiting check in): {status}")
if sum(status) != 7: if sum(status) != 7:
logger.warning("Num of OCR results is not seven") logger.warning("Num of OCR results is not seven")
self.config.stored.GiftofOdysseyClaimed.value = status[0]
return status return status
def _get_reward(self): def _get_reward(self):