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": {
"Collect": true
},
"GiftofOdyssey": {
"Collect": true,
"GiftofOdysseyClaimed": {}
}
},
"Weekly": {

View File

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

View File

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

View File

@ -951,6 +951,18 @@
"order": 0,
"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": {
"name": "SimulatedUniverseFarm",
"path": "Rogue.RogueWorld.SimulatedUniverseFarm",

View File

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

View File

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

View File

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

View File

@ -500,6 +500,20 @@
"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": {
"_info": {
"name": "Progreso del planificador de personajes",

View File

@ -500,6 +500,20 @@
"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": {
"_info": {
"name": "Planner._info.name",

View File

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

View File

@ -500,6 +500,20 @@
"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": {
"_info": {
"name": "養成規劃進度",

View File

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

View File

@ -1,6 +1,8 @@
from module.logger import logger
from module.base.base import ModuleBase
from tasks.freebies.support_reward import SupportReward
from tasks.freebies.gift_of_odyssey import GiftofOdyssey
class Freebies(ModuleBase):
def run(self):
@ -10,5 +12,12 @@ class Freebies(ModuleBase):
if self.config.SupportReward_Collect:
logger.hr('Support Reward')
SupportReward(config=self.config, device=self.device).run()
self.config.task_delay(server_update=True)
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)

View File

@ -30,7 +30,8 @@ class GiftofOdyssey(UI):
self.device.screenshot()
results = ocr.matched_ocr(self.device.image, GiftOfOdysseyEvent)
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
if len(results) == 1:
break
@ -58,6 +59,7 @@ class GiftofOdyssey(UI):
logger.info(f"Claim status (Claimed, Claim, Awaiting check in): {status}")
if sum(status) != 7:
logger.warning("Num of OCR results is not seven")
self.config.stored.GiftofOdysseyClaimed.value = status[0]
return status
def _get_reward(self):