WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Search/Requests (https://www.wowinterface.com/forums/forumdisplay.php?f=6)
-   -   Achive_Compare (https://www.wowinterface.com/forums/showthread.php?t=52817)

gmarco 10-16-15 11:02 AM

Achive_Compare
 
1 Attachment(s)
I used from ages a little addon:

achievecompare by strangelet.

It compares your achivement status when you click on a achivement link by someone else.

I think it is abandoned since last updated 11.01.2013 and curse client reports a not found home page here:

http://www.curse.com/addons/wow/achieve_compare

and wowinterface don't find it if you search.

I try to upload it here because I think it is a good and usefull idea and perhaps it finds someone that have the skill to updates it.

Cheers :)

Phanx 10-16-15 07:16 PM

XML and global everything, my bleeding eyes...

Here's an XML-free version that doesn't put names like "init" in the gloal namespace and, as a side bonus, shouldn't taint Twitter functionality for those poor confused souls who use it.

Not tested in-game.

Code:

local tooltip = CreateFrame("GameTooltip", "AchieveCompareTooltip", UIParent, "GameTooltipTemplate")
tooltip:EnableMouse(true)
tooltip:SetToplevel(true)
tooltip:SetMovable(true)
tooltip:SetFrameStrata("TOOLTIP")
tooltip:Hide()
tooltip:SetSize(128, 64)
tooltip:SetPoint("BOTTOM", 150, 80)
tooltip:SetPadding(16)
tooltip:RegisterForDrag("LeftButton")
tooltip:SetScript("OnDragStart", tooltip.StartMoving)
tooltip:SetScript("OnDragStop", function(self)
        self:StopMovingOrSizing()
        ValidateFramePosition(self)
end)

GameTooltip_OnLoad(tooltip)
tinsert(UISpecialFrames, "AchieveCompareTooltip")

local close = CreateFrame("Button", nil, tooltip)
close:SetSize(32, 32)
close:SetPoint("TOPRIGHT", 1, 0)
close:SetScript("OnClick", function() HideUIPanel(tooltip) end)
close:SetNormalTexture([[Interface\Buttons\UI-Panel-MinimizeButton-Up]])
close:SetPushedTexture([[Interface\Buttons\UI-Panel-MinimizeButton-Down]])
close:SetHighlightTexture([[Interface\Buttons\UI-Panel-MinimizeButton-Highlight]])
close:GetHighlightTexture():SetBlendMode("ADD")
tooltip.closeButton = close

hooksecurefunc(ItemRefTooltip, "SetHyperlink", function(ItemRefTooltip, link)
        local linkType, id = strsplit(":", link)
        if linkType == "achievement" then
                local achievementLink = GetAchievementLink(id)
                ShowUIPanel(tooltip)
                if not tooltip:IsShown() then
                        tooltip:SetOwner(UIParent, "ANCHOR_PRESERVE")
                end
                tooltip:SetHyperlink(achievementLink)
        end
end)


gmarco 10-17-15 01:02 AM

1 Attachment(s)
Phanx,

I tested in game and without no surprise (because you write it :-) works like a charm :)
Without the XML part I am also able to understand the code much better :)

I attach here the code packed as addon if someone else wants to use (it is really very handy).

If Phanx don't mind to make an addon herself and don't mind too the fact she wrote it all I can also publish and mantain it (or at least try to :) .

Thanks again Phanx.


All times are GMT -6. The time now is 12:41 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI