View Single Post
  #2  
Unread 11-12-2011, 11:20 AM
Cearbhall's Avatar
Cearbhall Cearbhall is offline
The Undefeated
Interface Author - Click to view interfaces
 
Join Date: Sep 2010
Posts: 5
the reason that is not working is because :GetShortcut() returns the class Turbine.UI.Lotro.Shortcut
which isn't the data you want

this is what i do
Code:
quickslot.ShortcutChanged = function(sender, args)
	local shortcut = sender:GetShortcut()
	local type, data = shortcut:GetType(), shortcut:GetData()
	if type == Turbine.UI.Lotro.ShortcutType.Undef then
		DB.quickslots[sender._index] = nil
	else
		DB.quickslots[sender._index] = {type, data}
	end
end

--and to load the data

if DB.quickslots[quickslot._index] then
	quickslot:SetShortcut(Turbine.UI.Lotro.Shortcut(DB.quickslots[quickslot._index][1], DB.quickslots[quickslot._index][2]))
end


--quickslot._index is something i set to show what slot it represented
Reply With Quote