I'm trying to find a way to programmatically (in an addon) detect if a piece of gear (that is either worn or linked) is correctly socketed.
The basic code is..
Code:
local numSockets = GetNumSockets();
local bonus = true
for i=1, numSockets do
local _, _, gemMatchesSocket = GetExistingSocketInfo(i);
if (not gemMatchesSocket) then
bonus = false
break
end
end
if (bonus) then
--Scan the socket bonus line
end
However calls to GetNumSockets() and GetExistingSocketInfo(<socket num>) require the ItemSocketingUI to be loaded. What I'm wondering is is there a way to programmatically load the UI with a piece of gear OR is there another way o go about checking the socket bonus.
Any help would be greatly appreciated.