Quantcast
Achievement Hyperlinks - WoWInterface
Thread Tools Display Modes
07-27-22, 05:45 PM   #1
Walkerbo
A Chromatic Dragonspawn
 
Walkerbo's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 183
Achievement Hyperlinks

Hi all

I am trying to build a hyperlink that will display a custom achievement.

I want the hyperlink to display my achievement Title, Character Name and Date strings.

I also want to find the achievement frame, that I would like to use as an addon frame.

Here is the image of the achievement frame yet I have not been able to find that frame yet.

Any help out there that can help me with these issues.
__________________
"As someone once told me, frames are just special types of tables, and tables are special types of pointers."
Fizzlemizz
  Reply With Quote
08-10-22, 06:12 PM   #2
Walkerbo
A Chromatic Dragonspawn
 
Walkerbo's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 183
Hey all

I have tried so many ways to try and get this working without success, and at this point, I have to accept there is likely no way to do it.

Oh well, we can't always get what we want.

Cheers all
__________________
"As someone once told me, frames are just special types of tables, and tables are special types of pointers."
Fizzlemizz
  Reply With Quote
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,136
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
08-12-22, 07:59 PM   #4
Walkerbo
A Chromatic Dragonspawn
 
Walkerbo's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 183
Hi SDPhantom

Yea, I also went down the tooltip path but it too did not solve my issue.

You are right, the only way to get this to work is to ensure both players have the addon, which is not guaranteed.

So I have now accepted that it will not work the way I wanted it to, (and I can see why).

Cheers
__________________
"As someone once told me, frames are just special types of tables, and tables are special types of pointers."
Fizzlemizz
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Achievement Hyperlinks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off