Skip to content

Commit

Permalink
Added a field showing the spellId of the latest spell casted at /deta…
Browse files Browse the repository at this point in the history
…ils auras
  • Loading branch information
Tercioo committed Jan 19, 2025
1 parent 1aa00c2 commit 5782cf8
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions frames/window_aura_tracker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Details.AuraTracker = {
}

--frame options
local windowWidth = 800
local windowWidth = 900
local windowHeight = 670
local scrollWidth = 790
local scrollWidth = 890
local scrollHeightBuff = 400
local scrollHeightDebuff = 200
local scrollLineAmountBuff = 20
Expand Down Expand Up @@ -164,6 +164,7 @@ function Details.AuraTracker.CreatePanel()
{text = "Spell Id", width = 100},
{text = "Lua Table", width = 200},
{text = "Payload (Points)", width = 296},
{text = "Last Cast", width = 100},
}
local headerOptions = {
padding = 2,
Expand Down Expand Up @@ -271,6 +272,12 @@ local formatToLuaTable = {

--[371354] = {[131] = 1, [151] = 2, [174] = 3, [1] = 131, [2] = 151, [3] = 174}, --Phial of the Eye in the Storm

local castEventFrame = CreateFrame("frame")
castEventFrame:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
castEventFrame:SetScript("OnEvent", function(self, event, unit, castGUID, spellId)
castEventFrame.lastSpellId = spellId
end)

function Details.AuraTracker.RefreshScroll(self, data, offset, totalLines)
for i = 1, totalLines do
local index = i + offset
Expand All @@ -285,6 +292,7 @@ function Details.AuraTracker.RefreshScroll(self, data, offset, totalLines)
local globalfunc = DETAILS_AURATRACKER_LUATABLE_FUNC
line.LuaTableEntry.text = globalfunc and globalfunc(auraInfo) or formatToLuaTable.doFormat2NoIndex(auraInfo) --doFormat2NoIndex
line.Points.text = formatToLuaTable.doFormat5(auraInfo)
line.LastCastSpellId.text = castEventFrame.lastSpellId or 0

line.Name:SetCursorPosition(0)
line.LuaTableEntry:SetCursorPosition(0)
Expand Down Expand Up @@ -342,6 +350,12 @@ function Details.AuraTracker.CreateScrollLine(self, lineId)
spellIdTextField:SetTextInsets(3, 3, 0, 0)
spellIdTextField:SetAutoSelectTextOnFocus(true)

--spellId text field
local lastSpellIdCastTextField = DetailsFramework:CreateTextEntry(line, function()end, header:GetColumnWidth(6), scrollLineHeight, _, _, _, dropdownTemplate)
lastSpellIdCastTextField:SetJustifyH("left")
lastSpellIdCastTextField:SetTextInsets(3, 3, 0, 0)
lastSpellIdCastTextField:SetAutoSelectTextOnFocus(true)

--formatted lua table
local luaTableEntryTextField = DetailsFramework:CreateTextEntry(line, function()end, header:GetColumnWidth(4), scrollLineHeight, _, _, _, dropdownTemplate)
luaTableEntryTextField:SetJustifyH("left")
Expand All @@ -359,6 +373,7 @@ function Details.AuraTracker.CreateScrollLine(self, lineId)
line:AddFrameToHeaderAlignment(spellIdTextField)
line:AddFrameToHeaderAlignment(luaTableEntryTextField)
line:AddFrameToHeaderAlignment(pointsTextField)
line:AddFrameToHeaderAlignment(lastSpellIdCastTextField)

line:AlignWithHeader(header, "left")

Expand All @@ -367,6 +382,7 @@ function Details.AuraTracker.CreateScrollLine(self, lineId)
line.SpellId = spellIdTextField
line.LuaTableEntry = luaTableEntryTextField
line.Points = pointsTextField
line.LastCastSpellId = lastSpellIdCastTextField

return line
end
Expand Down

0 comments on commit 5782cf8

Please sign in to comment.