You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3009 lines
113 KiB

4 years ago
do
local _detalhes = _G._detalhes
local DetailsFrameWork = _detalhes.gump
3 years ago
local AceLocale = LibStub("AceLocale-3.0")
4 years ago
local Loc = AceLocale:GetLocale ("Details_EncounterDetails")
local Graphics = LibStub:GetLibrary("LibGraph-2.0")
3 years ago
local ipairs = ipairs
4 years ago
local _math_floor = math.floor
local _cstr = string.format
local _GetSpellInfo = _detalhes.getspellinfo
local _
local AurasButtonTemplate = {
backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true},
backdropcolor = {.3, .3, .3, .5},
onentercolor = {1, 1, 1, .5},
backdropbordercolor = {0, 0, 0, 1},
}
local PhaseButtonTemplate = {
backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true},
backdropcolor = {.7, .7, .7, .5},
onentercolor = {1, 1, 1, .5},
backdropbordercolor = {0, 0, 0, 1},
}
local PhaseButtonTemplateHighlight = {
backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true},
backdropcolor = {.7, .7, .7, .5},
onentercolor = {1, 1, 1, .5},
backdropbordercolor = {.70, .70, .70, 1},
}
local PhaseButtonTemplateSelected = {
backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true},
backdropcolor = {.7, .7, .7, .5},
onentercolor = {1, 1, 1, .5},
backdropbordercolor = {.9, .7, 0, 1},
}
3 years ago
local set_backdrop = function(frame)
frame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tileSize = 64, tile = true})
frame:SetBackdropColor(0, 0, 0, .2)
frame:SetBackdropBorderColor(0, 0, 0, 1)
4 years ago
end
local BGColorDefault = {0.5, 0.5, 0.5, 0.3}
local BGColorDefault_Hover = {0.5, 0.5, 0.5, 0.7}
local BackdropDefault = {bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}
3 years ago
_detalhes.EncounterDetailsTempWindow = function(EncounterDetails)
4 years ago
3 years ago
--options panel
4 years ago
3 years ago
EncounterDetails.SetBarBackdrop_OnEnter = function(self)
self:SetBackdropColor(unpack(BGColorDefault_Hover))
4 years ago
end
3 years ago
EncounterDetails.SetBarBackdrop_OnLeave = function(self)
self:SetBackdropColor(unpack(BGColorDefault))
4 years ago
end
function EncounterDetails:AutoShowIcon()
local found_boss = false
3 years ago
for _, combat in ipairs(EncounterDetails:GetCombatSegments()) do
4 years ago
if (combat.is_boss) then
EncounterDetails:ShowIcon()
found_boss = true
end
end
if (EncounterDetails:GetCurrentCombat().is_boss) then
EncounterDetails:ShowIcon()
found_boss = true
end
if (not found_boss) then
EncounterDetails:HideIcon()
end
end
local build_options_panel = function()
local options_frame = EncounterDetails:CreatePluginOptionsFrame ("EncounterDetailsOptionsWindow", "Encounter Breakdown Options", 2)
-- 1 = only when inside a raid map
-- 2 = only when in raid group
-- 3 = only after a boss encounter
-- 4 = always show
-- 5 = automatic show when have at least 1 encounter with boss
3 years ago
local set = function(_, _, value)
4 years ago
EncounterDetails.db.show_icon = value
if (value == 1) then
if (EncounterDetails:GetZoneType() == "raid") then
EncounterDetails:ShowIcon()
else
EncounterDetails:HideIcon()
end
elseif (value == 2) then
if (EncounterDetails:InGroup()) then
EncounterDetails:ShowIcon()
else
EncounterDetails:HideIcon()
end
elseif (value == 3) then
if (EncounterDetails:GetCurrentCombat().is_boss) then
EncounterDetails:ShowIcon()
else
EncounterDetails:HideIcon()
end
elseif (value == 4) then
EncounterDetails:ShowIcon()
elseif (value == 5) then
EncounterDetails:AutoShowIcon()
end
end
local on_show_menu = {
{value = 1, label = "Inside Raid", onclick = set, desc = "Only show the icon while inside a raid."},
{value = 2, label = "In Group", onclick = set, desc = "Only show the icon while in group."},
{value = 3, label = "After Encounter", onclick = set, desc = "Show the icon after a raid boss encounter."},
{value = 4, label = "Always", onclick = set, desc = "Always show the icon."},
{value = 5, label = "Auto", onclick = set, desc = "The plugin decides when the icon needs to be shown."},
}
-- /dump DETAILS_PLUGIN_ENCOUNTER_DETAILS.db.show_icon
local menu = {
{
type = "select",
get = function() return EncounterDetails.db.show_icon end,
values = function() return on_show_menu end,
desc = "When the icon is shown in the Details! tooltip.",
name = "Show Icon"
},
{
type = "toggle",
get = function() return EncounterDetails.db.hide_on_combat end,
3 years ago
set = function(self, fixedparam, value) EncounterDetails.db.hide_on_combat = value end,
4 years ago
desc = "Encounter Breakdown window automatically close when you enter in combat.",
name = "Hide on Combat"
},
{
type = "range",
get = function() return EncounterDetails.db.max_emote_segments end,
3 years ago
set = function(self, fixedparam, value) EncounterDetails.db.max_emote_segments = value end,
4 years ago
min = 1,
max = 10,
step = 1,
desc = "Keep how many segments emotes.",
name = "Emote Segments Amount",
usedecimals = true,
},
{
type = "range",
get = function() return EncounterDetails.db.window_scale end,
3 years ago
set = function(self, fixedparam, value) EncounterDetails.db.window_scale = value; EncounterDetails:RefreshScale() end,
4 years ago
min = 0.65,
max = 1.50,
step = 0.1,
desc = "Set the window size",
name = "Window Scale",
usedecimals = true,
},
}
DetailsFrameWork:BuildMenu (options_frame, menu, 15, -75, 260)
end
EncounterDetails.OpenOptionsPanel = function()
if (not EncounterDetailsOptionsWindow) then
build_options_panel()
end
EncounterDetailsOptionsWindow:Show()
end
function EncounterDetails:RefreshScale()
local scale = EncounterDetails.db.window_scale
if (EncounterDetails.Frame) then
3 years ago
EncounterDetails.Frame:SetScale(scale)
4 years ago
end
end
function EncounterDetails:CreateRowTexture (row)
3 years ago
row.textura = CreateFrame("StatusBar", nil, row, "BackdropTemplate")
row.textura:SetAllPoints(row)
local t = row.textura:CreateTexture(nil, "overlay")
t:SetTexture(EncounterDetails.Frame.DefaultBarTexture)
4 years ago
row.t = t
3 years ago
row.textura:SetStatusBarTexture(t)
row.textura:SetStatusBarColor(.5, .5, .5, 0)
row.textura:SetMinMaxValues(0,100)
4 years ago
3 years ago
row.lineText1 = row.textura:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall")
row.lineText1:SetPoint("LEFT", row.textura, "LEFT", 22, -1)
row.lineText1:SetJustifyH("LEFT")
row.lineText1:SetTextColor(1,1,1,1)
4 years ago
3 years ago
row.lineText4 = row.textura:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall")
row.lineText4:SetPoint("RIGHT", row.textura, "RIGHT", -2, 0)
row.lineText4:SetJustifyH("RIGHT")
row.lineText4:SetTextColor(1,1,1,1)
4 years ago
row.textura:Show()
end
function EncounterDetails:CreateRow (index, container, x_mod, y_mod, width_mod)
3 years ago
local barra = CreateFrame("Button", "Details_"..container:GetName().."_barra_"..index, container,"BackdropTemplate")
4 years ago
x_mod = x_mod or 0
width_mod = width_mod or 0
local default_height = EncounterDetails.Frame.DefaultBarHeight
3 years ago
barra:SetWidth(200 + width_mod) --tamanho da barra de acordo com o tamanho da janela
barra:SetHeight(default_height) --altura determinada pela inst�ncia
4 years ago
local y = (index-1)*(default_height + 1)
y_mod = y_mod or 0
y = y + y_mod
3 years ago
y = y*-1 --baixo
4 years ago
3 years ago
barra:SetPoint("LEFT", container, "LEFT", x_mod, 0)
barra:SetPoint("RIGHT", container, "RIGHT", width_mod, 0)
barra:SetPoint("TOP", container, "TOP", 0, y)
barra:SetFrameLevel(container:GetFrameLevel() + 1)
4 years ago
3 years ago
barra:EnableMouse(true)
4 years ago
barra:RegisterForClicks ("LeftButtonDown","RightButtonUp")
EncounterDetails:CreateRowTexture (barra)
3 years ago
barra:SetBackdrop(BackdropDefault)
4 years ago
EncounterDetails.SetBarBackdrop_OnLeave (barra)
3 years ago
--icone
barra.icone = barra.textura:CreateTexture(nil, "OVERLAY")
barra.icone:SetWidth(default_height)
barra.icone:SetHeight(default_height)
barra.icone:SetPoint("RIGHT", barra.textura, "LEFT", 20, 0)
4 years ago
3 years ago
barra:SetAlpha(0.9)
barra.icone:SetAlpha(0.8)
4 years ago
EncounterDetails:SetRowScripts (barra, index, container)
container.barras [index] = barra
return barra
end
function EncounterDetails:JB_AtualizaContainer (container, amt, barras_total)
barras_total = barras_total or 6
if (amt >= barras_total and container.ultimo ~= amt) then
local tamanho = (EncounterDetails.Frame.DefaultBarHeight + 1) * amt
3 years ago
container:SetHeight(tamanho)
4 years ago
container.window.slider:Update()
container.window.ultimo = amt
elseif (amt <= barras_total-1 and container.slider.ativo) then
container.window.slider:Update (true)
3 years ago
container:SetHeight(140)
4 years ago
container.window.scroll_ativo = false
container.window.ultimo = 0
end
end
local grafico_cores = {{1, 1, 1, 1}, {1, 0.5, 0.3, 1}, {0.75, 0.7, 0.1, 1}, {0.2, 0.9, 0.2, 1}, {0.2, 0.5, 0.9, 1}}
local lastBoss = nil
EncounterDetails.CombatsAlreadyDrew = {}
local CONST_CHART_WIDTH = 870
local CONST_CHART_HEIGHT = 485
local CONST_PHASE_PANEL_WIDTH = 451
local CONST_PHASE_BAR_HEIGHT = 16
local CONST_CHART_LENGTH = 810
local CONST_CHART_TIMELINE_X_POSITION = 75
local CONST_CHART_TIMELINE_Y_POSITION = -550
local CONST_CHART_DAMAGELINE_X_POSITION = 27
local CONST_DAMAGE_LINES_COLOR = {1, 1, 1, .05}
local CONST_CHART_MAX_DEATHS_ICONS = 6
function EncounterDetails:BuildDpsGraphic()
local segment = EncounterDetails._segment
local g
if (not _G.DetailsRaidDpsGraph) then
EncounterDetails:CreateGraphPanel()
g = _G.DetailsRaidDpsGraph
else
g = _G.DetailsRaidDpsGraph
end
g:ResetData()
3 years ago
local combat = EncounterDetails:GetCombat(segment)
4 years ago
local graphicData = combat:GetTimeData ("Raid Damage Done")
if (not graphicData or not combat.start_time or not combat.end_time) then
3 years ago
EncounterDetails:Msg("This segment doesn't have chart data.")
4 years ago
return
--elseif (EncounterDetails.CombatsAlreadyDrew [combat:GetCombatNumber()]) then
--return
end
if (graphicData.max_value == 0) then
return
end
3 years ago
--battle time
4 years ago
if (combat.end_time - combat.start_time < 12) then
return
end
--EncounterDetails.Frame.linhas = EncounterDetails.Frame.linhas or 0
EncounterDetails.Frame.linhas = 1
if (EncounterDetails.Frame.linhas > 5) then
EncounterDetails.Frame.linhas = 1
end
g.max_damage = 0
3 years ago
for _, line in ipairs(g.VerticalLines) do
4 years ago
line:Hide()
end
lastBoss = combat.is_boss and combat.is_boss.index
--
if (not segment) then
return
end
for i = segment + 4, segment+1, -1 do
3 years ago
local combat = EncounterDetails:GetCombat(i)
4 years ago
if (combat) then --the combat exists
local elapsed_time = combat:GetCombatTime()
if (EncounterDetails.debugmode and not combat.is_boss) then
combat.is_boss = {
index = 1,
name = _detalhes:GetBossName (1098, 1),
zone = "Throne of Thunder",
mapid = 1098,
encounter = "Jin'Rohk the Breaker"
}
end
if (elapsed_time > 12 and combat.is_boss and combat.is_boss.index == lastBoss) then --is the same boss
local chart_data = combat:GetTimeData ("Raid Damage Done")
if (chart_data and chart_data.max_value and chart_data.max_value > 0) then --have a chart data
--if (not EncounterDetails.CombatsAlreadyDrew [combat:GetCombatNumber()]) then --isn't drew yet
EncounterDetails:DrawSegmentGraphic (g, chart_data, combat)
--EncounterDetails.CombatsAlreadyDrew [combat:GetCombatNumber()] = true
--end
end
end
end
end
g:ClearPhaseTexture()
local phase_data = combat.PhaseData
local scale = CONST_CHART_LENGTH / combat:GetCombatTime()
for i = 1, #phase_data do
local phase = phase_data[i][1]
local start_at = phase_data[i][2]
local texture = g:GetPhaseTexture (i, phase)
3 years ago
texture:SetPoint("bottomleft", g, "bottomleft", (start_at * scale) + 58, 0)
4 years ago
texture.phase = phase
texture.start_at = start_at
local next_phase = phase_data[i+1]
if (next_phase) then
local duration = next_phase [2] - start_at
3 years ago
texture:SetWidth(scale * duration)
4 years ago
texture.elapsed = duration
else
local duration = combat:GetCombatTime() - start_at
3 years ago
texture:SetWidth(scale * duration)
4 years ago
texture.elapsed = duration
end
end
g.combat = combat
--
EncounterDetails:DrawSegmentGraphic (g, graphicData, combat, combat)
EncounterDetails.CombatsAlreadyDrew [combat:GetCombatNumber()] = true
g:Show()
end
function EncounterDetails:DrawSegmentGraphic (g, graphicData, combat, drawDeathsCombat)
local _data = {}
local dps_max = graphicData.max_value or 0
local amount = #graphicData
local scaleW = 1/670
local content = graphicData
3 years ago
tinsert(content, 1, 0)
tinsert(content, 1, 0)
tinsert(content, #content+1, 0)
tinsert(content, #content+1, 0)
4 years ago
local _i = 3
3 years ago
local graphMaxDps = math.max(g.max_damage, dps_max)
4 years ago
while (_i <= #content-2) do
3 years ago
local v = (content[_i-2]+content[_i-1]+content[_i]+content[_i+1]+content[_i+2])/5 --normalize
_data [#_data+1] = {scaleW*(_i-2), v/graphMaxDps} --x and y coords
4 years ago
_i = _i + 1
end
3 years ago
tremove(content, 1)
tremove(content, 1)
tremove(content, #graphicData)
tremove(content, #graphicData)
4 years ago
3 years ago
--update timeline
4 years ago
local tempo = combat.end_time - combat.start_time
if (g.max_time < tempo) then
g.max_time = tempo
local tempo_divisao = g.max_time / 8
for i = 1, 8, 1 do
local t = tempo_divisao*i
3 years ago
local minutos, segundos = _math_floor(t/60), _math_floor(t%60)
4 years ago
if (segundos < 10) then
segundos = "0"..segundos
end
if (minutos < 10) then
minutos = "0"..minutos
end
3 years ago
EncounterDetails.Frame["timeamt"..i]:SetText(minutos..":"..segundos)
4 years ago
end
end
3 years ago
--normalize previous data
4 years ago
if (dps_max > g.max_damage) then
if (g.max_damage > 0) then
local normalizePercent = g.max_damage / dps_max
3 years ago
for dataIndex, Data in ipairs(g.Data) do
4 years ago
local Points = Data.Points
for i = 1, #Points do
Points[i][2] = Points[i][2]*normalizePercent
end
end
end
g.max_damage = dps_max
local dano_divisao = g.max_damage/8
3 years ago
--update damage line
4 years ago
local o = 1
for i = 8, 1, -1 do
local d = _detalhes:ToK (dano_divisao*i)
3 years ago
EncounterDetails.Frame["dpsamt"..o]:SetText(d)
4 years ago
o = o + 1
end
end
if (#g.Data == 5) then
table.remove (g.Data, 5)
end
g:AddDataSeriesOnFirstIndex (_data, grafico_cores [1])
for i = 2, #g.Data do
g:ChangeColorOnDataSeries (i, grafico_cores [i])
end
3 years ago
--add death icons for the first deaths in the segment
4 years ago
if (drawDeathsCombat) then
local mortes = drawDeathsCombat.last_events_tables
local scaleG = CONST_CHART_LENGTH / drawDeathsCombat:GetCombatTime()
3 years ago
for _, row in ipairs(g.VerticalLines) do
4 years ago
row:Hide()
end
for i = 1, math.min (CONST_CHART_MAX_DEATHS_ICONS, #mortes) do
local vRowFrame = g.VerticalLines [i]
if (not vRowFrame) then
3 years ago
vRowFrame = CreateFrame("frame", "DetailsEncountersVerticalLine"..i, g, "BackdropTemplate")
vRowFrame:SetWidth(20)
vRowFrame:SetHeight(43)
vRowFrame:SetFrameLevel(g:GetFrameLevel()+2)
4 years ago
3 years ago
vRowFrame:SetScript("OnEnter", function(frame)
4 years ago
if (vRowFrame.dead[1] and vRowFrame.dead[1][3] and vRowFrame.dead[1][3][2]) then
GameCooltip:Reset()
--time of death and player name
3 years ago
GameCooltip:AddLine(vRowFrame.dead[6].." "..vRowFrame.dead[3])
local class, l, r, t, b = _detalhes:GetClass(vRowFrame.dead[3])
4 years ago
if (class) then
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\classes_small]], 1, 1, 12, 12, l, r, t, b)
end
3 years ago
GameCooltip:AddLine("")
4 years ago
--last hits:
local death = vRowFrame.dead
local amt = 0
for i = #death[1], 1, -1 do
local this_hit = death[1][i]
3 years ago
if (type(this_hit[1]) == "boolean" and this_hit[1]) then
local spellname, _, spellicon = _GetSpellInfo(this_hit[2])
4 years ago
local t = death [2] - this_hit [4]
3 years ago
GameCooltip:AddLine("-" .. _cstr ("%.1f", t) .. " " .. spellname .. " (" .. this_hit[6] .. ")", EncounterDetails:comma_value (this_hit [3]))
4 years ago
GameCooltip:AddIcon (spellicon, 1, 1, 12, 12, 0.1, 0.9, 0.1, 0.9)
amt = amt + 1
if (amt == 3) then
break
end
end
end
3 years ago
GameCooltip:SetOption("TextSize", 9.5)
GameCooltip:SetOption("HeightAnchorMod", -15)
4 years ago
GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], {.6, 0.1, 0, 0.64453125}, {1, 1, 1, 0.1}, true)
3 years ago
GameCooltip:ShowCooltip(frame, "tooltip")
4 years ago
end
end)
3 years ago
vRowFrame:SetScript("OnLeave", function(frame)
_detalhes.popup:ShowMe(false)
4 years ago
end)
3 years ago
vRowFrame.texture = vRowFrame:CreateTexture(nil, "overlay")
vRowFrame.texture:SetTexture("Interface\\AddOns\\Details\\images\\verticalline")
vRowFrame.texture:SetWidth(3)
vRowFrame.texture:SetHeight(20)
vRowFrame.texture:SetPoint("center", "DetailsEncountersVerticalLine"..i, "center")
vRowFrame.texture:SetPoint("bottom", "DetailsEncountersVerticalLine"..i, "bottom", 0, 0)
vRowFrame.texture:SetVertexColor(1, 1, 1, .5)
vRowFrame.icon = vRowFrame:CreateTexture(nil, "overlay")
vRowFrame.icon:SetTexture("Interface\\WorldStateFrame\\SkullBones")
vRowFrame.icon:SetTexCoord(0.046875, 0.453125, 0.046875, 0.46875)
vRowFrame.icon:SetWidth(16)
vRowFrame.icon:SetHeight(16)
vRowFrame.icon:SetPoint("center", "DetailsEncountersVerticalLine"..i, "center")
vRowFrame.icon:SetPoint("bottom", "DetailsEncountersVerticalLine"..i, "bottom", 0, 20)
4 years ago
g.VerticalLines [i] = vRowFrame
end
local deadTime = mortes [i].dead_at
3 years ago
vRowFrame:SetPoint("topleft", EncounterDetails.Frame, "topleft", (deadTime*scaleG)+70, -CONST_CHART_HEIGHT-22)
4 years ago
vRowFrame.dead = mortes [i]
vRowFrame:Show()
end
end
end
--~chart ~graphic ~grafico
function EncounterDetails:CreateGraphPanel()
3 years ago
--main chart frame
4 years ago
local g = Graphics:CreateGraphLine ("DetailsRaidDpsGraph", EncounterDetails.Frame, "topleft", "topleft", 20, -76, CONST_CHART_WIDTH, CONST_CHART_HEIGHT)
g:SetXAxis (-1,1)
g:SetYAxis (-1,1)
g:SetGridSpacing (false, false)
g:SetGridColor ({0.5,0.5,0.5,0.3})
g:SetAxisDrawing (false,false)
g:SetAxisColor({1.0,1.0,1.0,1.0})
g:SetAutoScale (true)
--g:SetLineTexture ("smallline")
g:SetLineTexture([[Interface\AddOns\Details_EncounterDetails\images\line.tga]])
g:SetBorderSize ("right", 0.001)
g.VerticalLines = {}
g.TryIndicator = {}
g.PhaseTextures = {}
local phase_alpha = 0.5
local phase_colors = {{0.2, 1, 0.2, phase_alpha}, {1, 1, 0.2, phase_alpha}, {1, 0.2, 0.2, phase_alpha}, {0.2, 1, 1, phase_alpha}, {0.2, 0.2, 1, phase_alpha},
[1.5] = {0.25, 0.95, 0.25, phase_alpha}, [2.5] = {0.95, 0.95, 0.25, phase_alpha}, [3.5] = {0.95, 0.25, 0.25, phase_alpha}
}
3 years ago
--bloodlust indicators
4 years ago
g.bloodlustIndicators = {}
for i = 1, 5 do
local texture = g:CreateTexture(nil, "overlay")
texture:SetColorTexture(0, 1, 0, 0,6)
g.bloodlustIndicators[#g.bloodlustIndicators+1] = texture
end
3 years ago
--build the phase panel
local phase_panel = CreateFrame("frame", "EncounterDetailsPhasePanel", g, "BackdropTemplate")
phase_panel:SetFrameStrata("TOOLTIP")
phase_panel:SetWidth(CONST_PHASE_PANEL_WIDTH)
phase_panel:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16,
4 years ago
edgeFile = [[Interface\AddOns\Details\images\border_2]], edgeSize = 32,
insets = {left = 1, right = 1, top = 1, bottom = 1}})
3 years ago
phase_panel:SetBackdropColor(0, 0, 0, .4)
4 years ago
3 years ago
local damage_icon = DetailsFrameWork:CreateImage(phase_panel, [[Interface\AddOns\Details\images\skins\classic_skin_v1]], 16, 16, "overlay", {11/1024, 24/1024, 376/1024, 390/1024})
local damage_label = DetailsFrameWork:CreateLabel(phase_panel, "Damage Done:")
damage_icon:SetPoint("topleft", phase_panel, "topleft", 10, -10)
damage_label:SetPoint("left", damage_icon, "right", 4, 0)
4 years ago
3 years ago
local heal_icon = DetailsFrameWork:CreateImage(phase_panel, [[Interface\AddOns\Details\images\skins\classic_skin_v1]], 16, 16, "overlay", {43/1024, 57/1024, 376/1024, 390/1024})
local heal_label = DetailsFrameWork:CreateLabel(phase_panel, "Healing Done:")
heal_icon:SetPoint("topleft", phase_panel, "topleft", 250, -10)
heal_label:SetPoint("left", heal_icon, "right", 4, 0)
4 years ago
phase_panel.damage_labels = {}
phase_panel.heal_labels = {}
function phase_panel:ClearLabels()
3 years ago
for i, label in ipairs(phase_panel.damage_labels) do
4 years ago
label.lefttext:Hide()
label.righttext:Hide()
label.icon:Hide()
label.bg:Hide()
end
3 years ago
for i, label in ipairs(phase_panel.heal_labels) do
4 years ago
label.lefttext:Hide()
label.righttext:Hide()
label.icon:Hide()
label.bg:Hide()
end
end
function phase_panel:GetDamageLabel (index)
local label = phase_panel.damage_labels [index]
if (not label) then
3 years ago
local player_name = DetailsFrameWork:CreateLabel(phase_panel, "")
local amount = DetailsFrameWork:CreateLabel(phase_panel, "")
amount:SetJustifyH("right")
local icon = DetailsFrameWork:CreateImage(phase_panel, "", 16, 16)
local bg = DetailsFrameWork:CreateImage(phase_panel, [[Interface\AddOns\Details\images\BantoBar]], nil, nil, "artwork")
bg:SetPoint("left", icon, "left"); bg.height = 16; bg:SetPoint("right", amount, "right"); bg:SetVertexColor(.2, .2, .2, 0.8)
4 years ago
3 years ago
icon:SetPoint("topleft", phase_panel, "topleft", 10, ((index * 16) * -1) - 16)
player_name:SetPoint("left", icon, "right", 2, 0)
amount:SetPoint("topright", phase_panel, "topleft", 200, ((index * 16) * -1) - 16)
4 years ago
label = {lefttext = player_name, righttext = amount, icon = icon, bg = bg}
phase_panel.damage_labels [index] = label
end
return label
end
function phase_panel:GetHealLabel (index)
local label = phase_panel.heal_labels [index]
if (not label) then
3 years ago
local player_name = DetailsFrameWork:CreateLabel(phase_panel, "")
local amount = DetailsFrameWork:CreateLabel(phase_panel, "")
amount:SetJustifyH("right")
local icon = DetailsFrameWork:CreateImage(phase_panel, "", 16, 16)
local bg = DetailsFrameWork:CreateImage(phase_panel, [[Interface\AddOns\Details\images\BantoBar]], nil, nil, "artwork")
bg:SetPoint("left", icon, "left"); bg.height = 16; bg:SetPoint("right", amount, "right"); bg:SetVertexColor(.2, .2, .2, 0.8)
4 years ago
3 years ago
icon:SetPoint("topleft", phase_panel, "topleft", 250, ((index * 16) * -1) - 16)
player_name:SetPoint("left", icon, "right", 2, 0)
amount:SetPoint("topright", phase_panel, "topleft", 440, ((index * 16) * -1) - 16)
4 years ago
label = {lefttext = player_name, righttext = amount, icon = icon, bg = bg}
phase_panel.heal_labels [index] = label
end
return label
end
3 years ago
phase_panel.phase_label = DetailsFrameWork:CreateLabel(phase_panel, "")
phase_panel.time_label = DetailsFrameWork:CreateLabel(phase_panel, "")
phase_panel.report_label = DetailsFrameWork:CreateLabel(phase_panel, "|cFFffb400Left Click|r: Report Damage |cFFffb400Right Click|r: Report Heal")
4 years ago
3 years ago
phase_panel.phase_label:SetPoint("bottomleft", phase_panel, "bottomleft", 10, 5)
phase_panel.time_label:SetPoint("left", phase_panel.phase_label, "right", 5, 0)
phase_panel.report_label:SetPoint("bottomright", phase_panel, "bottomright", -10, 5)
4 years ago
3 years ago
local bg = DetailsFrameWork:CreateImage(phase_panel, [[Interface\Tooltips\UI-Tooltip-Background]], nil, nil, "artwork")
bg:SetPoint("left", phase_panel.phase_label, "left");
4 years ago
bg.height = 16;
3 years ago
bg:SetPoint("right", phase_panel.report_label, "right");
bg:SetVertexColor(0, 0, 0, 1)
4 years ago
local spark_container = {}
local create_spark = function()
3 years ago
local t = phase_panel:CreateTexture(nil, "overlay")
t:SetTexture([[Interface\CastingBar\UI-CastingBar-Spark]])
t:SetBlendMode("ADD")
4 years ago
t:Hide()
3 years ago
tinsert(spark_container, t)
4 years ago
end
3 years ago
local get_spark = function(index)
4 years ago
local spark = spark_container [index]
if (not spark) then
create_spark()
spark = spark_container [index]
end
spark:ClearAllPoints()
return spark
end
local hide_sparks = function()
3 years ago
for _, spark in ipairs(spark_container) do
4 years ago
spark:Hide()
end
end
3 years ago
local phase_on_enter = function(self)
4 years ago
local spark1 = get_spark (1)
local spark2 = get_spark (2)
3 years ago
self.texture:SetBlendMode("ADD")
spark1:SetPoint("left", self.texture, "left", -16, 0)
spark2:SetPoint("right", self.texture, "right", 16, 0)
4 years ago
spark1:Show()
spark2:Show()
local phase = self.phase
local spark_index = 3
3 years ago
self.texture:SetVertexColor(1, 1, 1)
4 years ago
3 years ago
for _, f in ipairs(g.PhaseTextures) do
4 years ago
if (f ~= self and f.phase == phase) then
local spark1 = get_spark (spark_index)
local spark2 = get_spark (spark_index+1)
3 years ago
f.texture:SetBlendMode("ADD")
f.texture:SetVertexColor(1, 1, 1)
spark1:SetPoint("left", f.texture, "left", -16, 0)
spark2:SetPoint("right", f.texture, "right", 16, 0)
4 years ago
spark1:Show()
spark2:Show()
spark_index = spark_index + 2
end
end
local combat = DetailsRaidDpsGraph.combat
if (combat) then
phase_panel:ClearLabels()
--damage
local players = {}
3 years ago
for player_name, damage in pairs(combat.PhaseData.damage [self.phase]) do
tinsert(players, {player_name, damage})
4 years ago
end
table.sort (players, _detalhes.Sort2)
3 years ago
for i, player in ipairs(players) do
4 years ago
local dlabel = phase_panel:GetDamageLabel (i)
3 years ago
dlabel.lefttext.text = EncounterDetails:GetOnlyName(player [1])
dlabel.righttext.text = _detalhes:ToK (_math_floor(player [2]))
4 years ago
3 years ago
local class = EncounterDetails:GetClass(player [1])
4 years ago
local spec = EncounterDetails:GetSpec (player [1])
if (spec) then
dlabel.icon.texture = [[Interface\AddOns\Details\images\spec_icons_normal]]
dlabel.icon.texcoord = EncounterDetails.class_specs_coords [spec]
elseif (class) then
dlabel.icon.texture = [[Interface\AddOns\Details\images\classes_small_alpha]]
dlabel.icon.texcoord = _detalhes.class_coords [class]
else
dlabel.icon.texture = [[Interface\LFGFRAME\LFGROLE_BW]]
3 years ago
dlabel.icon:SetTexCoord(.25, .5, 0, 1)
4 years ago
end
dlabel.lefttext:Show()
dlabel.righttext:Show()
dlabel.icon:Show()
dlabel.bg:Show()
end
local damage_players = #players
self.damage_actors = players
--heal
local players = {}
3 years ago
for player_name, heal in pairs(combat.PhaseData.heal [self.phase]) do
tinsert(players, {player_name, heal})
4 years ago
end
table.sort (players, _detalhes.Sort2)
3 years ago
for i, player in ipairs(players) do
4 years ago
local hlabel = phase_panel:GetHealLabel (i)
3 years ago
hlabel.lefttext.text = EncounterDetails:GetOnlyName(player [1])
hlabel.righttext.text = _detalhes:ToK (_math_floor(player [2]))
4 years ago
3 years ago
local classe = _detalhes:GetClass(player [1])
4 years ago
if (classe) then
3 years ago
hlabel.icon:SetTexture([[Interface\AddOns\Details\images\classes_small_alpha]])
hlabel.icon:SetTexCoord(unpack(_detalhes.class_coords [classe]))
4 years ago
else
3 years ago
hlabel.icon:SetTexture([[Interface\LFGFRAME\LFGROLE_BW]])
hlabel.icon:SetTexCoord(.25, .5, 0, 1)
4 years ago
end
hlabel.lefttext:Show()
hlabel.righttext:Show()
hlabel.icon:Show()
hlabel.bg:Show()
end
local heal_players = #players
self.heal_actors = players
--show the panel
3 years ago
phase_panel:SetHeight((math.max(damage_players, heal_players) * 16) + 60)
phase_panel:SetPoint("bottom", self, "top", 0, 10)
4 years ago
phase_panel:Show()
phase_panel.phase_label.text = "|cFFffb400Phase|r: " .. self.phase
3 years ago
local m, s = _math_floor(self.elapsed / 60), _math_floor(self.elapsed % 60)
4 years ago
phase_panel.time_label.text = "|cFFffb400Elapsed|r: " .. m .. "m " .. s .. "s"
end
end
3 years ago
local phase_on_leave = function(self)
table.wipe(self.damage_actors)
table.wipe(self.heal_actors)
4 years ago
3 years ago
for _, f in ipairs(g.PhaseTextures) do
f.texture:SetBlendMode("BLEND")
f.texture:SetVertexColor(unpack(f.texture.original_color))
4 years ago
end
hide_sparks()
phase_panel:Hide()
end
3 years ago
local phase_on_click = function(self, button)
4 years ago
if (button == "LeftButton") then
local result = {}
3 years ago
local reportFunc = function(IsCurrent, IsReverse, AmtLines)
4 years ago
AmtLines = AmtLines + 1
if (#result > AmtLines) then
for i = #result, AmtLines+1, -1 do
3 years ago
tremove(result, i)
4 years ago
end
end
EncounterDetails:SendReportLines (result)
end
--need to build here because the mouse will leave the block to click in the send button
3 years ago
tinsert(result, "Details!: Damage for Phase " .. self.phase .. " of " .. (g.combat and g.combat.is_boss and g.combat.is_boss.name or "Unknown") .. ":")
4 years ago
for i = 1, #self.damage_actors do
3 years ago
tinsert(result, EncounterDetails:GetOnlyName(self.damage_actors[i][1]) .. ": " .. _detalhes:ToK (_math_floor(self.damage_actors [i][2])))
4 years ago
end
EncounterDetails:SendReportWindow (reportFunc, nil, nil, true)
elseif (button == "RightButton") then
local result = {}
3 years ago
local reportFunc = function(IsCurrent, IsReverse, AmtLines)
4 years ago
AmtLines = AmtLines + 1
if (#result > AmtLines) then
for i = #result, AmtLines+1, -1 do
3 years ago
tremove(result, i)
4 years ago
end
end
EncounterDetails:SendReportLines (result)
end
3 years ago
tinsert(result, "Details!: Healing for Phase " .. self.phase .. " of " .. (g.combat and g.combat.is_boss and g.combat.is_boss.name or "Unknown") .. ":")
4 years ago
for i = 1, #self.heal_actors do
3 years ago
tinsert(result, EncounterDetails:GetOnlyName(self.heal_actors[i][1]) .. ": " .. _detalhes:ToK (_math_floor(self.heal_actors [i][2])))
4 years ago
end
EncounterDetails:SendReportWindow (reportFunc, nil, nil, true)
end
end
function g:GetPhaseTexture (index, phase)
local texture = g.PhaseTextures [index]
if (not texture) then
3 years ago
local f = CreateFrame("frame", "EncounterDetailsPhaseTexture" .. index, g, "BackdropTemplate")
f:SetHeight(CONST_PHASE_BAR_HEIGHT)
4 years ago
3 years ago
local t = f:CreateTexture(nil, "artwork")
4 years ago
t:SetAllPoints()
3 years ago
t:SetColorTexture(1, 1, 1, phase_alpha)
4 years ago
t.original_color = {1, 1, 1}
f.texture = t
3 years ago
f:SetScript("OnEnter", phase_on_enter)
f:SetScript("OnLeave", phase_on_leave)
f:SetScript("OnMouseUp", phase_on_click)
4 years ago
texture = f
3 years ago
tinsert(g.PhaseTextures, f)
4 years ago
end
texture:ClearAllPoints()
phase = math.min (phase, 5)
if (not phase_colors [phase]) then
3 years ago
_detalhes:Msg("Phase out of range:", phase)
phase = math.max(phase, 1)
4 years ago
end
3 years ago
texture.texture:SetVertexColor(unpack(phase_colors [phase]))
4 years ago
local oc = texture.texture.original_color
3 years ago
oc[1], oc[2], oc[3] = unpack(phase_colors [phase])
4 years ago
texture:Show()
return texture
end
function g:ClearPhaseTexture()
3 years ago
for i, texture in pairs(g.PhaseTextures) do
4 years ago
texture:Hide()
end
end
3 years ago
--chart frame implementations
4 years ago
function g:ChangeColorOnDataSeries (index, color)
self.Data [index].Color = color
self.NeedsUpdate=true
end
function g:AddDataSeriesOnFirstIndex (points, color, n2)
local data
--Make sure there is data points
if not points then
return
end
data=points
if n2==nil then
n2=false
end
if n2 or (table.getn(points)==2 and table.getn(points[1])~=2) then
data={}
for k,v in ipairs(points[1]) do
tinsert(data,{v,points[2][k]})
end
end
3 years ago
table.insert(self.Data, 1, {Points=data;Color=color})
4 years ago
self.NeedsUpdate=true
end
3 years ago
DetailsFrameWork:NewLabel(EncounterDetails.Frame, EncounterDetails.Frame, nil, "phases_string", "phases:", "GameFontHighlightSmall")
EncounterDetails.Frame["phases_string"]:SetPoint("TOPLEFT", EncounterDetails.Frame, "TOPLEFT", 20, CONST_CHART_TIMELINE_Y_POSITION)
4 years ago
3 years ago
DetailsFrameWork:NewLabel(EncounterDetails.Frame, EncounterDetails.Frame, nil, "timeamt0", "00:00", "GameFontHighlightSmall")
EncounterDetails.Frame["timeamt0"]:SetPoint("TOPLEFT", EncounterDetails.Frame, "TOPLEFT", 85, CONST_CHART_TIMELINE_Y_POSITION)
4 years ago
3 years ago
--create lines for damage and time
4 years ago
for i = 1, 8, 1 do
3 years ago
local line = g:CreateTexture(nil, "overlay")
line:SetColorTexture(unpack(CONST_DAMAGE_LINES_COLOR))
line:SetWidth(CONST_CHART_WIDTH)
line:SetHeight(1)
4 years ago
3 years ago
DetailsFrameWork:NewLabel(EncounterDetails.Frame, EncounterDetails.Frame, nil, "dpsamt"..i, "", "GameFontHighlightSmall")
EncounterDetails.Frame["dpsamt"..i]:SetPoint("TOPLEFT", EncounterDetails.Frame, "TOPLEFT", CONST_CHART_DAMAGELINE_X_POSITION, -61 + (-( (CONST_CHART_HEIGHT / 9) *i )))
line:SetPoint("topleft", EncounterDetails.Frame["dpsamt"..i].widget, "bottom", -27, 0)
4 years ago
3 years ago
DetailsFrameWork:NewLabel(EncounterDetails.Frame, EncounterDetails.Frame, nil, "timeamt"..i, "", "GameFontHighlightSmall")
EncounterDetails.Frame["timeamt"..i].widget:SetPoint("TOPLEFT", EncounterDetails.Frame, "TOPLEFT", CONST_CHART_TIMELINE_X_POSITION + ( (CONST_CHART_WIDTH / 9) * i ), CONST_CHART_TIMELINE_Y_POSITION + 1)
4 years ago
end
g.max_time = 0
g.max_damage = 0
EncounterDetails.MaxGraphics = EncounterDetails.MaxGraphics or 5
3 years ago
--fight segments at the top right corner
4 years ago
for i = 1, EncounterDetails.MaxGraphics do
3 years ago
local texture = g:CreateTexture(nil, "overlay")
texture:SetWidth(9)
texture:SetHeight(9)
texture:SetPoint("TOPLEFT", EncounterDetails.Frame, "TOPLEFT", (i*65) + 499, -81)
texture:SetColorTexture(unpack(grafico_cores[i]))
local text = g:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall")
text:SetPoint("LEFT", texture, "right", 2, 0)
text:SetJustifyH("LEFT")
4 years ago
if (i == 1) then
3 years ago
text:SetText(Loc ["STRING_CURRENT"])
4 years ago
else
3 years ago
text:SetText(Loc ["STRING_TRY"] .. " #" .. i)
4 years ago
end
g.TryIndicator [#g.TryIndicator+1] = {texture = texture, text = text}
end
3 years ago
--vertical line at the left side
local v = g:CreateTexture(nil, "overlay")
v:SetWidth(1)
v:SetHeight(CONST_CHART_HEIGHT + 1)
v:SetPoint("top", g, "top", 0, 1)
v:SetPoint("left", g, "left", CONST_CHART_DAMAGELINE_X_POSITION + 30, 0) --leave 30 pixels for the damage text
v:SetColorTexture(1, 1, 1, 1)
--horizontal line at the bottom side
local h = g:CreateTexture(nil, "overlay")
h:SetWidth(CONST_CHART_WIDTH)
h:SetHeight(1)
h:SetPoint("top", g, "top", 0, -CONST_CHART_HEIGHT + CONST_PHASE_BAR_HEIGHT*2)
h:SetPoint("left", g, "left")
h:SetColorTexture(1, 1, 1, 1)
4 years ago
end
-- ~start ~main ~frame ~baseframe ~bossframe
local BossFrame = EncounterDetails.Frame
local DetailsFrameWork = _detalhes.gump
3 years ago
BossFrame:SetFrameStrata("HIGH")
4 years ago
BossFrame:SetToplevel (true)
3 years ago
BossFrame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true})
BossFrame:SetBackdropColor(.5, .5, .5, .5)
BossFrame:SetBackdropBorderColor(0, 0, 0, 1)
4 years ago
-- ~size
3 years ago
BossFrame:SetWidth(898) -- + 200
BossFrame:SetHeight(504) -- + 150
4 years ago
3 years ago
BossFrame:EnableMouse(true)
BossFrame:SetResizable(false)
BossFrame:SetMovable(true)
4 years ago
--background
3 years ago
BossFrame.bg1 = BossFrame:CreateTexture(nil, "background")
BossFrame.bg1:SetTexture([[Interface\AddOns\Details\images\background]], true)
BossFrame.bg1:SetAlpha(0.7)
BossFrame.bg1:SetVertexColor(0.27, 0.27, 0.27)
BossFrame.bg1:SetVertTile(true)
BossFrame.bg1:SetHorizTile(true)
BossFrame.bg1:SetSize(790, 454)
4 years ago
BossFrame.bg1:SetAllPoints()
--title bar
3 years ago
local titlebar = CreateFrame("frame", nil, BossFrame,"BackdropTemplate")
titlebar:SetPoint("topleft", BossFrame, "topleft", 2, -3)
titlebar:SetPoint("topright", BossFrame, "topright", -2, -3)
titlebar:SetHeight(20)
titlebar:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true})
titlebar:SetBackdropColor(.5, .5, .5, 1)
titlebar:SetBackdropBorderColor(0, 0, 0, 1)
local name_bg_texture = BossFrame:CreateTexture(nil, "background")
name_bg_texture:SetTexture([[Interface\PetBattles\_PetBattleHorizTile]], true)
name_bg_texture:SetHorizTile(true)
name_bg_texture:SetTexCoord(0, 1, 126/256, 19/256)
name_bg_texture:SetPoint("topleft", BossFrame, "topleft", 2, -22)
name_bg_texture:SetPoint("bottomright", BossFrame, "bottomright")
name_bg_texture:SetHeight(54)
name_bg_texture:SetVertexColor(0, 0, 0, 0.2)
--header background
local headerFrame = CreateFrame("frame", "EncounterDetailsHeaderFrame", BossFrame,"BackdropTemplate")
headerFrame:EnableMouse(false)
headerFrame:SetPoint("topleft", titlebar, "bottomleft", 0, -1)
headerFrame:SetPoint("topright", titlebar, "bottomright", 0, -1)
headerFrame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true})
headerFrame:SetBackdropColor(.7, .7, .7, .4)
headerFrame:SetBackdropBorderColor(0, 0, 0, 0)
headerFrame:SetHeight(48)
4 years ago
--window title
3 years ago
local titleLabel = DetailsFrameWork:NewLabel(titlebar, titlebar, nil, "titulo", Loc ["STRING_WINDOW_TITLE"], "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255})
titleLabel:SetPoint("center", BossFrame, "center")
titleLabel:SetPoint("top", BossFrame, "top", 0, -7)
4 years ago
3 years ago
--Nome do Encontro
DetailsFrameWork:NewLabel(headerFrame, headerFrame, nil, "boss_name", "Unknown Encounter", "QuestFont_Large")
4 years ago
BossFrame.boss_name = headerFrame.boss_name
3 years ago
BossFrame.boss_name:SetPoint("TOPLEFT", BossFrame, "TOPLEFT", 100, -46)
4 years ago
3 years ago
--Nome da Raid
DetailsFrameWork:NewLabel(headerFrame, headerFrame, nil, "raid_name", "Unknown Raid", "GameFontHighlightSmall")
4 years ago
BossFrame.raid_name = headerFrame.raid_name
3 years ago
BossFrame.raid_name:SetPoint("CENTER", BossFrame.boss_name, "CENTER", 0, 14)
4 years ago
3 years ago
--icone da classe no canto esquerdo superior
BossFrame.boss_icone = headerFrame:CreateTexture(nil, "overlay")
BossFrame.boss_icone:SetPoint("TOPLEFT", BossFrame, "TOPLEFT", 9, -24)
BossFrame.boss_icone:SetWidth(46)
BossFrame.boss_icone:SetHeight(46)
4 years ago
----
3 years ago
BossFrame:SetScript("OnMouseDown",
function(self, botao)
4 years ago
if (botao == "LeftButton") then
self:StartMoving()
self.isMoving = true
elseif (botao == "RightButton" and not self.isMoving) then
EncounterDetails:CloseWindow()
end
end)
3 years ago
BossFrame:SetScript("OnMouseUp",
function(self)
4 years ago
if (self.isMoving) then
self:StopMovingOrSizing()
self.isMoving = false
end
end)
3 years ago
BossFrame:SetPoint("CENTER", UIParent)
--imagem de fundo
BossFrame.raidbackground = BossFrame:CreateTexture(nil, "BORDER")
BossFrame.raidbackground:SetPoint("TOPLEFT", BossFrame, "TOPLEFT", 0, -74)
BossFrame.raidbackground:SetPoint("bottomright", BossFrame, "bottomright", 0, 0)
BossFrame.raidbackground:SetDrawLayer("BORDER", 2)
BossFrame.raidbackground:SetAlpha(0.1)
--bot�o fechar
titlebar.CloseButton = CreateFrame("Button", nil, titlebar, "UIPanelCloseButton")
titlebar.CloseButton:SetWidth(20)
titlebar.CloseButton:SetHeight(20)
titlebar.CloseButton:SetPoint("TOPRIGHT", BossFrame, "TOPRIGHT", -2, -3)
titlebar.CloseButton:SetText("X")
titlebar.CloseButton:SetScript("OnClick", function(self)
4 years ago
EncounterDetails:CloseWindow()
end)
3 years ago
titlebar.CloseButton:SetFrameLevel(titlebar:GetFrameLevel()+2)
titlebar.CloseButton:GetNormalTexture():SetDesaturated(true)
4 years ago
3 years ago
--background completo
4 years ago
BossFrame.Widgets = {}
BossFrame.ShowType = "main"
3 years ago
--revisar
4 years ago
BossFrame.Reset = function()
BossFrame.switch (nil, nil, "main")
if (_G.DetailsRaidDpsGraph) then
_G.DetailsRaidDpsGraph:ResetData()
end
if (BossFrame.aberta) then
_detalhes:FecharEncounterWindows()
end
BossFrame.linhas = nil
end
local scrollframe
local emote_segment = 1
local searching
local hide_Graph = function()
if (_G.DetailsRaidDpsGraph) then
_G.DetailsRaidDpsGraph:Hide()
for i = 1, 8, 1 do
BossFrame["dpsamt"..i]:Hide()
BossFrame["timeamt"..i]:Hide()
end
BossFrame["timeamt0"]:Hide()
BossFrame["phases_string"]:Hide()
end
end
local hide_Emote = function()
--hide emote frames
3 years ago
for _, widget in pairs(BossFrame.EmoteWidgets) do
4 years ago
widget:Hide()
end
end
local hide_WeakAuras = function()
--hide spells frames
3 years ago
for _, widget in pairs(BossFrame.EnemySpellsWidgets) do
4 years ago
widget:Hide()
end
end
local hide_Summary = function()
--hide boss frames
3 years ago
for _, frame in ipairs(BossFrame.Widgets) do
4 years ago
frame:Hide()
end
end
local resetSelectedButtonTemplate = function()
3 years ago
BossFrame.buttonSwitchNormal:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE"))
BossFrame.buttonSwitchSpellsAuras:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE"))
BossFrame.buttonSwitchPhases:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE"))
BossFrame.buttonSwitchGraphic:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE"))
BossFrame.buttonSwitchBossEmotes:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE"))
4 years ago
end
3 years ago
BossFrame.switch = function(to, _, to2)
if (type(to) == "string") then
4 years ago
to = to
3 years ago
elseif (type(to2) == "string") then
4 years ago
to = to2
end
if (not BossFrame:IsShown()) then
Details:OpenPlugin ("DETAILS_PLUGIN_ENCOUNTER_DETAILS")
end
EncounterDetailsPhaseFrame:Hide()
resetSelectedButtonTemplate()
if (to == "main") then
BossFrame.raidbackground:Show()
3 years ago
for _, frame in ipairs(BossFrame.Widgets) do
4 years ago
frame:Show()
end
hide_Graph()
hide_Emote()
hide_WeakAuras()
BossFrame.ShowType = "main"
BossFrame.segmentosDropdown:Enable()
3 years ago
BossFrame.buttonSwitchNormal:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE"))
4 years ago
EncounterDetails.db.last_section_selected = BossFrame.ShowType
elseif (to == "spellsauras") then
_detalhes:SetTutorialCVar ("ENCOUNTER_BREAKDOWN_SPELLAURAS", true)
if (EncounterDetails.Frame.buttonSwitchSpellsAuras.AntsFrame) then
EncounterDetails.Frame.buttonSwitchSpellsAuras.AntsFrame:Hide()
end
hide_Summary()
BossFrame.raidbackground:Show()
hide_Graph()
hide_Emote()
--show spells frames
3 years ago
for _, widget in pairs(BossFrame.EnemySpellsWidgets) do
4 years ago
widget:Show()
end
BossFrame.ShowType = "spellsauras"
EncounterDetails.update_enemy_spells()
EncounterDetails.update_bossmods()
BossFrame.segmentosDropdown:Enable()
3 years ago
BossFrame.buttonSwitchSpellsAuras:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE"))
4 years ago
EncounterDetails.db.last_section_selected = BossFrame.ShowType
elseif (to == "emotes") then
_detalhes:SetTutorialCVar ("ENCOUNTER_BREAKDOWN_EMOTES", true)
if (EncounterDetails.Frame.buttonSwitchBossEmotes.AntsFrame) then
EncounterDetails.Frame.buttonSwitchBossEmotes.AntsFrame:Hide()
end
--hide boss frames
3 years ago
for _, frame in ipairs(BossFrame.Widgets) do
4 years ago
frame:Hide()
end
BossFrame.raidbackground:Show()
--hide graph
if (_G.DetailsRaidDpsGraph) then
_G.DetailsRaidDpsGraph:Hide()
for i = 1, 8, 1 do
BossFrame["dpsamt"..i]:Hide()
BossFrame["timeamt"..i]:Hide()
end
BossFrame["timeamt0"]:Hide()
BossFrame["phases_string"]:Hide()
end
--show emote frames
3 years ago
for _, widget in pairs(BossFrame.EmoteWidgets) do
4 years ago
widget:Show()
end
--hide spells frames
3 years ago
for _, widget in pairs(BossFrame.EnemySpellsWidgets) do
4 years ago
widget:Hide()
end
BossFrame.ShowType = "emotes"
scrollframe:Update()
BossFrame.EmotesSegment:Refresh()
3 years ago
BossFrame.EmotesSegment:Select(emote_segment)
4 years ago
BossFrame.segmentosDropdown:Disable()
3 years ago
BossFrame.buttonSwitchBossEmotes:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE"))
4 years ago
EncounterDetails.db.last_section_selected = BossFrame.ShowType
elseif (to == "phases") then
_detalhes:SetTutorialCVar ("ENCOUNTER_BREAKDOWN_PHASES", true)
if (EncounterDetails.Frame.buttonSwitchPhases.AntsFrame) then
EncounterDetails.Frame.buttonSwitchPhases.AntsFrame:Hide()
end
hide_Summary()
hide_Graph()
hide_Emote()
hide_WeakAuras()
BossFrame.ShowType = "phases"
EncounterDetailsPhaseFrame:Show()
3 years ago
BossFrame.buttonSwitchPhases:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE"))
4 years ago
EncounterDetails.db.last_section_selected = BossFrame.ShowType
elseif (to == "graph") then
_detalhes:SetTutorialCVar ("ENCOUNTER_BREAKDOWN_CHART", true)
if (EncounterDetails.Frame.buttonSwitchGraphic.AntsFrame) then
EncounterDetails.Frame.buttonSwitchGraphic.AntsFrame:Hide()
end
EncounterDetails:BuildDpsGraphic()
if (not _G.DetailsRaidDpsGraph) then
return
end
BossFrame.raidbackground:Hide()
3 years ago
for _, frame in ipairs(BossFrame.Widgets) do
4 years ago
frame:Hide()
end
_G.DetailsRaidDpsGraph:Show()
for i = 1, 8, 1 do
BossFrame["dpsamt"..i].widget:Show()
BossFrame["timeamt"..i].widget:Show()
end
BossFrame["timeamt0"].widget:Show()
BossFrame["phases_string"].widget:Show()
BossFrame.ShowType = "graph"
--hide emote frames
3 years ago
for _, widget in pairs(BossFrame.EmoteWidgets) do
4 years ago
widget:Hide()
end
--hide spells frames
3 years ago
for _, widget in pairs(BossFrame.EnemySpellsWidgets) do
4 years ago
widget:Hide()
end
BossFrame.segmentosDropdown:Enable()
3 years ago
BossFrame.buttonSwitchGraphic:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE"))
4 years ago
EncounterDetails.db.last_section_selected = BossFrame.ShowType
end
end
-- ~button ~menu
local BUTTON_WIDTH = 120
local BUTTON_HEIGHT = 20
local HEADER_MENUBUTTONS_SPACEMENT = 4
local HEADER_MENUBUTTONS_X = 290
local HEADER_MENUBUTTONS_Y = -38
--summary
3 years ago
BossFrame.buttonSwitchNormal = _detalhes.gump:CreateButton(BossFrame, BossFrame.switch, BUTTON_WIDTH, BUTTON_HEIGHT, "Summary", "main")
4 years ago
BossFrame.buttonSwitchNormal:SetIcon ("Interface\\AddOns\\Details_EncounterDetails\\images\\boss_frame_buttons", 18, 18, "overlay", {0, 32/256, 0, 0.505625})
3 years ago
BossFrame.buttonSwitchNormal:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE"))
BossFrame.buttonSwitchNormal:SetWidth(BUTTON_WIDTH)
4 years ago
--spells e auras
3 years ago
BossFrame.buttonSwitchSpellsAuras = _detalhes.gump:CreateButton(BossFrame, BossFrame.switch, BUTTON_WIDTH, BUTTON_HEIGHT, "Timers & Spells", "spellsauras")
4 years ago
BossFrame.buttonSwitchSpellsAuras:SetIcon ("Interface\\AddOns\\Details_EncounterDetails\\images\\boss_frame_buttons", 18, 18, "overlay", {33/256, 64/256, 0, 0.505625})
3 years ago
BossFrame.buttonSwitchSpellsAuras:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE"))
BossFrame.buttonSwitchSpellsAuras:SetWidth(BUTTON_WIDTH)
4 years ago
BossFrame.AllButtons = {BossFrame.buttonSwitchNormal, BossFrame.buttonSwitchGraphic, BossFrame.buttonSwitchBossEmotes, BossFrame.buttonSwitchSpellsAuras, BossFrame.buttonSwitchPhases}
--phases
3 years ago
BossFrame.buttonSwitchPhases = _detalhes.gump:CreateButton(BossFrame, BossFrame.switch, BUTTON_WIDTH, BUTTON_HEIGHT, "Phases", "phases")
4 years ago
BossFrame.buttonSwitchPhases:SetIcon ("Interface\\AddOns\\Details_EncounterDetails\\images\\boss_frame_buttons", 18, 18, "overlay", {65/256, 96/256, 0, 0.505625})
3 years ago
BossFrame.buttonSwitchPhases:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE"))
BossFrame.buttonSwitchPhases:SetWidth(BUTTON_WIDTH)
4 years ago
--chart
3 years ago
BossFrame.buttonSwitchGraphic = _detalhes.gump:CreateButton(BossFrame, BossFrame.switch, BUTTON_WIDTH, BUTTON_HEIGHT, "Damage Graphic", "graph")
4 years ago
BossFrame.buttonSwitchGraphic:SetIcon ("Interface\\AddOns\\Details_EncounterDetails\\images\\boss_frame_buttons", 18, 18, "overlay", {97/256, 128/256, 0, 0.505625})
3 years ago
BossFrame.buttonSwitchGraphic:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE"))
BossFrame.buttonSwitchGraphic:SetWidth(BUTTON_WIDTH)
4 years ago
--emotes
3 years ago
BossFrame.buttonSwitchBossEmotes = _detalhes.gump:CreateButton(BossFrame, BossFrame.switch, BUTTON_WIDTH, BUTTON_HEIGHT, "Emotes", "emotes")
4 years ago
BossFrame.buttonSwitchBossEmotes:SetIcon ("Interface\\AddOns\\Details_EncounterDetails\\images\\boss_frame_buttons", 18, 18, "overlay", {129/256, 160/256, 0, 0.505625})
3 years ago
BossFrame.buttonSwitchBossEmotes:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE"))
BossFrame.buttonSwitchBossEmotes:SetWidth(BUTTON_WIDTH)
4 years ago
--anchors
3 years ago
BossFrame.buttonSwitchNormal:SetPoint("TOPLEFT", BossFrame, "TOPLEFT", HEADER_MENUBUTTONS_X, HEADER_MENUBUTTONS_Y)
BossFrame.buttonSwitchSpellsAuras:SetPoint("left", BossFrame.buttonSwitchNormal, "right", HEADER_MENUBUTTONS_SPACEMENT, 0)
BossFrame.buttonSwitchPhases:SetPoint("left", BossFrame.buttonSwitchSpellsAuras, "right", HEADER_MENUBUTTONS_SPACEMENT, 0)
BossFrame.buttonSwitchGraphic:SetPoint("left", BossFrame.buttonSwitchPhases, "right", HEADER_MENUBUTTONS_SPACEMENT, 0)
BossFrame.buttonSwitchBossEmotes:SetPoint("left", BossFrame.buttonSwitchGraphic, "right", HEADER_MENUBUTTONS_SPACEMENT, 0)
4 years ago
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3 years ago
--~emotes
4 years ago
local emote_lines = {}
local emote_search_table = {}
local CONST_EMOTES_MAX_LINES = 32
3 years ago
local refresh_emotes = function(self)
4 years ago
--update emote scroll
local offset = FauxScrollFrame_GetOffset (self)
3 years ago
--print(EncounterDetails.charsaved, EncounterDetails.charsaved.emotes, EncounterDetails.charsaved.emotes [1], #EncounterDetails.charsaved.emotes)
4 years ago
local emote_pool = EncounterDetails.charsaved.emotes [emote_segment]
if (searching) then
local i = 0
local lower = string.lower
3 years ago
for index, data in ipairs(emote_pool) do
if (lower (data [2]):find(lower(searching))) then
4 years ago
i = i + 1
emote_search_table [i] = data
end
for o = #emote_search_table, i+1, -1 do
emote_search_table [o] = nil
end
emote_pool = emote_search_table
end
BossFrame.SearchResults:Show()
3 years ago
BossFrame.SearchResults:SetText("Found " .. i .. " matches")
4 years ago
if (i > 0) then
BossFrame.ReportEmoteButton:Enable()
elseif (i == 0) then
BossFrame.ReportEmoteButton:Disable()
end
else
BossFrame.SearchResults:Hide()
end
if (emote_pool) then
for bar_index = 1, CONST_EMOTES_MAX_LINES do
local data = emote_pool [bar_index + offset]
local bar = emote_lines [bar_index]
if (data) then
bar:Show()
3 years ago
local min, sec = _math_floor(data[1] / 60), _math_floor(data[1] % 60)
bar.lefttext:SetText(min .. "m" .. sec .. "s:")
4 years ago
if (data [2] == "") then
3 years ago
bar.righttext:SetText("--x--x--")
4 years ago
else
3 years ago
bar.righttext:SetText(_cstr (data [2], data [3]))
4 years ago
end
local color_string = EncounterDetails.BossWhispColors [data [4]]
local color_table = ChatTypeInfo [color_string]
3 years ago
bar.righttext:SetTextColor(color_table.r, color_table.g, color_table.b)
bar.icon:SetTexture([[Interface\CHARACTERFRAME\UI-StateIcon]])
bar.icon:SetTexCoord(0, 0.5, 0.5, 1)
bar.icon:SetBlendMode("ADD")
4 years ago
else
bar:Hide()
end
end
FauxScrollFrame_Update (self, #emote_pool, CONST_EMOTES_MAX_LINES, 15)
else
for bar_index = 1, CONST_EMOTES_MAX_LINES do
local bar = emote_lines [bar_index]
bar:Hide()
end
end
end
BossFrame.EmoteWidgets = {}
--~emotes ~whispers
3 years ago
local bar_div_emotes = DetailsFrameWork:CreateImage(BossFrame, "Interface\\AddOns\\Details_EncounterDetails\\images\\boss_bg", 4, 480, "artwork", {724/1024, 728/1024, 0, 245/512})
bar_div_emotes:SetPoint("TOPLEFT", BossFrame, "TOPLEFT", 244, -74)
4 years ago
bar_div_emotes:Hide()
3 years ago
tinsert(BossFrame.EmoteWidgets, bar_div_emotes)
4 years ago
3 years ago
scrollframe = CreateFrame("ScrollFrame", "EncounterDetails_EmoteScroll", BossFrame, "FauxScrollFrameTemplate, BackdropTemplate")
scrollframe:SetScript("OnVerticalScroll", function(self, offset) FauxScrollFrame_OnVerticalScroll (self, offset, 14, refresh_emotes) end)
scrollframe:SetPoint("topleft", BossFrame, "topleft", 249, -75)
scrollframe:SetPoint("bottomright", BossFrame, "bottomright", -33, 42)
4 years ago
scrollframe.Update = refresh_emotes
scrollframe:Hide()
3 years ago
_detalhes.gump:ReskinSlider(scrollframe, 3)
4 years ago
--
3 years ago
tinsert(BossFrame.EmoteWidgets, scrollframe)
4 years ago
3 years ago
local row_on_enter = function(self)
self:SetBackdrop({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16})
self:SetBackdropColor(1, 1, 1, .6)
4 years ago
if (self.righttext:IsTruncated()) then
GameCooltip:Reset()
3 years ago
GameCooltip:AddLine(self.righttext:GetText())
GameCooltip:SetOwner(self, "bottomleft", "topleft", 42, -9)
4 years ago
GameCooltip:Show()
end
end
3 years ago
local row_on_leave = function(self)
self:SetBackdrop({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16})
self:SetBackdropColor(1, 1, 1, .3)
4 years ago
GameCooltip:Hide()
end
3 years ago
local row_on_mouse_up = function(self)
4 years ago
--report
local text = self.righttext:GetText()
3 years ago
local timeString = self.lefttext:GetText()
4 years ago
local reportFunc = function()
-- remove textures
3 years ago
text = text:gsub("(|T).*(|t)", "")
4 years ago
-- remove colors
3 years ago
text = text:gsub("|c%x?%x?%x?%x?%x?%x?%x?%x?", "")
text = text:gsub("|r", "")
4 years ago
-- replace links
for _, spellid in text:gmatch ("(|Hspell:)(.-)(|h)") do
3 years ago
local spell = tonumber(spellid)
local link = GetSpellLink(spell)
text = text:gsub("(|Hspell).*(|h)", link)
4 years ago
end
-- remove unit links
3 years ago
text = text:gsub("(|Hunit).-(|h)", "")
4 years ago
-- remove the left space
3 years ago
text = text:gsub("^%s$", "")
4 years ago
3 years ago
EncounterDetails:SendReportLines ({"Details! Encounter Emote at " .. timeString, "\"" .. text .. "\""})
4 years ago
end
EncounterDetails:SendReportWindow (reportFunc)
end
for i = 1, CONST_EMOTES_MAX_LINES do
3 years ago
local line = CreateFrame("frame", nil, BossFrame,"BackdropTemplate")
4 years ago
local y = (i-1) * 15 * -1
3 years ago
line:SetPoint("topleft", scrollframe, "topleft", 0, y)
line:SetPoint("topright", scrollframe, "topright", 0, y)
line:SetHeight(14)
line:SetBackdrop({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16})
line:SetBackdropColor(1, 1, 1, .3)
line.icon = line:CreateTexture(nil, "overlay")
line.icon:SetPoint("left", line, "left", 2, 0)
line.icon:SetSize(14, 14)
line.lefttext = line:CreateFontString(nil, "overlay", "GameFontHighlightSmall")
line.lefttext:SetPoint("left", line.icon, "right", 2, 0)
line.lefttext:SetWidth(line:GetWidth() - 26)
line.lefttext:SetHeight(14)
line.lefttext:SetJustifyH("left")
line.righttext = line:CreateFontString(nil, "overlay", "GameFontHighlightSmall")
line.righttext:SetPoint("left", line.icon, "right", 46, 0)
line.righttext:SetWidth(line:GetWidth() - 60)
line.righttext:SetHeight(14)
line.righttext:SetJustifyH("left")
line:SetFrameLevel(scrollframe:GetFrameLevel()+1)
line:SetScript("OnEnter", row_on_enter)
line:SetScript("OnLeave", row_on_leave)
line:SetScript("OnMouseUp", row_on_mouse_up)
tinsert(emote_lines, line)
tinsert(BossFrame.EmoteWidgets, line)
4 years ago
line:Hide()
end
--select emote segment
3 years ago
local emotes_segment_label = DetailsFrameWork:CreateLabel(BossFrame, "Segment:", 11, nil, "GameFontHighlightSmall")
emotes_segment_label:SetPoint("topleft", BossFrame, "topleft", 10, -85)
4 years ago
3 years ago
local on_emote_Segment_select = function(_, _, segment)
4 years ago
FauxScrollFrame_SetOffset (scrollframe, 0)
emote_segment = segment
scrollframe:Update()
end
function EncounterDetails:SetEmoteSegment (segment)
emote_segment = segment
end
local segment_icon = [[Interface\AddOns\Details\images\icons]]
local segment_icon_coord = {0.7373046875, 0.9912109375, 0.6416015625, 0.7978515625}
local segment_icon_color = {1, 1, 1, 0.5}
local build_emote_segments = function()
local t = {}
if (not EncounterDetails.charsaved) then
return t
end
3 years ago
for index, segment in ipairs(EncounterDetails.charsaved.emotes) do
tinsert(t, {label = "#" .. index .. " " .. (segment.boss or "unknown"), value = index, icon = segment_icon, texcoord = segment_icon_coord, onclick = on_emote_Segment_select, iconcolor = segment_icon_color})
4 years ago
end
return t
end
local dropdown = DetailsFrameWork:NewDropDown (BossFrame, _, "$parentEmotesSegmentDropdown", "EmotesSegment", 180, 20, build_emote_segments, 1)
3 years ago
dropdown:SetPoint("topleft", emotes_segment_label, "bottomleft", -1, -2)
dropdown:SetTemplate(DetailsFrameWork:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE"))
4 years ago
3 years ago
tinsert(BossFrame.EmoteWidgets, dropdown)
tinsert(BossFrame.EmoteWidgets, emotes_segment_label)
4 years ago
--search box
3 years ago
local emotes_search_label = DetailsFrameWork:CreateLabel(BossFrame, "Search:", 11, nil, "GameFontHighlightSmall")
emotes_search_label:SetPoint("topleft", BossFrame, "topleft", 10, -130)
4 years ago
3 years ago
local emotes_search_results_label = DetailsFrameWork:CreateLabel(BossFrame, "", 11, nil, "GameFontNormal", "SearchResults")
emotes_search_results_label:SetPoint("topleft", BossFrame, "topleft", 10, -190)
4 years ago
--
3 years ago
local search = DetailsFrameWork:NewTextEntry(BossFrame, nil, "$parentEmoteSearchBox", nil, 180, 20)
search:SetTemplate(DetailsFrameWork:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE"))
search:SetPoint("topleft",emotes_search_label, "bottomleft", -1, -2)
search:SetJustifyH("left")
4 years ago
3 years ago
search:SetHook("OnTextChanged", function()
4 years ago
searching = search:GetText()
if (searching == "") then
searching = nil
FauxScrollFrame_SetOffset (scrollframe, 0)
BossFrame.ReportEmoteButton:Disable()
scrollframe:Update()
else
FauxScrollFrame_SetOffset (scrollframe, 0)
BossFrame.ReportEmoteButton:Enable()
scrollframe:Update()
end
end)
3 years ago
local reset = DetailsFrameWork:NewButton(BossFrame, nil, "$parentResetSearchBoxtButton", "ResetSearchBox", 16, 16, function()
search:SetText("")
4 years ago
end)
3 years ago
reset:SetPoint("left", search, "right", -1, 0)
reset:SetNormalTexture([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GroupLoot-Pass-Down]])
reset:SetHighlightTexture([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GROUPLOOT-PASS-HIGHLIGHT]])
reset:SetPushedTexture([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GroupLoot-Pass-Up]])
reset:GetNormalTexture():SetDesaturated(true)
4 years ago
reset.tooltip = "Reset Search"
3 years ago
tinsert(BossFrame.EmoteWidgets, search)
tinsert(BossFrame.EmoteWidgets, reset)
tinsert(BossFrame.EmoteWidgets, emotes_search_label)
4 years ago
-- report button
3 years ago
local report_emote_button = DetailsFrameWork:NewButton(BossFrame, nil, "$parentReportEmoteButton", "ReportEmoteButton", 180, 20, function()
local reportFunc = function(IsCurrent, IsReverse, AmtLines)
4 years ago
local segment = EncounterDetails.charsaved.emotes and EncounterDetails.charsaved.emotes [emote_segment]
if (segment) then
EncounterDetails.report_lines = {"Details!: Emotes for " .. segment.boss}
local added = 0
for index = 1, 16 do
local bar = emote_lines [index]
if (bar:IsShown() and added < AmtLines) then
3 years ago
local timeString = bar.lefttext:GetText()
4 years ago
local text = bar.righttext:GetText()
--"|Hunit:77182:Oregorger|hOregorger prepares to cast |cFFFF0000|Hspell:156879|h[Blackrock Barrage]|h|r."
-- remove textures
3 years ago
text = text:gsub("(|T).*(|t)", "")
4 years ago
-- remove colors
3 years ago
text = text:gsub("|c%x?%x?%x?%x?%x?%x?%x?%x?", "")
text = text:gsub("|r", "")
4 years ago
-- replace links
for _, spellid in text:gmatch ("(|Hspell:)(.-)(|h)") do
3 years ago
local spell = tonumber(spellid)
local link = GetSpellLink(spell)
text = text:gsub("(|Hspell).*(|h)", link)
4 years ago
end
-- remove unit links
3 years ago
text = text:gsub("(|Hunit).-(|h)", "")
4 years ago
-- remove the left space
3 years ago
text = text:gsub("^%s$", "")
4 years ago
3 years ago
tinsert(EncounterDetails.report_lines, timeString .. " " .. text)
4 years ago
added = added + 1
if (added == AmtLines) then
break
end
end
end
EncounterDetails:SendReportLines (EncounterDetails.report_lines)
else
3 years ago
EncounterDetails:Msg("There is nothing to report.")
4 years ago
end
end
local use_slider = true
EncounterDetails:SendReportWindow (reportFunc, nil, nil, use_slider)
end, nil, nil, nil, "Report Results")
report_emote_button:SetIcon ([[Interface\AddOns\Details\images\report_button]], 8, 14, nil, {0, 1, 0, 1}, nil, 4, 2)
3 years ago
report_emote_button:SetTemplate(DetailsFrameWork:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE"))
4 years ago
3 years ago
report_emote_button:SetPoint("topleft", search, "bottomleft", 0, -4)
4 years ago
report_emote_button:Disable()
3 years ago
tinsert(BossFrame.EmoteWidgets, report_emote_button)
4 years ago
--
3 years ago
for _, widget in pairs(BossFrame.EmoteWidgets) do
4 years ago
widget:Hide()
end
3 years ago
local emote_report_label = DetailsFrameWork:NewLabel(search.widget, search.widget, nil, "report_click", "|cFFffb400Left Click|r: Report Line")
emote_report_label:SetPoint("topleft", search.widget, "bottomleft", 1, -61)
4 years ago
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3 years ago
--auras weakauras
4 years ago
BossFrame.EnemySpellsWidgets = {}
3 years ago
--spells and auras ~auras ~spell ~weakaura �ura
4 years ago
local CONST_MAX_AURA_LINES = 21
local spell_blocks = {}
local bossmods_blocks = {}
3 years ago
local on_focus_gain = function(self)
4 years ago
self:HighlightText()
end
3 years ago
local on_focus_lost = function(self)
4 years ago
self:HighlightText (0, 0)
end
3 years ago
local on_enter_spell = function(self)
4 years ago
if (self.MyObject._spellid) then
3 years ago
GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT")
4 years ago
if (type(self.MyObject._spellid) == "string") then
local spellId = self.MyObject._spellid:gsub("%a", "")
spellId = tonumber(spellId)
if (spellId) then
GameTooltip:SetSpellByID(spellId)
end
else
GameTooltip:SetSpellByID(self.MyObject._spellid)
end
GameTooltip:Show()
3 years ago
self:SetBackdropColor(1, 1, 1, .5)
self:SetBackdropBorderColor(0, 0, 0, 1)
4 years ago
return true
end
end
3 years ago
local on_leave_spell = function(self, capsule)
4 years ago
GameTooltip:Hide()
3 years ago
self:SetBackdropColor(.3, .3, .3, .5)
4 years ago
end
3 years ago
local create_aura_func = function(self, button, spellid, encounter_id)
4 years ago
local name, _, icon = EncounterDetails.getspellinfo (spellid)
EncounterDetails:OpenAuraPanel (spellid, name, self and self.MyObject._icon.texture, encounter_id)
end
3 years ago
local info_onenter = function(self)
4 years ago
local spellid = self._spellid
local info = EncounterDetails.EnemySpellPool [spellid]
if (info) then
3 years ago
_detalhes:CooltipPreset(2)
GameCooltip:SetOption("FixedWidth", false)
4 years ago
3 years ago
for token, _ in pairs(info.token) do
GameCooltip:AddLine("event:", token, 1, nil, "white")
4 years ago
end
3 years ago
GameCooltip:AddLine("source:", info.source, 1, nil, "white")
GameCooltip:AddLine("school:", EncounterDetails:GetSpellSchoolFormatedName (info.school), 1, nil, "white")
4 years ago
if (info.type) then
3 years ago
GameCooltip:AddLine("aura type:", info.type, 1, nil, "white")
4 years ago
end
3 years ago
GameCooltip:ShowCooltip(self, "tooltip")
4 years ago
end
3 years ago
self:SetBackdropColor(1, 1, 1, .5)
4 years ago
end
3 years ago
local info_onleave = function(self)
4 years ago
GameCooltip:Hide()
3 years ago
self:SetBackdropColor(.3, .3, .3, .5)
4 years ago
end
3 years ago
local bossModsTitle = DetailsFrameWork:CreateLabel(BossFrame, "Boss Mods Time Bars:", 12, "orange")
4 years ago
bossModsTitle:SetPoint(10, -85)
3 years ago
tinsert(BossFrame.EnemySpellsWidgets, bossModsTitle)
4 years ago
bossModsTitle:Hide()
3 years ago
local bossSpellsTitle = DetailsFrameWork:CreateLabel(BossFrame, "Boss Spells and Auras:", 12, "orange")
4 years ago
bossSpellsTitle:SetPoint(444, -85)
3 years ago
tinsert(BossFrame.EnemySpellsWidgets, bossSpellsTitle)
4 years ago
bossSpellsTitle:Hide()
--create boss mods list
for i = 1, CONST_MAX_AURA_LINES do
3 years ago
local anchor_frame = CreateFrame("frame", "BossFrameBossModsAnchor" .. i, BossFrame, "BackdropTemplate")
4 years ago
3 years ago
local spellicon = DetailsFrameWork:NewImage(anchor_frame, [[Interface\ICONS\TEMP]], 19, 19, "background", nil, "icon", "$parentIcon")
4 years ago
--timerId
3 years ago
local spellid = DetailsFrameWork:CreateTextEntry(anchor_frame, EncounterDetails.empty_function, 80, 20, nil, "$parentSpellId")
spellid:SetTemplate(AurasButtonTemplate)
spellid:SetHook("OnEditFocusGained", on_focus_gain)
spellid:SetHook("OnEditFocusLost", on_focus_lost)
spellid:SetHook("OnEnter", on_enter_spell)
spellid:SetHook("OnLeave", on_leave_spell)
4 years ago
--ability name
3 years ago
local spellname = DetailsFrameWork:CreateTextEntry(anchor_frame, EncounterDetails.empty_function, 180, 20, nil, "$parentSpellName")
spellname:SetTemplate(AurasButtonTemplate)
spellname:SetHook("OnEditFocusGained", on_focus_gain)
spellname:SetHook("OnEditFocusLost", on_focus_lost)
spellname:SetHook("OnEnter", on_enter_spell)
spellname:SetHook("OnLeave", on_leave_spell)
4 years ago
3 years ago
local create_aura = DetailsFrameWork:NewButton(anchor_frame, nil, "$parentCreateAuraButton", "AuraButton", 90, 18, create_aura_func, nil, nil, nil, "Make Aura")
create_aura:SetTemplate(AurasButtonTemplate)
4 years ago
3 years ago
spellicon:SetPoint("topleft", BossFrame, "topleft", 10, -85 + (i * 21 * -1))
spellid:SetPoint("left", spellicon, "right", 4, 0)
spellname:SetPoint("left", spellid, "right", 4, 0)
create_aura:SetPoint("left", spellname, "right", 4, 0)
4 years ago
spellid:SetBackdropBorderColor(0, 0, 0)
spellname:SetBackdropBorderColor(0, 0, 0)
anchor_frame.icon = spellicon
anchor_frame.spellid = spellid
anchor_frame.spellname = spellname
anchor_frame.aurabutton = create_aura
anchor_frame.aurabutton._icon = spellicon
3 years ago
tinsert(bossmods_blocks, anchor_frame)
tinsert(BossFrame.EnemySpellsWidgets, anchor_frame)
4 years ago
anchor_frame:Hide()
end
--create buff list
for i = 1, CONST_MAX_AURA_LINES do
3 years ago
local anchor_frame = CreateFrame("frame", "BossFrameSpellAnchor" .. i, BossFrame, "BackdropTemplate")
local spellicon = DetailsFrameWork:NewImage(anchor_frame, [[Interface\ICONS\TEMP]], 19, 19, "background", nil, "icon", "$parentIcon")
local spellid = DetailsFrameWork:CreateTextEntry(anchor_frame, EncounterDetails.empty_function, 80, 20)
spellid:SetTemplate(AurasButtonTemplate)
spellid:SetHook("OnEditFocusGained", on_focus_gain)
spellid:SetHook("OnEditFocusLost", on_focus_lost)
spellid:SetHook("OnEnter", on_enter_spell)
spellid:SetHook("OnLeave", on_leave_spell)
local spellname = DetailsFrameWork:CreateTextEntry(anchor_frame, EncounterDetails.empty_function, 160, 20)
spellname:SetTemplate(AurasButtonTemplate)
spellname:SetHook("OnEditFocusGained", on_focus_gain)
spellname:SetHook("OnEditFocusLost", on_focus_lost)
spellname:SetHook("OnEnter", on_enter_spell)
spellname:SetHook("OnLeave", on_leave_spell)
--spellicon_button:SetPoint("topleft", BossFrame, "topleft", 255, -65 + (i * 21 * -1))
spellicon:SetPoint("topleft", BossFrame, "topleft", 443, -85 + (i * 21 * -1))
spellid:SetPoint("left", spellicon, "right", 4, 0)
spellname:SetPoint("left", spellid, "right", 4, 0)
local spellinfo = CreateFrame("frame", nil, anchor_frame,"BackdropTemplate")
spellinfo:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
spellinfo:SetBackdropColor(.3, .3, .3, .5)
spellinfo:SetBackdropBorderColor(0, 0, 0, 1)
spellinfo:SetSize(80, 20)
spellinfo:SetScript("OnEnter", info_onenter)
spellinfo:SetScript("OnLeave", info_onleave)
local spellinfotext = spellinfo:CreateFontString(nil, "overlay", "GameFontNormal")
spellinfotext:SetPoint("center", spellinfo, "center")
spellinfotext:SetText("info")
spellinfo:SetPoint("left", spellname.widget, "right", 4, 0)
local create_aura = DetailsFrameWork:NewButton(anchor_frame, nil, "$parentCreateAuraButton", "AuraButton", 90, 18, create_aura_func, nil, nil, nil, "Make Aura")
create_aura:SetPoint("left", spellinfo, "right", 4, 0)
create_aura:SetTemplate(AurasButtonTemplate)
4 years ago
anchor_frame.icon = spellicon
anchor_frame.spellid = spellid
anchor_frame.spellname = spellname
anchor_frame.aurabutton = create_aura
anchor_frame.aurabutton._icon = spellicon
anchor_frame.info = spellinfo
3 years ago
tinsert(spell_blocks, anchor_frame)
tinsert(BossFrame.EnemySpellsWidgets, anchor_frame)
4 years ago
anchor_frame:Hide()
end
local update_enemy_spells = function()
3 years ago
local combat = EncounterDetails:GetCombat(EncounterDetails._segment)
4 years ago
local spell_list = {}
if (combat) then
for i, npc in combat[1]:ListActors() do
--damage
if (npc:IsNeutralOrEnemy()) then
3 years ago
for spellid, spell in pairs(npc.spells._ActorTable) do
4 years ago
if (spellid > 10) then
local name, _, icon = EncounterDetails.getspellinfo (spellid)
3 years ago
tinsert(spell_list, {spellid, name, icon, nil, npc.serial})
4 years ago
end
end
end
end
for i, npc in combat[2]:ListActors() do
--heal
if (npc:IsNeutralOrEnemy()) then
3 years ago
for spellid, spell in pairs(npc.spells._ActorTable) do
4 years ago
if (spellid > 10) then
local name, _, icon = EncounterDetails.getspellinfo (spellid)
3 years ago
tinsert(spell_list, {spellid, name, icon, true, npc.serial})
4 years ago
end
end
end
end
table.sort(spell_list, function(t1, t2)
return t1[2] < t2[2]
end)
EncounterDetails_SpellAurasScroll.spell_pool = spell_list
EncounterDetails_SpellAurasScroll.encounter_id = combat.is_boss and combat.is_boss.id
EncounterDetails_SpellAurasScroll:Update()
end
end
local refresh_bossmods_timers = function(self)
local combat = EncounterDetails:GetCombat(EncounterDetails._segment)
local offset = FauxScrollFrame_GetOffset(self)
local already_added = {}
local db = _detalhes.boss_mods_timers
local encounter_id = combat.is_boss and combat.is_boss.id
if (db) then
wipe(already_added)
local timersToAdd = {}
3 years ago
for timerId, timerTable in pairs(db.encounter_timers_dbm) do
4 years ago
if (timerTable.id == encounter_id) then
local spellId = timerTable [7]
local spellIcon = timerTable [5]
local spellName
local spell = timerId
spell = spell:gsub("ej", "")
spell = tonumber(spell)
if (spell and not already_added[spell]) then
if (spell > 40000) then
local spellname, _, spellicon = _GetSpellInfo(spell)
3 years ago
tinsert(timersToAdd, {label = spellname, value = {timerTable[2], spellname, spellIcon or spellicon, timerTable.id, timerTable[7]}, icon = spellIcon or spellicon})
4 years ago
else
--local title, description, depth, abilityIcon, displayInfo, siblingID, nextSectionID, filteredByDifficulty, link, startsOpen, flag1, flag2, flag3, flag4 = C_EncounterJournal.GetSectionInfo(spell)
local sectionInfo = C_EncounterJournal.GetSectionInfo(spell)
3 years ago
tinsert(timersToAdd, {label = sectionInfo.title, value = {timerTable[2], sectionInfo.title, spellIcon or sectionInfo.abilityIcon, timerTable.id, timerTable[7]}, icon = spellIcon or sectionInfo.abilityIcon})
4 years ago
end
already_added[spell] = true
end
end
end
table.sort(timersToAdd, function(t1, t2)
return t1.label < t2.label
end)
local offset = FauxScrollFrame_GetOffset(self)
for barIndex = 1, CONST_MAX_AURA_LINES do
local data = timersToAdd[barIndex + offset]
local bar = bossmods_blocks[barIndex]
if (data) then
bar:Show()
bar.icon.texture = data.icon
bar.icon:SetTexCoord(.1, .9, .1, .9)
bar.spellid.text = data.value[1] or "--x--x--"
bar.spellname.text = data.label or "--x--x--"
bar.spellid._spellid = data.value[1]
bar.spellname._spellid = data.value[1]
local func = function()
local timerId, spellname, spellicon, encounterid, spellid = unpack(data.value)
EncounterDetails:OpenAuraPanel (timerId, spellname, spellicon, encounterid, DETAILS_WA_TRIGGER_DBM_TIMER, DETAILS_WA_AURATYPE_TEXT, {dbm_timer_id = timerId, spellid = spellid, text = "Next " .. spellname .. " In", text_size = 72, icon = spellicon})
end
bar.aurabutton:SetClickFunction(func)
else
bar:Hide()
end
end
FauxScrollFrame_Update(self, #timersToAdd, CONST_MAX_AURA_LINES, 20)
if (#timersToAdd > 0) then
self:Show()
end
end
end
3 years ago
local refresh_spellauras = function(self)
4 years ago
local pool = EncounterDetails_SpellAurasScroll.spell_pool
local encounter_id = EncounterDetails_SpellAurasScroll.encounter_id
local offset = FauxScrollFrame_GetOffset (self)
for bar_index = 1, CONST_MAX_AURA_LINES do
local data = pool [bar_index + offset]
local bar = spell_blocks [bar_index]
if (data) then
bar:Show()
bar.icon.texture = data [3]
bar.icon:SetTexCoord(.1, .9, .1, .9)
bar.spellid.text = data [1]
bar.spellname.text = data [2]
bar.spellid._spellid = data [1]
bar.spellname._spellid = data [1]
bar.info._spellid = data [1]
local is_heal = data [4]
if (is_heal) then
3 years ago
bar.spellid:SetBackdropBorderColor(0, 1, 0)
bar.spellname:SetBackdropBorderColor(0, 1, 0)
4 years ago
else
3 years ago
bar.spellid:SetBackdropBorderColor(0, 0, 0)
bar.spellname:SetBackdropBorderColor(0, 0, 0)
4 years ago
end
3 years ago
bar.aurabutton:SetClickFunction(create_aura_func, data [1], encounter_id)
4 years ago
else
bar:Hide()
end
end
FauxScrollFrame_Update (self, #pool, CONST_MAX_AURA_LINES, 20)
end
3 years ago
local spell_scrollframe = CreateFrame("ScrollFrame", "EncounterDetails_SpellAurasScroll", BossFrame, "FauxScrollFrameTemplate, BackdropTemplate")
spell_scrollframe:SetScript("OnVerticalScroll", function(self, offset) FauxScrollFrame_OnVerticalScroll (self, offset, 14, refresh_spellauras) end)
spell_scrollframe:SetPoint("topleft", BossFrame, "topleft", 200, -75)
spell_scrollframe:SetPoint("bottomright", BossFrame, "bottomright", -33, 42)
4 years ago
spell_scrollframe.Update = refresh_spellauras
spell_scrollframe:Hide()
EncounterDetails.SpellScrollframe = spell_scrollframe
_G.DetailsFramework:ReskinSlider(spell_scrollframe)
3 years ago
tinsert(BossFrame.EnemySpellsWidgets, spell_scrollframe)
4 years ago
EncounterDetails.update_enemy_spells = update_enemy_spells
3 years ago
local bossmods_scrollframe = CreateFrame("ScrollFrame", "EncounterDetails_BossModsScroll", BossFrame, "FauxScrollFrameTemplate, BackdropTemplate")
bossmods_scrollframe:SetScript("OnVerticalScroll", function(self, offset) FauxScrollFrame_OnVerticalScroll(self, offset, 14, refresh_bossmods_timers) end)
bossmods_scrollframe:SetPoint("topleft", BossFrame, "topleft", 10, -75)
bossmods_scrollframe:SetPoint("bottomleft", BossFrame, "bottomleft", 250, 42)
4 years ago
bossmods_scrollframe.Update = refresh_bossmods_timers
bossmods_scrollframe:Hide()
EncounterDetails.BossModsScrollframe = bossmods_scrollframe
3 years ago
tinsert(BossFrame.EnemySpellsWidgets, bossmods_scrollframe)
4 years ago
EncounterDetails.update_bossmods = function() bossmods_scrollframe:Update() end
local build_bigwigs_bars = function()
local t = {}
local db = _detalhes.boss_mods_timers
if (db) then
wipe (already_added)
local encounter_id = EncounterDetails_SpellAurasScroll.encounter_id
3 years ago
for timer_id, timer_table in pairs(db.encounter_timers_bw) do
4 years ago
if (timer_table.id == encounter_id) then
local spell = timer_id
if (spell and not already_added [spell]) then
3 years ago
local int_spell = tonumber(spell)
4 years ago
if (not int_spell) then
3 years ago
local spellname = timer_table [2]:gsub(" %(.%)", "")
tinsert(t, {label = spellname, value = {timer_table [2], spellname, timer_table [5], timer_table.id}, icon = timer_table [5], onclick = on_select_bw_bar})
4 years ago
elseif (int_spell < 0) then
3 years ago
local title, description, depth, abilityIcon, displayInfo, siblingID, nextSectionID, filteredByDifficulty, link, startsOpen, flag1, flag2, flag3, flag4 = C_EncounterJournal.GetSectionInfo (abs(int_spell))
tinsert(t, {label = title, value = {timer_table [2], title, timer_table [5] or abilityIcon, timer_table.id}, icon = timer_table [5] or abilityIcon, onclick = on_select_bw_bar})
4 years ago
else
3 years ago
local spellname, _, spellicon = _GetSpellInfo(int_spell)
tinsert(t, {label = spellname, value = {timer_table [2], spellname, timer_table [5] or spellicon, timer_table.id}, icon = timer_table [5] or spellicon, onclick = on_select_bw_bar})
4 years ago
end
already_added [spell] = true
end
end
end
end
return t
end
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- ~phases
3 years ago
local PhaseFrame = CreateFrame("frame", "EncounterDetailsPhaseFrame", BossFrame, "BackdropTemplate")
4 years ago
PhaseFrame:SetAllPoints()
3 years ago
PhaseFrame:SetFrameLevel(BossFrame:GetFrameLevel()+1)
4 years ago
PhaseFrame.DamageTable = {}
PhaseFrame.HealingTable = {}
PhaseFrame.LastPhaseSelected = 1
PhaseFrame.CurrentSegment = {}
PhaseFrame.PhaseButtons = {}
EncounterDetailsPhaseFrame:Hide()
local ScrollWidth, ScrollHeight, ScrollLineAmount, ScrollLineHeight = 250, 420, 20, 20
local PhasesY = -88
local AnchorY = -120
3 years ago
PhaseFrame:SetScript("OnShow", function()
4 years ago
PhaseFrame.OnSelectPhase (1)
end)
function PhaseFrame:ClearAll()
--disable all buttons
for i = 1, #PhaseFrame.PhaseButtons do
3 years ago
PhaseFrame.PhaseButtons[i]:SetTemplate(PhaseButtonTemplate)
4 years ago
PhaseFrame.PhaseButtons[i]:Disable()
end
--update damage and healing scrolls
3 years ago
table.wipe(PhaseFrame.DamageTable)
table.wipe(PhaseFrame.HealingTable)
4 years ago
--refresh the scroll
PhaseFrame.Damage_Scroll:Refresh()
PhaseFrame.Heal_Scroll:Refresh()
--clear phase bars
PhaseFrame:ClearPhaseBars()
end
3 years ago
local selectSegment = function(_, _, phaseSelected)
4 years ago
PhaseFrame ["OnSelectPhase"] (phaseSelected)
end
function PhaseFrame.OnSelectPhase (phaseSelected)
PhaseFrame:ClearAll()
--get the selected segment
3 years ago
PhaseFrame.CurrentSegment = EncounterDetails:GetCombat(EncounterDetails._segment)
4 years ago
if (not PhaseFrame.CurrentSegment) then
return
end
--get the heal and damage for phase selected
local phaseData = PhaseFrame.CurrentSegment.PhaseData
if (not phaseData) then
return
end
phaseSelected = phaseSelected or PhaseFrame.LastPhaseSelected
PhaseFrame.LastPhaseSelected = phaseSelected
local phases = PhaseFrame:GetPhaseTimers (PhaseFrame.CurrentSegment, true)
3 years ago
for buttonIndex, phase in ipairs(phases) do
4 years ago
local button = PhaseFrame.PhaseButtons [buttonIndex]
if (phase == phaseSelected) then
3 years ago
button:SetTemplate(PhaseButtonTemplateHighlight)
4 years ago
else
3 years ago
button:SetTemplate(PhaseButtonTemplate)
4 years ago
if (PhaseFrame.CurrentSegment.PhaseData.damage [phase]) then
button:Enable()
else
button:Disable()
end
end
3 years ago
button:SetText(phase)
button:SetClickFunction(selectSegment, phase)
4 years ago
end
if (not phaseData.damage [phaseSelected]) then
PhaseFrame:ClearAll()
return
end
--update damage and healing scrolls
3 years ago
table.wipe(PhaseFrame.DamageTable)
for charName, amount in pairs(phaseData.damage [phaseSelected]) do
tinsert(PhaseFrame.DamageTable, {charName, amount})
4 years ago
end
table.sort (PhaseFrame.DamageTable, function(a, b) return a[2] > b[2] end)
3 years ago
table.wipe(PhaseFrame.HealingTable)
for charName, amount in pairs(phaseData.heal [phaseSelected]) do
tinsert(PhaseFrame.HealingTable, {charName, amount})
4 years ago
end
table.sort (PhaseFrame.HealingTable, function(a, b) return a[2] > b[2] end)
--refresh the scroll
PhaseFrame.Damage_Scroll:Refresh()
PhaseFrame.Heal_Scroll:Refresh()
PhaseFrame:UpdatePhaseBars()
end
3 years ago
local PhaseSelectLabel = _detalhes.gump:CreateLabel(PhaseFrame, "Select Phase:", 12, "orange")
local DamageLabel = _detalhes.gump:CreateLabel(PhaseFrame, "Damage Done")
local HealLabel = _detalhes.gump:CreateLabel(PhaseFrame, "Healing Done")
local PhaseTimersLabel = _detalhes.gump:CreateLabel(PhaseFrame, "Time Spent on Each Phase")
4 years ago
3 years ago
local report_damage = function(IsCurrent, IsReverse, AmtLines)
4 years ago
local result = {}
3 years ago
local reportFunc = function(IsCurrent, IsReverse, AmtLines)
4 years ago
AmtLines = AmtLines + 1
if (#result > AmtLines) then
for i = #result, AmtLines+1, -1 do
3 years ago
tremove(result, i)
4 years ago
end
end
EncounterDetails:SendReportLines (result)
end
3 years ago
tinsert(result, "Details!: Damage for Phase " .. PhaseFrame.LastPhaseSelected .. " of " .. (PhaseFrame.CurrentSegment and PhaseFrame.CurrentSegment.is_boss and PhaseFrame.CurrentSegment.is_boss.name or "Unknown") .. ":")
4 years ago
for i = 1, #PhaseFrame.DamageTable do
3 years ago
tinsert(result, EncounterDetails:GetOnlyName(PhaseFrame.DamageTable[i][1]) .. ": " .. _detalhes:ToK (_math_floor(PhaseFrame.DamageTable [i][2])))
4 years ago
end
EncounterDetails:SendReportWindow (reportFunc, nil, nil, true)
end
3 years ago
local Report_DamageButton = _detalhes.gump:CreateButton(PhaseFrame, report_damage, 16, 16, "report")
Report_DamageButton:SetPoint("left", DamageLabel, "left", ScrollWidth-44, 0)
4 years ago
Report_DamageButton.textcolor = "gray"
Report_DamageButton.textsize = 9
local report_healing = function()
local result = {}
3 years ago
local reportFunc = function(IsCurrent, IsReverse, AmtLines)
4 years ago
AmtLines = AmtLines + 1
if (#result > AmtLines) then
for i = #result, AmtLines+1, -1 do
3 years ago
tremove(result, i)
4 years ago
end
end
EncounterDetails:SendReportLines (result)
end
3 years ago
tinsert(result, "Details!: Healing for Phase " .. PhaseFrame.LastPhaseSelected .. " of " .. (PhaseFrame.CurrentSegment and PhaseFrame.CurrentSegment.is_boss and PhaseFrame.CurrentSegment.is_boss.name or "Unknown") .. ":")
4 years ago
for i = 1, #PhaseFrame.HealingTable do
3 years ago
tinsert(result, EncounterDetails:GetOnlyName(PhaseFrame.HealingTable[i][1]) .. ": " .. _detalhes:ToK (_math_floor(PhaseFrame.HealingTable [i][2])))
4 years ago
end
EncounterDetails:SendReportWindow (reportFunc, nil, nil, true)
end
3 years ago
local Report_HealingButton = _detalhes.gump:CreateButton(PhaseFrame, report_healing, 16, 16, "report")
Report_HealingButton:SetPoint("left", HealLabel, "left", ScrollWidth-44, 0)
4 years ago
Report_HealingButton.textcolor = "gray"
Report_HealingButton.textsize = 9
3 years ago
PhaseSelectLabel:SetPoint("topleft", PhaseFrame, "topleft", 10, PhasesY)
4 years ago
3 years ago
DamageLabel:SetPoint("topleft", PhaseFrame, "topleft", 10, AnchorY)
HealLabel:SetPoint("topleft", PhaseFrame, "topleft", ScrollWidth + 40, AnchorY)
PhaseTimersLabel:SetPoint("topleft", PhaseFrame, "topleft", (ScrollWidth * 2) + (40*2), AnchorY)
4 years ago
for i = 1, 10 do
3 years ago
local button = _detalhes.gump:CreateButton(PhaseFrame, PhaseFrame.OnSelectPhase, 60, 20, "", i)
button:SetPoint("left", PhaseSelectLabel, "right", 8 + ((i-1) * 61), 0)
tinsert(PhaseFrame.PhaseButtons, button)
4 years ago
end
3 years ago
local ScrollRefresh = function(self, data, offset, total_lines)
4 years ago
local formatToK = Details:GetCurrentToKFunction()
local removeRealm = _detalhes.GetOnlyName
local topValue = data [1] and data [1][2]
for i = 1, ScrollLineAmount do
local index = i + offset
local player = data [index]
if (player) then
local line = self:GetLine (i)
local texture, L, R, T, B = _detalhes:GetPlayerIcon (player[1], PhaseFrame.CurrentSegment)
3 years ago
line.icon:SetTexture(texture)
line.icon:SetTexCoord(L, R, T, B)
line.name:SetText(index .. ". " .. removeRealm (_, player[1]))
line.done:SetText(formatToK (_, player[2]) .. " (" .. format("%.1f", player[2] / topValue * 100) .. "%)")
line.statusbar:SetValue(player[2] / topValue * 100)
local actorClass = Details:GetClass(player[1])
4 years ago
if (actorClass) then
line.statusbar:SetColor (actorClass)
else
line.statusbar:SetColor ("silver")
end
end
end
end
3 years ago
local line_onenter = function(self)
self:SetBackdropColor(unpack(BGColorDefault_Hover))
4 years ago
end
3 years ago
local line_onleave = function(self)
self:SetBackdropColor(unpack(BGColorDefault))
4 years ago
end
3 years ago
local ScrollCreateLine = function(self, index)
local line = CreateFrame("button", "$parentLine" .. index, self,"BackdropTemplate")
line:SetPoint("topleft", self, "topleft", 0, -((index-1)*(ScrollLineHeight+1)))
line:SetSize(ScrollWidth, ScrollLineHeight)
line:SetScript("OnEnter", line_onenter)
line:SetScript("OnLeave", line_onleave)
line:SetScript("OnClick", line_onclick)
4 years ago
3 years ago
line:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
line:SetBackdropColor(unpack(BGColorDefault))
4 years ago
local statusBar = DetailsFrameWork:CreateBar (line, EncounterDetails.Frame.DefaultBarTexture, 1, 1, 100)
3 years ago
statusBar:SetAllPoints(line)
4 years ago
statusBar.backgroundtexture = EncounterDetails.Frame.DefaultBarTexture
statusBar.backgroundcolor = {.3, .3, .3, .3}
3 years ago
local icon = statusBar:CreateTexture("$parentIcon", "overlay")
icon:SetSize(ScrollLineHeight, ScrollLineHeight)
4 years ago
3 years ago
local name = statusBar:CreateFontString("$parentName", "overlay", "GameFontNormal")
_detalhes.gump:SetFontSize(name, 10)
icon:SetPoint("left", line, "left", 2, 0)
name:SetPoint("left", icon, "right", 2, 0)
_detalhes.gump:SetFontColor(name, "white")
4 years ago
3 years ago
local done = statusBar:CreateFontString("$parentDone", "overlay", "GameFontNormal")
_detalhes.gump:SetFontSize(done, 10)
_detalhes.gump:SetFontColor(done, "white")
done:SetPoint("right", line, "right", -2, 0)
4 years ago
line.icon = icon
line.name = name
line.done = done
line.statusbar = statusBar
3 years ago
name:SetHeight(10)
name:SetJustifyH("left")
4 years ago
return line
end
local Damage_Scroll = _detalhes.gump:CreateScrollBox (PhaseFrame, "$parentDamageScroll", ScrollRefresh, PhaseFrame.DamageTable, ScrollWidth, ScrollHeight, ScrollLineAmount, ScrollLineHeight)
local Heal_Scroll = _detalhes.gump:CreateScrollBox (PhaseFrame, "$parentHealScroll", ScrollRefresh, PhaseFrame.HealingTable, ScrollWidth, ScrollHeight, ScrollLineAmount, ScrollLineHeight)
3 years ago
Damage_Scroll:SetPoint("topleft", DamageLabel.widget, "bottomleft", 0, -4)
Heal_Scroll:SetPoint("topleft", HealLabel.widget, "bottomleft", 0, -4)
4 years ago
3 years ago
_detalhes.gump:ReskinSlider(Damage_Scroll, 4)
_detalhes.gump:ReskinSlider(Heal_Scroll, 4)
4 years ago
for i = 1, ScrollLineAmount do
Damage_Scroll:CreateLine (ScrollCreateLine)
end
PhaseFrame.Damage_Scroll = Damage_Scroll
3 years ago
Damage_Scroll:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16})
Damage_Scroll:SetBackdropColor(0, 0, 0, .4)
4 years ago
for i = 1, ScrollLineAmount do
Heal_Scroll:CreateLine (ScrollCreateLine)
end
PhaseFrame.Heal_Scroll = Heal_Scroll
3 years ago
Heal_Scroll:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16})
Heal_Scroll:SetBackdropColor(0, 0, 0, .4)
4 years ago
----------------------------------------------------------
PhaseFrame.PhasesBars = {}
PhaseFrame.PhasesSegmentCompare = {}
3 years ago
local PhaseBarOnEnter = function(self)
4 years ago
PhaseFrame:UpdateSegmentCompareBars (self.phase)
3 years ago
self:SetBackdropColor(unpack(BGColorDefault_Hover))
4 years ago
end
3 years ago
local PhaseBarOnLeave = function(self)
4 years ago
PhaseFrame:ClearSegmentCompareBars()
3 years ago
self:SetBackdropColor(unpack(BGColorDefault))
4 years ago
end
3 years ago
local PhaseBarOnClick = function(self)
4 years ago
--report
end
--cria as linhas mostrando o tempo decorride de cada phase
for i = 1, 10 do
3 years ago
local line = CreateFrame("button", "$parentPhaseBar" .. i, PhaseFrame,"BackdropTemplate")
line:SetPoint("topleft", PhaseTimersLabel.widget, "bottomleft", 0, -((i-1)*(31)) - 4)
line:SetSize(175, 30)
line:SetScript("OnEnter", PhaseBarOnEnter)
line:SetScript("OnLeave", PhaseBarOnLeave)
line:SetScript("OnClick", PhaseBarOnClick)
line:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
line:SetBackdropColor(unpack(BGColorDefault))
local icon = line:CreateTexture("$parentIcon", "overlay")
icon:SetSize(16, 16)
icon:SetTexture([[Interface\AddOns\Details\images\clock]])
local name = line:CreateFontString("$parentName", "overlay", "GameFontNormal")
_detalhes.gump:SetFontSize(name, 10)
local done = line:CreateFontString("$parentDone", "overlay", "GameFontNormal")
_detalhes.gump:SetFontSize(done, 10)
icon:SetPoint("left", line, "left", 2, 0)
name:SetPoint("left", icon, "right", 2, 0)
done:SetPoint("right", line, "right", -3, 0)
4 years ago
line.icon = icon
line.name = name
line.done = done
3 years ago
name:SetHeight(10)
name:SetJustifyH("left")
4 years ago
3 years ago
tinsert(PhaseFrame.PhasesBars, line)
4 years ago
end
--cria a linha do segmento para a compara��o, � o que fica na parte direita da tela
--ele � acessado para mostrar quando passar o mouse sobre uma das barras de phase
for i = 1, 20 do
3 years ago
local line = CreateFrame("button", "$parentSegmentCompareBar" .. i, PhaseFrame,"BackdropTemplate")
line:SetPoint("topleft", PhaseTimersLabel.widget, "bottomleft", 175+10, -((i-1)*(ScrollLineHeight+1)) - 4)
line:SetSize(150, ScrollLineHeight)
4 years ago
3 years ago
line:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
line:SetBackdropColor(unpack(BGColorDefault))
4 years ago
line:Hide()
3 years ago
local name = line:CreateFontString("$parentName", "overlay", "GameFontNormal")
_detalhes.gump:SetFontSize(name, 9)
name:SetPoint("left", line, "left", 2, 0)
4 years ago
3 years ago
local done = line:CreateFontString("$parentDone", "overlay", "GameFontNormal")
_detalhes.gump:SetFontSize(done, 9)
done:SetPoint("right", line, "right", -2, 0)
4 years ago
line.name = name
line.done = done
3 years ago
name:SetHeight(10)
name:SetJustifyH("left")
4 years ago
3 years ago
tinsert(PhaseFrame.PhasesSegmentCompare, line)
4 years ago
end
function PhaseFrame:ClearPhaseBars()
for i = 1, #PhaseFrame.PhasesBars do
local bar = PhaseFrame.PhasesBars[i]
3 years ago
bar.name:SetText("")
bar.done:SetText("")
4 years ago
bar.phase = nil
bar:Hide()
end
end
function PhaseFrame:ClearSegmentCompareBars()
for i = 1, #PhaseFrame.PhasesSegmentCompare do
PhaseFrame.PhasesSegmentCompare[i]:Hide()
end
end
function PhaseFrame:GetPhaseTimers (segment, ordered)
local t = {}
segment = segment or PhaseFrame.CurrentSegment
for phaseIT = 1, #segment.PhaseData do
3 years ago
local phase, startAt = unpack(segment.PhaseData [phaseIT]) --phase iterator
4 years ago
local endAt = segment.PhaseData [phaseIT+1] and segment.PhaseData [phaseIT+1][2] or segment:GetCombatTime()
local elapsed = endAt - startAt
t [phase] = (t [phase] or 0) + elapsed
end
if (ordered) then
local order = {}
3 years ago
for phase, _ in pairs(t) do
tinsert(order, phase)
4 years ago
end
3 years ago
table.sort (order, function(a, b) return a < b end)
4 years ago
return order, t
end
return t
end
--executa quando atualizar o segment geral
function PhaseFrame:UpdatePhaseBars()
local timers, hash = PhaseFrame:GetPhaseTimers (PhaseFrame.CurrentSegment, true)
local i = 1
3 years ago
for index, phase in ipairs(timers) do
4 years ago
local timer = hash [phase]
3 years ago
PhaseFrame.PhasesBars [i].name:SetText("|cFFC0C0C0Phase:|r |cFFFFFFFF" .. phase)
PhaseFrame.PhasesBars [i].done:SetText(_detalhes.gump:IntegerToTimer(timer))
4 years ago
PhaseFrame.PhasesBars [i].phase = phase
PhaseFrame.PhasesBars [i]:Show()
i = i + 1
end
end
--executa quando passar o mouse sobre uma bnarra de phase
function PhaseFrame:UpdateSegmentCompareBars (phase)
--segmento atual (numero)
local segmentNumber = EncounterDetails._segment
local segmentTable = PhaseFrame.CurrentSegment
local bossID = segmentTable:GetBossInfo() and segmentTable:GetBossInfo().id
local index = 1
3 years ago
for i, segment in ipairs(_detalhes:GetCombatSegments()) do
4 years ago
if (segment:GetBossInfo() and segment:GetBossInfo().id == bossID) then
local bar = PhaseFrame.PhasesSegmentCompare [index]
local timers = PhaseFrame:GetPhaseTimers (segment)
if (timers [phase]) then
if (segment ~= segmentTable) then
3 years ago
bar.name:SetText("Segment " .. i .. ":")
_detalhes.gump:SetFontColor(bar.name, "orange")
bar.done:SetText(_detalhes.gump:IntegerToTimer(timers [phase]))
_detalhes.gump:SetFontColor(bar.done, "orange")
4 years ago
else
3 years ago
bar.name:SetText("Segment " .. i .. ":")
_detalhes.gump:SetFontColor(bar.name, "white")
bar.done:SetText(_detalhes.gump:IntegerToTimer(timers [phase]))
_detalhes.gump:SetFontColor(bar.done, "white")
4 years ago
end
else
3 years ago
bar.name:SetText("Segment " .. i .. ":")
_detalhes.gump:SetFontColor(bar.name, "red")
bar.done:SetText("--x--x--")
4 years ago
end
bar:Show()
index = index + 1
end
end
end
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
local frame = BossFrame
local mouse_down = function()
--frame:StartMoving()
--frame.isMoving = true
end
local mouse_up = function()
if (frame.isMoving) then
-- frame:StopMovingOrSizing()
-- frame.isMoving = false
end
end
local backdrop = {edgeFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, edgeSize = 1, insets = {left = 1, right = 1, top = 0, bottom = 1}}
3 years ago
--Selecionar o segmento
4 years ago
3 years ago
local buildSegmentosMenu = function(self)
4 years ago
local historico = _detalhes.tabela_historico.tabelas
local return_table = {}
3 years ago
for index, combate in ipairs(historico) do
4 years ago
if (combate.is_boss and combate.is_boss.index) then
local l, r, t, b, icon = _detalhes:GetBossIcon (combate.is_boss.mapid, combate.is_boss.index)
return_table [#return_table+1] = {value = index, label = "#" .. index .. " " .. combate.is_boss.name, icon = icon, texcoord = {l, r, t, b}, onclick = EncounterDetails.OpenAndRefresh}
end
end
return return_table
end
3 years ago
local segmentos_string = DetailsFrameWork:NewLabel(frame, nil, nil, "segmentosString", "Segment:", "GameFontNormal", 12)
segmentos_string:SetPoint("bottomleft", frame, "bottomleft", 20, 16)
4 years ago
-- ~dropdown
local segmentos = DetailsFrameWork:NewDropDown (frame, _, "$parentSegmentsDropdown", "segmentosDropdown", 160, 20, buildSegmentosMenu, nil)
3 years ago
segmentos:SetPoint("left", segmentos_string, "right", 2, 0)
segmentos:SetTemplate(DetailsFrameWork:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE"))
4 years ago
3 years ago
--options button
local options = DetailsFrameWork:NewButton(frame, nil, "$parentOptionsButton", "OptionsButton", 120, 20, EncounterDetails.OpenOptionsPanel, nil, nil, nil, "Options")
options:SetPoint("left", segmentos, "right", 10, 0)
options:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE"))
4 years ago
options:SetIcon ([[Interface\Buttons\UI-OptionsButton]], 14, 14, nil, {0, 1, 0, 1}, nil, 3)
3 years ago
--macro box
BossFrame.MacroEditBox = DetailsFrameWork:CreateTextEntry(frame, function()end, 300, 20)
BossFrame.MacroEditBox:SetPoint("left", options, "right", 10, 0)
BossFrame.MacroEditBox:SetAlpha(0.5)
BossFrame.MacroEditBox:SetText("/run Details:OpenPlugin ('Encounter Breakdown')")
BossFrame.MacroEditBox:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE"))
BossFrame.MacroEditBox:SetSize(360, 20)
4 years ago
BossFrame.MacroEditBox:HookScript ("OnEditFocusGained", function()
3 years ago
C_Timer.After(0, function() BossFrame.MacroEditBox:HighlightText() end)
4 years ago
end)
3 years ago
BossFrame.MacroEditBox.BackgroundLabel = DetailsFrameWork:CreateLabel(BossFrame.MacroEditBox, "macro")
BossFrame.MacroEditBox.BackgroundLabel:SetPoint("left", BossFrame.MacroEditBox, "left", 6, 0)
BossFrame.MacroEditBox.BackgroundLabel:SetTextColor(.3, .3, .3, .98)
4 years ago
3 years ago
--Caixa do Dano total tomado pela Raid
4 years ago
-- ~containers ~damagetaken
local CONST_BOX_HEIGHT = 220
local CONST_BOX_VERTICAL_SPACING = -26
local CONST_BOX_HORIZONTAL_SPACING = 42
local BOX_WIDTH = 250
local BOX_HEIGHT = CONST_BOX_HEIGHT --232
local BOX_HEIGHT_UPPER = CONST_BOX_HEIGHT --175
3 years ago
local container_damagetaken_window = CreateFrame("ScrollFrame", "Details_Boss_ContainerDamageTaken", frame,"BackdropTemplate")
4 years ago
set_backdrop (container_damagetaken_window)
3 years ago
local container_damagetaken_frame = CreateFrame("Frame", "Details_Boss_FrameDamageTaken", container_damagetaken_window,"BackdropTemplate")
4 years ago
frame.Widgets [#frame.Widgets+1] = container_damagetaken_window
3 years ago
container_damagetaken_frame:SetScript("OnMouseDown", mouse_down)
container_damagetaken_frame:SetScript("OnMouseUp", mouse_up)
4 years ago
container_damagetaken_frame.barras = {}
--label titulo & background
3 years ago
local dano_recebido_bg = CreateFrame("Frame", nil, frame, "BackdropTemplate")
dano_recebido_bg:SetWidth(BOX_WIDTH)
dano_recebido_bg:SetHeight(16)
dano_recebido_bg:EnableMouse(true)
dano_recebido_bg:SetResizable(false)
dano_recebido_bg:SetPoint("topleft", frame, "topleft", 10, -78)
4 years ago
frame.Widgets [#frame.Widgets+1] = dano_recebido_bg
3 years ago
DetailsFrameWork:NewLabel(dano_recebido_bg, dano_recebido_bg, nil, "damagetaken_title", "Damage Taken per Player", "GameFontHighlight") --localize-me
dano_recebido_bg.damagetaken_title:SetPoint("BOTTOMLEFT", container_damagetaken_window, "TOPLEFT", 5, 1)
4 years ago
3 years ago
container_damagetaken_frame:SetBackdrop(backdrop)
container_damagetaken_frame:SetBackdropBorderColor(0,0,0,0)
container_damagetaken_frame:SetBackdropColor(0, 0, 0, 0.6)
4 years ago
3 years ago
container_damagetaken_frame:SetAllPoints(container_damagetaken_window)
container_damagetaken_frame:SetWidth(BOX_WIDTH)
container_damagetaken_frame:SetHeight(BOX_HEIGHT)
container_damagetaken_frame:EnableMouse(true)
container_damagetaken_frame:SetResizable(false)
container_damagetaken_frame:SetMovable(true)
4 years ago
3 years ago
container_damagetaken_window:SetWidth(BOX_WIDTH)
container_damagetaken_window:SetHeight(BOX_HEIGHT)
4 years ago
container_damagetaken_window:SetScrollChild (container_damagetaken_frame)
3 years ago
container_damagetaken_window:SetPoint("TOPLEFT", frame, "TOPLEFT", 10, -92)
4 years ago
DetailsFrameWork:NewScrollBar (container_damagetaken_window, container_damagetaken_frame, 4, -16)
container_damagetaken_window.slider:Altura (BOX_HEIGHT - 31)
container_damagetaken_window.slider:cimaPoint (0, 1)
container_damagetaken_window.slider:baixoPoint (0, -1)
container_damagetaken_frame.slider = container_damagetaken_window.slider
3 years ago
_detalhes.gump:ReskinSlider(container_damagetaken_window)
4 years ago
container_damagetaken_window.gump = container_damagetaken_frame
container_damagetaken_frame.window = container_damagetaken_window
container_damagetaken_window.ultimo = 0
frame.overall_damagetaken = container_damagetaken_window
3 years ago
--Caixa das Habilidades do boss
4 years ago
--~ability ~damage taken by spell
3 years ago
local container_habilidades_window = CreateFrame("ScrollFrame", "Details_Boss_ContainerHabilidades", frame,"BackdropTemplate")
4 years ago
set_backdrop (container_habilidades_window)
3 years ago
local container_habilidades_frame = CreateFrame("Frame", "Details_Boss_FrameHabilidades", container_habilidades_window,"BackdropTemplate")
container_habilidades_frame:SetScript("OnMouseDown", mouse_down)
container_habilidades_frame:SetScript("OnMouseUp", mouse_up)
4 years ago
container_habilidades_frame.barras = {}
--label titulo % background
3 years ago
local habilidades_inimigas_bg = CreateFrame("Frame", nil, frame, "BackdropTemplate")
habilidades_inimigas_bg:SetWidth(BOX_WIDTH)
habilidades_inimigas_bg:SetHeight(16)
habilidades_inimigas_bg:EnableMouse(true)
habilidades_inimigas_bg:SetResizable(false)
habilidades_inimigas_bg:SetPoint("topleft", frame, "topleft", 10, -276)
4 years ago
frame.Widgets [#frame.Widgets+1] = habilidades_inimigas_bg
frame.Widgets [#frame.Widgets+1] = container_habilidades_window
frame.Widgets [#frame.Widgets+1] = container_habilidades_frame
3 years ago
DetailsFrameWork:NewLabel(habilidades_inimigas_bg, habilidades_inimigas_bg, nil, "habilidades_title", "Damage Taken by Spell", "GameFontHighlight") --localize-me
habilidades_inimigas_bg.habilidades_title:SetPoint("BOTTOMLEFT", container_habilidades_window, "TOPLEFT", 5, 1)
4 years ago
3 years ago
container_habilidades_frame:SetBackdrop(backdrop)
container_habilidades_frame:SetBackdropBorderColor(0,0,0,0)
container_habilidades_frame:SetBackdropColor(0, 0, 0, 0.6)
4 years ago
3 years ago
container_habilidades_frame:SetAllPoints(container_habilidades_window)
container_habilidades_frame:SetWidth(BOX_WIDTH)
container_habilidades_frame:SetHeight(BOX_HEIGHT)
container_habilidades_frame:EnableMouse(true)
container_habilidades_frame:SetResizable(false)
container_habilidades_frame:SetMovable(true)
4 years ago
3 years ago
container_habilidades_window:SetWidth(BOX_WIDTH)
container_habilidades_window:SetHeight(BOX_HEIGHT)
4 years ago
container_habilidades_window:SetScrollChild (container_habilidades_frame)
3 years ago
container_habilidades_window:SetPoint("TOPLEFT", container_damagetaken_window, "bottomleft", 0, CONST_BOX_VERTICAL_SPACING) --LOCATION
4 years ago
DetailsFrameWork:NewScrollBar (container_habilidades_window, container_habilidades_frame, 4, -16)
container_habilidades_window.slider:Altura (BOX_HEIGHT-31)
container_habilidades_window.slider:cimaPoint (0, 1)
container_habilidades_window.slider:baixoPoint (0, -1)
container_habilidades_frame.slider = container_habilidades_window.slider
3 years ago
_detalhes.gump:ReskinSlider(container_habilidades_window)
4 years ago
container_habilidades_window.gump = container_habilidades_frame
container_habilidades_frame.window = container_habilidades_window
container_habilidades_window.ultimo = 0
frame.overall_habilidades = container_habilidades_window
3 years ago
--Caixa dos Adds
4 years ago
-- ~adds �dds
local BOX_WIDTH = 270
local BOX_HEIGHT = CONST_BOX_HEIGHT --173
3 years ago
local container_adds_window = CreateFrame("ScrollFrame", "Details_Boss_ContainerAdds", frame,"BackdropTemplate")
4 years ago
set_backdrop (container_adds_window)
3 years ago
local container_adds_frame = CreateFrame("Frame", "Details_Boss_FrameAdds", container_adds_window, "BackdropTemplate")
4 years ago
frame.Widgets [#frame.Widgets+1] = container_adds_frame
frame.Widgets [#frame.Widgets+1] = container_adds_window
container_adds_frame.barras = {}
3 years ago
local adds_total_string = DetailsFrameWork:CreateLabel(container_adds_window, "damage taken")
4 years ago
adds_total_string.textcolor = "gray"
adds_total_string.textsize = 9
3 years ago
adds_total_string:SetPoint("bottomright", container_adds_window, "topright", 0, 3)
4 years ago
3 years ago
container_adds_frame:SetAllPoints(container_adds_window)
container_adds_frame:SetWidth(BOX_WIDTH)
container_adds_frame:SetHeight(BOX_HEIGHT)
container_adds_frame:EnableMouse(true)
container_adds_frame:SetResizable(false)
container_adds_frame:SetMovable(true)
4 years ago
3 years ago
container_adds_window:SetWidth(BOX_WIDTH)
container_adds_window:SetHeight(BOX_HEIGHT_UPPER)
4 years ago
container_adds_window:SetScrollChild (container_adds_frame)
3 years ago
container_adds_window:SetPoint("TOPLEFT", container_damagetaken_window, "topright", CONST_BOX_HORIZONTAL_SPACING, 0)
4 years ago
3 years ago
DetailsFrameWork:NewLabel(container_adds_window, container_adds_window, nil, "titulo", "Enemy Damage Taken", "GameFontHighlight")
container_adds_window.titulo:SetPoint("bottomleft", container_adds_window, "topleft", 0, 1)
4 years ago
DetailsFrameWork:NewScrollBar (container_adds_window, container_adds_frame, 4, -16)
container_adds_window.slider:Altura (BOX_HEIGHT - 31)
container_adds_window.slider:cimaPoint (0, 1)
container_adds_window.slider:baixoPoint (0, -1)
container_adds_frame.slider = container_adds_window.slider
3 years ago
_detalhes.gump:ReskinSlider(container_adds_window)
4 years ago
container_adds_window.gump = container_adds_frame
container_adds_frame.window = container_adds_window
container_adds_window.ultimo = 0
frame.overall_adds = container_adds_window
3 years ago
--Caixa dos interrupts (kicks)
4 years ago
-- ~interrupt
3 years ago
local container_interrupt_window = CreateFrame("ScrollFrame", "Details_Boss_Containerinterrupt", frame,"BackdropTemplate")
4 years ago
set_backdrop (container_interrupt_window)
3 years ago
local container_interrupt_frame = CreateFrame("Frame", "Details_Boss_Frameinterrupt", container_interrupt_window, "BackdropTemplate")
4 years ago
3 years ago
local interrupt_total_string = DetailsFrameWork:CreateLabel(container_interrupt_window, "interrupts / casts")
4 years ago
interrupt_total_string.textcolor = "gray"
interrupt_total_string.textsize = 9
3 years ago
interrupt_total_string:SetPoint("bottomright", container_interrupt_window, "topright", 0, 3)
4 years ago
frame.Widgets [#frame.Widgets+1] = container_interrupt_window
frame.Widgets [#frame.Widgets+1] = container_interrupt_frame
3 years ago
container_interrupt_frame:SetScript("OnMouseDown", mouse_down)
container_interrupt_frame:SetScript("OnMouseUp", mouse_up)
4 years ago
container_interrupt_frame.barras = {}
3 years ago
container_interrupt_frame:SetAllPoints(container_interrupt_window)
container_interrupt_frame:SetWidth(BOX_WIDTH)
container_interrupt_frame:SetHeight(BOX_HEIGHT)
container_interrupt_frame:EnableMouse(true)
container_interrupt_frame:SetResizable(false)
container_interrupt_frame:SetMovable(true)
4 years ago
3 years ago
container_interrupt_window:SetWidth(BOX_WIDTH)
container_interrupt_window:SetHeight(BOX_HEIGHT_UPPER)
4 years ago
container_interrupt_window:SetScrollChild (container_interrupt_frame)
3 years ago
container_interrupt_window:SetPoint("TOPLEFT", container_adds_window, "TOPRIGHT", CONST_BOX_HORIZONTAL_SPACING, 0)
4 years ago
3 years ago
DetailsFrameWork:NewLabel(container_interrupt_window, container_interrupt_window, nil, "titulo", Loc ["STRING_INTERRUPTS"], "GameFontHighlight")
container_interrupt_window.titulo:SetPoint("bottomleft", container_interrupt_window, "topleft", 0, 1)
4 years ago
DetailsFrameWork:NewScrollBar (container_interrupt_window, container_interrupt_frame, 4, -16)
container_interrupt_window.slider:Altura (BOX_HEIGHT-31)
container_interrupt_window.slider:cimaPoint (0, 1)
container_interrupt_window.slider:baixoPoint (0, -1)
container_interrupt_frame.slider = container_interrupt_window.slider
3 years ago
_detalhes.gump:ReskinSlider(container_interrupt_window)
4 years ago
container_interrupt_window.gump = container_interrupt_frame
container_interrupt_frame.window = container_interrupt_window
container_interrupt_window.ultimo = 0
frame.overall_interrupt = container_interrupt_window
3 years ago
--Caixa dos Dispells
4 years ago
-- ~dispel
3 years ago
local container_dispell_window = CreateFrame("ScrollFrame", "Details_Boss_Containerdispell", frame,"BackdropTemplate")
4 years ago
set_backdrop (container_dispell_window)
3 years ago
local container_dispell_frame = CreateFrame("Frame", "Details_Boss_Framedispell", container_dispell_window, "BackdropTemplate")
4 years ago
3 years ago
local dispell_total_string = DetailsFrameWork:CreateLabel(container_dispell_window, "total dispels")
4 years ago
dispell_total_string.textcolor = "gray"
dispell_total_string.textsize = 9
3 years ago
dispell_total_string:SetPoint("bottomright", container_dispell_window, "topright", 0, 3)
4 years ago
frame.Widgets [#frame.Widgets+1] = container_dispell_window
frame.Widgets [#frame.Widgets+1] = container_dispell_frame
3 years ago
container_dispell_frame:SetScript("OnMouseDown", mouse_down)
container_dispell_frame:SetScript("OnMouseUp", mouse_up)
4 years ago
container_dispell_frame.barras = {}
3 years ago
container_dispell_frame:SetAllPoints(container_dispell_window)
container_dispell_frame:SetWidth(BOX_WIDTH)
container_dispell_frame:SetHeight(BOX_HEIGHT)
container_dispell_frame:EnableMouse(true)
container_dispell_frame:SetResizable(false)
container_dispell_frame:SetMovable(true)
4 years ago
3 years ago
container_dispell_window:SetWidth(BOX_WIDTH)
container_dispell_window:SetHeight(BOX_HEIGHT_UPPER)
4 years ago
container_dispell_window:SetScrollChild (container_dispell_frame)
3 years ago
container_dispell_window:SetPoint("TOPLEFT", container_adds_window, "BOTTOMLEFT", 0, CONST_BOX_VERTICAL_SPACING)
4 years ago
3 years ago
DetailsFrameWork:NewLabel(container_dispell_window, container_dispell_window, nil, "titulo", Loc ["STRING_DISPELLS"], "GameFontHighlight")
container_dispell_window.titulo:SetPoint("bottomleft", container_dispell_window, "topleft", 0, 1)
4 years ago
DetailsFrameWork:NewScrollBar (container_dispell_window, container_dispell_frame, 4, -16)
container_dispell_window.slider:Altura (BOX_HEIGHT-31)
container_dispell_window.slider:cimaPoint (0, 1)
container_dispell_window.slider:baixoPoint (0, -1)
container_dispell_frame.slider = container_dispell_window.slider
3 years ago
_detalhes.gump:ReskinSlider(container_dispell_window)
4 years ago
container_dispell_window.gump = container_dispell_frame
container_dispell_frame.window = container_dispell_window
container_dispell_window.ultimo = 0
frame.overall_dispell = container_dispell_window
3 years ago
--Caixa das mortes
4 years ago
-- ~mortes ~deaths ~dead
3 years ago
local container_dead_window = CreateFrame("ScrollFrame", "Details_Boss_ContainerDead", frame,"BackdropTemplate")
4 years ago
set_backdrop (container_dead_window)
3 years ago
local container_dead_frame = CreateFrame("Frame", "Details_Boss_FrameDead", container_dead_window, "BackdropTemplate")
4 years ago
3 years ago
local dead_total_string = DetailsFrameWork:CreateLabel(container_dead_window, "time of death")
4 years ago
dead_total_string.textcolor = "gray"
dead_total_string.textsize = 9
3 years ago
dead_total_string:SetPoint("bottomright", container_dead_window, "topright", 0, 3)
4 years ago
frame.Widgets [#frame.Widgets+1] = container_dead_window
frame.Widgets [#frame.Widgets+1] = container_dead_frame
3 years ago
container_dead_frame:SetScript("OnMouseDown", mouse_down)
container_dead_frame:SetScript("OnMouseUp", mouse_up)
4 years ago
container_dead_frame.barras = {}
3 years ago
container_dead_frame:SetPoint("left", container_dead_window, "left")
container_dead_frame:SetPoint("right", container_dead_window, "right")
container_dead_frame:SetPoint("top", container_dead_window, "top")
container_dead_frame:SetPoint("bottom", container_dead_window, "bottom", 0, 10)
4 years ago
3 years ago
container_dead_frame:SetWidth(BOX_WIDTH)
container_dead_frame:SetHeight(BOX_HEIGHT)
4 years ago
3 years ago
container_dead_frame:EnableMouse(true)
container_dead_frame:SetResizable(false)
container_dead_frame:SetMovable(true)
4 years ago
3 years ago
container_dead_window:SetWidth(BOX_WIDTH)
container_dead_window:SetHeight(BOX_HEIGHT_UPPER)
4 years ago
container_dead_window:SetScrollChild (container_dead_frame)
3 years ago
container_dead_window:SetPoint("TOPLEFT", container_dispell_window, "TOPRIGHT", CONST_BOX_HORIZONTAL_SPACING, 0)
4 years ago
3 years ago
DetailsFrameWork:NewLabel(container_dead_window, container_dead_window, nil, "titulo", Loc ["STRING_DEATH_LOG"], "GameFontHighlight")
container_dead_window.titulo:SetPoint("bottomleft", container_dead_window, "topleft", 0, 1)
4 years ago
DetailsFrameWork:NewScrollBar (container_dead_window, container_dead_frame, 4, -16)
container_dead_window.slider:Altura (BOX_HEIGHT-31)
container_dead_window.slider:cimaPoint (0, 1)
container_dead_window.slider:baixoPoint (0, -1)
container_dead_frame.slider = container_dead_window.slider
3 years ago
_detalhes.gump:ReskinSlider(container_dead_window)
4 years ago
container_dead_window.gump = container_dead_frame
container_dead_frame.window = container_dead_window
container_dead_window.ultimo = 0
frame.overall_dead = container_dead_window
--emotes frame
3 years ago
local emote_frame = CreateFrame("frame", "DetailsEncountersEmoteFrame", UIParent, "BackdropTemplate")
4 years ago
emote_frame:RegisterEvent ("CHAT_MSG_RAID_BOSS_EMOTE")
emote_frame:RegisterEvent ("CHAT_MSG_RAID_BOSS_WHISPER")
emote_frame:RegisterEvent ("CHAT_MSG_MONSTER_EMOTE")
emote_frame:RegisterEvent ("CHAT_MSG_MONSTER_SAY")
emote_frame:RegisterEvent ("CHAT_MSG_MONSTER_WHISPER")
emote_frame:RegisterEvent ("CHAT_MSG_MONSTER_PARTY")
emote_frame:RegisterEvent ("CHAT_MSG_MONSTER_YELL")
local emote_table = {
["CHAT_MSG_RAID_BOSS_EMOTE"] = 1,
["CHAT_MSG_RAID_BOSS_WHISPER"] = 2,
["CHAT_MSG_MONSTER_EMOTE"] = 3,
["CHAT_MSG_MONSTER_SAY"] = 4,
["CHAT_MSG_MONSTER_WHISPER"] = 5,
["CHAT_MSG_MONSTER_PARTY"] = 6,
["CHAT_MSG_MONSTER_YELL"] = 7,
}
3 years ago
emote_frame:SetScript("OnEvent", function(...)
4 years ago
if (not EncounterDetails.current_whisper_table) then
return
end
3 years ago
local combat = EncounterDetails:GetCombat("current")
4 years ago
--local arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 = ...
3 years ago
--print("2 =", arg2, "3 =", arg3, "4 =", arg4, "5 =", arg5, "6 =", arg6, "7 =", arg7, "8 =", arg8, "9 =", arg9)
4 years ago
if (combat and EncounterDetails:IsInCombat() and EncounterDetails:GetZoneType() == "raid") then
local arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 = ...
3 years ago
tinsert(EncounterDetails.current_whisper_table, {combat:GetCombatTime(), arg3, arg4, emote_table [arg2]})
4 years ago
end
end)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
end
end
--endd