Skip to content

Commit

Permalink
Small gui adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
schwiti6190 committed Dec 30, 2024
1 parent 9f68584 commit 0c3b34e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
4 changes: 3 additions & 1 deletion scripts/gui/CpInGameMenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
39 changes: 21 additions & 18 deletions scripts/gui/pages/CpHelpFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0c3b34e

Please sign in to comment.