close inventory by almost every action

  • #1, by PanSFriday, 08. February 2019, 20:33 5 years ago
    I had a simple script to slide my in inventory with mousewheels.
    local movInventory = Interfaces.int_inventory
    
    function openInventory()
      if getTime() > 510 then
        Interfaces["int_inventory"].Visible = true
    
        startObjectTween(movInventory, VInterfaceOffset, movInventory:getPoint(VInterfaceOffset), {x = 230, y = 0}, 500, easeBackInOut)
     
        getTime({flags=1, reset=true})
      end
    end
    
    function closeInventory()
      if getTime() > 510 then
        startObjectTween(movInventory, VInterfaceOffset, movInventory:getPoint(VInterfaceOffset), {x = 230, y = -710}, 500, easeBackInOut)
    
        setDelay(510, function() Interfaces["int_inventory"].Visible = false end )
    
        getTime({flags=1, reset=true})
      end
    end
    

    But now I am looking for a simple methode to close it automatically by nearly every other action: go to menu, start dialog, click one the scene etc.
    It closes already when leaving the inventory area, but cursor must have been in the area before.

    Any Ideas? grin

    Newbie

    73 Posts


  • #2, by sebastianSaturday, 09. February 2019, 13:35 5 years ago
    you could use a button area inside the inventory, which covers the rest of the surrounding inventory. When clicked, it closes the menu.

    Thread Captain

    2346 Posts

  • #3, by PanSMonday, 11. February 2019, 17:04 5 years ago
    Thx. Thats really the simplest solution!

    Newbie

    73 Posts