diff --git a/tasks/combat/obtain.py b/tasks/combat/obtain.py index b73b5f8e6..cfd6df70f 100644 --- a/tasks/combat/obtain.py +++ b/tasks/combat/obtain.py @@ -253,7 +253,13 @@ class CombatObtain(PlannerMixin): ItemAmount: Arrow_of_the_Beast_Hunter, 85 """ self.planner.load_obtained_amount(items) - self.planner_write() + with self.config.multi_set(): + self.planner_write() + # Sync to dashboard + for item in items: + if item.item.name == 'Credit': + self.config.stored.Credit.value = item.value + return items def obtained_is_full(self, dungeon: DungeonList | None, wave_done=0, obtain_get=True) -> bool: diff --git a/tasks/item/data_update.py b/tasks/item/data_update.py index 71177328f..8423f74b8 100644 --- a/tasks/item/data_update.py +++ b/tasks/item/data_update.py @@ -7,6 +7,7 @@ from tasks.base.page import page_item from tasks.item.assets.assets_item_data import OCR_DATA from tasks.item.keywords import KEYWORDS_ITEM_TAB from tasks.item.ui import ItemUI +from tasks.planner.model import PlannerMixin class DataDigit(Digit): @@ -16,7 +17,7 @@ class DataDigit(Digit): return super().after_process(result) -class DataUpdate(ItemUI): +class DataUpdate(ItemUI, PlannerMixin): def _get_data(self): """ Page: @@ -53,3 +54,9 @@ class DataUpdate(ItemUI): self.config.stored.Credit.value = credit self.config.stored.StallerJade.value = jade self.config.task_delay(server_update=True) + # Sync to planner + require = self.config.cross_get('Dungeon.Planner.Item_Credit.total', default=0) + if require: + self.config.cross_set('Dungeon.Planner.Item_Credit.value', credit) + self.config.cross_set('Dungeon.Planner.Item_Credit.time', self.config.stored.Credit.time) + self.planner_write() diff --git a/tasks/planner/model.py b/tasks/planner/model.py index ba14f3d4b..bf29b9bdc 100644 --- a/tasks/planner/model.py +++ b/tasks/planner/model.py @@ -652,6 +652,15 @@ class PlannerMixin(UI): if add: planner.add_planner_result(self.planner) + # Load from dashboard + try: + row = planner.rows['Credit'] + value = self.config.stored.Credit.value + if value: + row.value = value + except KeyError: + pass + self.planner_write(planner) @cached_property