From 19e0a362c705eab2625d9bef919aefb1988e7a8e Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Fri, 30 Sep 2022 15:53:10 -0300 Subject: [PATCH] added aura tracker frame /details auras --- Details.toc | 1 + Libs/LibOpenRaid/LibOpenRaid.lua | 2 +- Libs/LibOpenRaid/ThingsToMantain.lua | 84 ++++++ core/parser.lua | 1 + frames/window_aura_tracker.lua | 385 +++++++++++++++++++++++++++ functions/profiles.lua | 8 + functions/skins.lua | 2 +- functions/slash.lua | 26 +- 8 files changed, 483 insertions(+), 26 deletions(-) create mode 100644 frames/window_aura_tracker.lua diff --git a/Details.toc b/Details.toc index d7b43443..2d01d19e 100644 --- a/Details.toc +++ b/Details.toc @@ -95,6 +95,7 @@ frames\window_brokertexteditor.lua frames\window_bookmark.lua frames\window_classcolor.lua frames\window_statistics.lua +frames\window_aura_tracker.lua classes\class_error.lua classes\class_combat.lua diff --git a/Libs/LibOpenRaid/LibOpenRaid.lua b/Libs/LibOpenRaid/LibOpenRaid.lua index 89ae8197..33b25c6a 100644 --- a/Libs/LibOpenRaid/LibOpenRaid.lua +++ b/Libs/LibOpenRaid/LibOpenRaid.lua @@ -58,7 +58,7 @@ if (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE and not isExpansion_Dragonflight()) t end local major = "LibOpenRaid-1.0" -local CONST_LIB_VERSION = 56 +local CONST_LIB_VERSION = 57 LIB_OPEN_RAID_CAN_LOAD = false --declae the library within the LibStub diff --git a/Libs/LibOpenRaid/ThingsToMantain.lua b/Libs/LibOpenRaid/ThingsToMantain.lua index 517a3598..5a2ec95c 100644 --- a/Libs/LibOpenRaid/ThingsToMantain.lua +++ b/Libs/LibOpenRaid/ThingsToMantain.lua @@ -112,6 +112,10 @@ elseif (gameLanguage == "zhTW") then L["STRING_CRITICAL_ONLY"] = "致命" end + +LIB_OPEN_RAID_FOOD_BUFF = {} --default +LIB_OPEN_RAID_FLASK_BUFF = {} --default + ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --Wrath of the Lich King @@ -150,6 +154,10 @@ if (isExpansion_LichKing()) then LIB_OPEN_RAID_WEAPON_ENCHANT_IDS = {} + LIB_OPEN_RAID_FOOD_BUFF = {} + + LIB_OPEN_RAID_FLASK_BUFF = {} + ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --Shadowlands @@ -268,6 +276,43 @@ elseif (isExpansion_Shadowlands()) then [5401] = true, --windfury } + --buff spellId, the value of the food is the tier level + LIB_OPEN_RAID_FOOD_BUFF = { + [259454] = 1, --(agility) Feast of Gluttonous Hedonism + [308434] = 1, --(critical) Phantasmal Souffle and Fries + [308397] = 1, --(critical +18) Butterscotch Marinated Ribs + [308400] = 1, --(critical +30) Spinefin Souffle and Fries + [308488] = 1, --(haste) Tenebrous Crown Roast Aspic + [308404] = 1, --(haste +18) Cinnamon Bonefish Stew + [308405] = 1, --(haste +30) Tenebrous Crown Roast Aspic + [308506] = 1, --(mastery) Crawler Ravioli with Apple Sauce + [308412] = 1, --(mastery +18) Meaty Apple Dumplings + [308413] = 1, --(mastery +30) Iridescent Ravioli with Apple Sauce + [308525] = 1, --(stamina) Banana Beef Pudding + [308414] = 1, --(stamina +14) Pickled Meat Smoothie + [308415] = 1, --(stamina +22) Banana Beef Pudding + [308514] = 1, --(versatility) Steak a la Mode + [308425] = 1, --(versatility +18) Sweet Silvergill Sausages + [308426] = 1, --(versatility +30) Steak a la Mode + [308419] = 1, --(periodicaly damage) Smothered Shank + [327715] = 1, --(speed) Fried Bonefish + + --feasts + [327706] = 2, --strength +20 + [327707] = 2, --stamina +20 + [327708] = 2, --intellect +20 + [327709] = 2, --agility +20 + [327704] = 2, --intellect +18 + [327701] = 2, --strength +18 + [327705] = 2, --agility +18 + } + + LIB_OPEN_RAID_FLASK_BUFF = { + [307185] = true, --Spectral Flask of Power + [307187] = true, --Spectral Stamina Flask + [307166] = true, --Eternal Flask + } + ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --Dragonflight @@ -385,6 +430,45 @@ elseif (isExpansion_Dragonflight()) then [5400] = true, --flametongue [5401] = true, --windfury } + + --buff spellId, the value of the food is the tier level + --use /details auras + LIB_OPEN_RAID_FOOD_BUFF = { + [382145] = 1, --Well Fed haste 220 + [382146] = 1, --Well Fed crit 220 + [382149] = 1, --Well Fed vers 220 + [382150] = 1, --Well Fed mastery 220 + [382152] = 1, --Well Fed haste + crit 130 + [382153] = 1, --Well Fed haste + vers 130 + [382154] = 1, --Well Fed haste + mastery 130 + [382155] = 1, --Well Fed crit + vers 130 + [382156] = 1, --Well Fed crit + mastery 130 + [382157] = 1, --Well Fed vers + mastery 130 + } + + --use /details auras + LIB_OPEN_RAID_FLASK_BUFF = { + --phials + [371354] = {[131] = 1, [151] = 2, [174] = 3}, --Phial of the Eye in the Storm + [370652] = {[470] = 1, [541] = 2, [622] = 3}, --Phial of Static Empowerment + [371172] = {[236] = 1, [257] = 2, [279] = 3}, --Phial of Tepid Versatility + [371204] = {[8125] = 1, [9344] = 2, [10746] = 3}, --Phial of Still Air + [371036] = {[-4] = 1, [-5] = 2, [-6] = 3}, --Phial of Icy Preservation + [374000] = {[690] = 1, [752] = 2, [814] = 3}, --Iced Phial of Corrupting Rage + [371386] = {[432] = 1, [497] = 2, [572] = 3}, --Phial of Charged Isolation + [373257] = {[4603] = 2, [3949] = 1, [5365] = 3}, --Phial of Glacial Fury + [393700] = {[45] = 3, [38] = 2, [32] = 1}, --Aerated Phial of Deftness + [393717] = {[45] = 3, [38] = 2, [32] = 1}, --Steaming Phial of Finesse + [371186] = {[558] = 3, [473] = 1, [515] = 2}, --Charged Phial of Alacrity + [393714] = {[45] = 3, [38] = 2, [32] = 1}, --Crystalline Phial of Perception + [371339] = {[562] = 3, [476] = 1, [519] = 2}, --Phial of Elemental Chaos + } + + --spellId of healing from potions + LIB_OPEN_RAID_HEALING_POTIONS = { + [370511] = 1, --Refreshing Healing Potion + + } end LIB_OPEN_RAID_MELEE_SPECS = { diff --git a/core/parser.lua b/core/parser.lua index a24f9fbb..bf0fc04d 100755 --- a/core/parser.lua +++ b/core/parser.lua @@ -4890,6 +4890,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if (DetailsFramework.IsDragonflight()) then Details:Msg("friendly reminder to enabled combat logs (/combatlog) if you're recording them (Dragonflight Beta).") + Details:Msg("and if you wanna help, you may post them on Details! discord as well.") end end diff --git a/frames/window_aura_tracker.lua b/frames/window_aura_tracker.lua new file mode 100644 index 00000000..1de62e75 --- /dev/null +++ b/frames/window_aura_tracker.lua @@ -0,0 +1,385 @@ + +local Details = Details +local DF = DetailsFramework +local _ + +--namespace +Details.AuraTracker = { + buff = {}, + debuff = {}, +} + +--frame options +local windowWidth = 800 +local windowHeight = 670 +local scrollWidth = 790 +local scrollHeightBuff = 400 +local scrollHeightDebuff = 200 +local scrollLineAmountBuff = 20 +local scrollLineAmountDebuff = 10 +local scrollLineHeight = 20 + +--templates +local dropdownTemplate = DetailsFramework:GetTemplate("dropdown", "OPTIONS_DROPDOWNDARK_TEMPLATE") + +function Details.AuraTracker.AddAura(auraType, spellid) + Details.AuraTracker[auraType][spellid] = true +end + +local doFullAuraUpdate = function() + wipe(Details.AuraTracker.buff) + wipe(Details.AuraTracker.debuff) + + local function HandleAuraBuff(aura) + local auraInfo = C_UnitAuras.GetAuraDataByAuraInstanceID("player", aura.auraInstanceID) + + local spellId = auraInfo.spellId + local isBossAura = auraInfo.isBossAura --"] = false + local duration = auraInfo.duration --"] = 0 + local expirationTime = auraInfo.expirationTime --"] = 0 + local isFromPlayerOrPlayerPet = auraInfo.isFromPlayerOrPlayerPet --"] = true + local points = auraInfo.points --"] = table { ["1"] = 200 ["2"] = 0 ["3"] = 400 } + local icon = auraInfo.icon --"] = 135922 + local nameplateShowPersonal = auraInfo.nameplateShowPersonal --"] = false + local nameplateShowAll = auraInfo.nameplateShowAll --"] = false + local auraInstanceID = auraInfo.auraInstanceID --"] = 8871 + local timeMod = auraInfo.timeMod --"] = 1 + local isRaid = auraInfo.isRaid --"] = false + local isHarmful = auraInfo.isHarmful --"] = false + local canApplyAura = auraInfo.canApplyAura --"] = false + local name = auraInfo.name --"] = 'Rhapsody' + local isHelpful = auraInfo.isHelpful --"] = true + local applications = auraInfo.applications --"] = 20 + local isNameplateOnly = auraInfo.isNameplateOnly --"] = false + local sourceUnit = auraInfo.sourceUnit --"] = 'player' + local isStealable = auraInfo.isStealable --"] = false + + Details.AuraTracker.buff[aura.auraInstanceID] = auraInfo + end + + local function HandleAuraDebuff(aura) + local auraInfo = C_UnitAuras.GetAuraDataByAuraInstanceID("player", aura.auraInstanceID) + Details.AuraTracker.debuff[aura.auraInstanceID] = auraInfo + end + + local batchCount = nil + local usePackedAura = true + AuraUtil.ForEachAura("player", "HELPFUL", batchCount, HandleAuraBuff, usePackedAura) + AuraUtil.ForEachAura("player", "HARMFUL", batchCount, HandleAuraDebuff, usePackedAura) + + Details.AuraTracker.RefreshScrollData() +end + +local doIncrementalAuraUpdate = function(aurasUpdated) + for _, auraInstanceId in ipairs(aurasUpdated) do + local auraInfo = C_UnitAuras.GetAuraDataByAuraInstanceID("player", auraInstanceId) + if (auraInfo.isHelpful) then + Details.AuraTracker.buff[auraInstanceId] = auraInfo + else + Details.AuraTracker.debuff[auraInstanceId] = auraInfo + end + end + Details.AuraTracker.RefreshScrollData() +end + +local doAddedAuraUpdate = function(aurasAdded) + for _, auraInfo in ipairs(aurasAdded) do + if (auraInfo.isHelpful) then + Details.AuraTracker.buff[auraInfo.auraInstanceID] = auraInfo + else + Details.AuraTracker.debuff[auraInfo.auraInstanceID] = auraInfo + end + end + Details.AuraTracker.RefreshScrollData() +end + +local doRemovedAuraUpdate = function(aurasRemoved) + for _, auraInstanceId in ipairs(aurasRemoved) do + if (Details.AuraTracker.buff[auraInstanceId]) then + Details.AuraTracker.buff[auraInstanceId] = nil + + elseif (Details.AuraTracker.debuff[auraInstanceId]) then + Details.AuraTracker.debuff[auraInstanceId] = nil + end + end + Details.AuraTracker.RefreshScrollData() +end + +function Details.AuraTracker.OnShowAuraTrackerFrame(auraTrackerFrame) + doFullAuraUpdate() + auraTrackerFrame.EventFrame:RegisterUnitEvent("UNIT_AURA", "player") +end + +function Details.AuraTracker.OnHideAuraTrackerFrame(auraTrackerFrame) + auraTrackerFrame.EventFrame:UnregisterEvent("UNIT_AURA") +end + +function Details.AuraTracker.CreatePanel() + --create a panel + local auraTrackerFrame = DetailsFramework:CreateSimplePanel(UIParent) + auraTrackerFrame:SetSize(windowWidth, windowHeight) + auraTrackerFrame:SetTitle("Details! Aura Tracker") + + --disable the buil-in mouse integration of the simple panel, doing this to use LibWindow-1.1 as the window management + auraTrackerFrame:SetScript("OnMouseDown", nil) + auraTrackerFrame:SetScript("OnMouseUp", nil) + + Details.AuraTracker.AuraTrackerFrame = auraTrackerFrame + auraTrackerFrame.data = { + buffs = {}, + debuffs = {}, + } + + auraTrackerFrame.EventFrame = CreateFrame("frame") + auraTrackerFrame.EventFrame:SetScript("OnEvent", Details.AuraTracker.OnUnitAuraEvent) + + --register in the libWindow + local LibWindow = LibStub("LibWindow-1.1") + LibWindow.RegisterConfig(auraTrackerFrame, Details.aura_tracker_frame.position) + LibWindow.MakeDraggable(auraTrackerFrame) + LibWindow.RestorePosition(auraTrackerFrame) + + --scale bar + local scaleBar = DetailsFramework:CreateScaleBar(auraTrackerFrame, Details.aura_tracker_frame.scaletable) + auraTrackerFrame:SetScale(Details.aura_tracker_frame.scaletable.scale) + + --status bar + local statusBar = DetailsFramework:CreateStatusBar(auraTrackerFrame) + statusBar.text = statusBar:CreateFontString(nil, "overlay", "GameFontNormal") + statusBar.text:SetPoint("left", statusBar, "left", 5, 0) + statusBar.text:SetText("Details! Damage Meter") + DetailsFramework:SetFontSize(statusBar.text, 11) + DetailsFramework:SetFontColor(statusBar.text, "gray") + + --header + local headerTable = { + {text = "", width = 20}, + {text = "Aura Name", width = 162}, + {text = "Spell Id", width = 100}, + {text = "Lua Table", width = 250}, + {text = "Points", width = 100}, + } + local headerOptions = { + padding = 2, + } + + auraTrackerFrame.Header = DetailsFramework:CreateHeader(auraTrackerFrame, headerTable, headerOptions) + auraTrackerFrame.Header:SetPoint("topleft", auraTrackerFrame, "topleft", 5, -22) + + --create a scroll to show all buffs + local buffScroll = DetailsFramework:CreateScrollBox(auraTrackerFrame, "$parentBuffScrollBox", Details.AuraTracker.RefreshScroll, auraTrackerFrame.data.buffs, scrollWidth, scrollHeightBuff, scrollLineAmountBuff, scrollLineHeight) + DetailsFramework:ReskinSlider(buffScroll) + buffScroll:CreateLines(Details.AuraTracker.CreateScrollLine, scrollLineAmountBuff) + buffScroll:SetPoint("topleft", auraTrackerFrame, "topleft", 5, -42) + auraTrackerFrame.BuffScroll = buffScroll + + --create a scroll to show all debuffs + local debuffScroll = DetailsFramework:CreateScrollBox(auraTrackerFrame, "$parentDebuffScrollBox", Details.AuraTracker.RefreshScroll, auraTrackerFrame.data.debuffs, scrollWidth, scrollHeightDebuff, scrollLineAmountDebuff, scrollLineHeight) + debuffScroll:CreateLines(Details.AuraTracker.CreateScrollLine, scrollLineAmountDebuff) + DetailsFramework:ReskinSlider(debuffScroll) + debuffScroll:SetPoint("topleft", buffScroll, "bottomleft", 0, -2) + auraTrackerFrame.DebuffScroll = debuffScroll +end + +local cachedPoints = {} +local storeAuraPointsOnCache = function(auraInfo) + local thisAuraCache = cachedPoints[auraInfo.spellId] + if (not thisAuraCache) then + thisAuraCache = {} + cachedPoints[auraInfo.spellId] = thisAuraCache + end + + for i = 1, #auraInfo.points do + thisAuraCache[auraInfo.points[i]] = 1 + end +end + +local formatToLuaTable = { + --[232698] = 1, --Shadowform + doFormat1 = function(auraInfo) + return "[" .. auraInfo.spellId .. "] = 1, --" .. auraInfo.name + end, + + --[390636] = {[1] = 200, [200] = 1, [2] = 0, [0] = 2, [3] = 400, [400] = 3}, --Rhapsody + doFormat2 = function(auraInfo) + local pointsTable = {} + for i = 1, #auraInfo.points do + pointsTable[#pointsTable+1] = "[" .. i .. "] = " .. auraInfo.points[i] + pointsTable[#pointsTable+1] = "[" .. auraInfo.points[i] .. "] = " .. i + end + return "[" .. auraInfo.spellId .. "] = {" .. table.concat(pointsTable, ", ") .. "}, --" .. auraInfo.name + end, + + --[371172] = {[236] = 1}, --Phial of Tepid Versatility + doFormat2NoIndex = function(auraInfo) + local pointsTable = {} + for i = 1, #auraInfo.points do + pointsTable[#pointsTable+1] = "[" .. auraInfo.points[i] .. "] = " .. i + end + return "[" .. auraInfo.spellId .. "] = {" .. table.concat(pointsTable, ", ") .. "}, --" .. auraInfo.name + end, + + --[572] = 1, [432] = 1, [75] = 1, [497] = 1 + doFormat2NoIndexFromCache = function(auraInfo) + local points = cachedPoints[auraInfo.spellId] or {} + local pointsTable = {} + + for point in pairs(points) do + pointsTable[#pointsTable+1] = "[" .. point .. "] = 1" + end + return table.concat(pointsTable, ", ") + end, + + --{[1] = 131, [131] = 1, [2] = 0, [0] = 2}, + doFormat3 = function(auraInfo) + local pointsTable = {} + for i = 1, #auraInfo.points do + pointsTable[#pointsTable+1] = "[" .. i .. "] = " .. auraInfo.points[i] + pointsTable[#pointsTable+1] = "[" .. auraInfo.points[i] .. "] = " .. i + end + return "{" .. table.concat(pointsTable, ", ") .. "}," + end, + + --same as 3 but ignore zeros + doFormat4 = function(auraInfo) + local pointsTable = {} + for i = 1, #auraInfo.points do + if (auraInfo.points[i] ~= 0) then + pointsTable[#pointsTable+1] = "[" .. i .. "] = " .. auraInfo.points[i] + pointsTable[#pointsTable+1] = "[" .. auraInfo.points[i] .. "] = " .. i + end + end + return "{" .. table.concat(pointsTable, ", ") .. "}," + end, + + --200, 0, 400 + doFormat5 = function(auraInfo) + return table.concat(auraInfo.points, ", ") + end, +} + +--[371354] = {[131] = 1, [151] = 2, [174] = 3, [1] = 131, [2] = 151, [3] = 174}, --Phial of the Eye in the Storm + +function Details.AuraTracker.RefreshScroll(self, data, offset, totalLines) + for i = 1, totalLines do + local index = i + offset + local auraInfo = data[index] + + if (auraInfo) then + local line = self:GetLine(i) + storeAuraPointsOnCache(auraInfo) + line.Icon.texture = auraInfo.icon + line.Name.text = auraInfo.name + line.SpellId.text = auraInfo.spellId + line.LuaTableEntry.text = formatToLuaTable.doFormat2NoIndex(auraInfo) + line.Points.text = formatToLuaTable.doFormat2NoIndexFromCache(auraInfo) + end + end +end + +function Details.AuraTracker.RefreshScrollData() + local buffData = {} + for spellId, auraInfo in pairs(Details.AuraTracker.buff) do + buffData[#buffData+1] = auraInfo + end + + local debuffData = {} + for spellId, auraInfo in pairs(Details.AuraTracker.debuff) do + debuffData[#debuffData+1] = auraInfo + end + + Details.AuraTracker.AuraTrackerFrame.BuffScroll:SetData(buffData) + Details.AuraTracker.AuraTrackerFrame.BuffScroll:Refresh() + Details.AuraTracker.AuraTrackerFrame.DebuffScroll:SetData(debuffData) + Details.AuraTracker.AuraTrackerFrame.DebuffScroll:Refresh() +end + +function Details.AuraTracker.OnUnitAuraEvent(self, event, unit, unitAuraUpdateInfo) + if (unitAuraUpdateInfo == nil or unitAuraUpdateInfo.isFullUpdate) then + doFullAuraUpdate() + else + if (unitAuraUpdateInfo.removedAuraInstanceIDs) then + doRemovedAuraUpdate(unitAuraUpdateInfo.removedAuraInstanceIDs) + end + + if (unitAuraUpdateInfo.updatedAuraInstanceIDs) then + doIncrementalAuraUpdate(unitAuraUpdateInfo.updatedAuraInstanceIDs) + end + + if (unitAuraUpdateInfo.addedAuras) then + doAddedAuraUpdate(unitAuraUpdateInfo.addedAuras) + end + end +end + +function Details.AuraTracker.CreateScrollLine(self, lineId) + local line = CreateFrame("frame", "$parentLine" .. lineId, self, "BackdropTemplate") + line.lineId = lineId + + line:SetPoint("topleft", self, "topleft", 2, (scrollLineHeight * (lineId - 1) * -1) - 2) + line:SetPoint("topright", self, "topright", -2, (scrollLineHeight * (lineId - 1) * -1) - 2) + line:SetHeight(scrollLineHeight) + + DetailsFramework:Mixin(line, DetailsFramework.HeaderFunctions) + DetailsFramework.BackdropUtil:SetColorStripe(line, lineId) + + local header = self:GetParent().Header + + --aura icon + local auraIconTexture = DetailsFramework:CreateTexture(line, "", scrollLineHeight - 2, scrollLineHeight - 2, "overlay", {.1, .9, .1, .9}) + + --aura name + local auraNameTextField = DetailsFramework:CreateTextEntry(line, function()end, header:GetColumnWidth(2), scrollLineHeight, _, _, _, dropdownTemplate) + auraNameTextField:SetJustifyH("left") + auraNameTextField:SetTextInsets(3, 3, 0, 0) + auraNameTextField:SetAutoSelectTextOnFocus(true) + + --spellId text field + local spellIdTextField = DetailsFramework:CreateTextEntry(line, function()end, header:GetColumnWidth(3), scrollLineHeight, _, _, _, dropdownTemplate) + spellIdTextField:SetJustifyH("left") + spellIdTextField:SetTextInsets(3, 3, 0, 0) + spellIdTextField:SetAutoSelectTextOnFocus(true) + + --formatted lua table + local luaTableEntryTextField = DetailsFramework:CreateTextEntry(line, function()end, header:GetColumnWidth(4), scrollLineHeight, _, _, _, dropdownTemplate) + luaTableEntryTextField:SetJustifyH("left") + luaTableEntryTextField:SetTextInsets(3, 3, 0, 0) + luaTableEntryTextField:SetAutoSelectTextOnFocus(true) + + --points + local pointsTextField = DetailsFramework:CreateTextEntry(line, function()end, header:GetColumnWidth(5), scrollLineHeight, _, _, _, dropdownTemplate) + pointsTextField:SetJustifyH("left") + pointsTextField:SetTextInsets(3, 3, 0, 0) + pointsTextField:SetAutoSelectTextOnFocus(true) + + line:AddFrameToHeaderAlignment(auraIconTexture) + line:AddFrameToHeaderAlignment(auraNameTextField) + line:AddFrameToHeaderAlignment(spellIdTextField) + line:AddFrameToHeaderAlignment(luaTableEntryTextField) + line:AddFrameToHeaderAlignment(pointsTextField) + + line:AlignWithHeader(header, "left") + + line.Icon = auraIconTexture + line.Name = auraNameTextField + line.SpellId = spellIdTextField + line.LuaTableEntry = luaTableEntryTextField + line.Points = pointsTextField + + return line +end + +function Details.AuraTracker.Open() + if (not Details.AuraTracker.framesCreated) then + Details.AuraTracker.CreatePanel() + end + Details.AuraTracker.AuraTrackerFrame:Show() + Details.AuraTracker.OnShowAuraTrackerFrame(Details.AuraTracker.AuraTrackerFrame) +end + +function Details.AuraTracker.Close() + if (Details.AuraTracker.framesCreated) then + Details.AuraTracker.AuraTrackerFrame:Hide() + Details.AuraTracker.OnHideAuraTrackerFrame(Details.AuraTracker.AuraTrackerFrame) + end +end \ No newline at end of file diff --git a/functions/profiles.lua b/functions/profiles.lua index ebca3cc2..85d41005 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -1319,6 +1319,14 @@ local default_global_data = { scale = 1, position = {}, }, + + --> aura tracker panel + aura_tracker_frame = { + position = {}, --for libwindow + scaletable = { + scale = 1 + }, + }, --> profile by spec profile_by_spec = {}, diff --git a/functions/skins.lua b/functions/skins.lua index 61fff48f..8b98d779 100644 --- a/functions/skins.lua +++ b/functions/skins.lua @@ -352,7 +352,7 @@ local _ 0.84036460518837, -- [4] }, ["menu_anchor"] = { - 22, + 20, 0, ["side"] = 2, }, diff --git a/functions/slash.lua b/functions/slash.lua index 414c2e02..a1cdee34 100644 --- a/functions/slash.lua +++ b/functions/slash.lua @@ -855,30 +855,6 @@ function SlashCmdList.DETAILS (msg, editbox) _detalhes.id_frame.texto:HighlightText() end - --> debug - - elseif (msg == "auras") then - if (IsInRaid()) then - for raidIndex = 1, GetNumGroupMembers() do - for buffIndex = 1, 41 do - local name, _, _, _, _, _, _, unitCaster, _, _, spellid = UnitAura ("raid"..raidIndex, buffIndex, nil, "HELPFUL") - print (name, unitCaster, "==", "raid"..raidIndex) - if (name and unitCaster == "raid"..raidIndex) then - - local playerName, realmName = UnitName ("raid"..raidIndex) - if (realmName and realmName ~= "") then - playerName = playerName .. "-" .. realmName - end - - _detalhes.parser:add_buff_uptime (nil, GetTime(), UnitGUID ("raid"..raidIndex), playerName, 0x00000417, UnitGUID ("raid"..raidIndex), playerName, 0x00000417, spellid, name, in_or_out) - - else - --break - end - end - end - end - elseif (command == "profile") then local profile = rest:match("^(%S*)%s*(.-)$") @@ -1557,6 +1533,8 @@ function SlashCmdList.DETAILS (msg, editbox) --elseif (msg == "update") then -- _detalhes:CopyPaste ([[https://www.wowinterface.com/downloads/info23056-DetailsDamageMeter8.07.3.5.html]]) + elseif (msg == "auras") then + Details.AuraTracker.Open() elseif (msg == "ec") then if (rest and tonumber(rest)) then