From 026860508a566148e6e12c5159e7931cbc800b35 Mon Sep 17 00:00:00 2001 From: 0O0o0oOoO00 <11174151+0O0o0oOoO00@users.noreply.github.com> Date: Thu, 11 Sep 2025 23:56:53 +0800 Subject: [PATCH] add: add shop enable setting for each shop in shop once --- config/template.json | 4 +++ module/config/argument/args.json | 16 +++++++++ module/config/argument/argument.yaml | 4 +++ module/config/config_generated.py | 4 +++ module/config/full_config_generated.py | 4 +++ module/config/i18n/en-US.json | 16 +++++++++ module/config/i18n/ja-JP.json | 16 +++++++++ module/config/i18n/zh-CN.json | 16 +++++++++ module/config/i18n/zh-TW.json | 16 +++++++++ module/shop/shop_reward.py | 47 ++++++++++++++++++++++++++ 10 files changed, 143 insertions(+) diff --git a/config/template.json b/config/template.json index ef920011e..f2e1a3ffa 100644 --- a/config/template.json +++ b/config/template.json @@ -2086,6 +2086,7 @@ "ServerUpdate": "00:00" }, "GuildShop": { + "Enable": true, "Refresh": true, "Filter": "PlateT4 > BookT3 > PR > CatT3 > Chip > BookT2 > Retrofit > FoodT6 > FoodT5 > CatT2 > BoxT4", "BOX_T3": "ironblood", @@ -2102,6 +2103,7 @@ "PR3": "cheshire" }, "MedalShop2": { + "Enable": true, "Filter": "DR > PR\n> BookRedT3 > BookYellowT3 > BookBlueT3\n> BookRedT2 > BookYellowT2 > BookBlueT2\n> RetrofitT3\n> FoodT6 > FoodT5\n> PlateGeneralT3 > PlateWildT3", "RETROFIT_T1": "cl", "RETROFIT_T2": "cl", @@ -2111,10 +2113,12 @@ "PLATE_T3": "general" }, "MeritShop": { + "Enable": true, "Refresh": false, "Filter": "Cube" }, "CoreShop": { + "Enable": true, "Filter": "Array" }, "Storage": { diff --git a/module/config/argument/args.json b/module/config/argument/args.json index 4643123b4..e0bb784ce 100644 --- a/module/config/argument/args.json +++ b/module/config/argument/args.json @@ -14591,6 +14591,10 @@ } }, "GuildShop": { + "Enable": { + "type": "checkbox", + "value": true + }, "Refresh": { "type": "checkbox", "value": true @@ -14724,6 +14728,10 @@ } }, "MedalShop2": { + "Enable": { + "type": "checkbox", + "value": true + }, "Filter": { "type": "textarea", "value": "DR > PR\n> BookRedT3 > BookYellowT3 > BookBlueT3\n> BookRedT2 > BookYellowT2 > BookBlueT2\n> RetrofitT3\n> FoodT6 > FoodT5\n> PlateGeneralT3 > PlateWildT3" @@ -14793,6 +14801,10 @@ } }, "MeritShop": { + "Enable": { + "type": "checkbox", + "value": true + }, "Refresh": { "type": "checkbox", "value": false @@ -14803,6 +14815,10 @@ } }, "CoreShop": { + "Enable": { + "type": "checkbox", + "value": true + }, "Filter": { "type": "textarea", "value": "Array" diff --git a/module/config/argument/argument.yaml b/module/config/argument/argument.yaml index b9b436d35..cf3f4dafe 100644 --- a/module/config/argument/argument.yaml +++ b/module/config/argument/argument.yaml @@ -469,6 +469,7 @@ GeneralShop: > Cube > FoodT6 > FoodT5 GuildShop: + Enable: true Refresh: true Filter: |- PlateT4 > BookT3 > PR > CatT3 > Chip > BookT2 > Retrofit > FoodT6 > FoodT5 > CatT2 > BoxT4 @@ -509,6 +510,7 @@ GuildShop: value: cheshire option: [ cheshire, mainz, odin, champagne ] MedalShop2: + Enable: true Filter: |- DR > PR > BookRedT3 > BookYellowT3 > BookBlueT3 @@ -535,10 +537,12 @@ MedalShop2: value: general option: [ general, gun, torpedo, antiair, plane ] MeritShop: + Enable: true Refresh: false Filter: |- Cube CoreShop: + Enable: true Filter: |- Array ShipyardDr: diff --git a/module/config/config_generated.py b/module/config/config_generated.py index d75a809e4..84def64d1 100644 --- a/module/config/config_generated.py +++ b/module/config/config_generated.py @@ -266,6 +266,7 @@ class GeneratedConfig: GeneralShop_Filter = 'BookRedT3 > BookYellowT3 > BookBlueT3 > BookRedT2\n> Cube\n> FoodT6 > FoodT5' # Group `GuildShop` + GuildShop_Enable = True GuildShop_Refresh = True GuildShop_Filter = 'PlateT4 > BookT3 > PR > CatT3 > Chip > BookT2 > Retrofit > FoodT6 > FoodT5 > CatT2 > BoxT4' GuildShop_BOX_T3 = 'ironblood' # eagle, royal, sakura, ironblood @@ -282,6 +283,7 @@ class GeneratedConfig: GuildShop_PR3 = 'cheshire' # cheshire, mainz, odin, champagne # Group `MedalShop2` + MedalShop2_Enable = True MedalShop2_Filter = 'DR > PR\n> BookRedT3 > BookYellowT3 > BookBlueT3\n> BookRedT2 > BookYellowT2 > BookBlueT2\n> RetrofitT3\n> FoodT6 > FoodT5\n> PlateGeneralT3 > PlateWildT3' MedalShop2_RETROFIT_T1 = 'cl' # dd, cl, bb, cv MedalShop2_RETROFIT_T2 = 'cl' # dd, cl, bb, cv @@ -291,10 +293,12 @@ class GeneratedConfig: MedalShop2_PLATE_T3 = 'general' # general, gun, torpedo, antiair, plane # Group `MeritShop` + MeritShop_Enable = True MeritShop_Refresh = False MeritShop_Filter = 'Cube' # Group `CoreShop` + CoreShop_Enable = True CoreShop_Filter = 'Array' # Group `ShipyardDr` diff --git a/module/config/full_config_generated.py b/module/config/full_config_generated.py index 2e8579c1e..c0b3332ac 100644 --- a/module/config/full_config_generated.py +++ b/module/config/full_config_generated.py @@ -1551,6 +1551,7 @@ class FullGeneratedConfig: ShopOnce_Scheduler_SuccessInterval = None ShopOnce_Scheduler_FailureInterval = None ShopOnce_Scheduler_ServerUpdate = None + ShopOnce_GuildShop_Enable = None ShopOnce_GuildShop_Refresh = None ShopOnce_GuildShop_Filter = None ShopOnce_GuildShop_BOX_T3 = None @@ -1565,6 +1566,7 @@ class FullGeneratedConfig: ShopOnce_GuildShop_PR1 = None ShopOnce_GuildShop_PR2 = None ShopOnce_GuildShop_PR3 = None + ShopOnce_MedalShop2_Enable = None ShopOnce_MedalShop2_Filter = None ShopOnce_MedalShop2_RETROFIT_T1 = None ShopOnce_MedalShop2_RETROFIT_T2 = None @@ -1572,8 +1574,10 @@ class FullGeneratedConfig: ShopOnce_MedalShop2_PLATE_T1 = None ShopOnce_MedalShop2_PLATE_T2 = None ShopOnce_MedalShop2_PLATE_T3 = None + ShopOnce_MeritShop_Enable = None ShopOnce_MeritShop_Refresh = None ShopOnce_MeritShop_Filter = None + ShopOnce_CoreShop_Enable = None ShopOnce_CoreShop_Filter = None ShopOnce_Storage_Storage = None diff --git a/module/config/i18n/en-US.json b/module/config/i18n/en-US.json index 1ce8e1c56..fb17d19b1 100644 --- a/module/config/i18n/en-US.json +++ b/module/config/i18n/en-US.json @@ -1722,6 +1722,10 @@ "name": "Guild Shop Settings", "help": "" }, + "Enable": { + "name": "GuildShop.Enable.name", + "help": "GuildShop.Enable.help" + }, "Refresh": { "name": "Allow Shop Refresh", "help": "Refreshing will consume 50 guild coins, these are not valuable and it is recommended to have this enabled" @@ -1835,6 +1839,10 @@ "name": "Medal Shop Settings", "help": "" }, + "Enable": { + "name": "MedalShop2.Enable.name", + "help": "MedalShop2.Enable.help" + }, "Filter": { "name": "Item Filter", "help": "All options have been defined at \nDifferent from other shops, the below select options assist with filling the unknowns for the vague items 'Retrofit' and 'Plate'\nFurthermore restricted for 'Plate', there are both specific and wild types\nIf you are targeting a specific type then use a string combination such as 'PlateGeneralT3 > PlateWildT3' otherwise 'PlateT3' will purchase every available T3 Plate\nFor research blueprints it is adviseable to use 'DR > PR', players should convert surplus into Prototype Core currency" @@ -1896,6 +1904,10 @@ "name": "Merit Shop Settings", "help": "" }, + "Enable": { + "name": "MeritShop.Enable.name", + "help": "MeritShop.Enable.help" + }, "Refresh": { "name": "Allow Shop Refresh", "help": "Refreshing will consume 50 gems" @@ -1910,6 +1922,10 @@ "name": "Core Shop Settings", "help": "" }, + "Enable": { + "name": "CoreShop.Enable.name", + "help": "CoreShop.Enable.help" + }, "Filter": { "name": "Item Filter", "help": "All options have been defined at \nHowever unlike other shops, only Chip and Array are supported\nALAS does not browse, scroll, or recognize any other items displayed besides those two" diff --git a/module/config/i18n/ja-JP.json b/module/config/i18n/ja-JP.json index 8bbbe8a62..197284a46 100644 --- a/module/config/i18n/ja-JP.json +++ b/module/config/i18n/ja-JP.json @@ -1722,6 +1722,10 @@ "name": "GuildShop._info.name", "help": "GuildShop._info.help" }, + "Enable": { + "name": "GuildShop.Enable.name", + "help": "GuildShop.Enable.help" + }, "Refresh": { "name": "GuildShop.Refresh.name", "help": "GuildShop.Refresh.help" @@ -1835,6 +1839,10 @@ "name": "MedalShop._info.name", "help": "MedalShop._info.help" }, + "Enable": { + "name": "MedalShop2.Enable.name", + "help": "MedalShop2.Enable.help" + }, "Filter": { "name": "MedalShop.Filter.name", "help": "MedalShop.Filter.help" @@ -1896,6 +1904,10 @@ "name": "MeritShop._info.name", "help": "MeritShop._info.help" }, + "Enable": { + "name": "MeritShop.Enable.name", + "help": "MeritShop.Enable.help" + }, "Refresh": { "name": "MeritShop.Refresh.name", "help": "MeritShop.Refresh.help" @@ -1910,6 +1922,10 @@ "name": "CoreShop._info.name", "help": "CoreShop._info.help" }, + "Enable": { + "name": "CoreShop.Enable.name", + "help": "CoreShop.Enable.help" + }, "Filter": { "name": "CoreShop.Filter.name", "help": "CoreShop.Filter.help" diff --git a/module/config/i18n/zh-CN.json b/module/config/i18n/zh-CN.json index c6ef63d80..45ec9e91d 100644 --- a/module/config/i18n/zh-CN.json +++ b/module/config/i18n/zh-CN.json @@ -1722,6 +1722,10 @@ "name": "舰队商店", "help": "" }, + "Enable": { + "name": "购买该商店", + "help": "" + }, "Refresh": { "name": "刷新商店", "help": "刷新需要消耗50舰队币,舰队币不值钱,建议打开" @@ -1835,6 +1839,10 @@ "name": "功勋商店(退役兑换)", "help": "" }, + "Enable": { + "name": "购买该商店", + "help": "" + }, "Filter": { "name": "商店过滤器", "help": "" @@ -1896,6 +1904,10 @@ "name": "军需商店(演习商店)", "help": "" }, + "Enable": { + "name": "购买该商店", + "help": "" + }, "Refresh": { "name": "刷新商店", "help": "刷新需要消耗20钻石" @@ -1910,6 +1922,10 @@ "name": "核心兑换", "help": "" }, + "Enable": { + "name": "购买该商店", + "help": "" + }, "Filter": { "name": "商店过滤器", "help": "" diff --git a/module/config/i18n/zh-TW.json b/module/config/i18n/zh-TW.json index af79a16e1..ac40ddf80 100644 --- a/module/config/i18n/zh-TW.json +++ b/module/config/i18n/zh-TW.json @@ -1722,6 +1722,10 @@ "name": "艦隊商店", "help": "" }, + "Enable": { + "name": "GuildShop.Enable.name", + "help": "GuildShop.Enable.help" + }, "Refresh": { "name": "刷新艦隊商店", "help": "需要消耗50艦隊幣,艦隊幣不值錢,建議打開" @@ -1835,6 +1839,10 @@ "name": "功勳商店(退役兌換)", "help": "" }, + "Enable": { + "name": "MedalShop2.Enable.name", + "help": "MedalShop2.Enable.help" + }, "Filter": { "name": "商店過濾器", "help": "" @@ -1896,6 +1904,10 @@ "name": "軍需商店 (演習商店)", "help": "" }, + "Enable": { + "name": "MeritShop.Enable.name", + "help": "MeritShop.Enable.help" + }, "Refresh": { "name": "刷新軍需商店", "help": "需要消耗20鑽石" @@ -1910,6 +1922,10 @@ "name": "核心兌換", "help": "" }, + "Enable": { + "name": "CoreShop.Enable.name", + "help": "CoreShop.Enable.help" + }, "Filter": { "name": "商店過濾器", "help": "" diff --git a/module/shop/shop_reward.py b/module/shop/shop_reward.py index 3fd5f56df..c2bcfe15e 100644 --- a/module/shop/shop_reward.py +++ b/module/shop/shop_reward.py @@ -50,3 +50,50 @@ class RewardShop(ShopUI): MedalShop2_250814(self.config, self.device).run() self.config.task_delay(server_update=True) + + +class RewardShop(RewardShop): + + def buy_merit_shop(self): + self.device.click_record_clear() + self.shop_tab_250814.set(main=self, upper=1) + self.shop_nav_250814.set(main=self, left=2) + MeritShop_250814(self.config, self.device).run() + + def buy_guild_shop(self): + self.device.click_record_clear() + self.shop_tab_250814.set(main=self, upper=1) + self.shop_nav_250814.set(main=self, left=3) + GuildShop_250814(self.config, self.device).run() + + def buy_core_shop(self): + # core limited, core monthly, medal, prototype + self.device.click_record_clear() + self.shop_tab_250814.set(main=self, upper=2) + self.monthly_shop_nav_250814.set(main=self, left=2) + CoreShop_250814(self.config, self.device).run() + + def buy_medal_shop(self): + self.device.click_record_clear() + self.shop_tab_250814.set(main=self, upper=2) + self.monthly_shop_nav_250814.set(main=self, left=3) + MedalShop2_250814(self.config, self.device).run() + + def run_once(self): + # Munitions shops + if self.config.SERVER in ['tw']: + self.config.task_delay(server_update=True) + self.config.task_stop() + + self.ui_goto_shop() + + if self.config.full_config.ShopOnce_MeritShop_Enable: + self.buy_merit_shop() + if self.config.full_config.ShopOnce_GuildShop_Enable: + self.buy_guild_shop() + if self.config.full_config.ShopOnce_CoreShop_Enable: + self.buy_core_shop() + if self.config.full_config.ShopOnce_MedalShop2_Enable: + self.buy_medal_shop() + + self.config.task_delay(server_update=True)