fix(gui): fanen Kæder efter Marker; kædelistens navne afkortes ikke (v1.61.1.0)
This commit is contained in:
@@ -13,7 +13,7 @@ ADChainView = {}
|
||||
ADChainView.INDENT = " "
|
||||
-- Tegnbudget pr. celle i flowListPrefab (gui/SmartPickupFrame.xml: textMaxWidth 192/162/62/244/92 px).
|
||||
-- Antaget ~11,5 px pr. tegn (spuInfoText: 800 px ~ 70 tegn), fed ~12,5 px; c3 har kun tal (~10 px pr. tegn).
|
||||
ADChainView.CELL_CHARS = {15, 14, 6, 21, 8}
|
||||
ADChainView.CELL_CHARS = {22, 20, 7, 28, 10} -- ca. tegn pr. celle (c1 192 px fed, c2 162, c3 62, c4 244, c5 92 fed)
|
||||
ADChainView.MAX_SOURCE_NAMES = 2
|
||||
-- Tegnbudget for en tekstlinje (addTextRow/spuInfoText: 800 px ~ 70 tegn), fx linjen med frie marker.
|
||||
ADChainView.TEXT_ROW_CHARS = 70
|
||||
|
||||
@@ -21,6 +21,14 @@ SmartPickupFrame.TAB_CHAINS = 10
|
||||
SmartPickupFrame.CHAIN_REBUILD_TICKS = 30
|
||||
-- Lagerfaner: én pr. bygningstype (indeks -> kind i ADSources.getFarmInventory)
|
||||
SmartPickupFrame.TAB_NAMES = {"spu_tab_overview", "spu_tab_flows", "spu_tab_fields", "spu_tab_month", "spu_tab_fieldsilos", "spu_tab_factories", "spu_tab_silos", "spu_tab_barns", "spu_tab_sheds", "spu_tab_chains"}
|
||||
-- Visningsrækkefølge (fane-id'erne ovenfor er faste og bruges overalt): Kæder står efter Marker (in-game 30/9).
|
||||
SmartPickupFrame.TAB_DISPLAY = {1, 2, 3, 10, 4, 5, 6, 7, 8, 9}
|
||||
function SmartPickupFrame.tabPosition(tabId)
|
||||
for position, id in ipairs(SmartPickupFrame.TAB_DISPLAY) do
|
||||
if id == tabId then return position end
|
||||
end
|
||||
return tabId
|
||||
end
|
||||
SmartPickupFrame.TAB_KINDS = {[6] = "factory", [7] = "silo", [8] = "husbandry", [9] = "objectStorage"}
|
||||
|
||||
function SmartPickupFrame.getTabKind(tab)
|
||||
@@ -99,8 +107,9 @@ function SmartPickupFrame:initialize()
|
||||
if self.selectorPrefab ~= nil and self.subCategoryBox ~= nil and self.subCategoryPaging ~= nil then
|
||||
self.selectorPrefab:unlinkElement()
|
||||
FocusManager:removeElement(self.selectorPrefab)
|
||||
for index, key in ipairs(SmartPickupFrame.TAB_NAMES) do
|
||||
self.subCategoryPaging:addText(tostring(index))
|
||||
for position, index in ipairs(SmartPickupFrame.TAB_DISPLAY) do
|
||||
local key = SmartPickupFrame.TAB_NAMES[index]
|
||||
self.subCategoryPaging:addText(tostring(position))
|
||||
local tab = self.selectorPrefab:clone(self.subCategoryBox)
|
||||
FocusManager:loadElementFromCustomValues(tab)
|
||||
tab:setText(self.i18n:getText(key))
|
||||
@@ -270,11 +279,11 @@ function SmartPickupFrame:switchTab(tabIndex)
|
||||
end
|
||||
if self.guide ~= nil and not self:hasGuideOn(tabIndex) then self:closeGuide() end
|
||||
self.currentTab = tabIndex
|
||||
for index, tab in ipairs(self.subCategoryTabs) do
|
||||
for index, tab in pairs(self.subCategoryTabs) do
|
||||
tab:setSelected(index == tabIndex)
|
||||
end
|
||||
if self.subCategoryPaging ~= nil then
|
||||
self.subCategoryPaging:setState(tabIndex, false)
|
||||
self.subCategoryPaging:setState(SmartPickupFrame.tabPosition(tabIndex), false)
|
||||
end
|
||||
self:requestRebuild()
|
||||
self:safe(function(frame)
|
||||
@@ -282,8 +291,9 @@ function SmartPickupFrame:switchTab(tabIndex)
|
||||
end)
|
||||
end
|
||||
|
||||
-- pilene/paging giver en position i visningsrækkefølgen
|
||||
function SmartPickupFrame:onClickTab(state)
|
||||
self:switchTab(state)
|
||||
self:switchTab(SmartPickupFrame.TAB_DISPLAY[state] or state)
|
||||
end
|
||||
|
||||
-- De faste rækker: Flow-vælger + Wait-pulje for alle flows; Ture/kør hjem for forsyning; Sælg fra/
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<modDesc descVersion="107">
|
||||
<author>masterdraco</author>
|
||||
<version>1.61.0.0</version>
|
||||
<version>1.61.1.0</version>
|
||||
<title>
|
||||
<en>AD Smart Pickup</en>
|
||||
</title>
|
||||
|
||||
Reference in New Issue
Block a user