Life is Feudal: Forest Village

Life is Feudal: Forest Village

GODS MODS
JLA 6 Nov, 2020 @ 11:36am
my personal fix for more compatibility with Storage Management mod
This fix will make the storage crates and cart memorize the storage filter after save game load. Feel free to use it.

If you're not the creator and want to edit it yourself you can copy paste text belo to your AddonStorages.lua in mods/1381772638 folder

--[[
Mod: All mods for Life is Feudal : Forest Village by GODS MODS
Author: Chaitanya Madicharla
File: AddonStorages for Life is Feudal : Forest Village
--]]

loadImageset('1381772638Buttons.imageset')
resourcePack = Class('resourcePack', fv.core.Building)
function resourcePack:generateResourceArea()
end

function resourcePack:createWindow()
return fv.core.BuildingWindow(self, fv.core.StoragePages)
end

function resourcePack:save(saveData)
saveData.allowed = self.allowed
end

function resourcePack:load(saveData)
self.allowed = saveData.allowed
or nil
end

resourcePack.config =
{
icon = "1381772638Buttons/resourcePack",
visibleName = loc("resourcePackName"),
description = loc('resourcePackDesc'),
price = {
logs = 12
},
buildTime = 20000,
durability = 578000,
resourceTimeSec = 2372,
maxBuilder = 1,
buildCellsOrientation = false,
type = "Storage",
workTimeScale = 1,
storageClass = "RESOURCE",
widthCells = 2,
lengthCells = 2,
foundationWidth = 2,
foundationLength = 2,
foundationOffsetX = 0,
foundationOffsetY = 0,
doorPosition = "1 1",
damageIgnore = true,
modelCenter = "1 1",
materialGroupPosIgnore = false,
housesBarn = true,
storedResource = true,
capacity = 2500,
burnedPrefab = "/mods/1381772638/Prefabs/LIF_crate2pack.prefab",
damagedPrefab = "/mods/1381772638/Prefabs/LIF_crate2pack.prefab",
destroyPrefab = "/mods/1381772638/Prefabs/LIF_crate2pack.prefab",
prefabSteps = {
"/mods/1381772638/Prefabs/LIF_crate2pack.prefab"
}
}
fv.core.GameMenu.model:regBuilding(resourcePack, 'storages.resourcePackName', '1381772638Buttons/resourcePack', loc('tooltip1'))
log("Chaitu's - GODS MODS resourcePack successfully loaded.")
logUI("MOD: Chaitu's - GODS MODS resourcePack successfully loaded.")


materialPack = Class('materialPack', fv.core.Building)
function materialPack:generateResourceArea()
end
function materialPack:createWindow()
return fv.core.BuildingWindow(self, fv.core.StoragePages)
end

function materialPack:save(saveData)
saveData.allowed = self.allowed
end

function materialPack:load(saveData)
self.allowed = saveData.allowed
or nil
end

materialPack.config =
{
icon = "1381772638Buttons/materialPack",
visibleName = loc("materialPackName"),
description = loc('materialPackDesc'),
price = {
logs = 12
},
buildTime = 20000,
durability = 578000,
resourceTimeSec = 2372,
maxBuilder = 1,
buildCellsOrientation = false,
type = "Storage",
workTimeScale = 1,
storageClass = "MATERIAL",
widthCells = 3,
lengthCells = 3,
foundationWidth = 3,
foundationLength = 3,
foundationOffsetX = 0,
foundationOffsetY = 0,
doorPosition = "1 1",
damageIgnore = true,
modelCenter = "1.5 1.5",
materialGroupPosIgnore = false,
housesWarehouse = true,
storedMaterial = true,
capacity = 2500,
burnedPrefab = "/mods/1381772638/Prefabs/LIF_crate3pack.prefab",
damagedPrefab = "/mods/1381772638/Prefabs/LIF_crate3pack.prefab",
destroyPrefab = "/mods/1381772638/Prefabs/LIF_crate3pack.prefab",
prefabSteps = {
"/mods/1381772638/Prefabs/LIF_crate3pack.prefab"
}
}
fv.core.GameMenu.model:regBuilding(materialPack, 'storages.materialPackName', '1381772638Buttons/materialPack', loc('tooltip2'))
log("Chaitu's - GODS MODS materialPack successfully loaded.")
logUI("MOD: Chaitu's - GODS MODS materialPack successfully loaded.")


storageCart = Class("storageCart", fv.core.Building)
function storageCart:generateResourceArea()
end
function storageCart:createWindow()
return fv.core.BuildingWindow(self, fv.core.StoragePages)
end

function storageCart:save(saveData)
saveData.allowed = self.allowed
end

function storageCart:load(saveData)
self.allowed = saveData.allowed
or nil
end

storageCart.config =
{
icon = "1381772638Buttons/storageCart",
visibleName = loc("storageCartName"),
description = loc('storageCartDesc'),
buildTime = 150000,
durability = 578000,
resourceTimeSec = 2372,
maxBuilder = 2,
buildCellsOrientation = false,
type = "Storage",
workTimeScale = 1,
storageClass = "RESOURCE",
widthCells = 4,
lengthCells = 8,
foundationWidth = 4,
foundationLength = 8,
foundationOffsetX = 0,
foundationOffsetY = 0,
doorPosition = "-3 -2",
damageIgnore = true,
modelCenter = "4 4",
materialGroupPosIgnore = false,
housesBarn = true,
storedResource = true,
capacity = 5000,
allowAngle = 8,
burnedPrefab = "/mods/1381772638/Prefabs/Wagon.prefab",
damagedPrefab = "/mods/1381772638/Prefabs/Wagon.prefab",
destroyPrefab = "/mods/1381772638/Prefabs/Wagon.prefab",
prefabSteps = {
"/mods/1381772638/Prefabs/Wagon.prefab"
},
price = {
hay = 20,
logs = 120,
pig_iron = 10
}
}
function storageCart:refreshModules()
end
fv.core.GameMenu.model:regBuilding(storageCart, 'storages.storageCartName', '1381772638Buttons/storageCart', loc('tooltip3'))
log("Chaitu's - GODS MODS storageCart successfully loaded.")
logUI("MOD: Chaitu's - GODS MODS storageCart successfully loaded.")