You can try this. Be sure to add
frame:EnableMouse(true) up where the frame is being set up to have it respond to mouse events.
Lua Code:
frame:SetScript("OnEvent", function(self, event, ...)
local itemID, _, itemName, itemIcon, totalXP, pointsSpent = C_ArtifactUI.GetEquippedArtifactInfo()
if itemID then
local pointsFree, xpToNextPoint = 0, C_ArtifactUI.GetCostForPointAtRank(pointsSpent);
while totalXP >= xpToNextPoint do
totalXP, pointsSpent, pointsFree, xpToNextPoint = totalXP - xpToNextPoint, pointsSpent + 1, pointsFree + 1, C_ArtifactUI.GetCostForPointAtRank(pointsSpent + 1);
end
text:SetFormattedText("AP |cff00ff00%d/%d (%.1f%%)|r" .. (pointsFree > 0 and " (+%d)" or ""), totalXP, xpToNextPoint, 100 * totalXP / xpToNextPoint, pointsFree);
end
frame:SetShown(itemID and true or false);
end);
frame:SetScript("OnEnter", function(self)
local _, _, itemName = C_ArtifactUI.GetEquippedArtifactInfo()
local _, akLevel = GetCurrencyInfo(1171);
GameTooltip:SetOwner(self, "ANCHOR_BOTTOM");
GameTooltip:SetText(itemName);
if akLevel > 0 then
GameTooltip:AddLine(string.format("Artifact Knowledge |cff00ff00%d (+%d%%)|r",akLevel,akMulti[akLevel] or 0));
end
GameTooltip:Show();
end);
frame:SetScript("OnLeave", function(self) GameTooltip:Hide(); end);