close inventory by almost every action

  • #1, by PanSFriday, 08. February, 20:33 A week 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
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22

    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

    45 Posts


  • #2, by sebastianSaturday, 09. February, 13:35 A week 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

    2268 Posts

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

    Newbie

    45 Posts

Write post