--- Forage Harvester Straw Pickup
-- @url https://www.farming-simulator.com/mod.php?lang=en&country=ie&mod_id=271847&title=fs2022
-- @author GMNGjoy
-- @copyright 07/01/2023


ForageStrawPickup = {}
local modDir = g_currentModDirectory

--- Register custom fillTypes.
function ForageStrawPickup.registerFillTypes(self, superFunc)
    superFunc(self)

    local xml = loadXMLFile("mod_fillTypes", modDir .. "xml/MGSmaps_fillTypes.xml")
    g_fillTypeManager:loadFillTypes(xml, modDir, false)
    delete(xml)
end

--- Register custom fruitTypes.
function ForageStrawPickup.registerFruitTypes(self, superFunc)
    superFunc(self)

    local xml = loadXMLFile("mod_fruitTypes", modDir .. "xml/MGSmaps_fruitTypes.xml")
    g_fruitTypeManager:loadFruitTypes(xml, nil, false)
    delete(xml)
end

FillTypeManager.loadDefaultTypes = Utils.overwrittenFunction(FillTypeManager.loadDefaultTypes, ForageStrawPickup.registerFillTypes)
FruitTypeManager.loadDefaultTypes = Utils.overwrittenFunction(FruitTypeManager.loadDefaultTypes, ForageStrawPickup.registerFruitTypes)
