Your browser does not support JavaScript or its disabled!
Please turn it on, or be aware that some features on this website will not work correctly.
332
Open Backpacks Minimised #21
790b | 21 lines.
local openMin = addSwitch("openMin", "Open Minimised", function(widget)
    widget:setOn(not widget:isOn())
    storage.openMin = widget:isOn()
end, parent)
openMin:setOn(storage.openMin)

onContainerOpen(function(container, previousContainer)
    if openMin:isOn() then
        if not previousContainer then
            local containerPanel = modules.game_interface.getContainerPanel()
            local containerWindow = containerPanel:getChildById('container' .. container:getId())
            if containerWindow then
                if containerWindow:getId() == "container0" then
                    containerWindow:setContentHeight(34)
                else
                    containerWindow:minimize()
                end
            end
        end
    end
end)

01 May 2021