@@ -89,8 +89,8 @@ def userDidPartialReinstall(self, gameInstallTimeProbePath):
89
89
return os .path .getctime (gameInstallTimeProbePath ) > os .path .getmtime (self .localVersionFilePath )
90
90
91
91
def __init__ (self , fullInstallConfiguration , modFileList , localVersionFolder , datadir = None , _testRemoteSubModVersion = None , verbosePrinting = True ):
92
- #type: (installConfiguration.FullInstallConfiguration, List[installConfiguration.ModFile], str, str, Optional[SubModVersionInfo], bool) -> None
93
- subMod = fullInstallConfiguration .subModConfig
92
+ #type: (installConfiguration.FullInstallConfiguration, List[installConfiguration.ModFile], str, str, Optional[SubModVersionInfo], bool, Optional[list[str]] ) -> None
93
+ subMod = fullInstallConfiguration .subModConfig # type: installConfiguration.SubModConfig
94
94
self .verbosePrinting = verbosePrinting
95
95
self .targetID = subMod .modName + '/' + subMod .subModName
96
96
self .unfilteredModFileList = modFileList
@@ -132,8 +132,14 @@ def __init__(self, fullInstallConfiguration, modFileList, localVersionFolder, da
132
132
for file in self .unfilteredModFileList :
133
133
self .updatesRequiredDict [file .id ] = (True , "Failed to retrieve remote version information" )
134
134
else :
135
+ forceUpdateList = []
136
+
137
+ # Always install script when language patch is enabled
138
+ if subMod .family == "higurashi" and modOptionParser .languagePatchIsEnabled :
139
+ forceUpdateList .append (ForceUpdate ('script' , 'Language patch option forces script re-install' ))
140
+
135
141
# Mark files which need update
136
- self .updatesRequiredDict = getFilesNeedingUpdate (self .unfilteredModFileList , self .localVersionInfo , self .remoteVersionInfo , repairMode = modOptionParser .repairMode )
142
+ self .updatesRequiredDict = getFilesNeedingUpdate (self .unfilteredModFileList , self .localVersionInfo , self .remoteVersionInfo , repairMode = modOptionParser .repairMode , forceUpdateList = forceUpdateList )
137
143
138
144
if verbosePrinting :
139
145
print ("\n Installer Update Information:" )
@@ -266,10 +272,15 @@ def getRemoteVersion(remoteTargetID):
266
272
267
273
return SubModVersionInfo (remoteVersionObject )
268
274
275
+ class ForceUpdate :
276
+ def __init__ (self , name , reason ):
277
+ #type: (str, str) -> None
278
+ self .name = name
279
+ self .reason = reason
269
280
270
281
# given a mod
271
- def getFilesNeedingUpdate (modFileList , localVersionInfo , remoteVersionInfo , repairMode ):
272
- #type: (List[installConfiguration.ModFile], SubModVersionInfo, SubModVersionInfo, bool) -> Dict[str, Tuple[bool, str]]
282
+ def getFilesNeedingUpdate (modFileList , localVersionInfo , remoteVersionInfo , repairMode , forceUpdateList = None ):
283
+ #type: (List[installConfiguration.ModFile], SubModVersionInfo, SubModVersionInfo, bool, Optional[list[ForceUpdate]] ) -> Dict[str, Tuple[bool, str]]
273
284
"""
274
285
275
286
:param modFileList:
@@ -301,6 +312,13 @@ def getFilesNeedingUpdate(modFileList, localVersionInfo, remoteVersionInfo, repa
301
312
result = updatesRequiredDict .get (file .id )
302
313
needUpdate , updateReason = (True , "Missing version info" ) if result is None else result
303
314
315
+ # Check for files forced to update via forceUpdateList parameter
316
+ if not needUpdate and forceUpdateList is not None :
317
+ for forceUpdate in forceUpdateList :
318
+ if file .name == forceUpdate .name :
319
+ needUpdate = True
320
+ updateReason = forceUpdate .reason
321
+
304
322
if not needUpdate and repairMode and file .installOnRepair :
305
323
needUpdate = True
306
324
updateReason = "Re-installing as Repair Mode Enabled"
0 commit comments