table.insert(game.CurrentCharacter.Interfaces, interface)
for i=0, #Characters.char_onk.Interfaces do
if Characters.char_onk.Interfaces[i] == interface then
table.remove(game.CurrentCharacter.Interfaces, interface)
end
end
for i=0, #animItem.Sprites do
print(animItem.Sprites[i])
end
table.insert(game.CurrentCharacter.Interfaces, interface)
local t = game.CurrentCharacter.Interfaces
table.insert(t, interface)
game.CurrentCharacter.Interfaces = t
for i=0, #animItem.Sprites do
print(animItem.Sprites[i].path)
print(animItem.Sprites[i].position)
print(animItem.Sprites[i].pause)
end
function pocketItem(item)
--print(item)
if not item:isEmpty() then
local curPos = getCursorPos()
local itemGfxPath = item.Sprite.Sprite:getPath()
local tmpOff = 22
showItemInt = true
local sprTable = {}
for i=0, 1 do
if animItem.Sprites[i] then
sprTable[i] = animItem.Sprites[i]
end
end
if sprTable[1] then
sprTable[1].path = "" ..itemGfxPath.. ""
sprTable[1].pause = 100
animItem.Pause = timePocket
animItem.Sprites = sprTable
end
startAnimation(animItem)
ActiveAnimations.anim_default_item:to(0, { AnimationCurrentPosition = {x = curPos.x - tmpOff, y = curPos.y - tmpOff}}, easeLinearInOut)
local movPos = { x=0, y=0 }
movPos.x = posInvIcon.x - math.floor(pxItemGfx/2)
movPos.y = posInvIcon.y - math.floor(pxItemGfx/2)
setDelay(10, function()
ActiveAnimations.anim_default_item:to(timePocket, { AnimationCurrentPosition = {x = movPos.x, y = movPos.y}}, easeBackIn)
end)
setDelay(10+timePocket, function() animInvBttn() end)
end
end
function activateHotBttn()
local gameHotBttn = Scenes.new_menu_main.Conditions.cond_hotspot_button.ConditionValue
local invHotSpots = Interfaces.int_hotspots
local tblInterface = {}
tblInterface = game.CurrentCharacter.Interfaces
local iC = 0 --check if an interface is already set
if gameHotBttn == true then
--print("activate hot button")
for i=0, #tblInterface do
if tblInterface[i] == invHotSpots then iC = iC + 1 end
end
if iC == 0 then
table.insert(tblInterface, invHotSpots)
end
else
--print("deactivate hot button")
for i=0, #tblInterface do
--print(tblInterface[i])
if tblInterface[i] == invHotSpots then
--print(tblInterface[i], "is part of the table")
table.remove(tblInterface)
end
end
end
game.CurrentCharacter.Interfaces = tblInterface
end