Fixed more bugs on the new Breakdown Window

This commit is contained in:
Tercio Jose
2023-05-01 14:20:04 -03:00
parent 11a6c48ddd
commit 690168bef3
82 changed files with 938 additions and 913 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
local _detalhes = _G._detalhes
local _detalhes = _G.Details
--code from blizzard AlertFrames
+1 -1
View File
@@ -9,7 +9,7 @@ local GetCursorPosition = GetCursorPosition
local GameTooltip = GameTooltip
local select = select
local _detalhes = _G._detalhes
local _detalhes = _G.Details
local gump = _detalhes.gump
+5 -5
View File
@@ -12,7 +12,7 @@ local libwindow = LibStub("LibWindow-1.1")
--main frame
local DF = _detalhes.gump
local DF = Details.gump
local _ = nil
--declaration
@@ -28,7 +28,7 @@ local libwindow = LibStub("LibWindow-1.1")
--register to libwindow
local LibWindow = LibStub("LibWindow-1.1")
LibWindow.RegisterConfig(f, _detalhes.benchmark_db.frame)
LibWindow.RegisterConfig(f, Details.benchmark_db.frame)
LibWindow.RestorePosition(f)
LibWindow.MakeDraggable(f)
LibWindow.SavePosition(f)
@@ -46,9 +46,9 @@ local libwindow = LibStub("LibWindow-1.1")
f.Close = CreateFrame("button", "$parentCloseButton", f,"BackdropTemplate")
f.Close:SetPoint("right", f.TitleBar, "right", -2, 0)
f.Close:SetSize(16, 16)
f.Close:SetNormalTexture(_detalhes.gump.folder .. "icons")
f.Close:SetHighlightTexture(_detalhes.gump.folder .. "icons")
f.Close:SetPushedTexture(_detalhes.gump.folder .. "icons")
f.Close:SetNormalTexture(Details.gump.folder .. "icons")
f.Close:SetHighlightTexture(Details.gump.folder .. "icons")
f.Close:SetPushedTexture(Details.gump.folder .. "icons")
f.Close:GetNormalTexture():SetTexCoord(0, 16/128, 0, 1)
f.Close:GetHighlightTexture():SetTexCoord(0, 16/128, 0, 1)
f.Close:GetPushedTexture():SetTexCoord(0, 16/128, 0, 1)
+1 -1
View File
@@ -1,6 +1,6 @@
do
local _detalhes = _G._detalhes
local _detalhes = _G.Details
local DetailsFrameWork = _detalhes.gump
local _
--panel
+52 -52
View File
@@ -15,7 +15,7 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
green_team_color = Details.class_colors.ARENA_GREEN --{.5, 1, .5, 1}
yellow_team_color = Details.class_colors.ARENA_YELLOW --{1, 1, .5, 1}
local DF = _detalhes.gump
local DF = Details.gump
local f = DF:CreateSimplePanel(UIParent, 700, 400, "Details! Arena Damage Bar Options", "DetailsCurrentRealDPSOptions")
f:SetPoint("center", UIParent, "center")
@@ -24,10 +24,10 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
DF:ApplyStandardBackdrop(f)
--scale bar
local scaleBar = DF:CreateScaleBar(f, _detalhes.realtime_dps_meter.options_frame)
local scaleBar = DF:CreateScaleBar(f, Details.realtime_dps_meter.options_frame)
local LibWindow = LibStub("LibWindow-1.1")
LibWindow.RegisterConfig(f, _detalhes.realtime_dps_meter.options_frame)
LibWindow.RegisterConfig(f, Details.realtime_dps_meter.options_frame)
LibWindow.MakeDraggable(f)
LibWindow.RestorePosition(f)
@@ -282,9 +282,9 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
{
type = "range",
get = function() return _detalhes.realtime_dps_meter.text_offset end,
get = function() return Details.realtime_dps_meter.text_offset end,
set = function(self, fixedparam, value)
_detalhes.realtime_dps_meter.text_offset = value
Details.realtime_dps_meter.text_offset = value
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end,
min = 0,
@@ -335,7 +335,7 @@ end
function Details:CreateCurrentDpsFrame(parent, name)
local DF = _detalhes.gump
local DF = Details.gump
local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0")
green_team_color = Details.class_colors.ARENA_GREEN --{.5, 1, .5, 1}
@@ -348,10 +348,10 @@ function Details:CreateCurrentDpsFrame(parent, name)
--main farame
local f = CreateFrame("frame", name, parent or UIParent, "BackdropTemplate")
f:SetPoint("top", UIParent, "top", 0, -110)
f:SetSize(_detalhes.realtime_dps_meter.frame_settings.width, _detalhes.realtime_dps_meter.frame_settings.height)
f:SetSize(Details.realtime_dps_meter.frame_settings.width, Details.realtime_dps_meter.frame_settings.height)
f:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}})
f:SetBackdropColor(unpack(_detalhes.realtime_dps_meter.frame_settings.backdrop_color))
f:SetBackdropColor(unpack(Details.realtime_dps_meter.frame_settings.backdrop_color))
f:EnableMouse(true)
f:SetMovable(true)
f:SetClampedToScreen(true)
@@ -376,7 +376,7 @@ function Details:CreateCurrentDpsFrame(parent, name)
f.PlayerTeam = 0
local LibWindow = LibStub("LibWindow-1.1")
LibWindow.RegisterConfig(f, _detalhes.realtime_dps_meter.frame_settings)
LibWindow.RegisterConfig(f, Details.realtime_dps_meter.frame_settings)
LibWindow.MakeDraggable(f)
LibWindow.RestorePosition(f)
@@ -525,7 +525,7 @@ function Details:CreateCurrentDpsFrame(parent, name)
--update
local time_fraction = 100/1000 --one tick per 100ms
f.NextUpdate = time_fraction --when the next tick occur
f.NextScreenUpdate = _detalhes.realtime_dps_meter.update_interval --when the labels on the frame receive update
f.NextScreenUpdate = Details.realtime_dps_meter.update_interval --when the labels on the frame receive update
--arena
f.PlayerTeamBuffer = {}
@@ -541,23 +541,23 @@ function Details:CreateCurrentDpsFrame(parent, name)
f.LastTickGroupDamage = 0
--general
f.SampleSize = _detalhes.realtime_dps_meter.sample_size
f.SampleSize = Details.realtime_dps_meter.sample_size
f.MaxBufferIndex = 1
f.ShowingArena = false
function _detalhes:UpdateTheRealCurrentDPSFrame(scenario)
function Details:UpdateTheRealCurrentDPSFrame(scenario)
--don't run if the featured hasn't loaded
if (not f) then
return
end
if (not _detalhes.realtime_dps_meter.enabled) then
if (not Details.realtime_dps_meter.enabled) then
f:Hide()
--print("D! debug currentdps.lua > !realtime_dps_meter.enabled")
return
end
if (not _detalhes.realtime_dps_meter.arena_enabled and not _detalhes.realtime_dps_meter.mythic_dungeon_enabled) then
if (not Details.realtime_dps_meter.arena_enabled and not Details.realtime_dps_meter.mythic_dungeon_enabled) then
f:Hide()
print("D! debug currentdps.lua > not _detalhes.realtime_dps_meter.arena_enabled and not _detalhes.realtime_dps_meter.mythic_dungeon_enabled")
return
@@ -566,21 +566,21 @@ function Details:CreateCurrentDpsFrame(parent, name)
--where the player are
if (scenario == "arena") then
f.SampleSize = _detalhes.realtime_dps_meter.sample_size
f.SampleSize = Details.realtime_dps_meter.sample_size
labelPlayerTeam_DPS:Show()
labelYellowTeam_DPS:Show()
--update arena labels
DF:SetFontColor(labelPlayerTeam_DPS, _detalhes.realtime_dps_meter.font_color)
DF:SetFontFace (labelPlayerTeam_DPS, _detalhes.realtime_dps_meter.font_face)
DF:SetFontSize(labelPlayerTeam_DPS, _detalhes.realtime_dps_meter.font_size)
DF:SetFontOutline (labelPlayerTeam_DPS, _detalhes.realtime_dps_meter.font_shadow)
DF:SetFontColor(labelPlayerTeam_DPS, Details.realtime_dps_meter.font_color)
DF:SetFontFace (labelPlayerTeam_DPS, Details.realtime_dps_meter.font_face)
DF:SetFontSize(labelPlayerTeam_DPS, Details.realtime_dps_meter.font_size)
DF:SetFontOutline (labelPlayerTeam_DPS, Details.realtime_dps_meter.font_shadow)
DF:SetFontColor(labelYellowTeam_DPS, _detalhes.realtime_dps_meter.font_color)
DF:SetFontFace (labelYellowTeam_DPS, _detalhes.realtime_dps_meter.font_face)
DF:SetFontSize(labelYellowTeam_DPS, _detalhes.realtime_dps_meter.font_size)
DF:SetFontOutline (labelYellowTeam_DPS, _detalhes.realtime_dps_meter.font_shadow)
DF:SetFontColor(labelYellowTeam_DPS, Details.realtime_dps_meter.font_color)
DF:SetFontFace (labelYellowTeam_DPS, Details.realtime_dps_meter.font_face)
DF:SetFontSize(labelYellowTeam_DPS, Details.realtime_dps_meter.font_size)
DF:SetFontOutline (labelYellowTeam_DPS, Details.realtime_dps_meter.font_shadow)
--wipe current data for arena
wipe (f.PlayerTeamBuffer)
@@ -616,10 +616,10 @@ function Details:CreateCurrentDpsFrame(parent, name)
labelGroupDamage:Show()
labelGroupDamage_DPS:Show()
DF:SetFontColor(labelGroupDamage_DPS, _detalhes.realtime_dps_meter.font_color)
DF:SetFontFace (labelGroupDamage_DPS, _detalhes.realtime_dps_meter.font_face)
DF:SetFontSize(labelGroupDamage_DPS, _detalhes.realtime_dps_meter.font_size)
DF:SetFontOutline (labelGroupDamage_DPS, _detalhes.realtime_dps_meter.font_shadow)
DF:SetFontColor(labelGroupDamage_DPS, Details.realtime_dps_meter.font_color)
DF:SetFontFace (labelGroupDamage_DPS, Details.realtime_dps_meter.font_face)
DF:SetFontSize(labelGroupDamage_DPS, Details.realtime_dps_meter.font_size)
DF:SetFontOutline (labelGroupDamage_DPS, Details.realtime_dps_meter.font_shadow)
--wipe current data for mythic dungeon
f.GroupBuffer = {}
@@ -641,25 +641,25 @@ function Details:CreateCurrentDpsFrame(parent, name)
end
--frame position
f:SetSize(_detalhes.realtime_dps_meter.frame_settings.width, _detalhes.realtime_dps_meter.frame_settings.height)
LibWindow.RegisterConfig(f, _detalhes.realtime_dps_meter.frame_settings)
f:SetSize(Details.realtime_dps_meter.frame_settings.width, Details.realtime_dps_meter.frame_settings.height)
LibWindow.RegisterConfig(f, Details.realtime_dps_meter.frame_settings)
LibWindow.RestorePosition(f)
--backdrop color
f:SetBackdropColor(unpack(_detalhes.realtime_dps_meter.frame_settings.backdrop_color))
f:SetBackdropColor(unpack(Details.realtime_dps_meter.frame_settings.backdrop_color))
--set frame size
f:SetSize(_detalhes.realtime_dps_meter.frame_settings.width, _detalhes.realtime_dps_meter.frame_settings.height)
f:SetSize(Details.realtime_dps_meter.frame_settings.width, Details.realtime_dps_meter.frame_settings.height)
--frame is locked
if (_detalhes.realtime_dps_meter.frame_settings.locked) then
if (Details.realtime_dps_meter.frame_settings.locked) then
f:EnableMouse(false)
else
f:EnableMouse(true)
end
--frame can show title
if (_detalhes.realtime_dps_meter.frame_settings.show_title) then
if (Details.realtime_dps_meter.frame_settings.show_title) then
TitleString:Show()
TitleBackground:Show()
else
@@ -668,27 +668,27 @@ function Details:CreateCurrentDpsFrame(parent, name)
end
--frame strata
f:SetFrameStrata(_detalhes.realtime_dps_meter.frame_settings.strata)
f:SetFrameStrata(Details.realtime_dps_meter.frame_settings.strata)
--calcule buffer size
f.MaxBufferIndex = f.SampleSize * time_fraction * 100 --sample size in seconds * fraction * tick milliseconds
--interval to update the frame
f.NextScreenUpdate = _detalhes.realtime_dps_meter.update_interval
f.NextScreenUpdate = Details.realtime_dps_meter.update_interval
labelPlayerTeam_DPS:SetPoint("left", barFrame.splitBar.widget, "left", 4 + _detalhes.realtime_dps_meter.text_offset, 0)
labelYellowTeam_DPS:SetPoint("right", barFrame.splitBar.widget, "right", -4 - _detalhes.realtime_dps_meter.text_offset, 0)
labelPlayerTeam_DPS:SetPoint("left", barFrame.splitBar.widget, "left", 4 + Details.realtime_dps_meter.text_offset, 0)
labelYellowTeam_DPS:SetPoint("right", barFrame.splitBar.widget, "right", -4 - Details.realtime_dps_meter.text_offset, 0)
end
_detalhes:UpdateTheRealCurrentDPSFrame()
Details:UpdateTheRealCurrentDPSFrame()
local on_tick = function(self, deltaTime)
self.NextUpdate = self.NextUpdate - deltaTime
if (self.NextUpdate <= 0) then
--update string
local currentCombat = _detalhes:GetCombat()
local currentCombat = Details:GetCombat()
local damageContainer = currentCombat:GetContainer (DETAILS_ATTRIBUTE_DAMAGE)
--show the current dps during an arena match
@@ -708,7 +708,7 @@ function Details:CreateCurrentDpsFrame(parent, name)
thisTickYellowDamage = thisTickYellowDamage + actor.total
end
if (actor.nome == _detalhes.playername) then
if (actor.nome == Details.playername) then
--if player isn't in green team > swap colors
if (f.PlayerTeam ~= actor.arena_team) then
f.SwapArenaTeamColors()
@@ -797,13 +797,13 @@ function Details:CreateCurrentDpsFrame(parent, name)
if (self.NextScreenUpdate <= 0) then
if (f.PlayerTeam == 0) then
labelPlayerTeam_DPS:SetText(_detalhes:ToK2 (self.PlayerTeamDamage / self.SampleSize))
labelYellowTeam_DPS:SetText(_detalhes:ToK2 (self.YellowDamage / self.SampleSize))
labelPlayerTeam_DPS:SetText(Details:ToK2 (self.PlayerTeamDamage / self.SampleSize))
labelYellowTeam_DPS:SetText(Details:ToK2 (self.YellowDamage / self.SampleSize))
else
labelPlayerTeam_DPS:SetText(_detalhes:ToK2 (self.YellowDamage / self.SampleSize))
labelYellowTeam_DPS:SetText(_detalhes:ToK2 (self.PlayerTeamDamage / self.SampleSize))
labelPlayerTeam_DPS:SetText(Details:ToK2 (self.YellowDamage / self.SampleSize))
labelYellowTeam_DPS:SetText(Details:ToK2 (self.PlayerTeamDamage / self.SampleSize))
end
f.NextScreenUpdate = _detalhes.realtime_dps_meter.update_interval
f.NextScreenUpdate = Details.realtime_dps_meter.update_interval
end
elseif (self.ShowingMythicDungeon) then
@@ -843,8 +843,8 @@ function Details:CreateCurrentDpsFrame(parent, name)
self.NextScreenUpdate = self.NextScreenUpdate - time_fraction
if (self.NextScreenUpdate <= 0) then
labelGroupDamage_DPS:SetText(_detalhes:ToK2 (f.GroupTotalDamage / self.SampleSize))
f.NextScreenUpdate = _detalhes.realtime_dps_meter.update_interval
labelGroupDamage_DPS:SetText(Details:ToK2 (f.GroupTotalDamage / self.SampleSize))
f.NextScreenUpdate = Details.realtime_dps_meter.update_interval
end
end
@@ -877,17 +877,17 @@ function Details:CreateCurrentDpsFrame(parent, name)
end
end
local eventListener = _detalhes:CreateEventListener()
local eventListener = Details:CreateEventListener()
function eventListener:ArenaStarted()
if (_detalhes.realtime_dps_meter.arena_enabled) then
if (Details.realtime_dps_meter.arena_enabled) then
--it is working here, f:StartForArenaMatch() is called but the frame is still now shown.
f:StartForArenaMatch()
end
end
function eventListener:MythicDungeonStarted()
if (_detalhes.realtime_dps_meter.mythic_dungeon_enabled) then
if (Details.realtime_dps_meter.mythic_dungeon_enabled) then
f:StartForMythicDungeon()
end
end
@@ -920,8 +920,8 @@ function Details:CreateCurrentDpsFrame(parent, name)
eventListener:RegisterEvent("COMBAT_MYTHICDUNGEON_END", "MythicDungeonEnded")
eventListener:RegisterEvent("COMBAT_PLAYER_ENTER", "ResetBuffer")
_detalhes.Broadcaster_CurrentDpsLoaded = true
_detalhes.Broadcaster_CurrentDpsFrame = f
Details.Broadcaster_CurrentDpsLoaded = true
Details.Broadcaster_CurrentDpsFrame = f
C_Timer.After(1, lockCallback)
f:Hide()
end
+1 -1
View File
@@ -1,5 +1,5 @@
--custom window
local _detalhes = _G._detalhes
local _detalhes = _G.Details
local gump = _detalhes.gump
local _
local Loc = LibStub("AceLocale-3.0"):GetLocale( "Details" )
+1 -1
View File
@@ -1,6 +1,6 @@
local Details = _G._detalhes
local Details = _G.Details
local DF = _G.DetailsFramework
local _
+5 -5
View File
@@ -73,11 +73,11 @@ end
--cancel button always closes the window and okay calls the comfirm function passed in the argument
--default text is the text shown show the window is show()
function _detalhes:DumpString (text)
_detalhes:ShowImportWindow (text)
function Details:DumpString (text)
Details:ShowImportWindow (text)
end
function _detalhes:ShowImportWindow (defaultText, confirmFunc, titleText)
function Details:ShowImportWindow (defaultText, confirmFunc, titleText)
if (not _G.DetailsExportWindow) then
local importWindow = DetailsFramework:CreateSimplePanel(_G.UIParent, 800, 610, "Details! Dump String", "DetailsExportWindow")
importWindow:SetFrameStrata("FULLSCREEN")
@@ -117,12 +117,12 @@ function _detalhes:ShowImportWindow (defaultText, confirmFunc, titleText)
end
importWindow:Hide()
end
local okayButton = DetailsFramework:CreateButton(importTextEditor, onClickImportButton, 120, 20, "Okay", -1, nil, nil, nil, nil, nil, _detalhes.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"), _detalhes.gump:GetTemplate("font", "OPTIONS_FONT_TEMPLATE")) --localize-me
local okayButton = DetailsFramework:CreateButton(importTextEditor, onClickImportButton, 120, 20, "Okay", -1, nil, nil, nil, nil, nil, Details.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"), Details.gump:GetTemplate("font", "OPTIONS_FONT_TEMPLATE")) --localize-me
okayButton:SetIcon ([[Interface\BUTTONS\UI-Panel-BiggerButton-Up]], 20, 20, "overlay", {0.1, .9, 0.1, .9})
importTextEditor.OkayButton = okayButton
--cancel button
local cancelButton = DetailsFramework:CreateButton(importTextEditor, function() importWindow:Hide() end, 120, 20, "Cancel", -1, nil, nil, nil, nil, nil, _detalhes.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"), _detalhes.gump:GetTemplate("font", "OPTIONS_FONT_TEMPLATE")) --localize-me
local cancelButton = DetailsFramework:CreateButton(importTextEditor, function() importWindow:Hide() end, 120, 20, "Cancel", -1, nil, nil, nil, nil, nil, Details.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"), Details.gump:GetTemplate("font", "OPTIONS_FONT_TEMPLATE")) --localize-me
cancelButton:SetIcon ([[Interface\BUTTONS\UI-Panel-MinimizeButton-Up]], 20, 20, "overlay", {0.1, .9, 0.1, .9})
okayButton:SetPoint("topright", importTextEditor, "bottomright", 0, -10)
+64 -64
View File
@@ -14,7 +14,7 @@ function Details:OpenEventTrackerOptions(bFromOptionsPanel)
optionsPanel:SetScript("OnMouseUp", nil)
local LibWindow = LibStub("LibWindow-1.1")
LibWindow.RegisterConfig(optionsPanel, _detalhes.event_tracker.options_frame)
LibWindow.RegisterConfig(optionsPanel, Details.event_tracker.options_frame)
LibWindow.MakeDraggable(optionsPanel)
LibWindow.RestorePosition(optionsPanel)
@@ -216,9 +216,9 @@ function Details:OpenEventTrackerOptions(bFromOptionsPanel)
{
type = "toggle",
get = function() return _detalhes.event_tracker.show_crowdcontrol_pvp end,
get = function() return Details.event_tracker.show_crowdcontrol_pvp end,
set = function(self, fixedparam, value)
_detalhes.event_tracker.show_crowdcontrol_pvp = value
Details.event_tracker.show_crowdcontrol_pvp = value
end,
desc = "Show Crowd Control (Arena & BG)",
name = "Show Crowd Control when inside a PvP zone",
@@ -226,9 +226,9 @@ function Details:OpenEventTrackerOptions(bFromOptionsPanel)
},
{
type = "toggle",
get = function() return _detalhes.event_tracker.show_crowdcontrol_pvm end,
get = function() return Details.event_tracker.show_crowdcontrol_pvm end,
set = function(self, fixedparam, value)
_detalhes.event_tracker.show_crowdcontrol_pvm = value
Details.event_tracker.show_crowdcontrol_pvm = value
end,
desc = "Show Crowd Control (Dungeon & Raid)",
name = "Show Crowd Control when inside a PvE zone",
@@ -255,7 +255,7 @@ end
function Details:CreateEventTrackerFrame(parentObject, name)
local DF = _detalhes.gump
local DF = Details.gump
local SharedMedia = LibStub:GetLibrary ("LibSharedMedia-3.0")
--> screen frame
@@ -269,17 +269,17 @@ function Details:CreateEventTrackerFrame(parentObject, name)
--f:SetResizeBounds(150, 40, 800, 1024)
end
screenFrame:SetSize(_detalhes.event_tracker.frame.width, _detalhes.event_tracker.frame.height)
screenFrame:SetSize(Details.event_tracker.frame.width, Details.event_tracker.frame.height)
screenFrame:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}})
screenFrame:SetBackdropColor(unpack(_detalhes.event_tracker.frame.backdrop_color))
screenFrame:SetBackdropColor(unpack(Details.event_tracker.frame.backdrop_color))
screenFrame:EnableMouse(true)
screenFrame:SetMovable(true)
screenFrame:SetResizable(true)
screenFrame:SetClampedToScreen(true)
local LibWindow = LibStub("LibWindow-1.1")
LibWindow.RegisterConfig(screenFrame, _detalhes.event_tracker.frame)
LibWindow.RegisterConfig(screenFrame, Details.event_tracker.frame)
LibWindow.MakeDraggable(screenFrame)
LibWindow.RestorePosition(screenFrame)
@@ -287,7 +287,7 @@ function Details:CreateEventTrackerFrame(parentObject, name)
local leftResize, rightResize = DF:CreateResizeGrips(screenFrame)
leftResize:SetScript("OnMouseDown", function(self)
if (not screenFrame.resizing and not _detalhes.event_tracker.frame.locked) then
if (not screenFrame.resizing and not Details.event_tracker.frame.locked) then
screenFrame.resizing = true
screenFrame:StartSizing("bottomleft")
end
@@ -296,12 +296,12 @@ function Details:CreateEventTrackerFrame(parentObject, name)
if (screenFrame.resizing) then
screenFrame.resizing = false
screenFrame:StopMovingOrSizing()
_detalhes.event_tracker.frame.width = screenFrame:GetWidth()
_detalhes.event_tracker.frame.height = screenFrame:GetHeight()
Details.event_tracker.frame.width = screenFrame:GetWidth()
Details.event_tracker.frame.height = screenFrame:GetHeight()
end
end)
rightResize:SetScript("OnMouseDown", function(self)
if (not screenFrame.resizing and not _detalhes.event_tracker.frame.locked) then
if (not screenFrame.resizing and not Details.event_tracker.frame.locked) then
screenFrame.resizing = true
screenFrame:StartSizing("bottomright")
end
@@ -310,8 +310,8 @@ function Details:CreateEventTrackerFrame(parentObject, name)
if (screenFrame.resizing) then
screenFrame.resizing = false
screenFrame:StopMovingOrSizing()
_detalhes.event_tracker.frame.width = screenFrame:GetWidth()
_detalhes.event_tracker.frame.height = screenFrame:GetHeight()
Details.event_tracker.frame.width = screenFrame:GetWidth()
Details.event_tracker.frame.height = screenFrame:GetHeight()
end
end)
@@ -407,7 +407,7 @@ function Details:CreateEventTrackerFrame(parentObject, name)
line.ActionIcon = actionicon
--set some parameters
_detalhes:UpdateWorldTrackerLines (line)
Details:UpdateWorldTrackerLines (line)
--set scripts
line:SetScript("OnUpdate", lineOnTick)
@@ -434,7 +434,7 @@ function Details:CreateEventTrackerFrame(parentObject, name)
local get_spec_or_class = function(serial, unitName)
local class
local spec = _detalhes.cached_specs [serial]
local spec = Details.cached_specs [serial]
if (not spec) then
local _, engClass = UnitClass(unitName)
if (engClass) then
@@ -452,9 +452,9 @@ function Details:CreateEventTrackerFrame(parentObject, name)
local get_player_icon = function(spec, class)
if (spec) then
return [[Interface\AddOns\Details\images\spec_icons_normal]], unpack(_detalhes.class_specs_coords [spec])
return [[Interface\AddOns\Details\images\spec_icons_normal]], unpack(Details.class_specs_coords [spec])
elseif (class) then
return [[Interface\AddOns\Details\images\classes_small]], unpack(_detalhes.class_coords [class])
return [[Interface\AddOns\Details\images\classes_small]], unpack(Details.class_coords [class])
else
return [[Interface\AddOns\Details\images\classes_plus]], 0.50390625, 0.62890625, 0, 0.125
end
@@ -462,11 +462,11 @@ function Details:CreateEventTrackerFrame(parentObject, name)
local add_role_and_class_color = function(unitName, unitSerial)
--get the actor object
local actor = _detalhes.tabela_vigente[1]:GetActor(unitName)
local actor = Details.tabela_vigente[1]:GetActor(unitName)
if (actor) then
--remove realm name
unitName = _detalhes:GetOnlyName(unitName)
unitName = Details:GetOnlyName(unitName)
local class, spec, role = actor.classe, actor.spec, actor.role
if (not class) then
@@ -474,26 +474,26 @@ function Details:CreateEventTrackerFrame(parentObject, name)
end
--add the class color
if (_detalhes.player_class [class]) then
if (Details.player_class [class]) then
--is a player, add the class color
unitName = _detalhes:AddColorString (unitName, class)
unitName = Details:AddColorString (unitName, class)
end
--add the role icon
if (role ~= "NONE") then
--have a role
unitName = _detalhes:AddRoleIcon (unitName, role, _detalhes.event_tracker.line_height)
unitName = Details:AddRoleIcon (unitName, role, Details.event_tracker.line_height)
end
else
local spec, class = get_spec_or_class (unitSerial, unitName)
unitName = _detalhes:GetOnlyName(unitName)
unitName = Details:GetOnlyName(unitName)
if (class) then
--add the class color
if (_detalhes.player_class [class]) then
if (Details.player_class [class]) then
--is a player, add the class color
unitName = _detalhes:AddColorString (unitName, class)
unitName = Details:AddColorString (unitName, class)
end
end
end
@@ -502,7 +502,7 @@ function Details:CreateEventTrackerFrame(parentObject, name)
end
local get_text_size = function()
local iconsSpace = _detalhes.event_tracker.line_height * 3
local iconsSpace = Details.event_tracker.line_height * 3
local textSpace = 4
local saveSpace = 14
@@ -553,7 +553,7 @@ function Details:CreateEventTrackerFrame(parentObject, name)
end
--]=]
local sourceNameNoRealm = _detalhes:GetOnlyName(sourceName)
local sourceNameNoRealm = Details:GetOnlyName(sourceName)
--need to use the language system from details framework to detect which language is being used
local languageId = DF.Language.DetectLanguageId(sourceNameNoRealm)
@@ -564,7 +564,7 @@ function Details:CreateEventTrackerFrame(parentObject, name)
local fontPath = DF.Language.GetFontForLanguageID(languageId)
if (fontPath) then
if (languageId == "enUS") then
DF:SetFontFace(line.LeftText, _detalhes.event_tracker.font_face)
DF:SetFontFace(line.LeftText, Details.event_tracker.font_face)
else
DF:SetFontFace(line.LeftText, fontPath)
end
@@ -657,7 +657,7 @@ function Details:CreateEventTrackerFrame(parentObject, name)
local CurrentShowing = {}
--scrollframe
local scrollframe = DF:CreateScrollBox (screenFrame, "$parentScrollFrame", scroll_refresh, CurrentShowing, scroll_width, 400, scroll_line_amount, _detalhes.event_tracker.line_height, scroll_createline, true, true)
local scrollframe = DF:CreateScrollBox (screenFrame, "$parentScrollFrame", scroll_refresh, CurrentShowing, scroll_width, 400, scroll_line_amount, Details.event_tracker.line_height, scroll_createline, true, true)
scrollframe:SetPoint("topleft", screenFrame, "topleft", 0, -header_size)
scrollframe:SetPoint("topright", screenFrame, "topright", 0, -header_size)
scrollframe:SetPoint("bottomleft", screenFrame, "bottomleft", 0, 0)
@@ -670,40 +670,40 @@ function Details:CreateEventTrackerFrame(parentObject, name)
local index = line.Index
--update left text
DF:SetFontColor(line.LeftText, _detalhes.event_tracker.font_color)
DF:SetFontFace (line.LeftText, _detalhes.event_tracker.font_face)
DF:SetFontSize(line.LeftText, _detalhes.event_tracker.font_size)
DF:SetFontOutline (line.LeftText, _detalhes.event_tracker.font_shadow)
DF:SetFontColor(line.LeftText, Details.event_tracker.font_color)
DF:SetFontFace (line.LeftText, Details.event_tracker.font_face)
DF:SetFontSize(line.LeftText, Details.event_tracker.font_size)
DF:SetFontOutline (line.LeftText, Details.event_tracker.font_shadow)
--update right text
DF:SetFontColor(line.RightText, _detalhes.event_tracker.font_color)
DF:SetFontFace (line.RightText, _detalhes.event_tracker.font_face)
DF:SetFontSize(line.RightText, _detalhes.event_tracker.font_size)
DF:SetFontOutline (line.RightText, _detalhes.event_tracker.font_shadow)
DF:SetFontColor(line.RightText, Details.event_tracker.font_color)
DF:SetFontFace (line.RightText, Details.event_tracker.font_face)
DF:SetFontSize(line.RightText, Details.event_tracker.font_size)
DF:SetFontOutline (line.RightText, Details.event_tracker.font_shadow)
--adjust where the line is anchored
line:SetPoint("topleft", line:GetParent(), "topleft", 1, -0.5 -((index-1)*(_detalhes.event_tracker.line_height+1)))
line:SetPoint("topright", line:GetParent(), "topright", -1, -0.5 -((index-1)*(_detalhes.event_tracker.line_height+1)))
line:SetPoint("topleft", line:GetParent(), "topleft", 1, -0.5 -((index-1)*(Details.event_tracker.line_height+1)))
line:SetPoint("topright", line:GetParent(), "topright", -1, -0.5 -((index-1)*(Details.event_tracker.line_height+1)))
--set its height
line:SetHeight(_detalhes.event_tracker.line_height)
line:SetHeight(Details.event_tracker.line_height)
--set texture
local texture = SharedMedia:Fetch ("statusbar", _detalhes.event_tracker.line_texture)
local texture = SharedMedia:Fetch ("statusbar", Details.event_tracker.line_texture)
line.StatusbarTexture:SetTexture(texture)
line.StatusbarTexture:SetVertexColor(unpack(_detalhes.event_tracker.line_color))
line.StatusbarTexture:SetVertexColor(unpack(Details.event_tracker.line_color))
--set icon size
line.LeftIcon:SetSize(_detalhes.event_tracker.line_height, _detalhes.event_tracker.line_height)
line.RightIcon:SetSize(_detalhes.event_tracker.line_height, _detalhes.event_tracker.line_height)
line.ActionIcon:SetSize(_detalhes.event_tracker.line_height-4, _detalhes.event_tracker.line_height-4)
line.LeftIcon:SetSize(Details.event_tracker.line_height, Details.event_tracker.line_height)
line.RightIcon:SetSize(Details.event_tracker.line_height, Details.event_tracker.line_height)
line.ActionIcon:SetSize(Details.event_tracker.line_height-4, Details.event_tracker.line_height-4)
line.ActionIcon:SetAlpha(0.65)
end
-- /run _detalhes.event_tracker.font_shadow = 24
-- /run _detalhes:UpdateWorldTrackerLines()
function _detalhes:UpdateWorldTrackerLines (line)
function Details:UpdateWorldTrackerLines (line)
--don't run if the featured hasn't loaded
if (not screenFrame) then
return
@@ -716,23 +716,23 @@ function Details:CreateEventTrackerFrame(parentObject, name)
for index, line in ipairs(scrollframe:GetFrames()) do
update_line (line)
end
scrollframe:SetFramesHeight (_detalhes.event_tracker.line_height)
scrollframe:SetFramesHeight (Details.event_tracker.line_height)
scrollframe:Refresh()
end
end
function _detalhes:UpdateEventTrackerFrame()
function Details:UpdateEventTrackerFrame()
--don't run if the featured hasn't loaded
if (not screenFrame) then
return
end
screenFrame:SetSize(_detalhes.event_tracker.frame.width, _detalhes.event_tracker.frame.height)
LibWindow.RegisterConfig(screenFrame, _detalhes.event_tracker.frame)
screenFrame:SetSize(Details.event_tracker.frame.width, Details.event_tracker.frame.height)
LibWindow.RegisterConfig(screenFrame, Details.event_tracker.frame)
LibWindow.RestorePosition(screenFrame)
scrollframe:OnSizeChanged()
if (_detalhes.event_tracker.frame.locked) then
if (Details.event_tracker.frame.locked) then
screenFrame:EnableMouse(false)
leftResize:Hide()
rightResize:Hide()
@@ -742,7 +742,7 @@ function Details:CreateEventTrackerFrame(parentObject, name)
rightResize:Show()
end
if (_detalhes.event_tracker.frame.show_title) then
if (Details.event_tracker.frame.show_title) then
TitleString:Show()
TitleBackground:Show()
scrollframe:SetPoint("topleft", screenFrame, "topleft", 0, -header_size)
@@ -754,12 +754,12 @@ function Details:CreateEventTrackerFrame(parentObject, name)
scrollframe:SetPoint("topright", screenFrame, "topright", 0, 0)
end
screenFrame:SetBackdropColor(unpack(_detalhes.event_tracker.frame.backdrop_color))
scrollframe.__background:SetVertexColor(unpack(_detalhes.event_tracker.frame.backdrop_color))
screenFrame:SetBackdropColor(unpack(Details.event_tracker.frame.backdrop_color))
scrollframe.__background:SetVertexColor(unpack(Details.event_tracker.frame.backdrop_color))
screenFrame:SetFrameStrata(_detalhes.event_tracker.frame.strata)
screenFrame:SetFrameStrata(Details.event_tracker.frame.strata)
_detalhes:UpdateWorldTrackerLines()
Details:UpdateWorldTrackerLines()
scrollframe:Refresh()
end
@@ -824,15 +824,15 @@ function Details:CreateEventTrackerFrame(parentObject, name)
--check if isnt a pet
if (caster_flags and is_player(caster_flags)) then
--the target is a player
if (_detalhes.event_tracker.show_crowdcontrol_pvp) then
if (_detalhes.zone_type == "arena" or _detalhes.zone_type == "pvp" or _detalhes.zone_type == "none") then
if (Details.event_tracker.show_crowdcontrol_pvp) then
if (Details.zone_type == "arena" or Details.zone_type == "pvp" or Details.zone_type == "none") then
tinsert(CurrentShowing, 1, {SPELLTYPE_CROWDCONTROL, spellid, caster_name, target_name, time, false, GetTime(), caster_serial, is_enemy (caster_flags), target_serial})
added = true
end
end
if (_detalhes.event_tracker.show_crowdcontrol_pvm) then
if (_detalhes.zone_type == "party" or _detalhes.zone_type == "raid") then
if (Details.event_tracker.show_crowdcontrol_pvm) then
if (Details.zone_type == "party" or Details.zone_type == "raid") then
tinsert(CurrentShowing, 1, {SPELLTYPE_CROWDCONTROL, spellid, caster_name, target_name, time, false, GetTime(), caster_serial, is_enemy (caster_flags), target_serial})
added = true
end
@@ -859,7 +859,7 @@ function Details:CreateEventTrackerFrame(parentObject, name)
end)
_detalhes.Broadcaster_EventTrackerLoaded = true
_detalhes.Broadcaster_EventTrackerFrame = screenFrame
Details.Broadcaster_EventTrackerLoaded = true
Details.Broadcaster_EventTrackerFrame = screenFrame
screenFrame:Hide()
end
+1 -1
View File
@@ -1,5 +1,5 @@
local Details = _G._detalhes
local Details = _G.Details
local Loc = LibStub("AceLocale-3.0"):GetLocale("Details")
local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0")
local segmentos = Details.segmentos
+1 -1
View File
@@ -52,7 +52,7 @@ function Details:OpenNewsWindow(textToShow, dumpValues, keeptext)
--show news
newsFrame:Text (textToShow or Loc["STRING_VERSION_LOG"])
--show textures
if (_detalhes.build_counter == 8154) then
if (Details.build_counter == 8154) then
newsFrame.imageFrame:Show()
newsFrame.imageFrame.texture:SetTexture([[interface/addons/details/images/news_images]])
newsFrame.imageFrame.texture:SetSize(279, 452)
+17 -17
View File
@@ -74,9 +74,9 @@ function Details.options.InitializeOptionsWindow(instance)
--select the instance to edit
local onSelectInstance = function(_, _, instanceId)
local instance = _detalhes.tabela_instancias[instanceId]
local instance = Details.tabela_instancias[instanceId]
if (not instance:IsEnabled() or not instance:IsStarted()) then
_detalhes.CriarInstancia (_, _, instance.meu_id)
Details.CriarInstancia (_, _, instance.meu_id)
end
Details.options.SetCurrentInstanceAndRefresh(instance)
f.updateMicroFrames()
@@ -84,20 +84,20 @@ function Details.options.InitializeOptionsWindow(instance)
local buildInstanceMenu = function()
local instanceList = {}
for index = 1, math.min (#_detalhes.tabela_instancias, _detalhes.instances_amount) do
local instance = _detalhes.tabela_instancias[index]
for index = 1, math.min (#Details.tabela_instancias, Details.instances_amount) do
local instance = Details.tabela_instancias[index]
--what the window is showing
local atributo = instance.atributo
local sub_atributo = instance.sub_atributo
if (atributo == 5) then --custom
local CustomObject = _detalhes.custom [sub_atributo]
local CustomObject = Details.custom [sub_atributo]
if (not CustomObject) then
instance:ResetAttribute()
atributo = instance.atributo
sub_atributo = instance.sub_atributo
instanceList [#instanceList+1] = {value = index, label = "#".. index .. " " .. _detalhes.atributos.lista [atributo] .. " - " .. _detalhes.sub_atributos [atributo].lista [sub_atributo], onclick = onSelectInstance, icon = _detalhes.sub_atributos [atributo].icones[sub_atributo] [1], texcoord = _detalhes.sub_atributos [atributo].icones[sub_atributo] [2]}
instanceList [#instanceList+1] = {value = index, label = "#".. index .. " " .. Details.atributos.lista [atributo] .. " - " .. Details.sub_atributos [atributo].lista [sub_atributo], onclick = onSelectInstance, icon = Details.sub_atributos [atributo].icones[sub_atributo] [1], texcoord = Details.sub_atributos [atributo].icones[sub_atributo] [2]}
else
instanceList [#instanceList+1] = {value = index, label = "#".. index .. " " .. CustomObject.name, onclick = onSelectInstance, icon = CustomObject.icon}
end
@@ -105,8 +105,8 @@ function Details.options.InitializeOptionsWindow(instance)
local modo = instance.modo
if (modo == 1) then --solo plugin
atributo = _detalhes.SoloTables.Mode or 1
local SoloInfo = _detalhes.SoloTables.Menu [atributo]
atributo = Details.SoloTables.Mode or 1
local SoloInfo = Details.SoloTables.Menu [atributo]
if (SoloInfo) then
instanceList [#instanceList+1] = {value = index, label = "#".. index .. " " .. SoloInfo [1], onclick = onSelectInstance, icon = SoloInfo [2]}
else
@@ -116,7 +116,7 @@ function Details.options.InitializeOptionsWindow(instance)
elseif (modo == 4) then --raid plugin
local plugin_name = instance.current_raid_plugin or instance.last_raid_plugin
if (plugin_name) then
local plugin_object = _detalhes:GetPlugin (plugin_name)
local plugin_object = Details:GetPlugin (plugin_name)
if (plugin_object) then
instanceList [#instanceList+1] = {value = index, label = "#".. index .. " " .. plugin_object.__name, onclick = onSelectInstance, icon = plugin_object.__icon}
else
@@ -126,7 +126,7 @@ function Details.options.InitializeOptionsWindow(instance)
instanceList [#instanceList+1] = {value = index, label = "#".. index .. " unknown", onclick = onSelectInstance, icon = ""}
end
else
instanceList [#instanceList+1] = {value = index, label = "#".. index .. " " .. _detalhes.atributos.lista [atributo] .. " - " .. _detalhes.sub_atributos [atributo].lista [sub_atributo], onclick = onSelectInstance, icon = _detalhes.sub_atributos [atributo].icones[sub_atributo] [1], texcoord = _detalhes.sub_atributos [atributo].icones[sub_atributo] [2]}
instanceList [#instanceList+1] = {value = index, label = "#".. index .. " " .. Details.atributos.lista [atributo] .. " - " .. Details.sub_atributos [atributo].lista [sub_atributo], onclick = onSelectInstance, icon = Details.sub_atributos [atributo].icones[sub_atributo] [1], texcoord = Details.sub_atributos [atributo].icones[sub_atributo] [2]}
end
end
end
@@ -157,9 +157,9 @@ function Details.options.InitializeOptionsWindow(instance)
--editing group checkbox
local onToggleEditingGroup = function(self, fixparam, value)
_detalhes.options_group_edit = value
Details.options_group_edit = value
end
local editingGroupCheckBox = DF:CreateSwitch(footerFrame, onToggleEditingGroup, _detalhes.options_group_edit, _, _, _, _, _, "$parentEditGroupCheckbox", _, _, _, _, DF:GetTemplate("switch", "OPTIONS_CHECKBOX_BRIGHT_TEMPLATE"))
local editingGroupCheckBox = DF:CreateSwitch(footerFrame, onToggleEditingGroup, Details.options_group_edit, _, _, _, _, _, "$parentEditGroupCheckbox", _, _, _, _, DF:GetTemplate("switch", "OPTIONS_CHECKBOX_BRIGHT_TEMPLATE"))
editingGroupCheckBox:SetAsCheckBox()
editingGroupCheckBox.tooltip = Loc ["STRING_MINITUTORIAL_OPTIONS_PANEL2"]
@@ -171,11 +171,11 @@ function Details.options.InitializeOptionsWindow(instance)
--create test bars
DF:NewColor("C_OptionsButtonOrange", 0.9999, 0.8196, 0, 1)
local create_test_bars_func = function()
_detalhes.CreateTestBars()
if (not _detalhes.test_bar_update) then
_detalhes:StartTestBarUpdate()
Details.CreateTestBars()
if (not Details.test_bar_update) then
Details:StartTestBarUpdate()
else
_detalhes:StopTestBarUpdate()
Details:StopTestBarUpdate()
end
end
local fillbars = DF:NewButton(footerFrame, _, "$parentCreateExampleBarsButton", nil, 140, 20, create_test_bars_func, nil, nil, nil, Loc ["STRING_OPTIONS_TESTBARS"], 1)
@@ -184,7 +184,7 @@ function Details.options.InitializeOptionsWindow(instance)
fillbars:SetIcon ("Interface\\AddOns\\Details\\images\\icons", nil, nil, nil, {323/512, 365/512, 42/512, 78/512}, {1, 1, 1, 0.6}, 4, 2)
--change log
local changelog = DF:NewButton(footerFrame, _, "$parentOpenChangeLogButton", nil, 140, 20, _detalhes.OpenNewsWindow, "change_log", nil, nil, Loc ["STRING_OPTIONS_CHANGELOG"], 1)
local changelog = DF:NewButton(footerFrame, _, "$parentOpenChangeLogButton", nil, 140, 20, Details.OpenNewsWindow, "change_log", nil, nil, Loc ["STRING_OPTIONS_CHANGELOG"], 1)
changelog:SetPoint("left", fillbars, "right", 10, 0)
changelog:SetTemplate(options_button_template)
changelog:SetIcon ("Interface\\AddOns\\Details\\images\\icons", nil, nil, nil, {367/512, 399/512, 43/512, 76/512}, {1, 1, 1, 0.8}, 4, 2)
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -264,8 +264,8 @@ local iconTableAuras = {
function Details:InitializeAurasTab()
--check if the tab is already created
for i = 1, #_detalhes.player_details_tabs do
local tabButton = _detalhes.player_details_tabs[i]
for i = 1, #Details.player_details_tabs do
local tabButton = Details.player_details_tabs[i]
if (tabButton.tabname == "Auras") then
return
end
+4 -4
View File
@@ -1879,15 +1879,15 @@ local iconTableCompare = {
function Details:InitializeCompareTab()
--check if the tab is already created
for i = 1, #_detalhes.player_details_tabs do
local tabButton = _detalhes.player_details_tabs[i]
for i = 1, #Details.player_details_tabs do
local tabButton = Details.player_details_tabs[i]
if (tabButton.tabname == "Compare" or tabButton.tabname == "New Compare") then
return
end
end
for i = 1, #_detalhes.player_details_tabs do
local tabButton = _detalhes.player_details_tabs[i]
for i = 1, #Details.player_details_tabs do
local tabButton = Details.player_details_tabs[i]
if (tabButton.replaces) then
if (tabButton.replaces.bIsCompareTab) then
return
+90 -67
View File
@@ -9,6 +9,7 @@ local wipe = wipe
local GetCursorPosition = GetCursorPosition
local CreateFrame = CreateFrame
local GetSpellLink = GetSpellLink
local GetSpellInfo = GetSpellInfo
local _GetSpellInfo = Details.GetSpellInfo
local GameTooltip = GameTooltip
local IsShiftKeyDown = IsShiftKeyDown
@@ -311,6 +312,33 @@ function spellsTab.BuildHeaderTable(containerType)
return headerTable
end
---some values required by the header sort key is not available in the spellTable, so they need to be calculated
---@param combatObject combat
---@param spellData spelltable|spelltableadv
---@param key string
---@return any
local getValueForHeaderSortKey = function(combatObject, spellData, key)
if (key == "critpercent") then
return Details.SpellTableMixin.GetCritPercent(spellData)
elseif (key == "casts") then
local spellName = GetSpellInfo(spellData.id)
local amountOfCasts = combatObject:GetSpellCastAmount(spellsTab.GetActor():Name(), spellName)
return amountOfCasts
elseif (key == "castavg") then
local spellName = GetSpellInfo(spellData.id)
local amountOfCasts = combatObject:GetSpellCastAmount(spellsTab.GetActor():Name(), spellName)
return Details.SpellTableMixin.GetCastAverage(spellData, amountOfCasts)
elseif (key == "uptime") then
return combatObject:GetSpellUptime(spellsTab.GetActor():Name(), spellData.id)
elseif (key == "healabsorbed") then
return spellData.absorbed
end
end
------------------------------------------------------------------------------------------------------------------------------------------------
--Bar Selection
@@ -1075,7 +1103,8 @@ end
---@param bkTargetData breakdowntargettable
---@param totalValue number
---@param topValue number the amount done of the first target, used to calculate the length of the statusbar
local updateTargetBar = function(targetBar, index, combatObject, scrollFrame, headerTable, bkTargetData, totalValue, topValue) --~target ~update ~targetbar ~updatetargetbar
---@param sortKey string
local updateTargetBar = function(targetBar, index, combatObject, scrollFrame, headerTable, bkTargetData, totalValue, topValue, sortKey) --~target ~update ~targetbar ~updatetargetbar
--scrollFrame is defined as a table which is false, scrollFrame is a frame
local textIndex = 1
@@ -1097,7 +1126,7 @@ local updateTargetBar = function(targetBar, index, combatObject, scrollFrame, he
--statusbar size by percent
if (topValue > 0) then
targetBar.statusBar:SetValue(bkTargetData.statusBarValue / topValue * 100)
targetBar.statusBar:SetValue(bkTargetData[sortKey] / topValue * 100)
else
targetBar.statusBar:SetValue(0)
end
@@ -1173,7 +1202,7 @@ end
---@param totalLines number
local refreshFuncTargets = function(scrollFrame, scrollData, offset, totalLines) --~refresh ~target ~refreshtargets
---@type number
local maxValue = scrollFrame.maxValue
local topValue = scrollFrame.topValue
---@type number
local totalValue = scrollData.totalValue
---@type actor
@@ -1188,6 +1217,7 @@ local refreshFuncTargets = function(scrollFrame, scrollData, offset, totalLines)
---@type number
local mainAttribute = spellsTab.mainAttribute
local sortKey = scrollFrame.SortKey
local headerTable = spellsTab.targetsHeaderData
local lineIndex = 1
@@ -1204,7 +1234,7 @@ local refreshFuncTargets = function(scrollFrame, scrollData, offset, totalLines)
do
if (targetBar) then
lineIndex = lineIndex + 1
updateTargetBar(targetBar, index, combatObject, scrollFrame, headerTable, bkTargetData, totalValue, maxValue)
updateTargetBar(targetBar, index, combatObject, scrollFrame, headerTable, bkTargetData, totalValue, topValue, sortKey)
end
end
@@ -1280,28 +1310,23 @@ function spellsTab.CreateTargetContainer(tabFrame) --~create ~target
function targetScrollFrame:RefreshMe(data) --~refreshme (targets) ~refreshmetargets
--get which column is currently selected and the sort order
local columnIndex, order, key = targetScrollFrame.Header:GetSelectedColumn()
targetScrollFrame.SortKey = key
---@type string
local keyToSort = key
for i = 1, #data do
---@type spelltableadv
local bkSpellData = data[i]
bkSpellData.statusBarValue = bkSpellData[keyToSort]
end
if (order == "DESC") then
table.sort(data,
function(t1, t2)
return t1[keyToSort] > t2[keyToSort]
end)
targetScrollFrame.maxValue = data[1] and data[1][keyToSort]
targetScrollFrame.topValue = data[1] and data[1][keyToSort]
else
table.sort(data,
function(t1, t2)
return t1[keyToSort] < t2[keyToSort]
end)
targetScrollFrame.maxValue = data[#data] and data[#data][keyToSort]
targetScrollFrame.topValue = data[#data] and data[#data][keyToSort]
end
if (key == "overheal") then
@@ -1385,6 +1410,20 @@ local onClickExpandButton = function(expandButton, button)
scrolFrame:Refresh()
end
local formatPetName = function(petName, spellName, ownerName)
--petName is raw (with the owner name)
local petNameWithoutOwner = petName:gsub((" <.*"), "")
local texture = [[Interface\AddOns\Details\images\classes_small]]
local bUseAlphaIcons = true
local specIcon = false
local iconSize = 14
petNameWithoutOwner = Details:AddClassOrSpecIcon(petNameWithoutOwner, "PET", specIcon, iconSize, bUseAlphaIcons)
return spellName .. " |cFFCCBBBB" .. petNameWithoutOwner .. "|r"
end
---update a line using the data passed
---@param spellBar breakdownspellbar
---@param index number spell position (from best to wrost)
@@ -1393,11 +1432,12 @@ end
---@param scrollFrame table
---@param headerTable table
---@param bkSpellData spelltableadv
---@param bkSpellStableIndex number
---@param spellTableIndex number
---@param totalValue number
---@param topValue number
---@param bIsMainLine boolean if true this is the line which has all the values of the spell merged
local updateSpellBar = function(spellBar, index, actorName, combatObject, scrollFrame, headerTable, bkSpellData, bkSpellStableIndex, totalValue, topValue, bIsMainLine)
---@param sortKey string
local updateSpellBar = function(spellBar, index, actorName, combatObject, scrollFrame, headerTable, bkSpellData, spellTableIndex, totalValue, topValue, bIsMainLine, sortKey)
--scrollFrame is defined as a table which is false, scrollFrame is a frame
local textIndex = 1
@@ -1417,12 +1457,12 @@ local updateSpellBar = function(spellBar, index, actorName, combatObject, scroll
spellTable = bkSpellData
value = bkSpellData.total
spellId = bkSpellData.id
petName = bkSpellData.petNames[bkSpellStableIndex]
petName = bkSpellData.petNames[spellTableIndex]
else
spellTable = bkSpellData.spellTables[bkSpellStableIndex]
spellTable = bkSpellData.spellTables[spellTableIndex]
value = spellTable.total
spellId = spellTable.id
petName = bkSpellData.petNames[bkSpellStableIndex]
petName = bkSpellData.petNames[spellTableIndex]
spellBar.bIsExpandedSpell = true
end
@@ -1444,8 +1484,16 @@ local updateSpellBar = function(spellBar, index, actorName, combatObject, scroll
---@type number
local combatTime = combatObject:GetCombatTime()
--statusbar size by percent
if (topValue > 0) then
local barValue = spellTable[sortKey] or getValueForHeaderSortKey(combatObject, spellTable, sortKey)
spellBar.statusBar:SetValue(barValue / topValue * 100)
else
spellBar.statusBar:SetValue(0)
end
if (petName ~= "") then
spellName = spellName .. " (" .. petName .. ")"
spellName = formatPetName(petName, spellName, actorName)
end
spellBar.spellId = spellId
@@ -1453,15 +1501,7 @@ local updateSpellBar = function(spellBar, index, actorName, combatObject, scroll
spellBar.statusBar.backgroundTexture:SetAlpha(Details.breakdown_spell_tab.spellbar_background_alpha)
--statusbar size by percent
if (topValue > 0) then
spellBar.statusBar:SetValue(bkSpellData.statusBarValue / topValue * 100)
else
spellBar.statusBar:SetValue(0)
end
--statusbar color by school
--print("spell school:", spellTable.spellschool) --healing has the spellschool not filled, it's nil
local r, g, b = Details:GetSpellSchoolColor(spellTable.spellschool or 1)
spellBar.statusBar:SetStatusBarColor(r, g, b, 1)
@@ -1579,7 +1619,6 @@ local updateSpellBar = function(spellBar, index, actorName, combatObject, scroll
text:SetText(Details:Format(spellTable.absorbed or 0))
spellBar:AddFrameToHeaderAlignment(text)
textIndex = textIndex + 1
end
end
@@ -1619,7 +1658,7 @@ end
---@param totalLines number
local refreshFunc = function(scrollFrame, scrollData, offset, totalLines) --~refreshspells ~refreshfunc ~refresh
---@type number
local maxValue = scrollFrame.maxValue
local topValue = scrollFrame.topValue
---@type number
local totalValue = scrollData.totalValue
---@type actor
@@ -1632,6 +1671,7 @@ local refreshFunc = function(scrollFrame, scrollData, offset, totalLines) --~ref
---@type instance
local instanceObject = spellsTab.GetInstance()
local sortKey = scrollFrame.SortKey
local headerTable = spellsTab.spellsHeaderData
--todo: when swapping sort orders, close allexpanded spells
@@ -1667,7 +1707,7 @@ local refreshFunc = function(scrollFrame, scrollData, offset, totalLines) --~ref
if (mainSpellBar) then
lineIndex = lineIndex + 1
local bIsMainLine = true
updateSpellBar(mainSpellBar, index, actorName, combatObject, scrollFrame, headerTable, bkSpellData, 1, totalValue, maxValue, bIsMainLine)
updateSpellBar(mainSpellBar, index, actorName, combatObject, scrollFrame, headerTable, bkSpellData, 1, totalValue, topValue, bIsMainLine, sortKey)
end
end
@@ -1685,9 +1725,9 @@ local refreshFunc = function(scrollFrame, scrollData, offset, totalLines) --~ref
local nameToUse = petName ~= "" and petName or actorName
local bIsMainLine = false
updateSpellBar(spellBar, index, nameToUse, combatObject, scrollFrame, headerTable, bkSpellData, spellTableIndex, totalValue, maxValue, bIsMainLine)
updateSpellBar(spellBar, index, nameToUse, combatObject, scrollFrame, headerTable, bkSpellData, spellTableIndex, totalValue, topValue, bIsMainLine, sortKey)
mainSpellBar.ExpandedChildren[#mainSpellBar.ExpandedChildren + 1] = spellBar
end
end
@@ -1797,6 +1837,7 @@ function spellsTab.CreateSpellScrollContainer(tabFrame) --~scroll ~create
function scrollFrame:RefreshMe(data) --~refreshme (spells)
--get which column is currently selected and the sort order
local columnIndex, order, key = scrollFrame.Header:GetSelectedColumn()
scrollFrame.SortKey = key
---@type string
local keyToSort = key
@@ -1806,29 +1847,14 @@ function spellsTab.CreateSpellScrollContainer(tabFrame) --~scroll ~create
---@type number, number
local mainAttribute, subAttribute = spellsTab.GetInstance():GetDisplay()
--filling necessary information to sort the data in the order the header wants
--filling necessary information to sort the data by the selected header column
for i = 1, #data do
---@type spelltableadv
local bkSpellData = data[i]
--crit percent
bkSpellData.critpercent = bkSpellData:GetCritPercent()
--cast amount
bkSpellData.casts = bkSpellData:GetCastAmount(spellsTab.GetActor():Name(), combatObject)
--cast avg
bkSpellData.castavg = bkSpellData:GetCastAverage(bkSpellData.casts)
--uptime
local uptime = combatObject:GetSpellUptime(spellsTab:GetActor():Name(), bkSpellData.id)
bkSpellData.uptime = uptime
if (mainAttribute == DETAILS_ATTRIBUTE_HEAL) then
bkSpellData.healabsorbed = bkSpellData.absorbed
if (not bkSpellData[keyToSort]) then
local value = getValueForHeaderSortKey(combatObject, bkSpellData, keyToSort)
bkSpellData[keyToSort] = value
end
bkSpellData.statusBarValue = bkSpellData[keyToSort]
end
if (order == "DESC") then
@@ -1838,7 +1864,7 @@ function spellsTab.CreateSpellScrollContainer(tabFrame) --~scroll ~create
function(t1, t2)
return t1[keyToSort] > t2[keyToSort]
end)
self.maxValue = data[1] and data[1][keyToSort]
self.topValue = data[1] and data[1][keyToSort]
else
table.sort(data,
---@param t1 spelltableadv
@@ -1846,7 +1872,7 @@ function spellsTab.CreateSpellScrollContainer(tabFrame) --~scroll ~create
function(t1, t2)
return t1[keyToSort] < t2[keyToSort]
end)
self.maxValue = data[#data] and data[#data][keyToSort]
self.topValue = data[#data] and data[#data][keyToSort]
end
self:SetData(data)
@@ -1909,9 +1935,6 @@ local onEnterBreakdownTargetBar = function(targetBar)
---@type string @the name of the target
local targetName = targetBar.actorName
---@type number @amount done of the target, at this point the code doesn't know if it's damage, healing, etc
local totalValue = targetBar.bkTargetData.statusBarValue
Details:FormatCooltipForSpells()
GameCooltip:SetOwner(targetBar, "bottom", "top", 4, -5)
GameCooltip:SetOption("MinWidth", math.max(230, targetBar:GetWidth() * 0.98))
@@ -2328,18 +2351,18 @@ end
function spellsTab.CreateReportButtons(tabFrame) --deprecated?
--spell list report button
tabFrame.report_esquerda = Details.gump:NewDetailsButton(tabFrame, tabFrame, nil, _detalhes.Reportar, tabFrame, 1, 16, 16, "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", nil, "DetailsJanelaInfoReport2")
tabFrame.report_esquerda = Details.gump:NewDetailsButton(tabFrame, tabFrame, nil, Details.Reportar, tabFrame, 1, 16, 16, "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", nil, "DetailsJanelaInfoReport2")
tabFrame.report_esquerda:SetPoint("bottomleft", spellsTab.GetSpellScrollFrame(), "TOPLEFT", 33, 3)
tabFrame.report_esquerda:SetFrameLevel(tabFrame:GetFrameLevel()+2)
tabFrame.topleft_report = tabFrame.report_esquerda
--targets report button
tabFrame.report_alvos = Details.gump:NewDetailsButton(tabFrame, tabFrame, nil, _detalhes.Reportar, tabFrame, 3, 16, 16, "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", nil, "DetailsJanelaInfoReport3")
tabFrame.report_alvos = Details.gump:NewDetailsButton(tabFrame, tabFrame, nil, Details.Reportar, tabFrame, 3, 16, 16, "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", nil, "DetailsJanelaInfoReport3")
tabFrame.report_alvos:SetPoint("bottomright", tabFrame.container_alvos, "TOPRIGHT", -2, -1)
tabFrame.report_alvos:SetFrameLevel(3) --solved inactive problem
--special barras in the right report button
tabFrame.report_direita = Details.gump:NewDetailsButton(tabFrame, tabFrame, nil, _detalhes.Reportar, tabFrame, 2, 16, 16, "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", nil, "DetailsJanelaInfoReport4")
tabFrame.report_direita = Details.gump:NewDetailsButton(tabFrame, tabFrame, nil, Details.Reportar, tabFrame, 2, 16, 16, "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", nil, "DetailsJanelaInfoReport4")
tabFrame.report_direita:SetPoint("TOPRIGHT", tabFrame, "TOPRIGHT", -10, -70)
tabFrame.report_direita:Show()
end
@@ -2354,12 +2377,12 @@ function spellsTab.monta_relatorio(botao) --deprecated?
---@type instance
local instance = breakdownWindow.instancia
---@type number
local amt = _detalhes.report_lines
local amt = Details.report_lines
local tabFrame = spellsTab.TabFrame
if (not player) then
_detalhes:Msg("Player not found.")
Details:Msg("Player not found.")
return
end
@@ -2373,7 +2396,7 @@ function spellsTab.monta_relatorio(botao) --deprecated?
report_lines = {"Details!: " .. player.nome .. " " .. Loc ["STRING_ATTRIBUTE_DAMAGE_TAKEN"] .. ":"}
else
report_lines = {"Details!: " .. player.nome .. " - " .. _detalhes.sub_atributos [mainSection].lista [subSection] .. ""}
report_lines = {"Details!: " .. player.nome .. " - " .. Details.sub_atributos [mainSection].lista [subSection] .. ""}
end
for index, barra in ipairs(tabFrame.barras1) do
@@ -2404,7 +2427,7 @@ function spellsTab.monta_relatorio(botao) --deprecated?
return
end
report_lines = {"Details! " .. Loc ["STRING_ACTORFRAME_REPORTTARGETS"] .. " " .. _detalhes.sub_atributos [1].lista [1] .. " " .. Loc ["STRING_ACTORFRAME_REPORTOF"] .. " " .. player.nome}
report_lines = {"Details! " .. Loc ["STRING_ACTORFRAME_REPORTTARGETS"] .. " " .. Details.sub_atributos [1].lista [1] .. " " .. Loc ["STRING_ACTORFRAME_REPORTOF"] .. " " .. player.nome}
for index, barra in ipairs(tabFrame.barras2) do
if (barra:IsShown()) then
@@ -2425,11 +2448,11 @@ function spellsTab.monta_relatorio(botao) --deprecated?
local nome = _GetSpellInfo(player.detalhes)
report_lines = {"Details! " .. Loc ["STRING_ACTORFRAME_REPORTTO"] .. " " .. _detalhes.sub_atributos [mainSection].lista [subSection] .. " " .. Loc ["STRING_ACTORFRAME_REPORTOF"] .. " " .. player.nome,
report_lines = {"Details! " .. Loc ["STRING_ACTORFRAME_REPORTTO"] .. " " .. Details.sub_atributos [mainSection].lista [subSection] .. " " .. Loc ["STRING_ACTORFRAME_REPORTOF"] .. " " .. player.nome,
Loc ["STRING_ACTORFRAME_SPELLDETAILS"] .. ": " .. nome}
for i = 1, 5 do
local caixa = _detalhes.playerDetailWindow.grupos_detalhes[i]
local caixa = Details.playerDetailWindow.grupos_detalhes[i]
if (caixa.bg:IsShown()) then
local linha = ""
@@ -2474,7 +2497,7 @@ function spellsTab.monta_relatorio(botao) --deprecated?
--dano --damage tanken
elseif ( (mainSection == 1 and subSection == 3) or mainSection == 3) then
if (player.detalhes) then
report_lines = {"Details! " .. Loc ["STRING_ACTORFRAME_REPORTTO"] .. " " .. _detalhes.sub_atributos [1].lista [1] .. " " .. Loc ["STRING_ACTORFRAME_REPORTOF"] .. " " .. player.detalhes.. " " .. Loc ["STRING_ACTORFRAME_REPORTAT"] .. " " .. player.nome}
report_lines = {"Details! " .. Loc ["STRING_ACTORFRAME_REPORTTO"] .. " " .. Details.sub_atributos [1].lista [1] .. " " .. Loc ["STRING_ACTORFRAME_REPORTOF"] .. " " .. player.detalhes.. " " .. Loc ["STRING_ACTORFRAME_REPORTAT"] .. " " .. player.nome}
for index, barra in ipairs(tabFrame.barras3) do
if (barra:IsShown()) then
report_lines [#report_lines+1] = barra.lineText1:GetText() .. " ....... " .. barra.lineText4:GetText()
@@ -2506,10 +2529,10 @@ function spellsTab.monta_relatorio(botao) --deprecated?
nome = ""
end
report_lines = {"Details! " .. Loc ["STRING_ACTORFRAME_REPORTTO"] .. " " .. _detalhes.sub_atributos [mainSection].lista [subSection].. " " .. Loc ["STRING_ACTORFRAME_REPORTOF"] .. " " .. player.nome,
report_lines = {"Details! " .. Loc ["STRING_ACTORFRAME_REPORTTO"] .. " " .. Details.sub_atributos [mainSection].lista [subSection].. " " .. Loc ["STRING_ACTORFRAME_REPORTOF"] .. " " .. player.nome,
Loc ["STRING_ACTORFRAME_SPELLDETAILS"] .. ": " .. nome}
local caixa = _detalhes.playerDetailWindow.grupos_detalhes[botao]
local caixa = Details.playerDetailWindow.grupos_detalhes[botao]
local linha = ""
local nome2 = caixa.nome2:GetText() --golpes
+1 -1
View File
@@ -1,7 +1,7 @@
local Loc = LibStub("AceLocale-3.0"):GetLocale("Details")
local Details = _G._detalhes
local Details = _G.Details
local gump = Details.gump
local _
+1 -1
View File
@@ -73,7 +73,7 @@ function Details:ScrollDamage()
DetailsScrollDamage.searchCache = {}
local refreshFunc = function(self, data, offset, totalLines) --~refresh
local ToK = _detalhes:GetCurrentToKFunction()
local ToK = Details:GetCurrentToKFunction()
for i = 1, totalLines do
local index = i + offset
+1 -1
View File
@@ -1,4 +1,4 @@
local _detalhes = _G._detalhes
local _detalhes = _G.Details
local L = LibStub("AceLocale-3.0"):GetLocale ( "Details" )
--default weaktable
+1 -1
View File
@@ -1,4 +1,4 @@
local _detalhes = _G._detalhes
local _detalhes = _G.Details
local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" )
local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0")