fix: stalde med sted i indstillingerne, så ens navne kan skelnes
This commit is contained in:
@@ -68,8 +68,14 @@ function SmartPickupFrame:fillSettingsRows(adEnv)
|
||||
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)
|
||||
-- fast rækkefølge også for ens navne (sted, så id — review)
|
||||
local function byLabel(a, b)
|
||||
local la, lb = ADBuildings.labelWithPlace(a), ADBuildings.labelWithPlace(b)
|
||||
if la ~= lb then return la < lb end
|
||||
return tostring(a.id) < tostring(b.id)
|
||||
end
|
||||
table.sort(barns, byLabel)
|
||||
table.sort(animalBarns, byLabel)
|
||||
for _, key in ipairs(keys) do
|
||||
local spec = ADSettings.KEYS[key]
|
||||
local barns = spec.animalBarns and animalBarns or barns
|
||||
@@ -79,11 +85,11 @@ function SmartPickupFrame:fillSettingsRows(adEnv)
|
||||
local own = ADSettings.getOwn(key, barn.id)
|
||||
if spec.barnOnly then
|
||||
-- kun staldens egen værdi (ingen "som global"): valgene direkte, intet valgt = standard (fra)
|
||||
local option = self:addFieldSiloChoiceRow("setBuilding", tostring(barn.name), choiceTexts(spec, i18n, false), choiceIndex(spec, own))
|
||||
local option = self:addFieldSiloChoiceRow("setBuilding", ADBuildings.labelWithPlace(barn), choiceTexts(spec, i18n, false), choiceIndex(spec, own))
|
||||
self.rowData[option] = {kind = "setBarnOnly", key = key, buildingId = barn.id}
|
||||
else
|
||||
local state = own ~= nil and (choiceIndex(spec, own) + 1) or 1
|
||||
local option = self:addFieldSiloChoiceRow("setBuilding", tostring(barn.name), choiceTexts(spec, i18n, true), state)
|
||||
local option = self:addFieldSiloChoiceRow("setBuilding", ADBuildings.labelWithPlace(barn), choiceTexts(spec, i18n, true), state)
|
||||
self.rowData[option] = {kind = "setBuilding", key = key, buildingId = barn.id}
|
||||
end
|
||||
end
|
||||
@@ -124,7 +130,7 @@ function SmartPickupFrame:fillLivestockTractorRows(adEnv, animalBarns)
|
||||
table.insert(ids, locked)
|
||||
state = #texts
|
||||
end
|
||||
local option = self:addFieldSiloChoiceRow("setBuilding", tostring(barn.name), texts, state)
|
||||
local option = self:addFieldSiloChoiceRow("setBuilding", ADBuildings.labelWithPlace(barn), texts, state)
|
||||
self.rowData[option] = {kind = "lockTractor", buildingId = barn.id, ids = ids}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<modDesc descVersion="107">
|
||||
<author>masterdraco</author>
|
||||
<version>1.62.391.0</version>
|
||||
<version>1.62.392.0</version>
|
||||
<title>
|
||||
<en>AD Smart Pickup</en>
|
||||
</title>
|
||||
|
||||
Reference in New Issue
Block a user