diff --git a/src/api/gui/menu/InventoryMenu.lua b/src/api/gui/menu/InventoryMenu.lua index 322bf9e4..b99f3832 100644 --- a/src/api/gui/menu/InventoryMenu.lua +++ b/src/api/gui/menu/InventoryMenu.lua @@ -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 @@ -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 diff --git a/src/api/gui/menu/InventoryWrapper.lua b/src/api/gui/menu/InventoryWrapper.lua index e9599630..9f210324 100644 --- a/src/api/gui/menu/InventoryWrapper.lua +++ b/src/api/gui/menu/InventoryWrapper.lua @@ -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)