View Single Post
08-11-22, 05:36 AM   #3
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,327
What you have in the image isn't the achievement frame, it's a tooltip. Specifically ItemRefTooltip.

Lua Code:
  1. function ShowCustomTooltip(title,character,date,description)
  2. --  Mimics SetItemRef() starting at ItemRef.lua:389
  3.     ShowUIPanel(ItemRefTooltip);
  4.     if not ItemRefTooltip:IsShown() then ItemRefTooltip:SetOwner(UIParent, "ANCHOR_PRESERVE"); end
  5.  
  6. --  Mimics :ItemRefSetHyperlink() at ItemRef.lua:791
  7.     ItemRefTooltip:SetPadding(0,0);
  8.  
  9. --  Custom Text (Replaces :SetHyperlink() at ItemRef.lua:793)
  10.     ItemRefTooltip:ClearLines();
  11.     ItemRefTooltip:AddLine(title,1,1,1);
  12.     ItemRefTooltip:AddLine(" ");
  13.     ItemRefTooltip:AddLine(("Achievement earned by %s on %s"):format(character,date),0,1,0);
  14.     if description then
  15.         ItemRefTooltip:AddLine(" ");
  16.         ItemRefTooltip:AddLine(description,1,1,1);
  17.     end
  18.  
  19.     if ItemRefTooltipTextLeft1 and ItemRefTooltipTextLeft1:GetRight()-ItemRefTooltip.CloseButton:GetLeft()>0 then
  20.         ItemRefTooltip:SetPadding(16,0);
  21.     end
  22. end

As for sending this through chat to another player, links are encoded with an achievement ID and the GUID of the player. Links of any type do not support custom data. You'll have to find your own way to encode and transmit this info and it'll require your addon on both ends.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote