View Single Post
12-17-20, 11:20 AM   #5
maqjav
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Feb 2012
Posts: 60
It seems they get that virtualID from the CURSOR_CHANGED event:

Extracted from https://www.townlong-yak.com/framexm...lbindsTree.lua
Code:
function SoulbindTreeMixin:OnEvent(event, ...)
	--
	elseif event == "CURSOR_CHANGED" then
		local isDefault, newCursorType, oldCursorType, oldCursorVirtualID = ...;
		self:OnCursorChanged(isDefault, newCursorType, oldCursorType, oldCursorVirtualID);
	---
	end
end

function SoulbindTreeMixin:OnCursorChanged(isDefault, newCursorType, oldCursorType, oldCursorVirtualID)
	if isDefault and oldCursorType == Enum.UICursorType.ConduitCollectionItem then
		local previewConduitType, previewConduitID = Soulbinds.GetPreviewConduit();
		
		if previewConduitID and oldCursorVirtualID > 0 then
			local conduitData = C_Soulbinds.GetConduitCollectionDataByVirtualID(oldCursorVirtualID);
			if conduitData.conduitID == previewConduitID then
				return;
			end
		end
       --
end
I have tried to loop trough half million IDs, and none exists, so I imagine that the ID is created under certain cases (probably that's why its named virtualID).
  Reply With Quote