1
0
mirror of https://github.com/sui-feng-cb/AzurLaneAutoScript1.git synced 2026-08-16 20:10:29 +08:00

Fix: missing ime check before equip code export

This commit is contained in:
guoh064
2026-08-14 22:09:50 +08:00
parent ef4ac76bba
commit 16ef6e3dae

View File

@@ -162,6 +162,9 @@ class EquipmentCodeHandler(StorageHandler):
def set_fastinput_ime(self): def set_fastinput_ime(self):
d = self.device.u2 d = self.device.u2
name, _ = d.current_ime()
if name == self.FASTINPUT_IME:
return
failed = False failed = False
try: try:
for command in ('enable', 'set'): for command in ('enable', 'set'):
@@ -185,11 +188,10 @@ class EquipmentCodeHandler(StorageHandler):
click_timer = Timer(1, count=3) click_timer = Timer(1, count=3)
for _ in self.loop(): for _ in self.loop():
name, shown = d.current_ime() name, shown = d.current_ime()
if shown:
if name != self.FASTINPUT_IME: if name != self.FASTINPUT_IME:
self.set_fastinput_ime() self.set_fastinput_ime()
continue continue
else: if shown:
break break
if click_timer.reached_and_reset(): if click_timer.reached_and_reset():
self.device.click(EQUIPMENT_CODE_TEXTBOX) self.device.click(EQUIPMENT_CODE_TEXTBOX)
@@ -244,6 +246,7 @@ class EquipmentCodeHandler(StorageHandler):
def _code_export(self): def _code_export(self):
self.handle_info_bar() self.handle_info_bar()
d = self.device.u2 d = self.device.u2
self.set_fastinput_ime()
for _ in self.loop(timeout=10): for _ in self.loop(timeout=10):
if self.info_bar_count(): if self.info_bar_count():
break break