Major update
-New feature: Arena DPS Bar, can be enabled at the Broadcaster Tools section, shows a bar in 'kamehameha' style showing which team is doing more damage in the latest 3 seconds. -Revamp on the options section for Broadcaster tools. -Added 'Icon Size Offset' under Options > Bars: General, this new option allow to adjust the size of the class/spec icon shown on each bar. -Added 'Show Faction Icon' under Options > Bars: General, with this new option, you can choose to not show the faction icon, this icon is usually shown during battlegrounds. -Added 'Faction Icon Size Offset' under Options > Bars: General, new option to adjust the size of the faction icon. -Added 'Show Arena Role Icon' under Options > Bars: General, new option to hide or show the role icon of players during an arena match. -Added 'Arena Role Icon Size Offset' under Options > Bars: General, new option which allow to control the size of the arena role icon. -Added 'Level' option to Wallpapers, the wallpaper can now be placed on different levels which solves issues where the wallpaper is too low of certain configuration. -Streamer! plugin got updates, now it is more clear to pick which mode to use. -WotLK classic compatibility (Flamanis, Daniel Henry). -Fixed the title bar text not showing when using the Custom Title Bar feature. -Role detection in classic versions got improvements. -New API: Details:GetTop5Actors(attributeId), return the top 5 actors from the selected attribute. -New API: Details:GetActorByRank(attributeId, rankIndex), return an actor from the selected attribute and rankIndex. -Major cleanup and code improvements on dropdowns for library Details! Framework. -Cleanup on NickTag library. -Removed LibGroupInSpecT, LibItemUpgradeInfo and LibCompress. These libraries got replaced by OpenRaidLib and LibDeflate.
This commit is contained in:
@@ -35,7 +35,7 @@ end
|
||||
|
||||
autoRunCodeEventFrame.OnEventFunc = function(self, event)
|
||||
--> ignore events triggered more than once in a small time window
|
||||
if (autoRunCodeEventFrame [event] and not autoRunCodeEventFrame [event]._cancelled) then
|
||||
if (autoRunCodeEventFrame [event] and not autoRunCodeEventFrame [event]:IsCancelled()) then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
|
||||
|
||||
local Details = _G.Details
|
||||
|
||||
--namespace
|
||||
Details.CurrentDps = {
|
||||
Dps = {},
|
||||
Hps = {},
|
||||
}
|
||||
|
||||
local currentDpsFrame = CreateFrame("frame", "DetailsCurrentDpsUpdaterFrame", UIParent)
|
||||
local delayTimeBetweenUpdates = 0.10
|
||||
local currentDelay = 0
|
||||
local cacheSize = 40 --4 seconds of data
|
||||
local dpsTime = delayTimeBetweenUpdates * cacheSize
|
||||
local cacheOverflowIndex = cacheSize + 1
|
||||
|
||||
currentDpsFrame.OnUpdateFunc = function(self, deltaTime)
|
||||
currentDelay = currentDelay + deltaTime
|
||||
if (currentDelay < delayTimeBetweenUpdates) then
|
||||
return
|
||||
end
|
||||
|
||||
local combatObject = Details.CurrentDps.CombatObject
|
||||
|
||||
local damageContainer = combatObject:GetContainer(DETAILS_ATTRIBUTE_DAMAGE)
|
||||
for index, actorObject in damageContainer:ListActors() do
|
||||
if (actorObject:IsPlayer()) then
|
||||
local actorTable = Details.CurrentDps.Dps[actorObject.serial]
|
||||
if (not actorTable) then
|
||||
actorTable = {
|
||||
totalDamage = 0, --hold a sum of all dps done in the latest #cacheSize delayed OnUpdate ticks
|
||||
currentDps = 0,
|
||||
latestDamageAmount = 0,
|
||||
cache = {},
|
||||
}
|
||||
Details.CurrentDps.Dps[actorObject.serial] = actorTable
|
||||
end
|
||||
|
||||
--get the damage done on this tick
|
||||
local totalDamageThisTick = actorObject.total - actorTable.latestDamageAmount
|
||||
--add the damage to the cache
|
||||
tinsert(actorTable.cache, 1, totalDamageThisTick)
|
||||
--set the latest damage amount
|
||||
actorTable.latestDamageAmount = actorObject.total
|
||||
--sum the total damage the actor inflicted
|
||||
actorTable.totalDamage = actorTable.totalDamage + totalDamageThisTick
|
||||
|
||||
--cut the damage
|
||||
local damageRemoved = tremove(actorTable.cache, cacheOverflowIndex)
|
||||
if (damageRemoved) then
|
||||
actorTable.totalDamage = actorTable.totalDamage - damageRemoved
|
||||
actorTable.totalDamage = max(0, actorTable.totalDamage) --safe guard
|
||||
end
|
||||
|
||||
actorTable.currentDps = actorTable.totalDamage / dpsTime
|
||||
if (actorObject.nome == "Ditador") then
|
||||
local formatToKFunc = Details:GetCurrentToKFunction()
|
||||
print(actorTable.totalDamage, #actorTable.cache, dpsTime, formatToKFunc(nil, actorTable.currentDps))
|
||||
end
|
||||
|
||||
if (actorObject.nome == "Ditador") then
|
||||
--print("Dps:", actorTable.currentDps)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
currentDelay = 0
|
||||
end
|
||||
|
||||
--start the proccess of updating the current dps and hps for each player
|
||||
function Details.CurrentDps.StartCurrentDpsTracker()
|
||||
Details.CurrentDps.CombatObject = Details:GetCurrentCombat()
|
||||
wipe(Details.CurrentDps.Dps)
|
||||
wipe(Details.CurrentDps.Hps)
|
||||
currentDpsFrame:SetScript("OnUpdate", currentDpsFrame.OnUpdateFunc)
|
||||
end
|
||||
--stop what the function above started
|
||||
function Details.CurrentDps.StopCurrentDpsTracker()
|
||||
currentDpsFrame:SetScript("OnUpdate", nil)
|
||||
end
|
||||
|
||||
--serial = guid
|
||||
function Details.CurrentDps.GetCurrentDps(serial)
|
||||
local actorTable = Details.CurrentDps.Dps[serial]
|
||||
if (actorTable) then
|
||||
local currentDps = actorTable.currentDps
|
||||
local formatToKFunc = Details:GetCurrentToKFunction()
|
||||
return formatToKFunc(nil, currentDps)
|
||||
end
|
||||
end
|
||||
|
||||
--handle internal details! events
|
||||
local eventListener = Details:CreateEventListener()
|
||||
eventListener:RegisterEvent("COMBAT_PLAYER_ENTER", function()
|
||||
--Details.CurrentDps.StartCurrentDpsTracker()
|
||||
end)
|
||||
eventListener:RegisterEvent("COMBAT_PLAYER_LEAVE", function()
|
||||
--Details.CurrentDps.StopCurrentDpsTracker()
|
||||
end)
|
||||
@@ -127,7 +127,7 @@ function Details:RefreshPlaterIntegration()
|
||||
plater_integration_frame.PlayerGUID = UnitGUID ("player")
|
||||
|
||||
--> cancel the timer if already have one
|
||||
if (plater_integration_frame.CleanUpTimer and not plater_integration_frame.CleanUpTimer._cancelled) then
|
||||
if (plater_integration_frame.CleanUpTimer and not plater_integration_frame.CleanUpTimer:IsCancelled()) then
|
||||
plater_integration_frame.CleanUpTimer:Cancel()
|
||||
end
|
||||
|
||||
@@ -149,7 +149,7 @@ function Details:RefreshPlaterIntegration()
|
||||
plater_integration_frame.OnTickFrame:SetScript ("OnUpdate", nil)
|
||||
|
||||
--> stop the cleanup process
|
||||
if (plater_integration_frame.CleanUpTimer and not plater_integration_frame.CleanUpTimer._cancelled) then
|
||||
if (plater_integration_frame.CleanUpTimer and not plater_integration_frame.CleanUpTimer:IsCancelled()) then
|
||||
plater_integration_frame.CleanUpTimer:Cancel()
|
||||
end
|
||||
end
|
||||
|
||||
+16
-9
@@ -1033,27 +1033,34 @@ local default_profile = {
|
||||
line_texture = "Details Serenity",
|
||||
line_color = {.1, .1, .1, 0.3},
|
||||
},
|
||||
|
||||
|
||||
--> current damage
|
||||
current_dps_meter = {
|
||||
frame = {
|
||||
locked = false,
|
||||
width = 220,
|
||||
height = 65,
|
||||
realtime_dps_meter = {
|
||||
frame_settings = {
|
||||
locked = true,
|
||||
width = 300,
|
||||
height = 23,
|
||||
backdrop_color = {0, 0, 0, 0.2},
|
||||
show_title = false,
|
||||
show_title = true,
|
||||
strata = "LOW",
|
||||
|
||||
--libwindow
|
||||
point = "TOP",
|
||||
scale = 1,
|
||||
y = -110,
|
||||
x = 0,
|
||||
},
|
||||
options_frame = {},
|
||||
enabled = false,
|
||||
arena_enabled = true,
|
||||
mythic_dungeon_enabled = true,
|
||||
mythic_dungeon_enabled = false,
|
||||
font_size = 18,
|
||||
font_color = {1, 1, 1, 1},
|
||||
font_shadow = "NONE",
|
||||
font_face = "Friz Quadrata TT",
|
||||
text_offset = 2,
|
||||
update_interval = 0.30,
|
||||
sample_size = 5, --in seconds
|
||||
sample_size = 3, --in seconds
|
||||
},
|
||||
|
||||
--> streamer
|
||||
|
||||
+4
-4
@@ -2004,8 +2004,8 @@ if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
|
||||
{text = "Class", width = 40, canSort = true, dataType = "number", order = "DESC", offset = 0},
|
||||
{text = "Player Name", width = 140, canSort = true, dataType = "string", order = "DESC", offset = 0},
|
||||
{text = "Level", width = 60, canSort = true, dataType = "number", order = "DESC", offset = 0, selected = true},
|
||||
{text = "Dungeon", width = 120, canSort = true, dataType = "string", order = "DESC", offset = 0},
|
||||
{text = "Classic Dungeon", width = 120, canSort = true, dataType = "string", order = "DESC", offset = 0},
|
||||
{text = "Dungeon", width = 240, canSort = true, dataType = "string", order = "DESC", offset = 0},
|
||||
--{text = "Classic Dungeon", width = 120, canSort = true, dataType = "string", order = "DESC", offset = 0},
|
||||
{text = "Mythic+ Rating", width = 100, canSort = true, dataType = "number", order = "DESC", offset = 0},
|
||||
}
|
||||
|
||||
@@ -2065,7 +2065,7 @@ if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
|
||||
line.playerNameText.text = unitName
|
||||
line.keystoneLevelText.text = level
|
||||
line.dungeonNameText.text = mapName
|
||||
DetailsFramework:TruncateText(line.dungeonNameText, 120)
|
||||
DetailsFramework:TruncateText(line.dungeonNameText, 240)
|
||||
line.classicDungeonNameText.text = mapNameChallenge or ""
|
||||
DetailsFramework:TruncateText(line.classicDungeonNameText, 120)
|
||||
line.inMyParty = inMyParty > 0
|
||||
@@ -2178,7 +2178,7 @@ if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
|
||||
line:AddFrameToHeaderAlignment(playerNameText)
|
||||
line:AddFrameToHeaderAlignment(keystoneLevelText)
|
||||
line:AddFrameToHeaderAlignment(dungeonNameText)
|
||||
line:AddFrameToHeaderAlignment(classicDungeonNameText)
|
||||
--line:AddFrameToHeaderAlignment(classicDungeonNameText)
|
||||
line:AddFrameToHeaderAlignment(ratingText)
|
||||
|
||||
line:AlignWithHeader(f.Header, "left")
|
||||
|
||||
Reference in New Issue
Block a user