Skip to content

Commit

Permalink
Don't use stored unity version when applying Translation UI (.languag…
Browse files Browse the repository at this point in the history
…especificassets files)

See #9 and #215
  • Loading branch information
drojf committed Jul 15, 2023
1 parent a39aac5 commit 4899732
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions higurashiInstaller.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,13 +316,18 @@ def _applyLanguageSpecificSharedAssets(self, folderToApply):
Returns False if there was an error during the proccess.
If no asset file was found to apply, this is not considered an error
(it's assumed the existing sharedassets0.assets is the correct one)"""
# If don't know own unity version, don't attempt to apply any UI
if self.info.unityVersion is None:
# Get the unity version (again) from the existing resources.assets file
# We don't use the version stored in self.info.unityVersion because on certain configurations,
# the mod itself updates the unity version, causing it to change mid-install.
try:
versionString = installConfiguration.getUnityVersion(self.dataDirectory)
except Exception as e:
# If don't know own unity version, don't attempt to apply any UI
print("ERROR (_applyLanguageSpecificSharedAssets()): Failed to retrieve unity version from resources.assets as {}".format(e))
print("ERROR: can't apply UI file as don't know own unity version!")
return False

# Use the sharedassets file with matching os/unityversion if provided by the language patch
versionString = self.info.unityVersion
osString = common.Globals.OS_STRING
if self.isWine:
osString = "windows"
Expand Down

0 comments on commit 4899732

Please sign in to comment.