Skip to content

Commit

Permalink
Add a Version field to auras which is shown in tooltips
Browse files Browse the repository at this point in the history
This is handled the same as the url. It's automatically filled by
websites such as wago.io.

Github-Ticket: 257
  • Loading branch information
InfusOnWoW authored and Stanzilla committed Jul 29, 2017
1 parent 83717c9 commit 5972beb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
9 changes: 7 additions & 2 deletions WeakAuras/Transmission.lua
Original file line number Diff line number Diff line change
Expand Up @@ -805,16 +805,17 @@ function WeakAuras.ShowDisplayTooltip(data, children, icon, icons, import, compr
local size = #tooltip
tooltip[26] = {2, " ", "[...]", 1, 1, 1, 1, 1, 1};
local nrOfChildren = children and #children or data.controlledChildren and #data.controlledChildren or 0
tooltip[27] = {1, string.format(L["%s total auras"], nrOfChildren), "", 1, 1, 1, 1, 1, 1};
tooltip[27] = {1, string.format(L["%s total auras"], nrOfChildren), "", 1, 1, 1, 1};
for i = 28, size do
tooltip[i] = nil;
end
end

local hasDescription = data.desc and data.desc ~= "";
local hasUrl = data.url and data.url ~= "";
local hasVersion = data.version and data.version ~= "";

if(hasDescription or hasUrl) then
if(hasDescription or hasUrl or hasVersion) then
tinsert(tooltip, {1, " "});
end

Expand All @@ -826,6 +827,10 @@ function WeakAuras.ShowDisplayTooltip(data, children, icon, icons, import, compr
tinsert(tooltip, {1, data.url, 1, 0.82, 0, 1});
end

if (hasVersion) then
tinsert(tooltip, {1, L["Version: "] .. data.version, 1, 0.82, 0, 1});
end

local importbutton;
local showcodebutton;
if(import) then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local tinsert, tconcat, tremove, wipe = table.insert, table.concat, table.remove
local select, pairs, next, type, unpack = select, pairs, next, type, unpack
local tostring, error = tostring, error

local Type, Version = "WeakAurasDisplayButton", 28
local Type, Version = "WeakAurasDisplayButton", 29
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end

Expand Down Expand Up @@ -872,8 +872,9 @@ local methods = {

local hasDescription = data.desc and data.desc ~= "";
local hasUrl = data.url and data.url ~= "";
local hasVersion = data.version and data.version ~= "";

if(hasDescription or hasUrl) then
if(hasDescription or hasUrl or hasVersion) then
tinsert(namestable, " ");
end

Expand All @@ -882,7 +883,11 @@ local methods = {
end

if (hasUrl) then
tinsert(namestable, "|cFFFFD100".. data.url);
tinsert(namestable, "|cFFFFD100" .. data.url .. "|r");
end

if (hasVersion) then
tinsert(namestable, "|cFFFFD100" .. L["Version: "] .. data.version .. "|r");
end

tinsert(namestable, " ");
Expand Down

0 comments on commit 5972beb

Please sign in to comment.