Updated LibOpenRaid and DetailsFramework
This commit is contained in:
+136
-136
@@ -11,9 +11,9 @@ function Details:OpenEventTrackerOptions (from_options_panel)
|
||||
local DF = _detalhes.gump
|
||||
|
||||
local f = DF:CreateSimplePanel (_G.UIParent, 700, 400, "Details! Event Tracker Options", "DetailsEventTrackerOptions")
|
||||
f:SetPoint ("center", _G.UIParent, "center")
|
||||
f:SetScript ("OnMouseDown", nil)
|
||||
f:SetScript ("OnMouseUp", nil)
|
||||
f:SetPoint("center", _G.UIParent, "center")
|
||||
f:SetScript("OnMouseDown", nil)
|
||||
f:SetScript("OnMouseUp", nil)
|
||||
local LibWindow = _G.LibStub("LibWindow-1.1")
|
||||
LibWindow.RegisterConfig (f, _detalhes.event_tracker.options_frame)
|
||||
LibWindow.MakeDraggable (f)
|
||||
@@ -25,7 +25,7 @@ function Details:OpenEventTrackerOptions (from_options_panel)
|
||||
local options_slider_template = DF:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE")
|
||||
local options_button_template = DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")
|
||||
|
||||
--> frame strata options
|
||||
--frame strata options
|
||||
local set_frame_strata = function(_, _, strata)
|
||||
Details.event_tracker.frame.strata = strata
|
||||
Details:UpdateEventTrackerFrame()
|
||||
@@ -37,7 +37,7 @@ function Details:OpenEventTrackerOptions (from_options_panel)
|
||||
strataTable [4] = {value = "HIGH", label = "HIGH", onclick = set_frame_strata}
|
||||
strataTable [5] = {value = "DIALOG", label = "DIALOG", onclick = set_frame_strata}
|
||||
|
||||
--> font options
|
||||
--font options
|
||||
local set_font_shadow= function(_, _, shadow)
|
||||
Details.event_tracker.font_shadow = shadow
|
||||
Details:UpdateEventTrackerFrame()
|
||||
@@ -52,7 +52,7 @@ function Details:OpenEventTrackerOptions (from_options_panel)
|
||||
Details:UpdateEventTrackerFrame()
|
||||
end
|
||||
|
||||
--> texture options
|
||||
--texture options
|
||||
local set_bar_texture = function(_, _, value)
|
||||
Details.event_tracker.line_texture = value
|
||||
Details:UpdateEventTrackerFrame()
|
||||
@@ -66,7 +66,7 @@ function Details:OpenEventTrackerOptions (from_options_panel)
|
||||
end
|
||||
table.sort (texTable, function(t1, t2) return t1.label < t2.label end)
|
||||
|
||||
--> options table
|
||||
--options table
|
||||
local options = {
|
||||
|
||||
{type = "label", get = function() return "Frame Settings:" end, text_template = DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")},
|
||||
@@ -214,8 +214,8 @@ function Details:OpenEventTrackerOptions (from_options_panel)
|
||||
|
||||
DF:BuildMenu (f, options, 7, -30, 500, true, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template)
|
||||
|
||||
f:SetScript ("OnHide", function()
|
||||
--> reopen the options panel
|
||||
f:SetScript("OnHide", function()
|
||||
--reopen the options panel
|
||||
if (f.FromOptionsPanel) then
|
||||
C_Timer.After (0.2, function()
|
||||
Details:OpenOptionsWindow(Details:GetInstance(1))
|
||||
@@ -235,9 +235,9 @@ function Details:CreateEventTrackerFrame(parent, name)
|
||||
local DF = _detalhes.gump
|
||||
local SharedMedia = LibStub:GetLibrary ("LibSharedMedia-3.0")
|
||||
|
||||
--> main farame
|
||||
local f = CreateFrame ("frame", name, parent or UIParent,"BackdropTemplate")
|
||||
f:SetPoint ("center", UIParent, "center")
|
||||
--main farame
|
||||
local f = CreateFrame("frame", name, parent or UIParent,"BackdropTemplate")
|
||||
f:SetPoint("center", UIParent, "center")
|
||||
|
||||
if (not DetailsFramework.IsDragonflight()) then
|
||||
f:SetMinResize (150, 40)
|
||||
@@ -246,13 +246,13 @@ function Details:CreateEventTrackerFrame(parent, name)
|
||||
--f:SetResizeBounds(150, 40, 800, 1024)
|
||||
end
|
||||
|
||||
f:SetSize (_detalhes.event_tracker.frame.width, _detalhes.event_tracker.frame.height)
|
||||
f:SetSize(_detalhes.event_tracker.frame.width, _detalhes.event_tracker.frame.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.event_tracker.frame.backdrop_color))
|
||||
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.event_tracker.frame.backdrop_color))
|
||||
f:EnableMouse (true)
|
||||
f:SetMovable (true)
|
||||
f:SetResizable (true)
|
||||
f:SetResizable(true)
|
||||
f:SetClampedToScreen (true)
|
||||
|
||||
local LibWindow = LibStub ("LibWindow-1.1")
|
||||
@@ -260,17 +260,17 @@ function Details:CreateEventTrackerFrame(parent, name)
|
||||
LibWindow.MakeDraggable (f)
|
||||
LibWindow.RestorePosition (f)
|
||||
|
||||
--> two resizers
|
||||
--two resizers
|
||||
|
||||
local left_resize, right_resize = DF:CreateResizeGrips (f)
|
||||
|
||||
left_resize:SetScript ("OnMouseDown", function(self)
|
||||
left_resize:SetScript("OnMouseDown", function(self)
|
||||
if (not f.resizing and not _detalhes.event_tracker.frame.locked) then
|
||||
f.resizing = true
|
||||
f:StartSizing ("bottomleft")
|
||||
end
|
||||
end)
|
||||
left_resize:SetScript ("OnMouseUp", function(self)
|
||||
left_resize:SetScript("OnMouseUp", function(self)
|
||||
if (f.resizing) then
|
||||
f.resizing = false
|
||||
f:StopMovingOrSizing()
|
||||
@@ -278,13 +278,13 @@ function Details:CreateEventTrackerFrame(parent, name)
|
||||
_detalhes.event_tracker.frame.height = f:GetHeight()
|
||||
end
|
||||
end)
|
||||
right_resize:SetScript ("OnMouseDown", function(self)
|
||||
right_resize:SetScript("OnMouseDown", function(self)
|
||||
if (not f.resizing and not _detalhes.event_tracker.frame.locked) then
|
||||
f.resizing = true
|
||||
f:StartSizing ("bottomright")
|
||||
end
|
||||
end)
|
||||
right_resize:SetScript ("OnMouseUp", function(self)
|
||||
right_resize:SetScript("OnMouseUp", function(self)
|
||||
if (f.resizing) then
|
||||
f.resizing = false
|
||||
f:StopMovingOrSizing()
|
||||
@@ -293,33 +293,33 @@ function Details:CreateEventTrackerFrame(parent, name)
|
||||
end
|
||||
end)
|
||||
|
||||
f:SetScript ("OnSizeChanged", function(self)
|
||||
f:SetScript("OnSizeChanged", function(self)
|
||||
|
||||
end)
|
||||
|
||||
--> scroll frame
|
||||
--scroll frame
|
||||
|
||||
--> frame config
|
||||
--frame config
|
||||
|
||||
local scroll_line_amount = 1
|
||||
local scroll_width = 195
|
||||
local header_size = 20
|
||||
|
||||
--> on tick script
|
||||
--on tick script
|
||||
local lineOnTick = function(self, deltaTime)
|
||||
--> when this event occured on combat log
|
||||
--when this event occured on combat log
|
||||
local gameTime = self.GameTime
|
||||
|
||||
--> calculate how much time elapsed since the event got triggered
|
||||
--calculate how much time elapsed since the event got triggered
|
||||
local elapsedTime = GetTime() - gameTime
|
||||
|
||||
--> set the bar animation:
|
||||
--set the bar animation:
|
||||
local animationPercent = min (elapsedTime, 1)
|
||||
self.Statusbar:SetValue (animationPercent)
|
||||
self.Statusbar:SetValue(animationPercent)
|
||||
|
||||
--> set the spark location
|
||||
--set the spark location
|
||||
if (animationPercent < 1) then
|
||||
self.Spark:SetPoint ("left", self, "left", (self:GetWidth() * animationPercent) - 10, 0)
|
||||
self.Spark:SetPoint("left", self, "left", (self:GetWidth() * animationPercent) - 10, 0)
|
||||
if (not self.Spark:IsShown()) then
|
||||
self.Spark:Show()
|
||||
end
|
||||
@@ -330,53 +330,53 @@ function Details:CreateEventTrackerFrame(parent, name)
|
||||
end
|
||||
end
|
||||
|
||||
--> create a line on the scroll frame
|
||||
--create a line on the scroll frame
|
||||
local scroll_createline = function(self, index)
|
||||
|
||||
local line = CreateFrame ("frame", "$parentLine" .. index, self,"BackdropTemplate")
|
||||
local line = CreateFrame("frame", "$parentLine" .. index, self,"BackdropTemplate")
|
||||
line:EnableMouse (false)
|
||||
line.Index = index --> hack to not trigger error on UpdateWorldTrackerLines since Index is set after this function is ran
|
||||
line.Index = index --hack to not trigger error on UpdateWorldTrackerLines since Index is set after this function is ran
|
||||
|
||||
--> set its backdrop
|
||||
line:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}})
|
||||
--line:SetBackdropColor (1, 1, 1, 0.75)
|
||||
--set its backdrop
|
||||
line:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}})
|
||||
--line:SetBackdropColor(1, 1, 1, 0.75)
|
||||
|
||||
--> statusbar
|
||||
local statusbar = CreateFrame ("statusbar", "$parentStatusBar", line,"BackdropTemplate")
|
||||
--statusbar
|
||||
local statusbar = CreateFrame("statusbar", "$parentStatusBar", line,"BackdropTemplate")
|
||||
statusbar:SetAllPoints()
|
||||
local statusbartexture = statusbar:CreateTexture (nil, "border")
|
||||
local statusbartexture = statusbar:CreateTexture(nil, "border")
|
||||
statusbar:SetStatusBarTexture (statusbartexture)
|
||||
statusbar:SetMinMaxValues (0, 1)
|
||||
statusbar:SetValue (0)
|
||||
statusbar:SetValue(0)
|
||||
|
||||
local statusbarspark = statusbar:CreateTexture (nil, "artwork")
|
||||
statusbarspark:SetTexture ([[Interface\CastingBar\UI-CastingBar-Spark]])
|
||||
statusbarspark:SetSize (16, 30)
|
||||
statusbarspark:SetBlendMode ("ADD")
|
||||
local statusbarspark = statusbar:CreateTexture(nil, "artwork")
|
||||
statusbarspark:SetTexture([[Interface\CastingBar\UI-CastingBar-Spark]])
|
||||
statusbarspark:SetSize(16, 30)
|
||||
statusbarspark:SetBlendMode("ADD")
|
||||
statusbarspark:Hide()
|
||||
|
||||
--> create the icon textures and texts - they are all statusbar childs
|
||||
local lefticon = statusbar:CreateTexture ("$parentLeftIcon", "overlay")
|
||||
lefticon:SetPoint ("left", line, "left", 0, 0)
|
||||
--create the icon textures and texts - they are all statusbar childs
|
||||
local lefticon = statusbar:CreateTexture("$parentLeftIcon", "overlay")
|
||||
lefticon:SetPoint("left", line, "left", 0, 0)
|
||||
|
||||
local righticon = statusbar:CreateTexture ("$parentRightIcon", "overlay")
|
||||
righticon:SetPoint ("right", line, "right", 0, 0)
|
||||
local righticon = statusbar:CreateTexture("$parentRightIcon", "overlay")
|
||||
righticon:SetPoint("right", line, "right", 0, 0)
|
||||
|
||||
local lefttext = statusbar:CreateFontString ("$parentLeftText", "overlay", "GameFontNormal")
|
||||
DF:SetFontSize (lefttext, 9)
|
||||
lefttext:SetPoint ("left", lefticon, "right", 2, 0)
|
||||
lefttext:SetPoint("left", lefticon, "right", 2, 0)
|
||||
|
||||
local righttext = statusbar:CreateFontString ("$parentRightText", "overlay", "GameFontNormal")
|
||||
DF:SetFontSize (righttext, 9)
|
||||
righttext:SetPoint ("right", righticon, "left", -2, 0)
|
||||
righttext:SetPoint("right", righticon, "left", -2, 0)
|
||||
|
||||
lefttext:SetJustifyH ("left")
|
||||
righttext:SetJustifyH ("right")
|
||||
lefttext:SetJustifyH("left")
|
||||
righttext:SetJustifyH("right")
|
||||
|
||||
local actionicon = statusbar:CreateTexture ("$parentRightIcon", "overlay")
|
||||
actionicon:SetPoint ("center", line, "center")
|
||||
local actionicon = statusbar:CreateTexture("$parentRightIcon", "overlay")
|
||||
actionicon:SetPoint("center", line, "center")
|
||||
|
||||
--> set members
|
||||
--set members
|
||||
line.LeftIcon = lefticon
|
||||
line.RightIcon = righticon
|
||||
line.LeftText = lefttext
|
||||
@@ -386,16 +386,16 @@ function Details:CreateEventTrackerFrame(parent, name)
|
||||
line.Spark = statusbarspark
|
||||
line.ActionIcon = actionicon
|
||||
|
||||
--> set some parameters
|
||||
--set some parameters
|
||||
_detalhes:UpdateWorldTrackerLines (line)
|
||||
|
||||
--> set scripts
|
||||
line:SetScript ("OnUpdate", lineOnTick)
|
||||
--set scripts
|
||||
line:SetScript("OnUpdate", lineOnTick)
|
||||
|
||||
return line
|
||||
end
|
||||
|
||||
--> some consts to help work with indexes
|
||||
--some consts to help work with indexes
|
||||
local SPELLTYPE_COOLDOWN = "cooldown"
|
||||
local SPELLTYPE_INTERRUPT = "interrupt"
|
||||
local SPELLTYPE_OFFENSIVE = "offensive"
|
||||
@@ -442,11 +442,11 @@ function Details:CreateEventTrackerFrame(parent, name)
|
||||
|
||||
local add_role_and_class_color = function(player_name, player_serial)
|
||||
|
||||
--> get the actor object
|
||||
--get the actor object
|
||||
local actor = _detalhes.tabela_vigente[1]:GetActor (player_name)
|
||||
|
||||
if (actor) then
|
||||
--> remove realm name
|
||||
--remove realm name
|
||||
player_name = _detalhes:GetOnlyName (player_name)
|
||||
|
||||
local class, spec, role = actor.classe, actor.spec, actor.role
|
||||
@@ -454,15 +454,15 @@ function Details:CreateEventTrackerFrame(parent, name)
|
||||
spec, class = get_spec_or_class (player_serial, player_name)
|
||||
end
|
||||
|
||||
--> add the class color
|
||||
--add the class color
|
||||
if (_detalhes.player_class [class]) then
|
||||
--> is a player, add the class color
|
||||
--is a player, add the class color
|
||||
player_name = _detalhes:AddColorString (player_name, class)
|
||||
end
|
||||
|
||||
--add the role icon
|
||||
if (role ~= "NONE") then
|
||||
--> have a role
|
||||
--have a role
|
||||
player_name = _detalhes:AddRoleIcon (player_name, role, _detalhes.event_tracker.line_height)
|
||||
end
|
||||
|
||||
@@ -471,9 +471,9 @@ function Details:CreateEventTrackerFrame(parent, name)
|
||||
player_name = _detalhes:GetOnlyName (player_name)
|
||||
|
||||
if (class) then
|
||||
--> add the class color
|
||||
--add the class color
|
||||
if (_detalhes.player_class [class]) then
|
||||
--> is a player, add the class color
|
||||
--is a player, add the class color
|
||||
player_name = _detalhes:AddColorString (player_name, class)
|
||||
end
|
||||
end
|
||||
@@ -497,7 +497,7 @@ function Details:CreateEventTrackerFrame(parent, name)
|
||||
local loops = 20
|
||||
while (fontstring:GetStringWidth() > size and loops > 0) do
|
||||
text = strsub (text, 1, #text-1)
|
||||
fontstring:SetText (text)
|
||||
fontstring:SetText(text)
|
||||
loops = loops - 1
|
||||
end
|
||||
|
||||
@@ -518,19 +518,19 @@ function Details:CreateEventTrackerFrame(parent, name)
|
||||
|
||||
local spec, class = get_spec_or_class (ability [ABILITYTABLE_CASTERSERIAL], ability [ABILITYTABLE_CASTERNAME])
|
||||
local texture, L, R, T, B = get_player_icon (spec, class)
|
||||
line.LeftIcon:SetTexture (texture)
|
||||
line.LeftIcon:SetTexture(texture)
|
||||
line.LeftIcon:SetTexCoord (L, R, T, B)
|
||||
line.LeftText:SetText (_detalhes:GetOnlyName (ability [ABILITYTABLE_CASTERNAME]))
|
||||
line.LeftText:SetText(_detalhes:GetOnlyName (ability [ABILITYTABLE_CASTERNAME]))
|
||||
|
||||
if (ability [ABILITYTABLE_ISENEMY]) then
|
||||
line:SetBackdropColor (1, .3, .3, 0.5)
|
||||
line:SetBackdropColor(1, .3, .3, 0.5)
|
||||
else
|
||||
line:SetBackdropColor (1, 1, 1, 0.5)
|
||||
line:SetBackdropColor(1, 1, 1, 0.5)
|
||||
end
|
||||
|
||||
if (ability [ABILITYTABLE_SPELLTYPE] == SPELLTYPE_COOLDOWN) then
|
||||
local spellName, _, spellIcon = GetSpellInfo(ability [ABILITYTABLE_SPELLID])
|
||||
line.RightIcon:SetTexture (spellIcon)
|
||||
line.RightIcon:SetTexture(spellIcon)
|
||||
line.RightIcon:SetTexCoord (.06, .94, .06, .94)
|
||||
|
||||
local targetName = ability [ABILITYTABLE_TARGETNAME]
|
||||
@@ -539,32 +539,32 @@ function Details:CreateEventTrackerFrame(parent, name)
|
||||
targetName = add_role_and_class_color (targetName, targetSerial)
|
||||
end
|
||||
|
||||
line.RightText:SetText (targetName or spellName)
|
||||
line.RightText:SetText(targetName or spellName)
|
||||
|
||||
line.ActionIcon:SetTexture ([[Interface\AddOns\Details\images\event_tracker_icons]])
|
||||
line.ActionIcon:SetTexture([[Interface\AddOns\Details\images\event_tracker_icons]])
|
||||
line.ActionIcon:SetTexCoord (0, 0.125, 0, 1)
|
||||
|
||||
elseif (ability [ABILITYTABLE_SPELLTYPE] == SPELLTYPE_OFFENSIVE) then
|
||||
local spellName, _, spellIcon = GetSpellInfo(ability [ABILITYTABLE_SPELLID])
|
||||
line.RightIcon:SetTexture (spellIcon)
|
||||
line.RightIcon:SetTexture(spellIcon)
|
||||
line.RightIcon:SetTexCoord (.06, .94, .06, .94)
|
||||
line.RightText:SetText (spellName)
|
||||
line.RightText:SetText(spellName)
|
||||
|
||||
line.ActionIcon:SetTexture ([[Interface\AddOns\Details\images\event_tracker_icons]])
|
||||
line.ActionIcon:SetTexture([[Interface\AddOns\Details\images\event_tracker_icons]])
|
||||
line.ActionIcon:SetTexCoord (0.127, 0.25, 0, 1)
|
||||
|
||||
elseif (ability [ABILITYTABLE_SPELLTYPE] == SPELLTYPE_INTERRUPT) then
|
||||
local spellNameInterrupted, _, spellIconInterrupted = GetSpellInfo(ability [ABILITYTABLE_EXTRASPELLID])
|
||||
line.RightIcon:SetTexture (spellIconInterrupted)
|
||||
line.RightIcon:SetTexture(spellIconInterrupted)
|
||||
line.RightIcon:SetTexCoord (.06, .94, .06, .94)
|
||||
line.RightText:SetText (spellNameInterrupted)
|
||||
line.RightText:SetText(spellNameInterrupted)
|
||||
|
||||
line.ActionIcon:SetTexture ([[Interface\AddOns\Details\images\event_tracker_icons]])
|
||||
line.ActionIcon:SetTexture([[Interface\AddOns\Details\images\event_tracker_icons]])
|
||||
line.ActionIcon:SetTexCoord (0.251, 0.375, 0, 1)
|
||||
|
||||
elseif (ability [ABILITYTABLE_SPELLTYPE] == SPELLTYPE_CROWDCONTROL) then
|
||||
local spellName, _, spellIcon = GetSpellInfo(ability [ABILITYTABLE_SPELLID])
|
||||
line.RightIcon:SetTexture (spellIcon)
|
||||
line.RightIcon:SetTexture(spellIcon)
|
||||
line.RightIcon:SetTexCoord (.06, .94, .06, .94)
|
||||
|
||||
local targetName = ability [ABILITYTABLE_TARGETNAME]
|
||||
@@ -573,9 +573,9 @@ function Details:CreateEventTrackerFrame(parent, name)
|
||||
targetName = add_role_and_class_color (targetName, targetSerial)
|
||||
end
|
||||
|
||||
line.RightText:SetText (targetName or "unknown target")
|
||||
line.RightText:SetText(targetName or "unknown target")
|
||||
|
||||
line.ActionIcon:SetTexture ([[Interface\AddOns\Details\images\event_tracker_icons]])
|
||||
line.ActionIcon:SetTexture([[Interface\AddOns\Details\images\event_tracker_icons]])
|
||||
line.ActionIcon:SetTexCoord (0.376, 0.5, 0, 1)
|
||||
|
||||
end
|
||||
@@ -583,7 +583,7 @@ function Details:CreateEventTrackerFrame(parent, name)
|
||||
shrink_string (line.LeftText, textSize)
|
||||
shrink_string (line.RightText, textSize)
|
||||
|
||||
--> set when the ability was registered on combat log
|
||||
--set when the ability was registered on combat log
|
||||
line.GameTime = ability [ABILITYTABLE_GAMETIME]
|
||||
line:Show()
|
||||
end
|
||||
@@ -592,59 +592,59 @@ function Details:CreateEventTrackerFrame(parent, name)
|
||||
|
||||
--title text
|
||||
local TitleString = f:CreateFontString (nil, "overlay", "GameFontNormal")
|
||||
TitleString:SetPoint ("top", f, "top", 0, -3)
|
||||
TitleString:SetText ("Details!: Event Tracker")
|
||||
local TitleBackground = f:CreateTexture (nil, "artwork")
|
||||
TitleBackground:SetTexture ([[Interface\Tooltips\UI-Tooltip-Background]])
|
||||
TitleString:SetPoint("top", f, "top", 0, -3)
|
||||
TitleString:SetText("Details!: Event Tracker")
|
||||
local TitleBackground = f:CreateTexture(nil, "artwork")
|
||||
TitleBackground:SetTexture([[Interface\Tooltips\UI-Tooltip-Background]])
|
||||
TitleBackground:SetVertexColor (.1, .1, .1, .9)
|
||||
TitleBackground:SetPoint ("topleft", f, "topleft")
|
||||
TitleBackground:SetPoint ("topright", f, "topright")
|
||||
TitleBackground:SetHeight (header_size)
|
||||
TitleBackground:SetPoint("topleft", f, "topleft")
|
||||
TitleBackground:SetPoint("topright", f, "topright")
|
||||
TitleBackground:SetHeight(header_size)
|
||||
|
||||
--> table with spells showing on the scroll frame
|
||||
--table with spells showing on the scroll frame
|
||||
local CurrentShowing = {}
|
||||
|
||||
--> scrollframe
|
||||
--scrollframe
|
||||
local scrollframe = DF:CreateScrollBox (f, "$parentScrollFrame", scroll_refresh, CurrentShowing, scroll_width, 400, scroll_line_amount, _detalhes.event_tracker.line_height, scroll_createline, true, true)
|
||||
scrollframe:SetPoint ("topleft", f, "topleft", 0, -header_size)
|
||||
scrollframe:SetPoint ("topright", f, "topright", 0, -header_size)
|
||||
scrollframe:SetPoint ("bottomleft", f, "bottomleft", 0, 0)
|
||||
scrollframe:SetPoint ("bottomright", f, "bottomright", 0, 0)
|
||||
scrollframe:SetPoint("topleft", f, "topleft", 0, -header_size)
|
||||
scrollframe:SetPoint("topright", f, "topright", 0, -header_size)
|
||||
scrollframe:SetPoint("bottomleft", f, "bottomleft", 0, 0)
|
||||
scrollframe:SetPoint("bottomright", f, "bottomright", 0, 0)
|
||||
|
||||
--> update line - used by 'UpdateWorldTrackerLines' function
|
||||
--update line - used by 'UpdateWorldTrackerLines' function
|
||||
local update_line = function(line)
|
||||
|
||||
--> get the line index
|
||||
--get the line index
|
||||
local index = line.Index
|
||||
|
||||
--> update left text
|
||||
DF:SetFontColor (line.LeftText, _detalhes.event_tracker.font_color)
|
||||
--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)
|
||||
|
||||
--> update right text
|
||||
DF:SetFontColor (line.RightText, _detalhes.event_tracker.font_color)
|
||||
--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)
|
||||
|
||||
--> adjust where the line is anchored
|
||||
line:SetPoint ("topleft", line:GetParent(), "topleft", 0, -((index-1)*(_detalhes.event_tracker.line_height+1)))
|
||||
line:SetPoint ("topright", line:GetParent(), "topright", 0, -((index-1)*(_detalhes.event_tracker.line_height+1)))
|
||||
--adjust where the line is anchored
|
||||
line:SetPoint("topleft", line:GetParent(), "topleft", 0, -((index-1)*(_detalhes.event_tracker.line_height+1)))
|
||||
line:SetPoint("topright", line:GetParent(), "topright", 0, -((index-1)*(_detalhes.event_tracker.line_height+1)))
|
||||
|
||||
--> set its height
|
||||
line:SetHeight (_detalhes.event_tracker.line_height)
|
||||
--set its height
|
||||
line:SetHeight(_detalhes.event_tracker.line_height)
|
||||
|
||||
--> set texture
|
||||
--set texture
|
||||
local texture = SharedMedia:Fetch ("statusbar", _detalhes.event_tracker.line_texture)
|
||||
line.StatusbarTexture:SetTexture (texture)
|
||||
line.StatusbarTexture:SetTexture(texture)
|
||||
line.StatusbarTexture:SetVertexColor (unpack (_detalhes.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)
|
||||
--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.ActionIcon:SetAlpha (0.65)
|
||||
end
|
||||
|
||||
@@ -652,7 +652,7 @@ function Details:CreateEventTrackerFrame(parent, name)
|
||||
-- /run _detalhes:UpdateWorldTrackerLines()
|
||||
|
||||
function _detalhes:UpdateWorldTrackerLines (line)
|
||||
--> don't run if the featured hasn't loaded
|
||||
--don't run if the featured hasn't loaded
|
||||
if (not f) then
|
||||
return
|
||||
end
|
||||
@@ -660,8 +660,8 @@ function Details:CreateEventTrackerFrame(parent, name)
|
||||
if (line) then
|
||||
update_line (line)
|
||||
else
|
||||
--> update all lines
|
||||
for index, line in ipairs (scrollframe:GetFrames()) do
|
||||
--update all lines
|
||||
for index, line in ipairs(scrollframe:GetFrames()) do
|
||||
update_line (line)
|
||||
end
|
||||
scrollframe:SetFramesHeight (_detalhes.event_tracker.line_height)
|
||||
@@ -670,12 +670,12 @@ function Details:CreateEventTrackerFrame(parent, name)
|
||||
end
|
||||
|
||||
function _detalhes:UpdateEventTrackerFrame()
|
||||
--> don't run if the featured hasn't loaded
|
||||
--don't run if the featured hasn't loaded
|
||||
if (not f) then
|
||||
return
|
||||
end
|
||||
|
||||
f:SetSize (_detalhes.event_tracker.frame.width, _detalhes.event_tracker.frame.height)
|
||||
f:SetSize(_detalhes.event_tracker.frame.width, _detalhes.event_tracker.frame.height)
|
||||
LibWindow.RegisterConfig (f, _detalhes.event_tracker.frame)
|
||||
LibWindow.RestorePosition (f)
|
||||
scrollframe:OnSizeChanged()
|
||||
@@ -693,16 +693,16 @@ function Details:CreateEventTrackerFrame(parent, name)
|
||||
if (_detalhes.event_tracker.frame.show_title) then
|
||||
TitleString:Show()
|
||||
TitleBackground:Show()
|
||||
scrollframe:SetPoint ("topleft", f, "topleft", 0, -header_size)
|
||||
scrollframe:SetPoint ("topright", f, "topright", 0, -header_size)
|
||||
scrollframe:SetPoint("topleft", f, "topleft", 0, -header_size)
|
||||
scrollframe:SetPoint("topright", f, "topright", 0, -header_size)
|
||||
else
|
||||
TitleString:Hide()
|
||||
TitleBackground:Hide()
|
||||
scrollframe:SetPoint ("topleft", f, "topleft", 0, 0)
|
||||
scrollframe:SetPoint ("topright", f, "topright", 0, 0)
|
||||
scrollframe:SetPoint("topleft", f, "topleft", 0, 0)
|
||||
scrollframe:SetPoint("topright", f, "topright", 0, 0)
|
||||
end
|
||||
|
||||
f:SetBackdropColor (unpack (_detalhes.event_tracker.frame.backdrop_color))
|
||||
f:SetBackdropColor(unpack (_detalhes.event_tracker.frame.backdrop_color))
|
||||
scrollframe.__background:SetVertexColor (unpack (_detalhes.event_tracker.frame.backdrop_color))
|
||||
|
||||
f:SetFrameStrata (_detalhes.event_tracker.frame.strata)
|
||||
@@ -716,20 +716,20 @@ function Details:CreateEventTrackerFrame(parent, name)
|
||||
scrollframe:CreateLine (scroll_createline)
|
||||
end
|
||||
f.scrollframe = scrollframe
|
||||
scrollframe:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16})
|
||||
scrollframe:SetBackdropColor (0, 0, 0, 0)
|
||||
scrollframe:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16})
|
||||
scrollframe:SetBackdropColor(0, 0, 0, 0)
|
||||
|
||||
--> get tables used inside the combat parser
|
||||
--get tables used inside the combat parser
|
||||
local cooldownListFromFramework = DetailsFramework.CooldownsAllDeffensive
|
||||
local attackCooldownsFromFramework = DetailsFramework.CooldownsAttack
|
||||
local crowdControlFromFramework = DetailsFramework.CrowdControlSpells
|
||||
|
||||
local combatLog = CreateFrame ("frame")
|
||||
local combatLog = CreateFrame("frame")
|
||||
combatLog:RegisterEvent ("COMBAT_LOG_EVENT_UNFILTERED")
|
||||
local OBJECT_TYPE_PLAYER = 0x00000400
|
||||
local OBJECT_TYPE_ENEMY = 0x00000040
|
||||
|
||||
--> combat parser
|
||||
--combat parser
|
||||
local is_player = function(flag)
|
||||
if (not flag) then
|
||||
return false
|
||||
@@ -743,22 +743,22 @@ function Details:CreateEventTrackerFrame(parent, name)
|
||||
return bit.band (flag, OBJECT_TYPE_ENEMY) ~= 0
|
||||
end
|
||||
|
||||
combatLog:SetScript ("OnEvent", function(self, event)
|
||||
combatLog:SetScript("OnEvent", function(self, event)
|
||||
|
||||
local time, token, hidding, caster_serial, caster_name, caster_flags, caster_flags2, target_serial, target_name, target_flags, target_flags2, spellid, spellname, spelltype, extraSpellID, extraSpellName, extraSchool = CombatLogGetCurrentEventInfo()
|
||||
local added = false
|
||||
|
||||
--> defensive cooldown
|
||||
--defensive cooldown
|
||||
if (token == "SPELL_CAST_SUCCESS" and (cooldownListFromFramework [spellid]) and is_player (caster_flags)) then
|
||||
tinsert (CurrentShowing, 1, {SPELLTYPE_COOLDOWN, spellid, caster_name, target_name, time, false, GetTime(), caster_serial, is_enemy (caster_flags), target_serial})
|
||||
added = true
|
||||
|
||||
--> offensive cooldown
|
||||
--offensive cooldown
|
||||
elseif (token == "SPELL_CAST_SUCCESS" and (attackCooldownsFromFramework [spellid]) and is_player (caster_flags)) then
|
||||
tinsert (CurrentShowing, 1, {SPELLTYPE_OFFENSIVE, spellid, caster_name, target_name, time, false, GetTime(), caster_serial, is_enemy (caster_flags), target_serial})
|
||||
added = true
|
||||
|
||||
--> crowd control
|
||||
--crowd control
|
||||
elseif (token == "SPELL_AURA_APPLIED" and (crowdControlFromFramework [spellid])) then
|
||||
--check if isnt a pet
|
||||
if (target_flags and is_player (target_flags)) then
|
||||
@@ -766,7 +766,7 @@ function Details:CreateEventTrackerFrame(parent, name)
|
||||
added = true
|
||||
end
|
||||
|
||||
--> spell interrupt
|
||||
--spell interrupt
|
||||
elseif (token == "SPELL_INTERRUPT") then
|
||||
tinsert (CurrentShowing, 1, {SPELLTYPE_INTERRUPT, spellid, caster_name, target_name, time, extraSpellID, GetTime(), caster_serial, is_enemy (caster_flags), target_serial})
|
||||
added = true
|
||||
|
||||
Reference in New Issue
Block a user