@@ -308,15 +308,30 @@ def _applyLanguageSpecificSharedAssets(self, folderToApply):
308
308
osString = "windows"
309
309
print ("Language Patch UI: Proton/Wine detected! Forcing install of Windows sharedassets0.assets." )
310
310
311
+ # TODO: use the sharedassets0.assets.backup to determine store name?
312
+ # For now, only differentiate steam/non-steam
313
+ # Or if can prove that it's always steam+mangagamer and gog, then can leave as-is
314
+ if self .isSteam :
315
+ print ("Language Patch UI: Assuming store is Steam/Mangagamer" )
316
+ storeName = 'steam'
317
+ else :
318
+ print ("Language Patch UI: Assuming store is GOG" )
319
+ storeName = 'gog'
320
+
321
+ bestAltUIPath = None
311
322
for altUIFilename in os .listdir (folderToApply ):
312
323
altUIPath = os .path .join (folderToApply , altUIFilename )
313
324
_ , ext = os .path .splitext (altUIFilename )
314
325
if ext .lower () == '.assets' or ext .lower () == '.languagespecificassets' :
315
326
if os .path .isfile (altUIPath ) and versionString in altUIFilename .lower () and osString in altUIFilename .lower ():
316
- uiPath = path .join (folderToApply , "sharedassets0.assets" )
317
- print ("Language Patch UI: Will copy UI File {} -> {}" .format (altUIPath , uiPath ))
318
- shutil .copy (altUIPath , uiPath )
319
- return True
327
+ if bestAltUIPath is None or storeName in altUIFilename .lower ():
328
+ bestAltUIPath = altUIPath
329
+
330
+ if bestAltUIPath is not None :
331
+ uiPath = path .join (folderToApply , "sharedassets0.assets" )
332
+ print ("Language Patch UI: Will copy UI File {} -> {}" .format (bestAltUIPath , uiPath ))
333
+ shutil .copy (bestAltUIPath , uiPath )
334
+ return True
320
335
321
336
print ("Language Patch UI: No UI/sharedassets0 found for ({},{}) - using default sharedassets0.assets" .format (osString , versionString ))
322
337
return True
0 commit comments