View Single Post
03-16-16, 09:59 AM   #37
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,891
I don't know Pitbull well enough to tell you exactly how but the process of getting a specialisation comes in two parts.

First determine if the target can be inspected and if so send an inspect request to the server.
Code:
if CanInspect("target") then
	frame:RegisterEvent("INSPECT_READY")
	NotifyInspect("target")
else
	print("Can't inspect target")
end
Once the server has gathered the information it will send an "INSPECT_READY" event to the designated frame(s) which can then retrieve the information.

Frames OnEvent script for the "INSPECT_READY" event:
Code:
local spec_id = GetInspectSpecialization("target")
self:UnregisterEvent("INSPECT_READY")
ClearInspectPlayer()
local id, name, description, icon, background, role, class = GetSpecializationInfoByID(spec_id)
print(name) -- or set a texture to display the icon
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote