-- author: DD ModPassion
-- date: 04.09.2020
-- copyright (C): DD ModPassion, All Rights Reserved
-- version: farming simulator 19
FillUnitAddon = {} FillUnitAddon.MOD_NAME = g_currentModName function FillUnitAddon.prerequisitesPresent(specializations) return true end function FillUnitAddon.registerEventListeners(vehicleType) SpecializationUtil.registerEventListener(vehicleType, "onLoad", FillUnitAddon) SpecializationUtil.registerEventListener(vehicleType, "onDraw", FillUnitAddon) end function FillUnitAddon:onLoad(savegame) self.spec_fillUnitAddon = self[string.format("spec_%s.fillUnitAddon", FillUnitAddon.MOD_NAME)] local spec = self.spec_fillUnitAddon end function FillUnitAddon:onDraw(isActiveForInput, isActiveForInputIgnoreSelection, isSelected) if self.isClient then local spec = self.spec_fillUnit local fillUnit = spec.fillUnits[2] if self:getFillUnitCapacity(2) > 0 and self:getFillUnitFillLevel(2) == 0 then local fillTypeNames = g_i18n:getText("button_load")..":" local i = 0 for supportedFillType,_ in pairs(fillUnit.supportedFillTypes) do local fillTypeName = Utils.getNoNil(g_fillTypeManager:getFillTypeNameByIndex(supportedFillType), "unknown") if fillTypeName ~= "DIESEL" then fillTypeName = string.lower(fillTypeName) if fillTypeName == "pigfood" then fillTypeName = "pigFood" end if fillTypeName == "liquidfertilizer" then fillTypeName = "liquidFertilizer" end fillTypeName = g_i18n:getText("fillType_"..fillTypeName) fillTypeNames = fillTypeNames.." "..fillTypeName end i = i + 1 end g_currentMission:addExtraPrintText(fillTypeNames) end end end