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.
2.1K
Open Backpacks Minimised #21
790b | 21 lines.
 --[[
  Script made by Lee (Discord: l33_) - www.trainorcreations.com
  If you want to support my work, feel free to donate at https://trainorcreations.com/donate
  PS. Stop ripping off my work and selling it as your own.
 ]]--
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
Ads