show "one hour buffs" if they aren't 100% uptime.

This commit is contained in:
Tercio Jose
2024-07-22 13:33:12 -03:00
committed by andrew6180
parent 1dec8b7540
commit 4409149841
6 changed files with 76 additions and 9 deletions
+24 -1
View File
@@ -20,7 +20,7 @@ local IsPassiveSpell = IsPassiveSpell
--api locals
local PixelUtil = PixelUtil or DFPixelUtil
local version = 24
local version = 26
local CONST_MENU_TYPE_MAINMENU = "main"
local CONST_MENU_TYPE_SUBMENU = "sub"
@@ -337,6 +337,13 @@ function DF:CreateCoolTip()
DF:SetFontSize(self.titleText, 10)
self.titleText:SetPoint("CENTER", self.titleIcon, "CENTER", 0, 6)
end
if (not self.modelFrame) then
self.modelFrame = CreateFrame("PlayerModel", "$parent_ModelFrame", self)
self.modelFrame:SetPoint("topleft", self, "topleft", 5, -5)
self.modelFrame:SetPoint("bottomright", self, "bottomright", -5, 5)
self.modelFrame:Hide()
end
end
--main frame
@@ -2734,6 +2741,9 @@ function DF:CreateCoolTip()
gameCooltip.Banner[2] = false
gameCooltip.Banner[3] = false
frame1.modelFrame:Hide()
frame2.modelFrame:Hide()
frame1.upperImage:Hide()
frame1.upperImage2:Hide()
frame1.upperImageText:Hide()
@@ -3019,6 +3029,19 @@ function DF:CreateCoolTip()
frame1.frameWallpaper:Hide()
frame2.frameWallpaper:Hide()
function gameCooltip:SetNpcModel(menuType, npcId)
menuType = gameCooltip:ParseMenuType(menuType)
if (menuType == CONST_MENU_TYPE_MAINMENU) then
frame1.modelFrame:Show()
frame1.modelFrame:SetCreature(npcId)
elseif (menuType == CONST_MENU_TYPE_SUBMENU) then
frame2.modelFrame:Show()
frame2.modelFrame:SetCreature(npcId)
end
end
---set an image as wallpaper for the cooltip frame
---@param menuType any
---@param texture any
+1 -1
View File
@@ -1,6 +1,6 @@
local dversion = 550
local dversion = 551
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary(major, minor)
+1
View File
@@ -188,6 +188,7 @@
}
Details222.IgnoredWorldAuras = {}
Details222.OneHourAuras = {}
Details222.Parser = {}
+21 -7
View File
@@ -1533,8 +1533,11 @@ function Details:CatchRaidBuffUptime(sOperationType) -- ~scan
end
for buffIndex = 1, 41 do
local name, _, _, _, _, _, _, unitCaster, _, _, spellId = UnitAura(unitId, buffIndex, "HELPFUL")
local name, _, _, _, _, duration, _, unitCaster, _, _, spellId = UnitAura(unitId, buffIndex, "HELPFUL")
if (name and unitCaster and UnitExists(unitCaster) and UnitExists(unitId) and UnitIsUnit(unitCaster, unitId)) then
if (duration == 3600) then
Details222.OneHourAuras[spellId] = true
end
Details.parser:add_buff_uptime(nil, cacheGetTime, playerGUID, playerName, 0x00000514, playerGUID, playerName, 0x00000514, 0x0, spellId, name, sOperationType)
if (sOperationType == "BUFF_UPTIME_IN") then
@@ -1598,7 +1601,11 @@ function Details:CatchRaidBuffUptime(sOperationType) -- ~scan
elseif (bUnitIsTheCaster) then
local playerGUID = UnitGUID(unitId)
if (playerGUID and auraInfo.duration ~= 3600) then
if (playerGUID) then
if (auraInfo.duration == 3600) then
Details222.OneHourAuras[spellId] = true
end
local playerName = Details:GetFullName(unitId)
if (sOperationType == "BUFF_UPTIME_IN") then
if (Details.PotionList[spellId]) then
@@ -1643,7 +1650,11 @@ function Details:CatchRaidBuffUptime(sOperationType) -- ~scan
else
local playerName = Details:GetFullName(unitId)
local playerGUID = UnitGUID(unitId)
if (playerGUID and auraInfo.duration ~= 3600) then
if (playerGUID) then
if (auraInfo.duration == 3600) then
Details222.OneHourAuras[spellId] = true
end
if (sOperationType == "BUFF_UPTIME_IN") then
if (Details.PotionList[spellId]) then
potUsage [playerName] = spellId
@@ -1685,20 +1696,23 @@ function Details:CatchRaidBuffUptime(sOperationType) -- ~scan
local focus_augmentation = {}
for buffIndex = 1, 41 do
local auraName, _, _, _, _, _, _, unitCaster, _, _, spellid = UnitAura ("player", buffIndex, "HELPFUL")
local auraName, _, _, _, _, duration, _, unitCaster, _, _, spellId = UnitAura ("player", buffIndex, "HELPFUL")
if (auraName and unitCaster and UnitExists(unitCaster) and UnitIsUnit(unitCaster, "player")) then
local playerName = Details.playername
local playerGUID = UnitGUID("player")
if (playerGUID) then
if (duration == 3600) then --1hr buffs, record auras which has 1 hr of duration, hence they can be checked for 100% at the end of the combat
Details222.OneHourAuras[spellId] = true
end
if (sOperationType == "BUFF_UPTIME_IN") then
if (Details.PotionList [spellid]) then
if (Details.PotionList [spellId]) then
pot_usage [playerName] = spellid
elseif (runeIds [spellid]) then
elseif (runeIds [spellId]) then
focus_augmentation [playerName] = true
end
end
Details.parser:add_buff_uptime (nil, GetTime(), playerGUID, playerName, 0x00000417, playerGUID, playerName, 0x00000417, 0x0, spellid, auraName, sOperationType)
Details.parser:add_buff_uptime (nil, GetTime(), playerGUID, playerName, 0x00000417, playerGUID, playerName, 0x00000417, 0x0, spellId, auraName, sOperationType)
end
end
end
+28
View File
@@ -32,7 +32,35 @@ function AuraScan.FindAndIgnoreWorldAuras()
end
end
function AuraScan.CheckForOneHourBuffs()
---@type combat
local currentCombat = Details:GetCurrentCombat()
---@type actorcontainer
local utilityContainer = currentCombat:GetContainer(DETAILS_ATTRIBUTE_MISC)
---@type combattime
local combatTime = floor(currentCombat:GetCombatTime())
for _, utilityActor in utilityContainer:ListActors() do
---@cast utilityActor actorutility
if (utilityActor:IsPlayer()) then
--get the buff container
---@type spellcontainer
local buffUptimeContainer = utilityActor.buff_uptime_spells
if (buffUptimeContainer) then
for spellId, spellTable in buffUptimeContainer:ListSpells() do
---@cast spellTable spelltable
if (Details222.OneHourAuras[spellId]) then
--is this buff have 100% uptime?
if (spellTable.uptime == combatTime) then
utilityActor.buff_uptime = utilityActor.buff_uptime - spellTable.uptime
utilityActor.buff_uptime_spells._ActorTable[spellId] = nil
end
end
end
end
end
end
end
function AuraScan.RegisterCallback(callback)
AuraScan.Callbacks[callback] = true
+1
View File
@@ -479,6 +479,7 @@
Details:CatchRaidBuffUptime("BUFF_UPTIME_OUT")
Details:CatchRaidDebuffUptime("DEBUFF_UPTIME_OUT")
Details:CloseEnemyDebuffsUptime()
Details222.AuraScan.CheckForOneHourBuffs()
Details222.GuessSpecSchedules.ClearSchedules()