DeckerMMIV / FS13_SoilManagement

A mod for Farming Simulator 2013 that adds additional abilities of field and soil management
7 stars 8 forks source link

Some HUD icons is changed by SoilMod, why? #10

Closed DeckerMMIV closed 10 years ago

DeckerMMIV commented 10 years ago

User 'mngrazy' send the following bug-report:

a small "bug" found on the github version ,,, i´m not sure wich one (pda plugin or the SoilMod) i use this mod from Jakob T http://www.modhoster.de/mods/filltypeoverlays but the soilMod or the pdaPlugin disable the colored Huds maybe you can take a look

JakobTischler commented 10 years ago

I assume he's talking about fertilizer, liquidManure and manure, as those are the only three that are both in my mod and in SoilMod.

The problem will obviously lie in the load and execution order of the 2 mods. SoilMod updates the fillTypes in loadMapFinished(), meaning at the end of loadMap01Finished(). My mod updates the fillTypes in loadMap(), which I assume happens before loadMapFinished(). So that's probably the reason your mod overwrites my overlays.

The question for me is, do you actually need to overwrite existing overlays? If there are already overlays for specific fillTypes, the user apparently installed them through a different mod/method, meaning he wants them there. So in my opinion, you could change it so your overlays are only installed for non-existing ones:

if g_currentMission.fillTypeOverlays[fillTypeDesc.index] == nil and fillTypeDesc.hudOverlayFilename ~= nil and fillTypeDesc.hudOverlayFilename ~= "" then
    g_currentMission:addFillTypeOverlay(fillTypeDesc.index, fillTypeDesc.hudOverlayFilename);
end;

Of course, I could say the same about my mod, where I delete existing ones as well. But that's because I overwrite the Giants default ones, while you overwrite ones that are never default but always custom ones.

DeckerMMIV commented 10 years ago

I came to the same conclusion.

However, since I want the fertilizer fill-type to use the fertiilzer1.dds icon (i.e. the one with "A"), when running SoilMod in advanced mode, to be able to distinguish between the 3 types.

How I solved it, including not overwriting all the existing overlays, is in @eb22b24c673cdbf06b7c73cf8e3acb3c11e078c5