Skip to content

Commit 112f75b

Browse files
committed
Don't use stored unity version when applying Translation UI (.languagespecificassets files)
See #9 and #215
1 parent 63097ab commit 112f75b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

higurashiInstaller.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -324,13 +324,18 @@ def _applyLanguageSpecificSharedAssets(self, folderToApply):
324324
Returns False if there was an error during the proccess.
325325
If no asset file was found to apply, this is not considered an error
326326
(it's assumed the existing sharedassets0.assets is the correct one)"""
327-
# If don't know own unity version, don't attempt to apply any UI
328-
if self.info.unityVersion is None:
327+
# Get the unity version (again) from the existing resources.assets file
328+
# We don't use the version stored in self.info.unityVersion because on certain configurations,
329+
# the mod itself updates the unity version, causing it to change mid-install.
330+
try:
331+
versionString = installConfiguration.getUnityVersion(self.dataDirectory)
332+
except Exception as e:
333+
# If don't know own unity version, don't attempt to apply any UI
334+
print("ERROR (_applyLanguageSpecificSharedAssets()): Failed to retrieve unity version from resources.assets as {}".format(e))
329335
print("ERROR: can't apply UI file as don't know own unity version!")
330336
return False
331337

332338
# Use the sharedassets file with matching os/unityversion if provided by the language patch
333-
versionString = self.info.unityVersion
334339
osString = common.Globals.OS_STRING
335340
if self.isWine:
336341
osString = "windows"

0 commit comments

Comments
 (0)