Login / Registrieren
DE EN FR ES IT CZ
Zurück Nach oben

close inventory by almost every action

  • #1, de PanS h 7 years ago Zitieren
    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
  • #2, de sebastian h 7 years ago Zitieren
    you could use a button area inside the inventory, which covers the rest of the surrounding inventory. When clicked, it closes the menu.
  • #3, de PanS h 7 years ago Zitieren
    Thx. Thats really the simplest solution!