Updated LibOpenRaid and DetailsFramework
This commit is contained in:
+86
-86
@@ -9,7 +9,7 @@ local on_deathrecap_line_enter = function(self)
|
||||
if (self.spellid) then
|
||||
GameTooltip:SetOwner (self, "ANCHOR_RIGHT")
|
||||
Details:GameTooltipSetSpellByID (self.spellid)
|
||||
self:SetBackdropColor (.3, .3, .3, .2)
|
||||
self:SetBackdropColor(.3, .3, .3, .2)
|
||||
GameTooltip:Show()
|
||||
self.backgroundTextureOverlay:Show()
|
||||
self.timeAt:SetAlpha (1)
|
||||
@@ -21,7 +21,7 @@ end
|
||||
|
||||
local on_deathrecap_line_leave = function(self)
|
||||
GameTooltip:Hide()
|
||||
self:SetBackdropColor (.3, .3, .3, 0)
|
||||
self:SetBackdropColor(.3, .3, .3, 0)
|
||||
self.backgroundTextureOverlay:Hide()
|
||||
self.timeAt:SetAlpha (textAlpha)
|
||||
self.sourceName:SetAlpha (textAlpha)
|
||||
@@ -30,19 +30,19 @@ local on_deathrecap_line_leave = function(self)
|
||||
end
|
||||
|
||||
local create_deathrecap_line = function(parent, n)
|
||||
local line = CreateFrame ("frame", "DetailsDeathRecapLine" .. n, parent, "BackdropTemplate")
|
||||
line:SetPoint ("topleft", parent, "topleft", 10, (-24 * n) - 17)
|
||||
line:SetPoint ("topright", parent, "topright", -10, (-24 * n) - 17)
|
||||
line:SetScript ("OnEnter", on_deathrecap_line_enter)
|
||||
line:SetScript ("OnLeave", on_deathrecap_line_leave)
|
||||
local line = CreateFrame("frame", "DetailsDeathRecapLine" .. n, parent, "BackdropTemplate")
|
||||
line:SetPoint("topleft", parent, "topleft", 10, (-24 * n) - 17)
|
||||
line:SetPoint("topright", parent, "topright", -10, (-24 * n) - 17)
|
||||
line:SetScript("OnEnter", on_deathrecap_line_enter)
|
||||
line:SetScript("OnLeave", on_deathrecap_line_leave)
|
||||
|
||||
line:SetSize (300, 21)
|
||||
line:SetSize(300, 21)
|
||||
|
||||
local timeAt = line:CreateFontString (nil, "overlay", "GameFontNormal")
|
||||
local backgroundTexture = line:CreateTexture (nil, "border")
|
||||
local backgroundTextureOverlay = line:CreateTexture (nil, "artwork")
|
||||
local spellIcon = line:CreateTexture (nil, "overlay")
|
||||
local spellIconBorder = line:CreateTexture (nil, "overlay")
|
||||
local backgroundTexture = line:CreateTexture(nil, "border")
|
||||
local backgroundTextureOverlay = line:CreateTexture(nil, "artwork")
|
||||
local spellIcon = line:CreateTexture(nil, "overlay")
|
||||
local spellIconBorder = line:CreateTexture(nil, "overlay")
|
||||
spellIcon:SetDrawLayer ("overlay", 1)
|
||||
spellIconBorder:SetDrawLayer ("overlay", 2)
|
||||
local sourceName = line:CreateFontString (nil, "overlay", "GameFontNormal")
|
||||
@@ -51,30 +51,30 @@ local create_deathrecap_line = function(parent, n)
|
||||
local lifeStatusBar = line:CreateTexture(nil, "border", nil, -3)
|
||||
|
||||
--grave icon
|
||||
local graveIcon = line:CreateTexture (nil, "overlay")
|
||||
graveIcon:SetTexture ([[Interface\MINIMAP\POIIcons]])
|
||||
local graveIcon = line:CreateTexture(nil, "overlay")
|
||||
graveIcon:SetTexture([[Interface\MINIMAP\POIIcons]])
|
||||
graveIcon:SetTexCoord (146/256, 160/256, 0/512, 18/512)
|
||||
graveIcon:SetPoint ("left", line, "left", 11, 0)
|
||||
graveIcon:SetSize (14, 18)
|
||||
graveIcon:SetPoint("left", line, "left", 11, 0)
|
||||
graveIcon:SetSize(14, 18)
|
||||
|
||||
--spell icon
|
||||
spellIcon:SetSize (19, 19)
|
||||
spellIconBorder:SetTexture ([[Interface\ENCOUNTERJOURNAL\LootTab]])
|
||||
spellIcon:SetSize(19, 19)
|
||||
spellIconBorder:SetTexture([[Interface\ENCOUNTERJOURNAL\LootTab]])
|
||||
spellIconBorder:SetTexCoord (6/256, 38/256, 49/128, 81/128)
|
||||
spellIconBorder:SetSize (20, 20)
|
||||
spellIconBorder:SetPoint ("topleft", spellIcon, "topleft", 0, 0)
|
||||
spellIconBorder:SetSize(20, 20)
|
||||
spellIconBorder:SetPoint("topleft", spellIcon, "topleft", 0, 0)
|
||||
|
||||
--locations
|
||||
timeAt:SetPoint ("left", line, "left", 2, 0)
|
||||
spellIcon:SetPoint ("left", line, "left", 50, 0)
|
||||
sourceName:SetPoint ("left", line, "left", 82, 0)
|
||||
amount:SetPoint ("left", line, "left", 240, 0)
|
||||
lifePercent:SetPoint ("left", line, "left", 320, 0)
|
||||
timeAt:SetPoint("left", line, "left", 2, 0)
|
||||
spellIcon:SetPoint("left", line, "left", 50, 0)
|
||||
sourceName:SetPoint("left", line, "left", 82, 0)
|
||||
amount:SetPoint("left", line, "left", 240, 0)
|
||||
lifePercent:SetPoint("left", line, "left", 320, 0)
|
||||
|
||||
--text colors
|
||||
Details.gump:SetFontColor (amount, "red")
|
||||
Details.gump:SetFontColor (timeAt, "gray")
|
||||
Details.gump:SetFontColor (sourceName, "yellow")
|
||||
Details.gump:SetFontColor(amount, "red")
|
||||
Details.gump:SetFontColor(timeAt, "gray")
|
||||
Details.gump:SetFontColor(sourceName, "yellow")
|
||||
|
||||
Details.gump:SetFontSize (sourceName, 10)
|
||||
|
||||
@@ -85,50 +85,50 @@ local create_deathrecap_line = function(parent, n)
|
||||
lifePercent:SetAlpha (textAlpha)
|
||||
|
||||
--text setup
|
||||
amount:SetWidth (85)
|
||||
amount:SetJustifyH ("right")
|
||||
lifePercent:SetWidth (42)
|
||||
lifePercent:SetJustifyH ("right")
|
||||
amount:SetWidth(85)
|
||||
amount:SetJustifyH("right")
|
||||
lifePercent:SetWidth(42)
|
||||
lifePercent:SetJustifyH("right")
|
||||
|
||||
--life statusbar
|
||||
lifeStatusBar:SetPoint("topleft", line, "topleft")
|
||||
lifeStatusBar:SetPoint("bottomleft", line, "bottomleft")
|
||||
lifeStatusBar:SetColorTexture(0.5, 0.5, 0.5, 0.4)
|
||||
|
||||
backgroundTexture:SetTexture ([[Interface\AddOns\Details\images\deathrecap_background]])
|
||||
backgroundTexture:SetTexture([[Interface\AddOns\Details\images\deathrecap_background]])
|
||||
backgroundTexture:SetTexCoord (0, 1, 0, 1)
|
||||
backgroundTexture:SetVertexColor (.1, .1, .1, .3)
|
||||
|
||||
--top border
|
||||
local TopFader = line:CreateTexture (nil, "border")
|
||||
TopFader:SetTexture ([[Interface\AddOns\Details\images\deathrecap_background_top]])
|
||||
local TopFader = line:CreateTexture(nil, "border")
|
||||
TopFader:SetTexture([[Interface\AddOns\Details\images\deathrecap_background_top]])
|
||||
TopFader:SetTexCoord (0, 1, 0, 1)
|
||||
TopFader:SetVertexColor (.1, .1, .1, .3)
|
||||
TopFader:SetPoint ("bottomleft", backgroundTexture, "topleft", 0, -0)
|
||||
TopFader:SetPoint ("bottomright", backgroundTexture, "topright", 0, -0)
|
||||
TopFader:SetHeight (32)
|
||||
TopFader:SetPoint("bottomleft", backgroundTexture, "topleft", 0, -0)
|
||||
TopFader:SetPoint("bottomright", backgroundTexture, "topright", 0, -0)
|
||||
TopFader:SetHeight(32)
|
||||
TopFader:Hide()
|
||||
line.TopFader = TopFader
|
||||
|
||||
if (n == 10) then
|
||||
--bottom fader
|
||||
local backgroundTexture2 = line:CreateTexture (nil, "border")
|
||||
backgroundTexture2:SetTexture ([[Interface\AddOns\Details\images\deathrecap_background_bottom]])
|
||||
local backgroundTexture2 = line:CreateTexture(nil, "border")
|
||||
backgroundTexture2:SetTexture([[Interface\AddOns\Details\images\deathrecap_background_bottom]])
|
||||
backgroundTexture2:SetTexCoord (0, 1, 0, 1)
|
||||
backgroundTexture2:SetVertexColor (.1, .1, .1, .3)
|
||||
backgroundTexture2:SetPoint ("topleft", backgroundTexture, "bottomleft", 0, 0)
|
||||
backgroundTexture2:SetPoint ("topright", backgroundTexture, "bottomright", 0, 0)
|
||||
backgroundTexture2:SetHeight (32)
|
||||
backgroundTexture2:SetPoint("topleft", backgroundTexture, "bottomleft", 0, 0)
|
||||
backgroundTexture2:SetPoint("topright", backgroundTexture, "bottomright", 0, 0)
|
||||
backgroundTexture2:SetHeight(32)
|
||||
|
||||
Details.gump:SetFontSize (amount, 14)
|
||||
Details.gump:SetFontSize (lifePercent, 14)
|
||||
backgroundTexture:SetVertexColor (.2, .1, .1, .3)
|
||||
end
|
||||
|
||||
backgroundTexture:SetPoint ("topleft", 0, 1)
|
||||
backgroundTexture:SetPoint ("bottomright", 0, -1)
|
||||
backgroundTexture:SetPoint("topleft", 0, 1)
|
||||
backgroundTexture:SetPoint("bottomright", 0, -1)
|
||||
backgroundTexture:SetDesaturated (true)
|
||||
backgroundTextureOverlay:SetTexture ([[Interface\AdventureMap\AdventureMap]])
|
||||
backgroundTextureOverlay:SetTexture([[Interface\AdventureMap\AdventureMap]])
|
||||
backgroundTextureOverlay:SetTexCoord (460/1024, 659/1024, 330/1024, 350/1024)
|
||||
backgroundTextureOverlay:SetAllPoints()
|
||||
backgroundTextureOverlay:SetDesaturated (true)
|
||||
@@ -238,7 +238,7 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
|
||||
for i = 1, 10 do
|
||||
Details.DeathRecap.Lines [i]:Hide()
|
||||
end
|
||||
for i, button in ipairs (Details.DeathRecap.Segments) do
|
||||
for i, button in ipairs(Details.DeathRecap.Segments) do
|
||||
button:Hide()
|
||||
end
|
||||
end
|
||||
@@ -255,10 +255,10 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
|
||||
|
||||
--create details death recap if not existant
|
||||
if (not Details.DeathRecap) then
|
||||
Details.DeathRecap = CreateFrame ("frame", "DetailsDeathRecap", DeathRecapFrame, "BackdropTemplate")
|
||||
Details.DeathRecap = CreateFrame("frame", "DetailsDeathRecap", DeathRecapFrame, "BackdropTemplate")
|
||||
Details.DeathRecap:SetAllPoints()
|
||||
|
||||
DeathRecapFrame.Title:SetText (DeathRecapFrame.Title:GetText() .. " (by Details!)")
|
||||
DeathRecapFrame.Title:SetText(DeathRecapFrame.Title:GetText() .. " (by Details!)")
|
||||
|
||||
--lines
|
||||
Details.DeathRecap.Lines = {}
|
||||
@@ -269,18 +269,18 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
|
||||
--segments
|
||||
Details.DeathRecap.Segments = {}
|
||||
for i = 5, 1, -1 do
|
||||
local segmentButton = CreateFrame ("button", "DetailsDeathRecapSegmentButton" .. i, Details.DeathRecap, "BackdropTemplate")
|
||||
local segmentButton = CreateFrame("button", "DetailsDeathRecapSegmentButton" .. i, Details.DeathRecap, "BackdropTemplate")
|
||||
|
||||
segmentButton:SetSize (16, 20)
|
||||
segmentButton:SetPoint ("topright", DeathRecapFrame, "topright", (-abs (i-6) * 22) - 10, -5)
|
||||
segmentButton:SetSize(16, 20)
|
||||
segmentButton:SetPoint("topright", DeathRecapFrame, "topright", (-abs (i-6) * 22) - 10, -5)
|
||||
|
||||
local text = segmentButton:CreateFontString (nil, "overlay", "GameFontNormal")
|
||||
segmentButton.text = text
|
||||
text:SetText ("#" .. i)
|
||||
text:SetPoint ("center")
|
||||
Details.gump:SetFontColor (text, "silver")
|
||||
text:SetText("#" .. i)
|
||||
text:SetPoint("center")
|
||||
Details.gump:SetFontColor(text, "silver")
|
||||
|
||||
segmentButton:SetScript ("OnClick", function()
|
||||
segmentButton:SetScript("OnClick", function()
|
||||
OpenDetailsDeathRecapAtSegment (i)
|
||||
end)
|
||||
tinsert (Details.DeathRecap.Segments, i, segmentButton)
|
||||
@@ -320,11 +320,11 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
|
||||
if (Details.death_recap.show_segments) then
|
||||
local last_index = 0
|
||||
local buttonsInUse = {}
|
||||
for i, button in ipairs (Details.DeathRecap.Segments) do
|
||||
for i, button in ipairs(Details.DeathRecap.Segments) do
|
||||
if (Details.tabela_historico.tabelas [i]) then
|
||||
button:Show()
|
||||
tinsert (buttonsInUse, button)
|
||||
Details.gump:SetFontColor (button.text, "silver")
|
||||
Details.gump:SetFontColor(button.text, "silver")
|
||||
last_index = i
|
||||
else
|
||||
button:Hide()
|
||||
@@ -338,18 +338,18 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
|
||||
for i = 1, #buttonsInUse2 do
|
||||
local button = buttonsInUse2 [i]
|
||||
button:ClearAllPoints()
|
||||
button:SetPoint ("topright", DeathRecapFrame, "topright", (-i * 22) - 10, -5)
|
||||
button:SetPoint("topright", DeathRecapFrame, "topright", (-i * 22) - 10, -5)
|
||||
end
|
||||
|
||||
if (not segment) then
|
||||
Details.gump:SetFontColor (Details.DeathRecap.Segments [1].text, "orange")
|
||||
Details.gump:SetFontColor(Details.DeathRecap.Segments [1].text, "orange")
|
||||
else
|
||||
Details.gump:SetFontColor (Details.DeathRecap.Segments [segment].text, "orange")
|
||||
Details.gump:SetFontColor(Details.DeathRecap.Segments [segment].text, "orange")
|
||||
death = Details.tabela_historico.tabelas [segment] and Details.tabela_historico.tabelas [segment].last_events_tables
|
||||
end
|
||||
|
||||
else
|
||||
for i, button in ipairs (Details.DeathRecap.Segments) do
|
||||
for i, button in ipairs(Details.DeathRecap.Segments) do
|
||||
button:Hide()
|
||||
end
|
||||
end
|
||||
@@ -407,14 +407,14 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
|
||||
for i = #events, 1, -1 do
|
||||
local event = events [i]
|
||||
local evType = event [1]
|
||||
if (type (evType) == "boolean" and evType) then
|
||||
if (type(evType) == "boolean" and evType) then
|
||||
hitKill = event
|
||||
break
|
||||
end
|
||||
end
|
||||
if (hitKill) then
|
||||
local haveHitKill = false
|
||||
for index, t in ipairs (BiggestDamageHits) do
|
||||
for index, t in ipairs(BiggestDamageHits) do
|
||||
if (t == hitKill) then
|
||||
haveHitKill = true
|
||||
break
|
||||
@@ -430,9 +430,9 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
|
||||
for i = #events, 1, -1 do
|
||||
local event = events [i]
|
||||
local evType = event [1]
|
||||
if (type (evType) == "boolean" and evType) then
|
||||
if (type(evType) == "boolean" and evType) then
|
||||
local alreadyHave = false
|
||||
for index, t in ipairs (BiggestDamageHits) do
|
||||
for index, t in ipairs(BiggestDamageHits) do
|
||||
if (t == event) then
|
||||
alreadyHave = true
|
||||
break
|
||||
@@ -470,7 +470,7 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
|
||||
local lineIndex = 10
|
||||
|
||||
--for i = #events, 1, -1 do
|
||||
for i, event in ipairs (events) do
|
||||
for i, event in ipairs(events) do
|
||||
local event = events [i]
|
||||
|
||||
local evType = event [1]
|
||||
@@ -483,15 +483,15 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
|
||||
|
||||
local customSpellInfo = event [11]
|
||||
|
||||
if (type (evType) == "boolean" and evType) then
|
||||
if (type(evType) == "boolean" and evType) then
|
||||
|
||||
local line = Details.DeathRecap.Lines [lineIndex]
|
||||
if (line) then
|
||||
line.timeAt:SetText (format ("%.1f", eventTime - timeOfDeath) .. "s")
|
||||
line.spellIcon:SetTexture (spellIcon or customSpellInfo and customSpellInfo [3] or "")
|
||||
line.timeAt:SetText(format ("%.1f", eventTime - timeOfDeath) .. "s")
|
||||
line.spellIcon:SetTexture(spellIcon or customSpellInfo and customSpellInfo [3] or "")
|
||||
line.TopFader:Hide()
|
||||
--line.spellIcon:SetTexCoord (.1, .9, .1, .9)
|
||||
--line.sourceName:SetText ("|cFFC6B0D9" .. source .. "|r")
|
||||
--line.sourceName:SetText("|cFFC6B0D9" .. source .. "|r")
|
||||
|
||||
--parse source and cut the length of the string after setting the spellname and source
|
||||
local sourceClass = Details:GetClass (source)
|
||||
@@ -517,12 +517,12 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
|
||||
end
|
||||
end
|
||||
|
||||
--> remove real name or owner name
|
||||
--remove real name or owner name
|
||||
source = Details:GetOnlyName (source)
|
||||
--> remove owner name
|
||||
--remove owner name
|
||||
source = source:gsub ((" <.*"), "")
|
||||
|
||||
--> if a player?
|
||||
--if a player?
|
||||
if (Details.player_class [sourceClass]) then
|
||||
source = Details:AddClassOrSpecIcon (source, sourceClass, sourceSpec, 16, true)
|
||||
|
||||
@@ -531,7 +531,7 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
|
||||
|
||||
end
|
||||
|
||||
--> remove the dot signal from the spell name
|
||||
--remove the dot signal from the spell name
|
||||
if (not spellName) then
|
||||
spellName = customSpellInfo and customSpellInfo [2] or "*?*"
|
||||
if (spellName:find (STRING_ENVIRONMENTAL_DAMAGE_FALLING)) then
|
||||
@@ -541,7 +541,7 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
|
||||
else
|
||||
source = "Gravity"
|
||||
end
|
||||
--/run for a,b in pairs (_G) do if (type (b)=="string" and b:find ("Falling")) then print (a,b) end end
|
||||
--/run for a,b in pairs (_G) do if (type(b)=="string" and b:find ("Falling")) then print (a,b) end end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -549,18 +549,18 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
|
||||
spellName = spellName:gsub ("[*] ", "")
|
||||
source = source or ""
|
||||
|
||||
line.sourceName:SetText (spellName .. " (" .. "|cFFC6B0D9" .. source .. "|r" .. ")")
|
||||
line.sourceName:SetText(spellName .. " (" .. "|cFFC6B0D9" .. source .. "|r" .. ")")
|
||||
DetailsFramework:TruncateText (line.sourceName, 185)
|
||||
|
||||
if (amount > 1000) then
|
||||
--line.amount:SetText ("-" .. Details:ToK (amount))
|
||||
line.amount:SetText ("-" .. Details:comma_value(floor(amount)))
|
||||
--line.amount:SetText("-" .. Details:ToK (amount))
|
||||
line.amount:SetText("-" .. Details:comma_value(floor(amount)))
|
||||
else
|
||||
--line.amount:SetText ("-" .. floor (amount))
|
||||
line.amount:SetText ("-" .. floor (amount))
|
||||
--line.amount:SetText("-" .. floor (amount))
|
||||
line.amount:SetText("-" .. floor (amount))
|
||||
end
|
||||
|
||||
line.lifePercent:SetText (hp .. "%")
|
||||
line.lifePercent:SetText(hp .. "%")
|
||||
line.lifeStatusBar:SetWidth(line:GetWidth() * (hp/100))
|
||||
|
||||
line.spellid = event [2]
|
||||
@@ -569,12 +569,12 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
|
||||
|
||||
if (Details.death_recap.show_life_percent) then
|
||||
line.lifePercent:Show()
|
||||
line.amount:SetPoint ("left", line, "left", 240, 0)
|
||||
line.lifePercent:SetPoint ("left", line, "left", 320, 0)
|
||||
line.amount:SetPoint("left", line, "left", 240, 0)
|
||||
line.lifePercent:SetPoint("left", line, "left", 320, 0)
|
||||
else
|
||||
line.lifePercent:Hide()
|
||||
line.amount:SetPoint ("left", line, "left", 280, 0)
|
||||
--line.lifePercent:SetPoint ("left", line, "left", 320, 0)
|
||||
line.amount:SetPoint("left", line, "left", 280, 0)
|
||||
--line.lifePercent:SetPoint("left", line, "left", 320, 0)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user