1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-30 14:23:51 +08:00
This commit is contained in:
GH Action - Upstream Sync
2026-03-28 14:39:56 +00:00
17 changed files with 109 additions and 53 deletions

View File

@@ -332,7 +332,7 @@ class LDOpenGL(Platform):
if not self.is_ldplayer_bluestacks_family:
return False
logger.attr('EmulatorInfo_Emulator', self.config.EmulatorInfo_Emulator)
if self.config.EmulatorInfo_Emulator not in ['LDPlayer9']:
if self.config.EmulatorInfo_Emulator not in ['LDPlayer9', 'LDPlayer14']:
return False
try:

View File

@@ -155,7 +155,8 @@ class EmulatorBase:
LDPlayer3 = 'LDPlayer3'
LDPlayer4 = 'LDPlayer4'
LDPlayer9 = 'LDPlayer9'
LDPlayerFamily = [LDPlayer3, LDPlayer4, LDPlayer9]
LDPlayer14 = 'LDPlayer14'
LDPlayerFamily = [LDPlayer3, LDPlayer4, LDPlayer9, LDPlayer14]
MuMuPlayer = 'MuMuPlayer'
MuMuPlayerX = 'MuMuPlayerX'
MuMuPlayer12 = 'MuMuPlayer12'

View File

@@ -110,6 +110,8 @@ class Emulator(EmulatorBase):
return cls.LDPlayer4
elif dir1 == 'ldplayer9':
return cls.LDPlayer9
elif dir1 == 'ldplayer14':
return cls.LDPlayer14
else:
return cls.LDPlayer3
if exe == 'nemuplayer.exe':
@@ -538,8 +540,11 @@ class EmulatorManager(EmulatorManagerBase):
exe.add(file)
# LDPlayer install path
for path in [r'SOFTWARE\leidian\ldplayer',
r'SOFTWARE\leidian\ldplayer9']:
for path in [
r'SOFTWARE\leidian\ldplayer',
r'SOFTWARE\leidian\ldplayer9',
r'SOFTWARE\leidian\ldplayer14',
]:
ld = self.get_install_dir_from_reg(path, 'InstallDir')
if ld:
ld = abspath(os.path.join(ld, './dnplayer.exe'))

View File

@@ -181,6 +181,20 @@ class PlatformBase(Connection, EmulatorManagerBase):
logger.info(f'Found emulator instance: {instance}')
return instance
# search by emulator type first, which is the easiest setting for user to setup, so more trustworthy
# Multiple instances in given serial, name and path, search by emulator
if emulator:
search_args['type'] = emulator
select = instances.select(**search_args)
if select.count == 0:
logger.warning(f'No emulator instances with {search_args}, type invalid')
search_args.pop('type')
elif select.count == 1:
instance = select[0]
logger.hr('Emulator instance', level=2)
logger.info(f'Found emulator instance: {instance}')
return instance
# Multiple instances in given serial, search by name
if name:
search_args['name'] = name
@@ -207,19 +221,6 @@ class PlatformBase(Connection, EmulatorManagerBase):
logger.info(f'Found emulator instance: {instance}')
return instance
# Multiple instances in given serial, name and path, search by emulator
if emulator:
search_args['type'] = emulator
select = instances.select(**search_args)
if select.count == 0:
logger.warning(f'No emulator instances with {search_args}, type invalid')
search_args.pop('type')
elif select.count == 1:
instance = select[0]
logger.hr('Emulator instance', level=2)
logger.info(f'Found emulator instance: {instance}')
return instance
# Still too many instances, search from running emulators
running = remove_duplicated_path(list(self.iter_running_emulator()))
logger.info('Running emulators')