translated code to English and a few bug fixes from latest alpha
This commit is contained in:
+3
-1
@@ -11,6 +11,7 @@ local addonName, Details222 = ...
|
||||
|
||||
--local helpers
|
||||
local getCombatObject = function(segmentNumber)
|
||||
---@type combat
|
||||
local combatObject
|
||||
|
||||
--select which segment to use, use low level variables for performance
|
||||
@@ -19,7 +20,8 @@ local getCombatObject = function(segmentNumber)
|
||||
elseif (segmentNumber == 0) then
|
||||
combatObject = Details.tabela_vigente
|
||||
else
|
||||
combatObject = Details.tabela_historico.tabelas [segmentNumber]
|
||||
local segmentsTable = Details:GetCombatSegments()
|
||||
combatObject = segmentsTable[segmentNumber]
|
||||
end
|
||||
|
||||
return combatObject
|
||||
|
||||
+32
-27
@@ -1,29 +1,29 @@
|
||||
local Details = _G.Details
|
||||
local DF = _G.DetailsFramework
|
||||
local detailsFramework = _G.DetailsFramework
|
||||
local C_Timer = _G.C_Timer
|
||||
local addonName, Details222 = ...
|
||||
local load = loadstring
|
||||
|
||||
--auto run scripts
|
||||
Details.AutoRunCode = {}
|
||||
local codeTable
|
||||
local functionCache = {}
|
||||
|
||||
--compile and store code
|
||||
function Details:RecompileAutoRunCode()
|
||||
for codeKey, code in pairs(codeTable) do
|
||||
local func, errorText = _G.loadstring(code)
|
||||
function Details222.AutoRunCode.RecompileAutoRunCode()
|
||||
for codeKey, code in pairs(Details222.AutoRunCode.CodeTable) do
|
||||
local func, errorText = load(code)
|
||||
if (func) then
|
||||
DetailsFramework:SetEnvironment(func)
|
||||
Details.AutoRunCode[codeKey] = func
|
||||
detailsFramework:SetEnvironment(func)
|
||||
functionCache[codeKey] = func
|
||||
else
|
||||
--if the code didn't pass, create a dummy function for it without triggering errors
|
||||
Details.AutoRunCode[codeKey] = function() end
|
||||
functionCache[codeKey] = function() end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--function to dispatch events
|
||||
function Details:DispatchAutoRunCode(codeKey)
|
||||
local func = Details.AutoRunCode[codeKey]
|
||||
function Details222.AutoRunCode.DispatchAutoRunCode(codeKey)
|
||||
local func = functionCache[codeKey]
|
||||
|
||||
if (type(func) ~= "function") then
|
||||
Details:Msg("error running function for auto run script", codeKey)
|
||||
@@ -39,15 +39,15 @@ function Details:DispatchAutoRunCode(codeKey)
|
||||
end
|
||||
|
||||
--auto run frame to dispatch scrtips for some events that details! doesn't handle
|
||||
local autoRunCodeEventFrame = _G.CreateFrame("frame")
|
||||
local autoRunCodeEventFrame = CreateFrame("frame")
|
||||
|
||||
if (not _G.DetailsFramework.IsTimewalkWoW()) then
|
||||
if (not detailsFramework.IsTimewalkWoW()) then
|
||||
autoRunCodeEventFrame:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED")
|
||||
end
|
||||
|
||||
autoRunCodeEventFrame.OnEventFunc = function(self, event)
|
||||
--ignore events triggered more than once in a small time window
|
||||
if (autoRunCodeEventFrame [event] and not autoRunCodeEventFrame [event]:IsCancelled()) then
|
||||
if (autoRunCodeEventFrame[event] and not autoRunCodeEventFrame[event]:IsCancelled()) then
|
||||
return
|
||||
end
|
||||
|
||||
@@ -55,13 +55,13 @@ autoRunCodeEventFrame.OnEventFunc = function(self, event)
|
||||
--create a trigger for the event, many times it is triggered more than once
|
||||
--so if the event is triggered a second time, it will be ignored
|
||||
local newTimer = C_Timer.NewTimer(1, function()
|
||||
Details:DispatchAutoRunCode("on_specchanged")
|
||||
|
||||
Details222.AutoRunCode.DispatchAutoRunCode("on_specchanged")
|
||||
|
||||
--clear and invalidate the timer
|
||||
autoRunCodeEventFrame[event]:Cancel()
|
||||
autoRunCodeEventFrame[event] = nil
|
||||
end)
|
||||
|
||||
|
||||
--store the trigger
|
||||
autoRunCodeEventFrame[event] = newTimer
|
||||
end
|
||||
@@ -71,21 +71,26 @@ autoRunCodeEventFrame:SetScript("OnEvent", autoRunCodeEventFrame.OnEventFunc)
|
||||
|
||||
--dispatch scripts at startup
|
||||
C_Timer.After(2, function()
|
||||
Details:DispatchAutoRunCode("on_init")
|
||||
Details:DispatchAutoRunCode("on_specchanged")
|
||||
Details:DispatchAutoRunCode("on_zonechanged")
|
||||
Details222.AutoRunCode.DispatchAutoRunCode("on_init")
|
||||
Details222.AutoRunCode.DispatchAutoRunCode("on_specchanged")
|
||||
Details222.AutoRunCode.DispatchAutoRunCode("on_zonechanged")
|
||||
|
||||
if (_G.InCombatLockdown()) then
|
||||
Details:DispatchAutoRunCode("on_entercombat")
|
||||
Details222.AutoRunCode.DispatchAutoRunCode("on_entercombat")
|
||||
else
|
||||
Details:DispatchAutoRunCode("on_leavecombat")
|
||||
Details222.AutoRunCode.DispatchAutoRunCode("on_leavecombat")
|
||||
end
|
||||
|
||||
Details:DispatchAutoRunCode("on_groupchange")
|
||||
Details222.AutoRunCode.DispatchAutoRunCode("on_groupchange")
|
||||
end)
|
||||
|
||||
function Details:StartAutoRun()
|
||||
--compile code
|
||||
codeTable = Details.run_code
|
||||
Details:RecompileAutoRunCode()
|
||||
function Details222.AutoRunCode.StartAutoRun()
|
||||
local newData = detailsFramework.table.copy({}, Details.run_code)
|
||||
Details.run_code = nil
|
||||
Details222.AutoRunCode.CodeTable = newData
|
||||
Details222.AutoRunCode.RecompileAutoRunCode()
|
||||
end
|
||||
|
||||
function Details222.AutoRunCode.OnLogout()
|
||||
Details.run_code = Details222.AutoRunCode.CodeTable
|
||||
end
|
||||
+67
-66
@@ -36,7 +36,7 @@ local create_deathrecap_line = function(parent, n)
|
||||
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)
|
||||
|
||||
local timeAt = line:CreateFontString(nil, "overlay", "GameFontNormal")
|
||||
@@ -50,14 +50,14 @@ local create_deathrecap_line = function(parent, n)
|
||||
local amount = line:CreateFontString(nil, "overlay", "GameFontNormal")
|
||||
local lifePercent = line:CreateFontString(nil, "overlay", "GameFontNormal")
|
||||
local lifeStatusBar = line:CreateTexture(nil, "border", nil, -3)
|
||||
|
||||
|
||||
--grave icon
|
||||
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)
|
||||
|
||||
|
||||
--spell icon
|
||||
spellIcon:SetSize(19, 19)
|
||||
spellIconBorder:SetTexture([[Interface\ENCOUNTERJOURNAL\LootTab]])
|
||||
@@ -71,12 +71,12 @@ local create_deathrecap_line = function(parent, n)
|
||||
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:SetFontSize(sourceName, 10)
|
||||
|
||||
--text alpha
|
||||
@@ -84,13 +84,13 @@ local create_deathrecap_line = function(parent, n)
|
||||
sourceName:SetAlpha(textAlpha)
|
||||
amount:SetAlpha(textAlpha)
|
||||
lifePercent:SetAlpha(textAlpha)
|
||||
|
||||
|
||||
--text setup
|
||||
amount:SetWidth(85)
|
||||
amount:SetJustifyH("right")
|
||||
lifePercent:SetWidth(42)
|
||||
lifePercent:SetJustifyH("right")
|
||||
|
||||
|
||||
--life statusbar
|
||||
lifeStatusBar:SetPoint("topleft", line, "topleft")
|
||||
lifeStatusBar:SetPoint("bottomleft", line, "bottomleft")
|
||||
@@ -99,7 +99,7 @@ local create_deathrecap_line = function(parent, n)
|
||||
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]])
|
||||
@@ -110,13 +110,13 @@ local create_deathrecap_line = function(parent, n)
|
||||
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]])
|
||||
backgroundTexture2:SetTexCoord(0, 1, 0, 1)
|
||||
backgroundTexture2:SetVertexColor(.1, .1, .1, .3)
|
||||
backgroundTexture2:SetVertexColor(.1, .1, .1, .3)
|
||||
backgroundTexture2:SetPoint("topleft", backgroundTexture, "bottomleft", 0, 0)
|
||||
backgroundTexture2:SetPoint("topright", backgroundTexture, "bottomright", 0, 0)
|
||||
backgroundTexture2:SetHeight(32)
|
||||
@@ -125,7 +125,7 @@ local create_deathrecap_line = function(parent, n)
|
||||
Details.gump:SetFontSize(lifePercent, 14)
|
||||
backgroundTexture:SetVertexColor(.2, .1, .1, .3)
|
||||
end
|
||||
|
||||
|
||||
backgroundTexture:SetPoint("topleft", 0, 1)
|
||||
backgroundTexture:SetPoint("bottomright", 0, -1)
|
||||
backgroundTexture:SetDesaturated(true)
|
||||
@@ -135,7 +135,7 @@ local create_deathrecap_line = function(parent, n)
|
||||
backgroundTextureOverlay:SetDesaturated(true)
|
||||
backgroundTextureOverlay:SetAlpha(0.5)
|
||||
backgroundTextureOverlay:Hide()
|
||||
|
||||
|
||||
line.timeAt = timeAt
|
||||
line.spellIcon = spellIcon
|
||||
line.sourceName = sourceName
|
||||
@@ -145,14 +145,14 @@ local create_deathrecap_line = function(parent, n)
|
||||
line.backgroundTextureOverlay = backgroundTextureOverlay
|
||||
line.graveIcon = graveIcon
|
||||
line.lifeStatusBar = lifeStatusBar
|
||||
|
||||
|
||||
if (n == 10) then
|
||||
graveIcon:Show()
|
||||
line.timeAt:Hide()
|
||||
else
|
||||
graveIcon:Hide()
|
||||
end
|
||||
|
||||
|
||||
return line
|
||||
end
|
||||
|
||||
@@ -162,13 +162,13 @@ end
|
||||
|
||||
function Details.BuildDeathTableFromRecap (recapID)
|
||||
local events = DeathRecap_GetEvents (recapID)
|
||||
|
||||
|
||||
--check if it is a valid recap
|
||||
if (not events or #events <= 0) then
|
||||
DeathRecapFrame.Unavailable:Show()
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
--build an death log using details format
|
||||
ArtificialDeathLog = {
|
||||
{}, --deathlog events
|
||||
@@ -200,11 +200,11 @@ function Details.BuildDeathTableFromRecap (recapID)
|
||||
evtData.overkill,
|
||||
not spellId and {spellId, spellName, texture},
|
||||
}
|
||||
|
||||
|
||||
tinsert(ArtificialDeathLog[1], ev)
|
||||
ArtificialDeathLog.n = ArtificialDeathLog.n + 1
|
||||
end
|
||||
|
||||
|
||||
return ArtificialDeathLog
|
||||
end
|
||||
|
||||
@@ -226,7 +226,7 @@ function Details.GetDeathRecapFromChat()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if (recapIDFromChat) then
|
||||
Details.OpenDetailsDeathRecap (nil, recapIDFromChat, true)
|
||||
return
|
||||
@@ -258,29 +258,29 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
|
||||
if (not Details.DeathRecap) then
|
||||
Details.DeathRecap = CreateFrame("frame", "DetailsDeathRecap", DeathRecapFrame, "BackdropTemplate")
|
||||
Details.DeathRecap:SetAllPoints()
|
||||
|
||||
|
||||
DeathRecapFrame.Title:SetText(DeathRecapFrame.Title:GetText() .. " (by Details!)")
|
||||
|
||||
|
||||
--lines
|
||||
Details.DeathRecap.Lines = {}
|
||||
for i = 1, 10 do
|
||||
Details.DeathRecap.Lines [i] = create_deathrecap_line (Details.DeathRecap, i)
|
||||
end
|
||||
|
||||
|
||||
--segments
|
||||
Details.DeathRecap.Segments = {}
|
||||
for i = 5, 1, -1 do
|
||||
local segmentButton = CreateFrame("button", "DetailsDeathRecapSegmentButton" .. i, Details.DeathRecap, "BackdropTemplate")
|
||||
|
||||
|
||||
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")
|
||||
|
||||
|
||||
segmentButton:SetScript("OnClick", function()
|
||||
OpenDetailsDeathRecapAtSegment (i)
|
||||
end)
|
||||
@@ -306,9 +306,9 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
|
||||
|
||||
--in case a combat has been created after the player death, the death won't be at the current segment
|
||||
if (not foundPlayer) then
|
||||
local segmentHistory = Details:GetCombatSegments()
|
||||
local segmentsTable = Details:GetCombatSegments()
|
||||
for i = 1, 2 do
|
||||
local segment = segmentHistory [1]
|
||||
local segment = segmentsTable [1]
|
||||
if (segment and segment ~= Details.tabela_vigente) then
|
||||
if (Details.tabela_vigente.start_time - 3 < segment.end_time) then
|
||||
death = segment.last_events_tables
|
||||
@@ -321,34 +321,35 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
|
||||
if (Details.death_recap.show_segments) then
|
||||
local last_index = 0
|
||||
local buttonsInUse = {}
|
||||
local segmentsTable = Details:GetCombatSegments()
|
||||
|
||||
for i, button in ipairs(Details.DeathRecap.Segments) do
|
||||
if (Details.tabela_historico.tabelas [i]) then
|
||||
if (segmentsTable[i]) then
|
||||
button:Show()
|
||||
tinsert(buttonsInUse, button)
|
||||
table.insert(buttonsInUse, button)
|
||||
Details.gump:SetFontColor(button.text, "silver")
|
||||
last_index = i
|
||||
else
|
||||
button:Hide()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local buttonsInUse2 = {}
|
||||
for i = #buttonsInUse, 1, -1 do
|
||||
tinsert(buttonsInUse2, buttonsInUse[i])
|
||||
table.insert(buttonsInUse2, buttonsInUse[i])
|
||||
end
|
||||
for i = 1, #buttonsInUse2 do
|
||||
local button = buttonsInUse2 [i]
|
||||
button:ClearAllPoints()
|
||||
button:SetPoint("topright", DeathRecapFrame, "topright", (-i * 22) - 10, -5)
|
||||
end
|
||||
|
||||
|
||||
if (not segment) then
|
||||
Details.gump:SetFontColor(Details.DeathRecap.Segments [1].text, "orange")
|
||||
else
|
||||
Details.gump:SetFontColor(Details.DeathRecap.Segments [segment].text, "orange")
|
||||
death = Details.tabela_historico.tabelas [segment] and Details.tabela_historico.tabelas [segment].last_events_tables
|
||||
death = segmentsTable[segment] and segmentsTable[segment].last_events_tables
|
||||
end
|
||||
|
||||
else
|
||||
for i, button in ipairs(Details.DeathRecap.Segments) do
|
||||
button:Hide()
|
||||
@@ -368,9 +369,9 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
|
||||
--get the death events from the blizzard's recap
|
||||
ArtificialDeathLog = Details.BuildDeathTableFromRecap (RecapID)
|
||||
end
|
||||
|
||||
|
||||
DeathRecapFrame.Unavailable:Hide()
|
||||
|
||||
|
||||
--get the relevance config
|
||||
local relevanceTime = Details.death_recap.relevance_time
|
||||
|
||||
@@ -389,12 +390,12 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
|
||||
if (t) then
|
||||
local events = t [1]
|
||||
local timeOfDeath = t [2]
|
||||
|
||||
|
||||
local BiggestDamageHits = {}
|
||||
for i = #events, 1, -1 do
|
||||
tinsert(BiggestDamageHits, events [i])
|
||||
end
|
||||
table.sort (BiggestDamageHits, function(t1, t2)
|
||||
table.sort (BiggestDamageHits, function(t1, t2)
|
||||
return t1[3] > t2[3]
|
||||
end)
|
||||
for i = #BiggestDamageHits, 1, -1 do
|
||||
@@ -402,7 +403,7 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
|
||||
tremove(BiggestDamageHits, i)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--check if the event which killed the player is in the list, or addit to BiggestDamageHits
|
||||
local hitKill
|
||||
for i = #events, 1, -1 do
|
||||
@@ -449,7 +450,7 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
|
||||
end
|
||||
else
|
||||
--cut table to show only 10 events
|
||||
while (#BiggestDamageHits > 10) do
|
||||
while (#BiggestDamageHits > 10) do
|
||||
tremove(BiggestDamageHits, 11)
|
||||
end
|
||||
end
|
||||
@@ -459,21 +460,21 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
|
||||
Details.GetDeathRecapFromChat()
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
table.sort (BiggestDamageHits, function(t1, t2)
|
||||
table.sort (BiggestDamageHits, function(t1, t2)
|
||||
return t1[4] > t2[4]
|
||||
end)
|
||||
|
||||
local events = BiggestDamageHits
|
||||
|
||||
|
||||
local maxHP = t [5]
|
||||
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]
|
||||
local hp = min (floor(event [5] / maxHP * 100), 100)
|
||||
local spellName, _, spellIcon = Details.GetSpellInfo(event [2])
|
||||
@@ -481,11 +482,11 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
|
||||
local eventTime = event [4]
|
||||
local source = event [6]
|
||||
local overkill = event [10] or 0
|
||||
|
||||
|
||||
local customSpellInfo = event [11]
|
||||
|
||||
|
||||
if (type(evType) == "boolean" and evType) then
|
||||
|
||||
|
||||
local line = Details.DeathRecap.Lines [lineIndex]
|
||||
if (line) then
|
||||
line.timeAt:SetText(format("%.1f", eventTime - timeOfDeath) .. "s")
|
||||
@@ -493,11 +494,11 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
|
||||
line.TopFader:Hide()
|
||||
--line.spellIcon:SetTexCoord(.1, .9, .1, .9)
|
||||
--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)
|
||||
local sourceSpec = Details:GetSpec(source)
|
||||
|
||||
|
||||
if (not sourceClass) then
|
||||
local combat = Details:GetCurrentCombat()
|
||||
if (combat) then
|
||||
@@ -507,7 +508,7 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if (not sourceSpec) then
|
||||
local combat = Details:GetCurrentCombat()
|
||||
if (combat) then
|
||||
@@ -517,19 +518,19 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--remove real name or owner name
|
||||
source = Details:GetOnlyName(source)
|
||||
--remove owner name
|
||||
source = source:gsub((" <.*"), "")
|
||||
|
||||
|
||||
--if a player?
|
||||
if (Details.player_class [sourceClass]) then
|
||||
source = Details:AddClassOrSpecIcon (source, sourceClass, sourceSpec, 16, true)
|
||||
|
||||
|
||||
elseif (sourceClass == "PET") then
|
||||
source = Details:AddClassOrSpecIcon (source, sourceClass)
|
||||
|
||||
|
||||
end
|
||||
|
||||
--remove the dot signal from the spell name
|
||||
@@ -545,14 +546,14 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
|
||||
--/run for a,b in pairs(_G) do if (type(b)=="string" and b:find("Falling")) then print(a,b) end end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
spellName = spellName:gsub(L["STRING_DOT"], "")
|
||||
spellName = spellName:gsub("[*] ", "")
|
||||
source = source or ""
|
||||
|
||||
|
||||
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)))
|
||||
@@ -560,14 +561,14 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
|
||||
--line.amount:SetText("-" .. floor(amount))
|
||||
line.amount:SetText("-" .. floor(amount))
|
||||
end
|
||||
|
||||
|
||||
line.lifePercent:SetText(hp .. "%")
|
||||
line.lifeStatusBar:SetWidth(line:GetWidth() * (hp/100))
|
||||
|
||||
line.spellid = event [2]
|
||||
|
||||
|
||||
line:Show()
|
||||
|
||||
|
||||
if (Details.death_recap.show_life_percent) then
|
||||
line.lifePercent:Show()
|
||||
line.amount:SetPoint("left", line, "left", 240, 0)
|
||||
@@ -578,16 +579,16 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
|
||||
--line.lifePercent:SetPoint("left", line, "left", 320, 0)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
lineIndex = lineIndex - 1
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local lastLine = Details.DeathRecap.Lines [lineIndex + 1]
|
||||
if (lastLine) then
|
||||
lastLine.TopFader:Show()
|
||||
end
|
||||
|
||||
|
||||
DeathRecapFrame.Unavailable:Hide()
|
||||
else
|
||||
if (not fromChat) then
|
||||
@@ -674,7 +675,7 @@ end)
|
||||
--[=[ hooks not loaded at this point
|
||||
Details:InstallHook(DETAILS_HOOK_DEATH, function(_, _, _, _, _, _, _, targetName)
|
||||
if (targetName == UnitName("player")) then
|
||||
|
||||
|
||||
end
|
||||
end)
|
||||
--]=]
|
||||
|
||||
@@ -105,6 +105,7 @@ end
|
||||
|
||||
--load previous saved combat data
|
||||
function Details222.LoadSavedVariables.CombatSegments()
|
||||
--this is the table where the character data is saved as well the combat data
|
||||
local currentCharacterData = _G["_detalhes_database"] --no need to check if it exists, it's already checked
|
||||
if (currentCharacterData == nil) then
|
||||
currentCharacterData = {}
|
||||
@@ -189,7 +190,7 @@ function Details222.LoadSavedVariables.CombatSegments()
|
||||
end
|
||||
|
||||
--get the first segment saved and use it as current segment
|
||||
Details.tabela_vigente = Details.tabela_historico.tabelas[1]
|
||||
Details.tabela_vigente = Details.tabela_historico.tabelas[1] --only low level access to this table allowed
|
||||
|
||||
--need refresh for all containers
|
||||
for _, actorContainer in ipairs(Details.tabela_overall) do
|
||||
|
||||
+22
-22
@@ -64,7 +64,7 @@ function DetailsMythicPlusFrame.MergeSegmentsOnEnd()
|
||||
|
||||
--get the current combat just created and the table with all past segments
|
||||
local newCombat = Details:GetCurrentCombat()
|
||||
local segmentHistory = Details:GetCombatSegments()
|
||||
local segmentsTable = Details:GetCombatSegments()
|
||||
|
||||
local totalTime = 0
|
||||
local startDate, endDate = "", ""
|
||||
@@ -73,14 +73,14 @@ function DetailsMythicPlusFrame.MergeSegmentsOnEnd()
|
||||
|
||||
if (Details.mythic_plus.reverse_death_log) then
|
||||
for i = 1, 40 do --copy the deaths from the first segment to the last one
|
||||
local thisCombat = segmentHistory[i]
|
||||
local thisCombat = segmentsTable[i]
|
||||
if (thisCombat and thisCombat.is_mythic_dungeon_run_id == Details.mythic_dungeon_id) then
|
||||
newCombat:CopyDeathsFrom(thisCombat, true)
|
||||
end
|
||||
end
|
||||
else
|
||||
for i = 40, 1, -1 do --copy the deaths from the last segment to the new segment
|
||||
local thisCombat = segmentHistory[i]
|
||||
local thisCombat = segmentsTable[i]
|
||||
if (thisCombat) then
|
||||
if (thisCombat.is_mythic_dungeon_run_id == Details.mythic_dungeon_id) then
|
||||
newCombat:CopyDeathsFrom(thisCombat, true)
|
||||
@@ -91,7 +91,7 @@ function DetailsMythicPlusFrame.MergeSegmentsOnEnd()
|
||||
|
||||
--add all boss segments from this run to this new segment
|
||||
for i = 1, 40 do --from the newer combat to the oldest
|
||||
local thisCombat = segmentHistory[i]
|
||||
local thisCombat = segmentsTable[i]
|
||||
if (thisCombat and thisCombat.is_mythic_dungeon_run_id == Details.mythic_dungeon_id) then
|
||||
local canAddThisSegment = true
|
||||
if (Details.mythic_plus.make_overall_boss_only) then
|
||||
@@ -255,11 +255,11 @@ function DetailsMythicPlusFrame.MergeTrashCleanup (isFromSchedule)
|
||||
end
|
||||
|
||||
--delete all segments that were merged
|
||||
local segmentHistory = Details:GetCombatSegments()
|
||||
for segmentId = #segmentHistory, 1, -1 do
|
||||
local segment = segmentHistory[segmentId]
|
||||
local segmentsTable = Details:GetCombatSegments()
|
||||
for segmentId = #segmentsTable, 1, -1 do
|
||||
local segment = segmentsTable[segmentId]
|
||||
if (segment and segment._trashoverallalreadyadded) then
|
||||
tremove(segmentHistory, segmentId)
|
||||
tremove(segmentsTable, segmentId)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -342,16 +342,16 @@ function DetailsMythicPlusFrame.MergeRemainingTrashAfterAllBossesDone()
|
||||
|
||||
--remove trash segments from the segment history after the merge
|
||||
local removedCurrentSegment = false
|
||||
local segmentHistory = Details:GetCombatSegments()
|
||||
local segmentsTable = Details:GetCombatSegments()
|
||||
for _, pastCombat in ipairs(segmentsToMerge) do
|
||||
for i = #segmentHistory, 1, -1 do
|
||||
local segment = segmentHistory [i]
|
||||
for i = #segmentsTable, 1, -1 do
|
||||
local segment = segmentsTable [i]
|
||||
if (segment == pastCombat) then
|
||||
--remove the segment
|
||||
if (Details.tabela_vigente == segment) then
|
||||
removedCurrentSegment = true
|
||||
end
|
||||
tremove(segmentHistory, i)
|
||||
tremove(segmentsTable, i)
|
||||
break
|
||||
end
|
||||
end
|
||||
@@ -363,8 +363,8 @@ function DetailsMythicPlusFrame.MergeRemainingTrashAfterAllBossesDone()
|
||||
|
||||
if (removedCurrentSegment) then
|
||||
--find another current segment
|
||||
local segmentHistory = Details:GetCombatSegments()
|
||||
Details.tabela_vigente = segmentHistory [1]
|
||||
local segmentsTable = Details:GetCombatSegments()
|
||||
Details.tabela_vigente = segmentsTable [1]
|
||||
|
||||
if (not Details.tabela_vigente) then
|
||||
--assuming there's no segment from the dungeon run
|
||||
@@ -425,11 +425,11 @@ function DetailsMythicPlusFrame.BossDefeated(this_is_end_end, encounterID, encou
|
||||
local segmentsToMerge = DetailsMythicPlusFrame.TrashMergeScheduled or {}
|
||||
|
||||
--table with all past semgnets
|
||||
local segmentHistory = Details:GetCombatSegments()
|
||||
local segmentsTable = Details:GetCombatSegments()
|
||||
|
||||
--iterate among segments
|
||||
for i = 1, 25 do --from the newer combat to the oldest
|
||||
local pastCombat = segmentHistory [i]
|
||||
local pastCombat = segmentsTable [i]
|
||||
--does the combat exists
|
||||
if (pastCombat and not pastCombat._trashoverallalreadyadded and pastCombat.is_mythic_dungeon_trash) then
|
||||
--is the combat a mythic segment from this run?
|
||||
@@ -522,10 +522,10 @@ function DetailsMythicPlusFrame.MythicDungeonFinished (fromZoneLeft)
|
||||
end
|
||||
|
||||
--table with all past semgnets
|
||||
local segmentHistory = Details:GetCombatSegments()
|
||||
local segmentsTable = Details:GetCombatSegments()
|
||||
|
||||
for i = 1, #segmentHistory do
|
||||
local pastCombat = segmentHistory [i]
|
||||
for i = 1, #segmentsTable do
|
||||
local pastCombat = segmentsTable [i]
|
||||
--does the combat exists
|
||||
|
||||
if (pastCombat and not pastCombat._trashoverallalreadyadded and pastCombat:GetCombatTime() > 5) then
|
||||
@@ -562,10 +562,10 @@ function DetailsMythicPlusFrame.MythicDungeonFinished (fromZoneLeft)
|
||||
end
|
||||
|
||||
--find the latest trash overall
|
||||
local segmentHistory = Details:GetCombatSegments()
|
||||
local segmentsTable = Details:GetCombatSegments()
|
||||
local latestTrashOverall
|
||||
for i = 1, #segmentHistory do
|
||||
local pastCombat = segmentHistory [i]
|
||||
for i = 1, #segmentsTable do
|
||||
local pastCombat = segmentsTable [i]
|
||||
if (pastCombat and pastCombat.is_mythic_dungeon and pastCombat.is_mythic_dungeon.SegmentID == "trashoverall") then
|
||||
latestTrashOverall = pastCombat
|
||||
break
|
||||
|
||||
+2
-1
@@ -273,7 +273,8 @@ function SlashCmdList.DETAILS (msg, editbox)
|
||||
local segmentId = rest and tonumber(rest)
|
||||
if (segmentId and segmentId ~= 1) then
|
||||
local segmentToErase = tonumber(segmentId)
|
||||
local combatObject = tremove(Details.tabela_historico.tabelas, segmentToErase)
|
||||
local combatObject = table.remove(Details:GetCombatSegments(), segmentToErase)
|
||||
|
||||
if (combatObject) then
|
||||
Details:DestroyCombat(combatObject)
|
||||
Details:SendEvent("DETAILS_DATA_SEGMENTREMOVED")
|
||||
|
||||
Reference in New Issue
Block a user