diff --git a/scripts/gui/CpInGameMenu.lua b/scripts/gui/CpInGameMenu.lua index fc0a1176..5b59256f 100644 --- a/scripts/gui/CpInGameMenu.lua +++ b/scripts/gui/CpInGameMenu.lua @@ -290,9 +290,11 @@ function CpInGameMenu:onClickMenu() end function CpInGameMenu:onPageChange(pageIndex, pageMappingIndex, element, skipTabVisualUpdate) - CpInGameMenu:superClass().onPageChange(self, pageIndex, pageMappingIndex, element, skipTabVisualUpdate) self:updateBackground() + if self.currentPage.categoryHeaderIcon then + self.currentPage.categoryHeaderIcon:setImageSlice(nil, self.pageTabs[self.currentPage].iconSliceId) + end end function CpInGameMenu:getPageButtonInfo(page) diff --git a/scripts/gui/pages/CpHelpFrame.lua b/scripts/gui/pages/CpHelpFrame.lua index a1372a98..a5ce7b2e 100644 --- a/scripts/gui/pages/CpHelpFrame.lua +++ b/scripts/gui/pages/CpHelpFrame.lua @@ -46,28 +46,31 @@ end function CpHelpFrame:onFrameOpen() CpHelpFrame:superClass().onFrameOpen(self) - self.customEnvironments = self.helpLineManager:getCustomEnvironmentNames() - local texts = {} - for _, env in ipairs(self.customEnvironments) do - if string.isNilOrWhitespace(env) then - --table.insert(texts, g_i18n:getText("ui_helpLine_baseGame")) - else - local mod = g_modManager:getModByName(env) - if mod then - table.insert(texts, mod.title) + if not self.wasOpened then + self.customEnvironments = self.helpLineManager:getCustomEnvironmentNames() + local texts = {} + for _, env in ipairs(self.customEnvironments) do + if string.isNilOrWhitespace(env) then + --table.insert(texts, g_i18n:getText("ui_helpLine_baseGame")) else - table.insert(texts, "Unknown") + local mod = g_modManager:getModByName(env) + if mod then + table.insert(texts, mod.title) + else + table.insert(texts, "Unknown") + end + end + end + self.helpLineSelector:setTexts(texts) + for i = 1, #self.helpLineSelector.texts do + local dot = self.helpLineDotTemplate:clone(self.helpLineDotBox) + dot.getIsSelected = function () + return self.helpLineSelector:getState() == i end - end - end - self.helpLineSelector:setTexts(texts) - for i = 1, #self.helpLineSelector.texts do - local dot = self.helpLineDotTemplate:clone(self.helpLineDotBox) - dot.getIsSelected = function () - return self.helpLineSelector:getState() == i end + self.helpLineDotBox:invalidateLayout() + self.wasOpened = true end - self.helpLineDotBox:invalidateLayout() self.helpLineList:reloadData() self:setSoundSuppressed(true) FocusManager:setFocus(self.helpLineList)