Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions modules/game_interface/widgets/statsbar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ function StatsBar.getCurrentStatsBarWithPosition()
-- It's made this way so we can call the current stats bar without having to use a switch statement.
-- And if it's necessary to add more stats bars like "largeOnLeft" it will be easier to add them
-- Without changing this code.
if currentStats.dimension == 'hide' and currentStats.placement == 'hide' then
if currentStats.dimension == 'hide' or currentStats.placement == 'hide' then
return nil
end
-- -- Get full position as a single string.
Expand All @@ -222,7 +222,7 @@ end
function StatsBar.getCurrentStatsBar()
-- This method will return the statsbar based on its placement.
-- i.e statsBarTop // statsBarBottom
if currentStats.dimension == 'hide' and currentStats.placement == 'hide' then
if currentStats.dimension == 'hide' or currentStats.placement == 'hide' then
return nil
end
-- -- Get full placement.
Expand Down Expand Up @@ -475,7 +475,12 @@ local function onStatsMousePress(tab, mousePos, mouseButton)
end

function StatsBar.reloadCurrentTab()
if currentStats.dimension == "hide" then
return
end

local dimension = currentStats.dimension:gsub("^%l", string.upper)

if statsBarsDimensions[dimension] then
return constructStatsBar(dimension, currentStats.placement)
else
Expand Down