From da9edaaabc64c45ac7e1a00adf917a0e608c395a Mon Sep 17 00:00:00 2001 From: masterdraco Date: Tue, 29 Sep 2026 18:40:40 +0200 Subject: [PATCH] =?UTF-8?q?feat(gui):=20Smart=20Pickup-fanen=20ligger=20li?= =?UTF-8?q?ge=20over=20spillets=20Indstillinger=20i=20ESC-menuen=20(flytte?= =?UTF-8?q?s=20p=C3=A5=20alle=20tre=20lister=20som=20FarmOperationsDashboa?= =?UTF-8?q?rd)=20(v1.60.1.0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FS25_ADSmartPickup/adSmartPickup.lua | 23 +++++++++++++++++++++++ FS25_ADSmartPickup/modDesc.xml | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/FS25_ADSmartPickup/adSmartPickup.lua b/FS25_ADSmartPickup/adSmartPickup.lua index ef60141..5a361f4 100644 --- a/FS25_ADSmartPickup/adSmartPickup.lua +++ b/FS25_ADSmartPickup/adSmartPickup.lua @@ -1202,10 +1202,33 @@ local function insertInGameMenuPage(frame, pageName, iconFile, iconUVs, predicat end inGameMenu[pageName] = frame inGameMenu.pagingElement:addElement(frame) + -- Lige over spillets Indstillinger (brugerønske 29/9). Siden flyttes på ALLE tre lister med samme indeks + -- (sider, pagerens sider, pageFrames) som FS25_FarmOperationsDashboard — at flytte kun nogle af dem gav + -- tidligere forskudt fane↔side. Uden Indstillinger-side: sidst som før. + local target = 0 + for i, child in ipairs(inGameMenu.pagingElement.elements) do + if inGameMenu.pageSettings ~= nil and child == inGameMenu.pageSettings then + target = i + break + end + end + local function moveTo(list, matches) + if target == 0 or list == nil then return end + for i, child in ipairs(list) do + if matches(child) then + table.remove(list, i) + table.insert(list, target, child) + return + end + end + end + moveTo(inGameMenu.pagingElement.elements, function(child) return child == frame end) + moveTo(inGameMenu.pagingElement.pages, function(child) return child.element == frame end) inGameMenu.pagingElement:updateAbsolutePosition() inGameMenu.pagingElement:updatePageMapping() inGameMenu:registerPage(frame, position, predicate) inGameMenu:addPageTab(frame, iconFile, iconUVs) + moveTo(inGameMenu.pageFrames, function(child) return child == frame end) if frame.updateAbsolutePosition ~= nil then frame:updateAbsolutePosition() end diff --git a/FS25_ADSmartPickup/modDesc.xml b/FS25_ADSmartPickup/modDesc.xml index abfd84f..81edcf3 100644 --- a/FS25_ADSmartPickup/modDesc.xml +++ b/FS25_ADSmartPickup/modDesc.xml @@ -1,7 +1,7 @@ masterdraco - 1.60.0.0 + 1.60.1.0 <en>AD Smart Pickup</en>