Explorar o código

fix(Component): update switch soul translations

runhey %!s(int64=3) %!d(string=hai) anos
pai
achega
e352f1e80e

BIN=BIN
module/config/i18n/zh_CN.qm


+ 4 - 2
module/config/i18n/zh_CN.ts

@@ -532,8 +532,10 @@ mode_3策略是刷到五个契灵后开始结契,选择高级、中级盘来
 "1,2"表示第一个预设组,第二个队伍
 请使用英文输入法下的逗号
 预设组支持[1-7], 预设队伍支持[1-4]</translation></message>
-	<message><source>group_name</source><translation>御魂分组名</translation></message>
-	<message><source>team_name</source><translation>队伍名</translation></message>
+	<message><source>Group Name</source><translation>御魂分组名</translation></message>
+	<message><source>Team Name</source><translation>队伍名</translation></message>
+	<message><source>Enable Switch By Name</source><translation>通过OCR来切换御魂预设</translation></message>
+	<message><source>enable_switch_by_name_help</source><translation>这是切换御魂的另一种方式,对比上方的方式而言支持更多的预设,但是同样的你还确保预设队伍是锁定状态的</translation></message>
 </context>
 <context>
     <name>Args</name>

+ 13 - 9
tasks/Component/SwitchSoul/switch_soul.py

@@ -88,13 +88,16 @@ class SwitchSoul(BaseTask, SwitchSoulAssets):
             raise ValueError('Switch soul_one team must be in [1-4]')
         # 这一步是选择组
         target_click, target_check = get_group_assets(group)
-        while 1:
-            self.screenshot()
-            if self.click(target_click, interval=1):
-                continue
-            if self.appear(target_check):
-                break
-
+        # while 1:
+        #     self.screenshot()
+        #     if self.click(target_click, interval=1):
+        #         continue
+        #     if self.appear(target_check):
+        #         break
+        # 2023.8.5 修改为无反馈的点击切换
+        for i in range(2):
+            self.click(target_click)
+            sleep(0.5)
         # 点击队伍
         target_team = get_team_asset(team)
         for i in range(3):
@@ -213,7 +216,7 @@ class SwitchSoul(BaseTask, SwitchSoulAssets):
             if self.ocr_appear_click(self.O_SS_TEAM_NAME):
                 break
         # 切换御魂
-        for i in range(6):
+        for i in range(5):
             sleep(0.8)
             self.screenshot()
             if self.appear_then_click(self.I_SOU_CLICK_PRESENT, interval=1):
@@ -230,4 +233,5 @@ if __name__ == '__main__':
     s = SwitchSoul(c, d)
 
     s.click_preset()
-    s.switch_soul_one(2, 1)
+    # s.switch_soul_one(2, 1)
+    s.switch_soul_by_name('契灵', '茨球')

+ 3 - 3
tasks/Component/SwitchSoul/switch_soul_config.py

@@ -10,6 +10,6 @@ from datetime import datetime, time
 class SwitchSoulConfig(BaseModel):
     enable: bool = Field(default=False)
     switch_group_team: str = Field(default='-1,-1', description='switch_group_team_help')
-    enable_switch_by_name: bool = Field(default=False)
-    group_name: str = Field(default='', description='group_name')
-    team_name: str = Field(default='', description='team_name')
+    enable_switch_by_name: bool = Field(default=False, description='enable_switch_by_name_help')
+    group_name: str = Field(default='')
+    team_name: str = Field(default='')