Skip to content

Commit

Permalink
Fix HelpLine manager
Browse files Browse the repository at this point in the history
Invalid function signature caused help line manager to stop reading subsequent help chapters from other mods.

Closes #39 #37
  • Loading branch information
bodzio528 committed Dec 7, 2023
1 parent ba01653 commit 9effd40
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
14 changes: 8 additions & 6 deletions CropRotation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -650,14 +650,16 @@ end

FSBaseMission.initTerrain = Utils.appendedFunction(FSBaseMission.initTerrain, postInitTerrain)

function loadCropRotationHelpLine(...)
g_cropRotation.log:debug("loadCropRotationHelpLine()")

g_helpLineManager:loadFromXML(Utils.getFilename("gui/helpLine.xml", g_cropRotation.MOD_DIRECTORY))
return true
function CropRotation:loadCropRotationHelpLine(superFunc, ...)
local ret = superFunc(self, ...)
if ret then
self:loadFromXML(Utils.getFilename("gui/helpLine.xml", g_cropRotation.MOD_DIRECTORY))
return true
end
return false
end

HelpLineManager.loadMapData = Utils.appendedFunction(HelpLineManager.loadMapData, loadCropRotationHelpLine)
HelpLineManager.loadMapData = Utils.overwrittenFunction( HelpLineManager.loadMapData, CropRotation.loadCropRotationHelpLine)

------------------------------------------------
--- Vanilla Player HUD Updater
Expand Down
4 changes: 2 additions & 2 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ tar.exe -a -c -f FS22_CropRotation.zip^
utils^
maps^
translations^
utils^
CropRotation.lua^
CropRotation.xml^
CropRotationData.lua^
Expand All @@ -14,8 +13,9 @@ tar.exe -a -c -f FS22_CropRotation.zip^
icon_cropRotation.dds^
modDesc.xml


rem copy ZIP to FS22 mods folder
xcopy /b/v/y FS22_CropRotation.zip "D:\Users\Bodzio\Documents\My Games\FarmingSimulator2022\mods"
rem xcopy /b/v/y FS22_CropRotation.zip "D:\Users\Bodzio\Documents\My Games\FarmingSimulator2022\mods"

rem make update mod as well
rem copy /b/v/y FS22_CropRotation.zip FS22_CropRotation_update.zip

0 comments on commit 9effd40

Please sign in to comment.