not the best way i'm sure but can get around this until Turbine fixes it
Code:
--create quickslots
local needsItemAddedEvent = false
local function setShortCuts()
needsItemAddedEvent = false
for i = 1, 5 do
if DB.quickslots[i] then
local qs = window.quickslots[i]
local sc = Turbine.UI.Lotro.Shortcut(DB.quickslots[i][1], DB.quickslots[i][2])
local ok = pcall(qs.SetShortcut, qs, sc)
if not ok then
needsItemAddedEvent = true
end
end
end
if not needsItemAddedEvent and ItemAdded then
Shady.Helper.Event.UnregisterCallback(backpack, 'ItemAdded', ItemAdded)
end
end
plugin.Load = function()
setShortCuts()
if needsItemAddedEvent then
local player = Turbine.Gameplay.LocalPlayer.GetInstance()
backpack = player:GetBackpack()
ItemAdded = Shady.Helper.Event.RegisterCallback(backpack, 'ItemAdded', function(s, args)
setShortCuts()
end)
end
end
downside: quickslot's shortcut gets set everytime ItemAdded event fires
Of course you can check to see if all your quickslots setshortcut without error and unregister the backpack.ItemAdded event
edit: updated it to do just that