diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d3ce02..c862ec8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ står i [docs/BRUGERMANUAL.md](docs/BRUGERMANUAL.md) (dansk) og [docs/USER_MANUA ## 1.61 — Produktionskæder +- **1.61.12** Oversigt-tavlen folder også kædeflows uden traktor sammen og viser navnene uden "Kæde: "; et kædeflow uden traktor har status *mangler traktor/vogn* (tavle og Flows-liste). - **1.61.11** Markørvalg ved bygninger: når to markører står inden for 20 m af hinanden, afgør navnet — pålæsning foretrækker *Pickup/Hent/Læs/Load*, aflæsning *Unload/Drop/Aflæs*. Før vandt den nærmeste (Sell Egg kørte til "Chicken Storage Unload" i stedet for "Egg Storage Pickup"). - **1.61.10** Markflådens puljeliste viser korte maskinnavne (uden " Unrealistic" og parenteser som "(+ Custom Crops)"), så lange linjer ikke ombrydes med traktorens nummer alene på næste linje. - **1.61.9** *Sælg fra* i udkørselsflows har valget **Altid (uanset pris)** øverst: flowet sælger, så snart der er noget at køre med, uden at vente på en god pris. Resumé og status viser *sælg altid*. diff --git a/FS25_ADSmartPickup/adFlowView.lua b/FS25_ADSmartPickup/adFlowView.lua index c062cba..8105298 100644 --- a/FS25_ADSmartPickup/adFlowView.lua +++ b/FS25_ADSmartPickup/adFlowView.lua @@ -83,6 +83,11 @@ function ADFlowView.shortVehicleName(name) return short end +-- Kædeflow uden traktor (venter på en ledig traktor/vogn). +function ADFlowView.isIdleChain(run) + return run.chain ~= nil and run.chain ~= "" and #(run.vehicleIds or {}) == 0 +end + -- Kædeflows uden traktor foldes sammen i listen (de venter på en ledig traktor/vogn). -> active, idle function ADFlowView.splitIdle(runs) local active, idle = {}, {} diff --git a/FS25_ADSmartPickup/gui/SmartPickupFlowTab.lua b/FS25_ADSmartPickup/gui/SmartPickupFlowTab.lua index 982813b..d0e09c1 100644 --- a/FS25_ADSmartPickup/gui/SmartPickupFlowTab.lua +++ b/FS25_ADSmartPickup/gui/SmartPickupFlowTab.lua @@ -64,7 +64,9 @@ function SmartPickupFrame:flowCells(adEnv, run) elseif row.reason ~= nil then status = row.reason end - local name = (run.id == self.selectedRunId and "> " or "") .. tostring(run.name) + -- kædeflow uden traktor: sig hvorfor det står stille i stedet for flowets regel + if ADFlowView.isIdleChain(run) then status = i18n:getText("spu_flow_chainIdle") end + local name = (run.id == self.selectedRunId and "> " or "") .. ADFlowView.listName(run) return {name, products, from, to, string.format("%d/%d", row.running, row.total), status} end @@ -103,15 +105,29 @@ function SmartPickupFrame:fillOverviewRows(adEnv) local i18n = self.i18n self:addTextRow(i18n:getText("spu_overview_hint")) self:addCellRow(self.flowPrefab, {i18n:getText("spu_col_flow"), i18n:getText("spu_col_goods"), i18n:getText("spu_col_from"), i18n:getText("spu_col_to"), i18n:getText("spu_col_tractors"), i18n:getText("spu_col_status")}) + local function addBoardRow(run) + local cells = self:addCellRow(self.flowPrefab, self:flowCells(adEnv, run)) + if cells[1] ~= nil and cells[1].parent ~= nil then + local runId = run.id + self:makeRowClickable(cells[1].parent, function(frame) frame:openFlow(runId) end) + end + table.insert(self.overviewRows, {runId = run.id, cells = cells}) + end for _, group in ipairs(ADFlowView.boardGroups(ADRunsController.store.runs)) do self:addTextRow(i18n:getText(group.chain and "spu_board_chain" or group.kind == "outbound" and "spu_board_outbound" or "spu_board_supply")) - for _, run in ipairs(group.runs) do - local cells = self:addCellRow(self.flowPrefab, self:flowCells(adEnv, run)) - if cells[1] ~= nil and cells[1].parent ~= nil then - local runId = run.id - self:makeRowClickable(cells[1].parent, function(frame) frame:openFlow(runId) end) + local runs, idle = group.runs, {} + -- kædeflows uden traktor foldes sammen som i Flows-listen (in-game 30/9) + if group.chain then runs, idle = ADFlowView.splitIdle(group.runs) end + for _, run in ipairs(runs) do addBoardRow(run) end + if #idle > 0 then + local key = self.showIdleChainFlows and "spu_board_chainIdleHide" or "spu_board_chainIdleShow" + self:addLinkRow(" " .. string.format(i18n:getText(key), #idle), function(frame) + frame.showIdleChainFlows = not frame.showIdleChainFlows + frame:requestRebuild() + end) + if self.showIdleChainFlows then + for _, run in ipairs(idle) do addBoardRow(run) end end - table.insert(self.overviewRows, {runId = run.id, cells = cells}) end end if #ADRunsController.store.runs == 0 then diff --git a/FS25_ADSmartPickup/l10n/l10n_da.xml b/FS25_ADSmartPickup/l10n/l10n_da.xml index 754e0c0..5504245 100644 --- a/FS25_ADSmartPickup/l10n/l10n_da.xml +++ b/FS25_ADSmartPickup/l10n/l10n_da.xml @@ -352,6 +352,7 @@ + diff --git a/FS25_ADSmartPickup/l10n/l10n_en.xml b/FS25_ADSmartPickup/l10n/l10n_en.xml index 2a1155b..b8cdfb8 100644 --- a/FS25_ADSmartPickup/l10n/l10n_en.xml +++ b/FS25_ADSmartPickup/l10n/l10n_en.xml @@ -352,6 +352,7 @@ + diff --git a/FS25_ADSmartPickup/modDesc.xml b/FS25_ADSmartPickup/modDesc.xml index 17ee958..79d27a4 100644 --- a/FS25_ADSmartPickup/modDesc.xml +++ b/FS25_ADSmartPickup/modDesc.xml @@ -1,7 +1,7 @@ masterdraco - 1.61.11.0 + 1.61.12.0 <en>AD Smart Pickup</en>