I don't think .IsItem works correctly with shorthand script. Anyway... I've rigged up a rough script that seems to do the trick. Might even use it myself.
1. You need to make sure you create the item images under the animation tab. They should be set to infinite loop under the properties tab & if they are only a single frame, then set a high pause amount, say: 999 or something to that effect - give the engine less work to do by having it loop the frame less often.
2. you will need a mouse event listener that calls the functions used to scale the items up & reset the non-active items back to default size.
function mouseEvt(typ, pos)
-- + --
if typ == eEvtMouseMove then
if game.CurrentScene:getName() == game.CurrentCharacter.Scene:getName() then scaleItem() end
end
-- + --
end
registerEventHandler("mouseEvent", "mouseEvt")
... if you already have a mouse event handler then just add this line inside of a if type == eEvtMouseMove query. (this is just to prevent the function from triggering if current character is not on the current scene. I suppose I could have just queried if inventory was visible, but... too late now.
if game.CurrentScene:getName() == game.CurrentCharacter.Scene:getName() then scaleItem() end
3. create a new definition script & add this to it...
--[[
Scale Items Up / Down (on mouse enter / leave) [V2] (30/09/2015)
Written by AFRLme [Lee Clarke]
-- + --
afrlme@outlook.com | skype @ AFRLme
-- + --
This script is donation optional. In game credit is non-negotiable.
You are free to: ¹ use it in your game(s). ² modify the script.
Do not remove - or edit - this comment block.
--]]
local ci = nil
local itm = nil
local state = false
function scaleItem()
if game.CurrentObject:getId().tableId == eObjects then
if game.CurrentObject:getBool(VObjectIsItem) then
if itm ~= game.CurrentObject:getName() then state = true; itm = game.CurrentObject:getName(); ActiveAnimations[itm]:to(220, {AnimationSize = 115}, easeQuadOut); resetItemScale() end
end
else
itm = nil; resetItemScale()
end
end
function resetItemScale()
if state then
ci = game.CurrentCharacter.Items
if itm == nil then state = false end
for i = 1, #ci do
if ci[i]:getName() ~= itm and ActiveAnimations[ ci[i]:getName() ].AnimationSize ~= 100 then ActiveAnimations[ ci[i]:getName() ]:to(220, {AnimationSize = 100}, easeQuadOut) end
end
end
end
& voila. It should work & without any errors either.