fix: stald med indbygget silo kan få indstillingen sælg slagteklare dyr
This commit is contained in:
@@ -38,7 +38,8 @@ ADSettings.KEYS = {
|
||||
text = "min: en AutoDrive-tur uden for flows, der holder ved et fuldt mål med læs, tømmes efter så lang tid på et lager og kører hjem (0 = vent)"},
|
||||
-- slagteklare dyr (brugerønske 19/10): stalden sælger dyr, hvis pris har toppet — lånt traktor + kreaturvogn kører dem
|
||||
-- til den dyrehandler, der betaler bedst (ADLivestock). Slås til pr. stald
|
||||
sellReadyAnimals = {default = 0, min = 0, max = 1, perBuilding = true, choices = {1, 0},
|
||||
-- animalBarns: også stalde med indbygget silo (de klassificeres som silo, fx Midwest Moraines' "Cowbarn with manure Pit")
|
||||
sellReadyAnimals = {default = 0, min = 0, max = 1, perBuilding = true, animalBarns = true, choices = {1, 0},
|
||||
labels = {"spu_set_sellReadyAnimals_on", "spu_set_sellReadyAnimals_off"},
|
||||
text = "1/0: slagteklare dyr (prisen har toppet) køres til dyrehandleren og sælges — kræver kreaturvogn med P-plads og Connect"},
|
||||
troughRefillPercent = {default = 100, min = 10, max = 100, perBuilding = true, choices = {30, 40, 50, 60, 70, 80, 90, 100}, format = "%s %%",
|
||||
|
||||
@@ -57,13 +57,19 @@ function SmartPickupFrame:fillSettingsRows(adEnv)
|
||||
|
||||
-- pr. stald: kun nøgler med perBuilding = true
|
||||
local farmId = g_currentMission:getFarmId()
|
||||
local barns = {}
|
||||
local barns, animalBarns = {}, {}
|
||||
for _, building in ipairs(ADBuildings.list(adEnv, farmId) or {}) do
|
||||
if building.kind == "husbandry" then table.insert(barns, building) end
|
||||
-- stald med indbygget silo er klassificeret som silo, men har dyr (dyre-indstillinger)
|
||||
if building.kind == "husbandry" or (building.placeable ~= nil and building.placeable.spec_husbandryAnimals ~= nil) then
|
||||
table.insert(animalBarns, building)
|
||||
end
|
||||
end
|
||||
table.sort(barns, function(a, b) return tostring(a.name) < tostring(b.name) end)
|
||||
table.sort(animalBarns, function(a, b) return tostring(a.name) < tostring(b.name) end)
|
||||
for _, key in ipairs(keys) do
|
||||
local spec = ADSettings.KEYS[key]
|
||||
local barns = spec.animalBarns and animalBarns or barns
|
||||
if spec.perBuilding and #barns > 0 then
|
||||
self:addTextRow(string.format(i18n:getText("spu_set_perBarnTitle"), keyTitle(i18n, key)))
|
||||
for _, barn in ipairs(barns) do
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<modDesc descVersion="107">
|
||||
<author>masterdraco</author>
|
||||
<version>1.62.382.0</version>
|
||||
<version>1.62.383.0</version>
|
||||
<title>
|
||||
<en>AD Smart Pickup</en>
|
||||
</title>
|
||||
|
||||
Reference in New Issue
Block a user