From 7459a3c8113534b792bfb0bd5a404000ed479648 Mon Sep 17 00:00:00 2001 From: WizadlyPayload <26ct8617@gmail.com> Date: Wed, 12 Aug 2026 17:06:06 +0100 Subject: [PATCH] fix(ui): restore Crop Stress Esc Help; hide consultant SPACE chip Esc Crop Stress footer is Back + Help opening CsHelpDialog via guest soft-detect. On-page Crop consultant activate chip stays hidden. Agronomist and Pivot on the page unchanged. --- modDesc.xml | 2 +- src/gui/RfEscModules.lua | 1 + src/gui/RfPdaMenuPage.lua | 39 +++++++++++++++++++++++++++++++++------ 3 files changed, 35 insertions(+), 7 deletions(-) diff --git a/modDesc.xml b/modDesc.xml index 978afb1..548c710 100644 --- a/modDesc.xml +++ b/modDesc.xml @@ -1,7 +1,7 @@ TisonK & LeGrizzly - 1.3.0.49 + 1.3.0.50 <en>Market Dynamics</en> diff --git a/src/gui/RfEscModules.lua b/src/gui/RfEscModules.lua index fa5f8bd..bf5bc02 100644 --- a/src/gui/RfEscModules.lua +++ b/src/gui/RfEscModules.lua @@ -232,6 +232,7 @@ function RfEscModules:registerModule(def) -- discarded and the Esc Crop Stress buttons would do nothing. onOpenConsultant = def.onOpenConsultant, onOpenSchedule = def.onOpenSchedule, + onOpenHelp = def.onOpenHelp, onPaintConsultant = def.onPaintConsultant, -- Same trap again, BUILD 15:46: the CS guest registers onPivotRemote on -- its module def (CsRfPdaGuest.lua) but it was missing here, so it was diff --git a/src/gui/RfPdaMenuPage.lua b/src/gui/RfPdaMenuPage.lua index 3e6dcfa..30efd18 100644 --- a/src/gui/RfPdaMenuPage.lua +++ b/src/gui/RfPdaMenuPage.lua @@ -656,8 +656,8 @@ function RfPdaMenuPage:initialize() end end } - -- SPACE (MENU_EXTRA_1): Crop Stress consultant is secondary only — never default home. - -- EXTRA_1 free on CS (Help is Soil-only). SmoothList would swallow MENU_ACTIVATE. + -- Dead candidate: Crop Stress consultant footer chip. Kept constructed so stale + -- bindings resolve; never assigned to menuButtonInfo (table-hide path VETO). self.btnCsConsultant = { inputAction = InputAction.MENU_EXTRA_1, showWhenPaused = true, @@ -666,6 +666,16 @@ function RfPdaMenuPage:initialize() self:onClickCsConsultant() end } + -- CS footer Help (MENU_EXTRA_1). Soft-detects guest onOpenHelp → CsHelpDialog. + -- Do not reuse Soil btnHelp (wrong dialog content). + self.btnHelpCs = { + inputAction = InputAction.MENU_EXTRA_1, + showWhenPaused = true, + text = tr("cs_pda_btn_help", "Help"), + callback = function() + self:onClickHelpCs() + end + } -- Back only. Help is Soil-only and _syncHostGuestChrome adds it when the Soil -- module is the active one; seeding it here leaked Help onto every module's @@ -1684,10 +1694,12 @@ function RfPdaMenuPage:_syncHostGuestChrome(activeId) elseif isWc and self.btnOpenWorkerManager ~= nil then self.menuButtonInfo = { self.btnBack, self.btnOpenWorkerManager } elseif isCs then - -- BUILD 18:48: SPACE no longer swaps panes. The consultant button owned the - -- table-hiding path, so it comes off the CS footer entirely rather than being - -- left pointing at a no-op the player can still press. - self.menuButtonInfo = { self.btnBack } + -- BUILD Help restore 2026-08-12: Back + Help. Consultant chip stays off footer. + self.menuButtonInfo = { self.btnBack, self.btnHelpCs } + local trFn = self._rfTr + if type(trFn) == "function" and self.btnHelpCs ~= nil then + self.btnHelpCs.text = trFn("cs_pda_btn_help", "Help") + end elseif isSoil then -- BUILD 18:52: Rotation Planner and Field Detail come off the Soil footer. -- Both dialogs stay registered and still open from the PDA/joiner; only the @@ -2212,6 +2224,21 @@ function RfPdaMenuPage:onClickCsConsultant() return end +--- Esc CS Help → guest onOpenHelp → CsHelpDialog (inside SCS env). Never bare CsDialogLoader. +function RfPdaMenuPage:onClickHelpCs() + local host = self:_getHost() + local active = host and host:getActivePanel() + if active ~= nil and type(active.onOpenHelp) == "function" then + pcall(active.onOpenHelp, self.rfHostPlaceholder) + return + end + local csGuest = (type(mdResolve) == "function") + and mdResolve(CsRfPdaGuest, "CsRfPdaGuest") or CsRfPdaGuest + if csGuest ~= nil and type(csGuest.onOpenHelp) == "function" then + pcall(csGuest.onOpenHelp, self.rfHostPlaceholder) + end +end + function RfPdaMenuPage:_csPageSel() return self.csSubnavSelector end