Skip to content

Commit

Permalink
Don't draw icon bar if inventory menu is hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruin0x11 committed Aug 25, 2021
1 parent 32e5fe5 commit 817469e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/api/gui/menu/InventoryMenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ function InventoryMenu:init(ctxt, returns_item)
self.cargo_weight = 0
self.detail_view = nil
self.subtext_column = self.ctxt.proto.window_detail_header or "ui.inv.window.weight"
self.is_drawing = true
self.total_weight_text = ""
self.text_equip_slots = {}
self.play_sound = false
Expand Down Expand Up @@ -458,8 +457,12 @@ function InventoryMenu:update_filtering(play_sound)
end
end

function InventoryMenu:is_menu_visible()
return self.ctxt:is_menu_visible()
end

function InventoryMenu:draw()
if not self.ctxt:is_menu_visible() then
if not self:is_menu_visible() then
return
end

Expand Down
2 changes: 1 addition & 1 deletion src/api/gui/menu/InventoryWrapper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ function InventoryWrapper:relayout(x, y, width, height)
end

function InventoryWrapper:draw()
if not self.submenu.is_drawing then
if not self.submenu:is_menu_visible() then
return
end
Draw.set_color(255, 255, 255)
Expand Down

0 comments on commit 817469e

Please sign in to comment.