From 77df52da34ce4dd4df3c67b7879d3fd7eb40b440 Mon Sep 17 00:00:00 2001 From: Zuosizhu <60862861+Zuosizhu@users.noreply.github.com> Date: Sat, 8 Apr 2023 17:15:31 +0800 Subject: [PATCH] Fix: use config.server instead of choose another time in GG Handler --- config/template.json | 1 - module/config/argument/args.json | 10 ---------- module/config/argument/argument.yaml | 3 --- module/config/config_generated.py | 1 - module/config/i18n/en-US.json | 8 -------- module/config/i18n/ja-JP.json | 8 -------- module/config/i18n/zh-CN.json | 8 -------- module/config/i18n/zh-TW.json | 8 -------- module/gg_handler/gg_u2.py | 4 ++-- 9 files changed, 2 insertions(+), 49 deletions(-) diff --git a/config/template.json b/config/template.json index dd663ac79..78831f8e3 100644 --- a/config/template.json +++ b/config/template.json @@ -2012,7 +2012,6 @@ }, "GGHandler": { "Enabled": false, - "ServerLocation": "cn", "GGMethod": "u2", "RestartATX": false, "GGPackageName": "com.", diff --git a/module/config/argument/args.json b/module/config/argument/args.json index 79063b5e6..e9ac56d8f 100644 --- a/module/config/argument/args.json +++ b/module/config/argument/args.json @@ -9657,16 +9657,6 @@ "type": "checkbox", "value": false }, - "ServerLocation": { - "type": "select", - "value": "cn", - "option": [ - "cn", - "jp", - "en", - "tw" - ] - }, "GGMethod": { "type": "select", "value": "u2", diff --git a/module/config/argument/argument.yaml b/module/config/argument/argument.yaml index 6c6213318..5612643c6 100644 --- a/module/config/argument/argument.yaml +++ b/module/config/argument/argument.yaml @@ -685,9 +685,6 @@ GameManager: GGHandler: Enabled: false - ServerLocation: - value: cn - option: [ cn, jp, en, tw ] GGMethod: value: u2 option: [ u2 ] diff --git a/module/config/config_generated.py b/module/config/config_generated.py index 4f49a7f01..8b29a1d5a 100644 --- a/module/config/config_generated.py +++ b/module/config/config_generated.py @@ -435,7 +435,6 @@ class GeneratedConfig: # Group `GGHandler` GGHandler_Enabled = False - GGHandler_ServerLocation = 'cn' # cn, jp, en, tw GGHandler_GGMethod = 'u2' # u2 GGHandler_RestartATX = False GGHandler_GGPackageName = 'com.' diff --git a/module/config/i18n/en-US.json b/module/config/i18n/en-US.json index 335ad7b0a..6fe085692 100644 --- a/module/config/i18n/en-US.json +++ b/module/config/i18n/en-US.json @@ -2428,14 +2428,6 @@ "name": "Enabled", "help": "" }, - "ServerLocation": { - "name": "Server location", - "help": "", - "cn": "CN", - "jp": "JP", - "en": "EN", - "tw": "TW" - }, "GGMethod": { "name": "Control Method", "help": "Screenshot is slow and has some bugs, only for environments that not support UiAutomator", diff --git a/module/config/i18n/ja-JP.json b/module/config/i18n/ja-JP.json index a7a5ccca9..f3f105e82 100644 --- a/module/config/i18n/ja-JP.json +++ b/module/config/i18n/ja-JP.json @@ -2428,14 +2428,6 @@ "name": "GGHandler.Enabled.name", "help": "GGHandler.Enabled.help" }, - "ServerLocation": { - "name": "GGHandler.ServerLocation.name", - "help": "GGHandler.ServerLocation.help", - "cn": "cn", - "jp": "jp", - "en": "en", - "tw": "tw" - }, "GGMethod": { "name": "GGHandler.GGMethod.name", "help": "GGHandler.GGMethod.help", diff --git a/module/config/i18n/zh-CN.json b/module/config/i18n/zh-CN.json index 02a79e0c6..c281f43cd 100644 --- a/module/config/i18n/zh-CN.json +++ b/module/config/i18n/zh-CN.json @@ -2428,14 +2428,6 @@ "name": "启用该功能", "help": "注意事项!若GG打开则应该启用该功能以达成防弹窗卡重启\n只能使用指定的lua,会自动推送至/sdcard/Notes/Multiplier.lua\n演习,共斗,Meta信标时会自动关闭倍率" }, - "ServerLocation": { - "name": "服务器地区", - "help": "", - "cn": "国服", - "jp": "日服", - "en": "国际服", - "tw": "台服" - }, "GGMethod": { "name": "GG操作方法", "help": "推荐UiAutomator2\n截图由于公版更新已经不再可用\n红手指,vmos环境,以及蓝叠模拟器有概率无法使用。", diff --git a/module/config/i18n/zh-TW.json b/module/config/i18n/zh-TW.json index ba38cd130..7881078c0 100644 --- a/module/config/i18n/zh-TW.json +++ b/module/config/i18n/zh-TW.json @@ -2428,14 +2428,6 @@ "name": "啟用該功能", "help": "注意事項!若GG打開則應該啟用該功能以達成防彈窗卡重啓\n只能使用指定的lua,會自動推送至/sdcard/Notes/Multiplier.lua\n演習,共鬥,Meta信標時會自動關閉倍率" }, - "ServerLocation": { - "name": "Server location", - "help": "", - "cn": "國服", - "jp": "JP", - "en": "EN", - "tw": "台服" - }, "GGMethod": { "name": "GG操作方法", "help": "推薦UiAutomator2,但未填寫包名時會使用截圖\n截圖相容性較差(已知逍遙模擬器無法使用)\n無法安裝UiAutomator2(如紅手指,vmos環境)時可嘗試使用\n使用截圖時,開啟模擬器後需要手動打開GG,將GG懸浮窗遮擋住石油圖標。 第一次使用還需要手動指定好lua路徑。", diff --git a/module/gg_handler/gg_u2.py b/module/gg_handler/gg_u2.py index 6aab0d246..86975bd15 100644 --- a/module/gg_handler/gg_u2.py +++ b/module/gg_handler/gg_u2.py @@ -36,7 +36,7 @@ class GGU2(Base): 'jp' : 'アズールレーン', 'tw' : '碧藍航線' } - _server = deep_get(d=self.config.data, keys='GameManager.GGHandler.ServerLocation', default='cn') + _server = self.config.SERVER _name = _name_dict[_server] self.factor = factor ggdata = GGData(self.config).get_data() @@ -115,7 +115,7 @@ class GGU2(Base): self.device.sleep(0.3) continue if self.d.xpath('//*[@text="重启游戏"]').exists: - self.d.d.xpath('//*[@text="重启游戏"]').click() + self.d.xpath('//*[@text="重启游戏"]').click() logger.info('GG Panel after game died exists, restart the game') logger.info('Click Restart') self.device.sleep(0.3)