diff --git a/plugins/Details_EncounterDetails/frames.lua b/plugins/Details_EncounterDetails/frames.lua index acf8caf6..170c5f6d 100644 --- a/plugins/Details_EncounterDetails/frames.lua +++ b/plugins/Details_EncounterDetails/frames.lua @@ -1,10 +1,10 @@ do local _detalhes = _G._detalhes local DetailsFrameWork = _detalhes.gump - local AceLocale = LibStub("AceLocale-3.0") + local AceLocale = LibStub ("AceLocale-3.0") local Loc = AceLocale:GetLocale ("Details_EncounterDetails") local Graphics = LibStub:GetLibrary("LibGraph-2.0") - local ipairs = ipairs + local _ipairs = ipairs local _math_floor = math.floor local _cstr = string.format local _GetSpellInfo = _detalhes.getspellinfo @@ -36,30 +36,30 @@ do backdropbordercolor = {.9, .7, 0, 1}, } - 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) + 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) 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} -_detalhes.EncounterDetailsTempWindow = function(EncounterDetails) +_detalhes.EncounterDetailsTempWindow = function (EncounterDetails) - --options panel + --> options panel - EncounterDetails.SetBarBackdrop_OnEnter = function(self) - self:SetBackdropColor(unpack(BGColorDefault_Hover)) + EncounterDetails.SetBarBackdrop_OnEnter = function (self) + self:SetBackdropColor (unpack (BGColorDefault_Hover)) end - EncounterDetails.SetBarBackdrop_OnLeave = function(self) - self:SetBackdropColor(unpack(BGColorDefault)) + EncounterDetails.SetBarBackdrop_OnLeave = function (self) + self:SetBackdropColor (unpack (BGColorDefault)) end function EncounterDetails:AutoShowIcon() local found_boss = false - for _, combat in ipairs(EncounterDetails:GetCombatSegments()) do + for _, combat in ipairs (EncounterDetails:GetCombatSegments()) do if (combat.is_boss) then EncounterDetails:ShowIcon() found_boss = true @@ -84,7 +84,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) -- 4 = always show -- 5 = automatic show when have at least 1 encounter with boss - local set = function(_, _, value) + local set = function (_, _, value) EncounterDetails.db.show_icon = value if (value == 1) then if (EncounterDetails:GetZoneType() == "raid") then @@ -131,14 +131,14 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) { type = "toggle", get = function() return EncounterDetails.db.hide_on_combat end, - set = function(self, fixedparam, value) EncounterDetails.db.hide_on_combat = value end, + set = function (self, fixedparam, value) EncounterDetails.db.hide_on_combat = value end, 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, - set = function(self, fixedparam, value) EncounterDetails.db.max_emote_segments = value end, + set = function (self, fixedparam, value) EncounterDetails.db.max_emote_segments = value end, min = 1, max = 10, step = 1, @@ -149,7 +149,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) { type = "range", get = function() return EncounterDetails.db.window_scale end, - set = function(self, fixedparam, value) EncounterDetails.db.window_scale = value; EncounterDetails:RefreshScale() end, + set = function (self, fixedparam, value) EncounterDetails.db.window_scale = value; EncounterDetails:RefreshScale() end, min = 0.65, max = 1.50, step = 0.1, @@ -174,72 +174,72 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) function EncounterDetails:RefreshScale() local scale = EncounterDetails.db.window_scale if (EncounterDetails.Frame) then - EncounterDetails.Frame:SetScale(scale) + EncounterDetails.Frame:SetScale (scale) end end function EncounterDetails:CreateRowTexture (row) - row.textura = CreateFrame("StatusBar", nil, row, "BackdropTemplate") - row.textura:SetAllPoints(row) - local t = row.textura:CreateTexture(nil, "overlay") - t:SetTexture(EncounterDetails.Frame.DefaultBarTexture) + row.textura = CreateFrame ("StatusBar", nil, row, "BackdropTemplate") + row.textura:SetAllPoints (row) + local t = row.textura:CreateTexture (nil, "overlay") + t:SetTexture (EncounterDetails.Frame.DefaultBarTexture) row.t = t - row.textura:SetStatusBarTexture(t) - row.textura:SetStatusBarColor(.5, .5, .5, 0) - row.textura:SetMinMaxValues(0,100) + row.textura:SetStatusBarTexture (t) + row.textura:SetStatusBarColor (.5, .5, .5, 0) + row.textura:SetMinMaxValues (0,100) - 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) + 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) - 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) + 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) row.textura:Show() end function EncounterDetails:CreateRow (index, container, x_mod, y_mod, width_mod) - local barra = CreateFrame("Button", "Details_"..container:GetName().."_barra_"..index, container,"BackdropTemplate") + local barra = CreateFrame ("Button", "Details_"..container:GetName().."_barra_"..index, container,"BackdropTemplate") x_mod = x_mod or 0 width_mod = width_mod or 0 local default_height = EncounterDetails.Frame.DefaultBarHeight - barra:SetWidth(200 + width_mod) --tamanho da barra de acordo com o tamanho da janela - barra:SetHeight(default_height) --altura determinada pela inst�ncia + barra:SetWidth (200 + width_mod) --> tamanho da barra de acordo com o tamanho da janela + barra:SetHeight (default_height) --> altura determinada pela inst�ncia local y = (index-1)*(default_height + 1) y_mod = y_mod or 0 y = y + y_mod - y = y*-1 --baixo + y = y*-1 --> baixo - 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) + 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) - barra:EnableMouse(true) + barra:EnableMouse (true) barra:RegisterForClicks ("LeftButtonDown","RightButtonUp") EncounterDetails:CreateRowTexture (barra) - barra:SetBackdrop(BackdropDefault) + barra:SetBackdrop (BackdropDefault) EncounterDetails.SetBarBackdrop_OnLeave (barra) - --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) + --> 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) - barra:SetAlpha(0.9) - barra.icone:SetAlpha(0.8) + barra:SetAlpha (0.9) + barra.icone:SetAlpha (0.8) EncounterDetails:SetRowScripts (barra, index, container) @@ -252,12 +252,12 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) barras_total = barras_total or 6 if (amt >= barras_total and container.ultimo ~= amt) then local tamanho = (EncounterDetails.Frame.DefaultBarHeight + 1) * amt - container:SetHeight(tamanho) + container:SetHeight (tamanho) container.window.slider:Update() container.window.ultimo = amt elseif (amt <= barras_total-1 and container.slider.ativo) then container.window.slider:Update (true) - container:SetHeight(140) + container:SetHeight (140) container.window.scroll_ativo = false container.window.ultimo = 0 end @@ -293,11 +293,11 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) end g:ResetData() - local combat = EncounterDetails:GetCombat(segment) + local combat = EncounterDetails:GetCombat (segment) local graphicData = combat:GetTimeData ("Raid Damage Done") if (not graphicData or not combat.start_time or not combat.end_time) then - EncounterDetails:Msg("This segment doesn't have chart data.") + EncounterDetails:Msg ("This segment doesn't have chart data.") return --elseif (EncounterDetails.CombatsAlreadyDrew [combat:GetCombatNumber()]) then --return @@ -307,7 +307,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) return end - --battle time + --> battle time if (combat.end_time - combat.start_time < 12) then return end @@ -321,7 +321,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) g.max_damage = 0 - for _, line in ipairs(g.VerticalLines) do + for _, line in ipairs (g.VerticalLines) do line:Hide() end @@ -332,7 +332,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) return end for i = segment + 4, segment+1, -1 do - local combat = EncounterDetails:GetCombat(i) + local combat = EncounterDetails:GetCombat (i) if (combat) then --the combat exists local elapsed_time = combat:GetCombatTime() @@ -368,18 +368,18 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) local start_at = phase_data[i][2] local texture = g:GetPhaseTexture (i, phase) - texture:SetPoint("bottomleft", g, "bottomleft", (start_at * scale) + 58, 0) + texture:SetPoint ("bottomleft", g, "bottomleft", (start_at * scale) + 58, 0) 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 - texture:SetWidth(scale * duration) + texture:SetWidth (scale * duration) texture.elapsed = duration else local duration = combat:GetCombatTime() - start_at - texture:SetWidth(scale * duration) + texture:SetWidth (scale * duration) texture.elapsed = duration end end @@ -404,26 +404,26 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) local scaleW = 1/670 local content = graphicData - tinsert(content, 1, 0) - tinsert(content, 1, 0) - tinsert(content, #content+1, 0) - tinsert(content, #content+1, 0) + tinsert (content, 1, 0) + tinsert (content, 1, 0) + tinsert (content, #content+1, 0) + tinsert (content, #content+1, 0) local _i = 3 - local graphMaxDps = math.max(g.max_damage, dps_max) + local graphMaxDps = math.max (g.max_damage, dps_max) while (_i <= #content-2) do - 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 + 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 _i = _i + 1 end - tremove(content, 1) - tremove(content, 1) - tremove(content, #graphicData) - tremove(content, #graphicData) + tremove (content, 1) + tremove (content, 1) + tremove (content, #graphicData) + tremove (content, #graphicData) - --update timeline + --> update timeline local tempo = combat.end_time - combat.start_time if (g.max_time < tempo) then g.max_time = tempo @@ -432,22 +432,22 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) for i = 1, 8, 1 do local t = tempo_divisao*i - local minutos, segundos = _math_floor(t/60), _math_floor(t%60) + local minutos, segundos = _math_floor (t/60), _math_floor (t%60) if (segundos < 10) then segundos = "0"..segundos end if (minutos < 10) then minutos = "0"..minutos end - EncounterDetails.Frame["timeamt"..i]:SetText(minutos..":"..segundos) + EncounterDetails.Frame["timeamt"..i]:SetText (minutos..":"..segundos) end end - --normalize previous data + --> normalize previous data if (dps_max > g.max_damage) then if (g.max_damage > 0) then local normalizePercent = g.max_damage / dps_max - for dataIndex, Data in ipairs(g.Data) do + for dataIndex, Data in ipairs (g.Data) do local Points = Data.Points for i = 1, #Points do Points[i][2] = Points[i][2]*normalizePercent @@ -459,11 +459,11 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) local dano_divisao = g.max_damage/8 - --update damage line + --> update damage line local o = 1 for i = 8, 1, -1 do local d = _detalhes:ToK (dano_divisao*i) - EncounterDetails.Frame["dpsamt"..o]:SetText(d) + EncounterDetails.Frame["dpsamt"..o]:SetText (d) o = o + 1 end @@ -479,12 +479,12 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) g:ChangeColorOnDataSeries (i, grafico_cores [i]) end - --add death icons for the first deaths in the segment + --> add death icons for the first deaths in the segment if (drawDeathsCombat) then local mortes = drawDeathsCombat.last_events_tables local scaleG = CONST_CHART_LENGTH / drawDeathsCombat:GetCombatTime() - for _, row in ipairs(g.VerticalLines) do + for _, row in _ipairs (g.VerticalLines) do row:Hide() end @@ -494,34 +494,34 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) if (not vRowFrame) then - vRowFrame = CreateFrame("frame", "DetailsEncountersVerticalLine"..i, g, "BackdropTemplate") - vRowFrame:SetWidth(20) - vRowFrame:SetHeight(43) - vRowFrame:SetFrameLevel(g:GetFrameLevel()+2) + vRowFrame = CreateFrame ("frame", "DetailsEncountersVerticalLine"..i, g, "BackdropTemplate") + vRowFrame:SetWidth (20) + vRowFrame:SetHeight (43) + vRowFrame:SetFrameLevel (g:GetFrameLevel()+2) - vRowFrame:SetScript("OnEnter", function(frame) + vRowFrame:SetScript ("OnEnter", function (frame) if (vRowFrame.dead[1] and vRowFrame.dead[1][3] and vRowFrame.dead[1][3][2]) then GameCooltip:Reset() --time of death and player name - GameCooltip:AddLine(vRowFrame.dead[6].." "..vRowFrame.dead[3]) - local class, l, r, t, b = _detalhes:GetClass(vRowFrame.dead[3]) + GameCooltip:AddLine (vRowFrame.dead[6].." "..vRowFrame.dead[3]) + local class, l, r, t, b = _detalhes:GetClass (vRowFrame.dead[3]) if (class) then GameCooltip:AddIcon ([[Interface\AddOns\Details\images\classes_small]], 1, 1, 12, 12, l, r, t, b) end - GameCooltip:AddLine("") + GameCooltip:AddLine ("") --last hits: local death = vRowFrame.dead local amt = 0 for i = #death[1], 1, -1 do local this_hit = death[1][i] - if (type(this_hit[1]) == "boolean" and this_hit[1]) then - local spellname, _, spellicon = _GetSpellInfo(this_hit[2]) + if (type (this_hit[1]) == "boolean" and this_hit[1]) then + local spellname, _, spellicon = _GetSpellInfo (this_hit[2]) local t = death [2] - this_hit [4] - GameCooltip:AddLine("-" .. _cstr ("%.1f", t) .. " " .. spellname .. " (" .. this_hit[6] .. ")", EncounterDetails:comma_value (this_hit [3])) + GameCooltip:AddLine ("-" .. _cstr ("%.1f", t) .. " " .. spellname .. " (" .. this_hit[6] .. ")", EncounterDetails:comma_value (this_hit [3])) GameCooltip:AddIcon (spellicon, 1, 1, 12, 12, 0.1, 0.9, 0.1, 0.9) amt = amt + 1 if (amt == 3) then @@ -530,39 +530,39 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) end end - GameCooltip:SetOption("TextSize", 9.5) - GameCooltip:SetOption("HeightAnchorMod", -15) + GameCooltip:SetOption ("TextSize", 9.5) + GameCooltip:SetOption ("HeightAnchorMod", -15) GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], {.6, 0.1, 0, 0.64453125}, {1, 1, 1, 0.1}, true) - GameCooltip:ShowCooltip(frame, "tooltip") + GameCooltip:ShowCooltip (frame, "tooltip") end end) - vRowFrame:SetScript("OnLeave", function(frame) - _detalhes.popup:ShowMe(false) + vRowFrame:SetScript ("OnLeave", function (frame) + _detalhes.popup:ShowMe (false) end) - 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.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) + 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) g.VerticalLines [i] = vRowFrame end local deadTime = mortes [i].dead_at - vRowFrame:SetPoint("topleft", EncounterDetails.Frame, "topleft", (deadTime*scaleG)+70, -CONST_CHART_HEIGHT-22) + vRowFrame:SetPoint ("topleft", EncounterDetails.Frame, "topleft", (deadTime*scaleG)+70, -CONST_CHART_HEIGHT-22) vRowFrame.dead = mortes [i] vRowFrame:Show() @@ -573,7 +573,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) --~chart ~graphic ~grafico function EncounterDetails:CreateGraphPanel() - --main chart frame + --> main chart frame 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) @@ -594,7 +594,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) [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} } - --bloodlust indicators + --> bloodlust indicators g.bloodlustIndicators = {} for i = 1, 5 do local texture = g:CreateTexture(nil, "overlay") @@ -602,36 +602,36 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) g.bloodlustIndicators[#g.bloodlustIndicators+1] = texture end - --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, + --> 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, edgeFile = [[Interface\AddOns\Details\images\border_2]], edgeSize = 32, insets = {left = 1, right = 1, top = 1, bottom = 1}}) - phase_panel:SetBackdropColor(0, 0, 0, .4) + phase_panel:SetBackdropColor (0, 0, 0, .4) - 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) + 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) - 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) + 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) phase_panel.damage_labels = {} phase_panel.heal_labels = {} function phase_panel:ClearLabels() - for i, label in ipairs(phase_panel.damage_labels) do + for i, label in ipairs (phase_panel.damage_labels) do label.lefttext:Hide() label.righttext:Hide() label.icon:Hide() label.bg:Hide() end - for i, label in ipairs(phase_panel.heal_labels) do + for i, label in ipairs (phase_panel.heal_labels) do label.lefttext:Hide() label.righttext:Hide() label.icon:Hide() @@ -642,16 +642,16 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) function phase_panel:GetDamageLabel (index) local label = phase_panel.damage_labels [index] if (not label) then - 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) + 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) - 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) + 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) label = {lefttext = player_name, righttext = amount, icon = icon, bg = bg} phase_panel.damage_labels [index] = label @@ -662,16 +662,16 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) function phase_panel:GetHealLabel (index) local label = phase_panel.heal_labels [index] if (not label) then - 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) + 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) - 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) + 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) label = {lefttext = player_name, righttext = amount, icon = icon, bg = bg} phase_panel.heal_labels [index] = label @@ -679,29 +679,29 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) return label end - 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") + 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") - 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) + 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) - local bg = DetailsFrameWork:CreateImage(phase_panel, [[Interface\Tooltips\UI-Tooltip-Background]], nil, nil, "artwork") - bg:SetPoint("left", phase_panel.phase_label, "left"); + local bg = DetailsFrameWork:CreateImage (phase_panel, [[Interface\Tooltips\UI-Tooltip-Background]], nil, nil, "artwork") + bg:SetPoint ("left", phase_panel.phase_label, "left"); bg.height = 16; - bg:SetPoint("right", phase_panel.report_label, "right"); - bg:SetVertexColor(0, 0, 0, 1) + bg:SetPoint ("right", phase_panel.report_label, "right"); + bg:SetVertexColor (0, 0, 0, 1) local spark_container = {} local create_spark = function() - local t = phase_panel:CreateTexture(nil, "overlay") - t:SetTexture([[Interface\CastingBar\UI-CastingBar-Spark]]) - t:SetBlendMode("ADD") + local t = phase_panel:CreateTexture (nil, "overlay") + t:SetTexture ([[Interface\CastingBar\UI-CastingBar-Spark]]) + t:SetBlendMode ("ADD") t:Hide() - tinsert(spark_container, t) + tinsert (spark_container, t) end - local get_spark = function(index) + local get_spark = function (index) local spark = spark_container [index] if (not spark) then create_spark() @@ -711,34 +711,34 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) return spark end local hide_sparks = function() - for _, spark in ipairs(spark_container) do + for _, spark in ipairs (spark_container) do spark:Hide() end end - local phase_on_enter = function(self) + local phase_on_enter = function (self) local spark1 = get_spark (1) local spark2 = get_spark (2) - self.texture:SetBlendMode("ADD") - spark1:SetPoint("left", self.texture, "left", -16, 0) - spark2:SetPoint("right", self.texture, "right", 16, 0) + self.texture:SetBlendMode ("ADD") + spark1:SetPoint ("left", self.texture, "left", -16, 0) + spark2:SetPoint ("right", self.texture, "right", 16, 0) spark1:Show() spark2:Show() local phase = self.phase local spark_index = 3 - self.texture:SetVertexColor(1, 1, 1) + self.texture:SetVertexColor (1, 1, 1) - for _, f in ipairs(g.PhaseTextures) do + for _, f in ipairs (g.PhaseTextures) do if (f ~= self and f.phase == phase) then local spark1 = get_spark (spark_index) local spark2 = get_spark (spark_index+1) - 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) + 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) spark1:Show() spark2:Show() spark_index = spark_index + 2 @@ -752,18 +752,18 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) --damage local players = {} - for player_name, damage in pairs(combat.PhaseData.damage [self.phase]) do - tinsert(players, {player_name, damage}) + for player_name, damage in pairs (combat.PhaseData.damage [self.phase]) do + tinsert (players, {player_name, damage}) end table.sort (players, _detalhes.Sort2) - for i, player in ipairs(players) do + for i, player in ipairs (players) do local dlabel = phase_panel:GetDamageLabel (i) - dlabel.lefttext.text = EncounterDetails:GetOnlyName(player [1]) - dlabel.righttext.text = _detalhes:ToK (_math_floor(player [2])) + dlabel.lefttext.text = EncounterDetails:GetOnlyName (player [1]) + dlabel.righttext.text = _detalhes:ToK (_math_floor (player [2])) - local class = EncounterDetails:GetClass(player [1]) - local spec = EncounterDetails:GetSpec(player [1]) + local class = EncounterDetails:GetClass (player [1]) + local spec = EncounterDetails:GetSpec (player [1]) if (spec) then dlabel.icon.texture = [[Interface\AddOns\Details\images\spec_icons_normal]] @@ -775,7 +775,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) else dlabel.icon.texture = [[Interface\LFGFRAME\LFGROLE_BW]] - dlabel.icon:SetTexCoord(.25, .5, 0, 1) + dlabel.icon:SetTexCoord (.25, .5, 0, 1) end dlabel.lefttext:Show() @@ -789,23 +789,23 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) --heal local players = {} - for player_name, heal in pairs(combat.PhaseData.heal [self.phase]) do - tinsert(players, {player_name, heal}) + for player_name, heal in pairs (combat.PhaseData.heal [self.phase]) do + tinsert (players, {player_name, heal}) end table.sort (players, _detalhes.Sort2) - for i, player in ipairs(players) do + for i, player in ipairs (players) do local hlabel = phase_panel:GetHealLabel (i) - hlabel.lefttext.text = EncounterDetails:GetOnlyName(player [1]) - hlabel.righttext.text = _detalhes:ToK (_math_floor(player [2])) + hlabel.lefttext.text = EncounterDetails:GetOnlyName (player [1]) + hlabel.righttext.text = _detalhes:ToK (_math_floor (player [2])) - local classe = _detalhes:GetClass(player [1]) + local classe = _detalhes:GetClass (player [1]) if (classe) then - hlabel.icon:SetTexture([[Interface\AddOns\Details\images\classes_small_alpha]]) - hlabel.icon:SetTexCoord(unpack(_detalhes.class_coords [classe])) + hlabel.icon:SetTexture ([[Interface\AddOns\Details\images\classes_small_alpha]]) + hlabel.icon:SetTexCoord (unpack (_detalhes.class_coords [classe])) else - hlabel.icon:SetTexture([[Interface\LFGFRAME\LFGROLE_BW]]) - hlabel.icon:SetTexCoord(.25, .5, 0, 1) + hlabel.icon:SetTexture ([[Interface\LFGFRAME\LFGROLE_BW]]) + hlabel.icon:SetTexCoord (.25, .5, 0, 1) end hlabel.lefttext:Show() @@ -818,68 +818,68 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) self.heal_actors = players --show the panel - phase_panel:SetHeight((math.max(damage_players, heal_players) * 16) + 60) - phase_panel:SetPoint("bottom", self, "top", 0, 10) + phase_panel:SetHeight ((math.max (damage_players, heal_players) * 16) + 60) + phase_panel:SetPoint ("bottom", self, "top", 0, 10) phase_panel:Show() phase_panel.phase_label.text = "|cFFffb400Phase|r: " .. self.phase - local m, s = _math_floor(self.elapsed / 60), _math_floor(self.elapsed % 60) + local m, s = _math_floor (self.elapsed / 60), _math_floor (self.elapsed % 60) phase_panel.time_label.text = "|cFFffb400Elapsed|r: " .. m .. "m " .. s .. "s" end end - local phase_on_leave = function(self) - table.wipe(self.damage_actors) - table.wipe(self.heal_actors) + local phase_on_leave = function (self) + table.wipe (self.damage_actors) + table.wipe (self.heal_actors) - for _, f in ipairs(g.PhaseTextures) do - f.texture:SetBlendMode("BLEND") - f.texture:SetVertexColor(unpack(f.texture.original_color)) + for _, f in ipairs (g.PhaseTextures) do + f.texture:SetBlendMode ("BLEND") + f.texture:SetVertexColor (unpack (f.texture.original_color)) end hide_sparks() phase_panel:Hide() end - local phase_on_click = function(self, button) + local phase_on_click = function (self, button) if (button == "LeftButton") then local result = {} - local reportFunc = function(IsCurrent, IsReverse, AmtLines) + local reportFunc = function (IsCurrent, IsReverse, AmtLines) AmtLines = AmtLines + 1 if (#result > AmtLines) then for i = #result, AmtLines+1, -1 do - tremove(result, i) + tremove (result, i) end end EncounterDetails:SendReportLines (result) end --need to build here because the mouse will leave the block to click in the send button - tinsert(result, "Details!: Damage for Phase " .. self.phase .. " of " .. (g.combat and g.combat.is_boss and g.combat.is_boss.name or "Unknown") .. ":") + tinsert (result, "Details!: Damage for Phase " .. self.phase .. " of " .. (g.combat and g.combat.is_boss and g.combat.is_boss.name or "Unknown") .. ":") for i = 1, #self.damage_actors do - tinsert(result, EncounterDetails:GetOnlyName(self.damage_actors[i][1]) .. ": " .. _detalhes:ToK (_math_floor(self.damage_actors [i][2]))) + tinsert (result, EncounterDetails:GetOnlyName (self.damage_actors[i][1]) .. ": " .. _detalhes:ToK (_math_floor (self.damage_actors [i][2]))) end EncounterDetails:SendReportWindow (reportFunc, nil, nil, true) elseif (button == "RightButton") then local result = {} - local reportFunc = function(IsCurrent, IsReverse, AmtLines) + local reportFunc = function (IsCurrent, IsReverse, AmtLines) AmtLines = AmtLines + 1 if (#result > AmtLines) then for i = #result, AmtLines+1, -1 do - tremove(result, i) + tremove (result, i) end end EncounterDetails:SendReportLines (result) end - tinsert(result, "Details!: Healing for Phase " .. self.phase .. " of " .. (g.combat and g.combat.is_boss and g.combat.is_boss.name or "Unknown") .. ":") + tinsert (result, "Details!: Healing for Phase " .. self.phase .. " of " .. (g.combat and g.combat.is_boss and g.combat.is_boss.name or "Unknown") .. ":") for i = 1, #self.heal_actors do - tinsert(result, EncounterDetails:GetOnlyName(self.heal_actors[i][1]) .. ": " .. _detalhes:ToK (_math_floor(self.heal_actors [i][2]))) + tinsert (result, EncounterDetails:GetOnlyName (self.heal_actors[i][1]) .. ": " .. _detalhes:ToK (_math_floor (self.heal_actors [i][2]))) end EncounterDetails:SendReportWindow (reportFunc, nil, nil, true) @@ -891,34 +891,39 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) local texture = g.PhaseTextures [index] if (not texture) then - local f = CreateFrame("frame", "EncounterDetailsPhaseTexture" .. index, g, "BackdropTemplate") - f:SetHeight(CONST_PHASE_BAR_HEIGHT) + local f = CreateFrame ("frame", "EncounterDetailsPhaseTexture" .. index, g, "BackdropTemplate") + f:SetHeight (CONST_PHASE_BAR_HEIGHT) - local t = f:CreateTexture(nil, "artwork") + local t = f:CreateTexture (nil, "artwork") t:SetAllPoints() - t:SetColorTexture(1, 1, 1, phase_alpha) + t:SetColorTexture (1, 1, 1, phase_alpha) t.original_color = {1, 1, 1} f.texture = t - f:SetScript("OnEnter", phase_on_enter) - f:SetScript("OnLeave", phase_on_leave) - f:SetScript("OnMouseUp", phase_on_click) + f:SetScript ("OnEnter", phase_on_enter) + f:SetScript ("OnLeave", phase_on_leave) + f:SetScript ("OnMouseUp", phase_on_click) texture = f - tinsert(g.PhaseTextures, f) + tinsert (g.PhaseTextures, f) end texture:ClearAllPoints() phase = math.min (phase, 5) if (not phase_colors [phase]) then - _detalhes:Msg("Phase out of range:", phase) - phase = math.max(phase, 1) + _detalhes:Msg ("Phase out of range:", phase) + phase = math.max (phase, 1) end - texture.texture:SetVertexColor(unpack(phase_colors [phase])) + local phaseColor = phase_colors[phase] + if (not phaseColor) then + phaseColor = {1, 1, 1} + end + + texture.texture:SetVertexColor (unpack (phaseColor)) local oc = texture.texture.original_color - oc[1], oc[2], oc[3] = unpack(phase_colors [phase]) + oc[1], oc[2], oc[3] = unpack (phase_colors [phase]) texture:Show() @@ -926,12 +931,12 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) end function g:ClearPhaseTexture() - for i, texture in pairs(g.PhaseTextures) do + for i, texture in pairs (g.PhaseTextures) do texture:Hide() end end - --chart frame implementations + --> chart frame implementations function g:ChangeColorOnDataSeries (index, color) self.Data [index].Color = color @@ -956,30 +961,30 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) end end - table.insert(self.Data, 1, {Points=data;Color=color}) + table.insert (self.Data, 1, {Points=data;Color=color}) self.NeedsUpdate=true end - 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) + 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) - 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) + 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) - --create lines for damage and time + --> create lines for damage and time for i = 1, 8, 1 do - local line = g:CreateTexture(nil, "overlay") - line:SetColorTexture(unpack(CONST_DAMAGE_LINES_COLOR)) - line:SetWidth(CONST_CHART_WIDTH) - line:SetHeight(1) + local line = g:CreateTexture (nil, "overlay") + line:SetColorTexture (unpack (CONST_DAMAGE_LINES_COLOR)) + line:SetWidth (CONST_CHART_WIDTH) + line:SetHeight (1) - 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) + 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) - 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) + 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) end g.max_time = 0 @@ -987,123 +992,123 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) EncounterDetails.MaxGraphics = EncounterDetails.MaxGraphics or 5 - --fight segments at the top right corner + --> fight segments at the top right corner for i = 1, EncounterDetails.MaxGraphics do - 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") + 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") if (i == 1) then - text:SetText(Loc ["STRING_CURRENT"]) + text:SetText (Loc ["STRING_CURRENT"]) else - text:SetText(Loc ["STRING_TRY"] .. " #" .. i) + text:SetText (Loc ["STRING_TRY"] .. " #" .. i) end g.TryIndicator [#g.TryIndicator+1] = {texture = texture, text = text} end - --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) + --> 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) + --> 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) end -- ~start ~main ~frame ~baseframe ~bossframe local BossFrame = EncounterDetails.Frame local DetailsFrameWork = _detalhes.gump - BossFrame:SetFrameStrata("HIGH") - BossFrame:SetToplevel(true) + BossFrame:SetFrameStrata ("HIGH") + BossFrame:SetToplevel (true) - 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) + 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) -- ~size - BossFrame:SetWidth(898) -- + 200 - BossFrame:SetHeight(504) -- + 150 + BossFrame:SetWidth (898) -- + 200 + BossFrame:SetHeight (504) -- + 150 - BossFrame:EnableMouse(true) - BossFrame:SetResizable(false) - BossFrame:SetMovable(true) + BossFrame:EnableMouse (true) + BossFrame:SetResizable (false) + BossFrame:SetMovable (true) --background - 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) + 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) BossFrame.bg1:SetAllPoints() --title bar - 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 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) + 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) + --> 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) --window title - 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) + 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) - --Nome do Encontro - DetailsFrameWork:NewLabel(headerFrame, headerFrame, nil, "boss_name", "Unknown Encounter", "QuestFont_Large") + --> Nome do Encontro + DetailsFrameWork:NewLabel (headerFrame, headerFrame, nil, "boss_name", "Unknown Encounter", "QuestFont_Large") BossFrame.boss_name = headerFrame.boss_name - BossFrame.boss_name:SetPoint("TOPLEFT", BossFrame, "TOPLEFT", 100, -46) + BossFrame.boss_name:SetPoint ("TOPLEFT", BossFrame, "TOPLEFT", 100, -46) - --Nome da Raid - DetailsFrameWork:NewLabel(headerFrame, headerFrame, nil, "raid_name", "Unknown Raid", "GameFontHighlightSmall") + --> Nome da Raid + DetailsFrameWork:NewLabel (headerFrame, headerFrame, nil, "raid_name", "Unknown Raid", "GameFontHighlightSmall") BossFrame.raid_name = headerFrame.raid_name - BossFrame.raid_name:SetPoint("CENTER", BossFrame.boss_name, "CENTER", 0, 14) + BossFrame.raid_name:SetPoint ("CENTER", BossFrame.boss_name, "CENTER", 0, 14) - --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) + --> 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) ---- - BossFrame:SetScript("OnMouseDown", - function(self, botao) + BossFrame:SetScript ("OnMouseDown", + function (self, botao) if (botao == "LeftButton") then self:StartMoving() self.isMoving = true @@ -1112,42 +1117,42 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) end end) - BossFrame:SetScript("OnMouseUp", - function(self) + BossFrame:SetScript ("OnMouseUp", + function (self) if (self.isMoving) then self:StopMovingOrSizing() self.isMoving = false end end) - BossFrame:SetPoint("CENTER", UIParent) + 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) + --> 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) + --> 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) EncounterDetails:CloseWindow() end) - titlebar.CloseButton:SetFrameLevel(titlebar:GetFrameLevel()+2) - titlebar.CloseButton:GetNormalTexture():SetDesaturated(true) + titlebar.CloseButton:SetFrameLevel (titlebar:GetFrameLevel()+2) + titlebar.CloseButton:GetNormalTexture():SetDesaturated (true) - --background completo + --> background completo BossFrame.Widgets = {} BossFrame.ShowType = "main" - --revisar + --> revisar BossFrame.Reset = function() BossFrame.switch (nil, nil, "main") if (_G.DetailsRaidDpsGraph) then @@ -1177,37 +1182,37 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) local hide_Emote = function() --hide emote frames - for _, widget in pairs(BossFrame.EmoteWidgets) do + for _, widget in pairs (BossFrame.EmoteWidgets) do widget:Hide() end end local hide_WeakAuras = function() --hide spells frames - for _, widget in pairs(BossFrame.EnemySpellsWidgets) do + for _, widget in pairs (BossFrame.EnemySpellsWidgets) do widget:Hide() end end local hide_Summary = function() --hide boss frames - for _, frame in ipairs(BossFrame.Widgets) do + for _, frame in _ipairs (BossFrame.Widgets) do frame:Hide() end end local resetSelectedButtonTemplate = function() - 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")) + 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")) end - BossFrame.switch = function(to, _, to2) - if (type(to) == "string") then + BossFrame.switch = function (to, _, to2) + if (type (to) == "string") then to = to - elseif (type(to2) == "string") then + elseif (type (to2) == "string") then to = to2 end @@ -1221,7 +1226,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) if (to == "main") then BossFrame.raidbackground:Show() - for _, frame in ipairs(BossFrame.Widgets) do + for _, frame in _ipairs (BossFrame.Widgets) do frame:Show() end @@ -1232,7 +1237,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) BossFrame.ShowType = "main" BossFrame.segmentosDropdown:Enable() - BossFrame.buttonSwitchNormal:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE")) + BossFrame.buttonSwitchNormal:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE")) EncounterDetails.db.last_section_selected = BossFrame.ShowType @@ -1251,7 +1256,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) hide_Emote() --show spells frames - for _, widget in pairs(BossFrame.EnemySpellsWidgets) do + for _, widget in pairs (BossFrame.EnemySpellsWidgets) do widget:Show() end @@ -1262,7 +1267,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) BossFrame.segmentosDropdown:Enable() - BossFrame.buttonSwitchSpellsAuras:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE")) + BossFrame.buttonSwitchSpellsAuras:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE")) EncounterDetails.db.last_section_selected = BossFrame.ShowType @@ -1274,7 +1279,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) end --hide boss frames - for _, frame in ipairs(BossFrame.Widgets) do + for _, frame in _ipairs (BossFrame.Widgets) do frame:Hide() end @@ -1291,12 +1296,12 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) BossFrame["phases_string"]:Hide() end --show emote frames - for _, widget in pairs(BossFrame.EmoteWidgets) do + for _, widget in pairs (BossFrame.EmoteWidgets) do widget:Show() end --hide spells frames - for _, widget in pairs(BossFrame.EnemySpellsWidgets) do + for _, widget in pairs (BossFrame.EnemySpellsWidgets) do widget:Hide() end @@ -1304,11 +1309,11 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) scrollframe:Update() BossFrame.EmotesSegment:Refresh() - BossFrame.EmotesSegment:Select(emote_segment) + BossFrame.EmotesSegment:Select (emote_segment) BossFrame.segmentosDropdown:Disable() - BossFrame.buttonSwitchBossEmotes:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE")) + BossFrame.buttonSwitchBossEmotes:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE")) EncounterDetails.db.last_section_selected = BossFrame.ShowType @@ -1328,7 +1333,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) EncounterDetailsPhaseFrame:Show() - BossFrame.buttonSwitchPhases:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE")) + BossFrame.buttonSwitchPhases:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE")) EncounterDetails.db.last_section_selected = BossFrame.ShowType @@ -1346,7 +1351,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) BossFrame.raidbackground:Hide() - for _, frame in ipairs(BossFrame.Widgets) do + for _, frame in _ipairs (BossFrame.Widgets) do frame:Hide() end @@ -1362,18 +1367,18 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) BossFrame.ShowType = "graph" --hide emote frames - for _, widget in pairs(BossFrame.EmoteWidgets) do + for _, widget in pairs (BossFrame.EmoteWidgets) do widget:Hide() end --hide spells frames - for _, widget in pairs(BossFrame.EnemySpellsWidgets) do + for _, widget in pairs (BossFrame.EnemySpellsWidgets) do widget:Hide() end BossFrame.segmentosDropdown:Enable() - BossFrame.buttonSwitchGraphic:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE")) + BossFrame.buttonSwitchGraphic:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE")) EncounterDetails.db.last_section_selected = BossFrame.ShowType end @@ -1388,64 +1393,64 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) local HEADER_MENUBUTTONS_Y = -38 --summary - BossFrame.buttonSwitchNormal = _detalhes.gump:CreateButton(BossFrame, BossFrame.switch, BUTTON_WIDTH, BUTTON_HEIGHT, "Summary", "main") + BossFrame.buttonSwitchNormal = _detalhes.gump:CreateButton (BossFrame, BossFrame.switch, BUTTON_WIDTH, BUTTON_HEIGHT, "Summary", "main") BossFrame.buttonSwitchNormal:SetIcon ("Interface\\AddOns\\Details_EncounterDetails\\images\\boss_frame_buttons", 18, 18, "overlay", {0, 32/256, 0, 0.505625}) - BossFrame.buttonSwitchNormal:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE")) - BossFrame.buttonSwitchNormal:SetWidth(BUTTON_WIDTH) + BossFrame.buttonSwitchNormal:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE")) + BossFrame.buttonSwitchNormal:SetWidth (BUTTON_WIDTH) --spells e auras - BossFrame.buttonSwitchSpellsAuras = _detalhes.gump:CreateButton(BossFrame, BossFrame.switch, BUTTON_WIDTH, BUTTON_HEIGHT, "Timers & Spells", "spellsauras") + BossFrame.buttonSwitchSpellsAuras = _detalhes.gump:CreateButton (BossFrame, BossFrame.switch, BUTTON_WIDTH, BUTTON_HEIGHT, "Timers & Spells", "spellsauras") BossFrame.buttonSwitchSpellsAuras:SetIcon ("Interface\\AddOns\\Details_EncounterDetails\\images\\boss_frame_buttons", 18, 18, "overlay", {33/256, 64/256, 0, 0.505625}) - BossFrame.buttonSwitchSpellsAuras:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) - BossFrame.buttonSwitchSpellsAuras:SetWidth(BUTTON_WIDTH) + BossFrame.buttonSwitchSpellsAuras:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) + BossFrame.buttonSwitchSpellsAuras:SetWidth (BUTTON_WIDTH) BossFrame.AllButtons = {BossFrame.buttonSwitchNormal, BossFrame.buttonSwitchGraphic, BossFrame.buttonSwitchBossEmotes, BossFrame.buttonSwitchSpellsAuras, BossFrame.buttonSwitchPhases} --phases - BossFrame.buttonSwitchPhases = _detalhes.gump:CreateButton(BossFrame, BossFrame.switch, BUTTON_WIDTH, BUTTON_HEIGHT, "Phases", "phases") + BossFrame.buttonSwitchPhases = _detalhes.gump:CreateButton (BossFrame, BossFrame.switch, BUTTON_WIDTH, BUTTON_HEIGHT, "Phases", "phases") BossFrame.buttonSwitchPhases:SetIcon ("Interface\\AddOns\\Details_EncounterDetails\\images\\boss_frame_buttons", 18, 18, "overlay", {65/256, 96/256, 0, 0.505625}) - BossFrame.buttonSwitchPhases:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) - BossFrame.buttonSwitchPhases:SetWidth(BUTTON_WIDTH) + BossFrame.buttonSwitchPhases:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) + BossFrame.buttonSwitchPhases:SetWidth (BUTTON_WIDTH) --chart - BossFrame.buttonSwitchGraphic = _detalhes.gump:CreateButton(BossFrame, BossFrame.switch, BUTTON_WIDTH, BUTTON_HEIGHT, "Damage Graphic", "graph") + BossFrame.buttonSwitchGraphic = _detalhes.gump:CreateButton (BossFrame, BossFrame.switch, BUTTON_WIDTH, BUTTON_HEIGHT, "Damage Graphic", "graph") BossFrame.buttonSwitchGraphic:SetIcon ("Interface\\AddOns\\Details_EncounterDetails\\images\\boss_frame_buttons", 18, 18, "overlay", {97/256, 128/256, 0, 0.505625}) - BossFrame.buttonSwitchGraphic:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) - BossFrame.buttonSwitchGraphic:SetWidth(BUTTON_WIDTH) + BossFrame.buttonSwitchGraphic:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) + BossFrame.buttonSwitchGraphic:SetWidth (BUTTON_WIDTH) --emotes - BossFrame.buttonSwitchBossEmotes = _detalhes.gump:CreateButton(BossFrame, BossFrame.switch, BUTTON_WIDTH, BUTTON_HEIGHT, "Emotes", "emotes") + BossFrame.buttonSwitchBossEmotes = _detalhes.gump:CreateButton (BossFrame, BossFrame.switch, BUTTON_WIDTH, BUTTON_HEIGHT, "Emotes", "emotes") BossFrame.buttonSwitchBossEmotes:SetIcon ("Interface\\AddOns\\Details_EncounterDetails\\images\\boss_frame_buttons", 18, 18, "overlay", {129/256, 160/256, 0, 0.505625}) - BossFrame.buttonSwitchBossEmotes:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) - BossFrame.buttonSwitchBossEmotes:SetWidth(BUTTON_WIDTH) + BossFrame.buttonSwitchBossEmotes:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) + BossFrame.buttonSwitchBossEmotes:SetWidth (BUTTON_WIDTH) --anchors - 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) + 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) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---~emotes +--> ~emotes local emote_lines = {} local emote_search_table = {} local CONST_EMOTES_MAX_LINES = 32 - local refresh_emotes = function(self) + local refresh_emotes = function (self) --update emote scroll local offset = FauxScrollFrame_GetOffset (self) - --print(EncounterDetails.charsaved, EncounterDetails.charsaved.emotes, EncounterDetails.charsaved.emotes [1], #EncounterDetails.charsaved.emotes) + --print (EncounterDetails.charsaved, EncounterDetails.charsaved.emotes, EncounterDetails.charsaved.emotes [1], #EncounterDetails.charsaved.emotes) local emote_pool = EncounterDetails.charsaved.emotes [emote_segment] if (searching) then local i = 0 local lower = string.lower - for index, data in ipairs(emote_pool) do - if (lower (data [2]):find(lower(searching))) then + for index, data in ipairs (emote_pool) do + if (lower (data [2]):find (lower(searching))) then i = i + 1 emote_search_table [i] = data end @@ -1455,7 +1460,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) emote_pool = emote_search_table end BossFrame.SearchResults:Show() - BossFrame.SearchResults:SetText("Found " .. i .. " matches") + BossFrame.SearchResults:SetText ("Found " .. i .. " matches") if (i > 0) then BossFrame.ReportEmoteButton:Enable() @@ -1473,22 +1478,22 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) if (data) then bar:Show() - local min, sec = _math_floor(data[1] / 60), _math_floor(data[1] % 60) - bar.lefttext:SetText(min .. "m" .. sec .. "s:") + local min, sec = _math_floor (data[1] / 60), _math_floor (data[1] % 60) + bar.lefttext:SetText (min .. "m" .. sec .. "s:") if (data [2] == "") then - bar.righttext:SetText("--x--x--") + bar.righttext:SetText ("--x--x--") else - bar.righttext:SetText(_cstr (data [2], data [3])) + bar.righttext:SetText (_cstr (data [2], data [3])) end local color_string = EncounterDetails.BossWhispColors [data [4]] local color_table = ChatTypeInfo [color_string] - 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") + 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") else bar:Hide() end @@ -1506,106 +1511,106 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) BossFrame.EmoteWidgets = {} --~emotes ~whispers - 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) + 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) bar_div_emotes:Hide() - tinsert(BossFrame.EmoteWidgets, bar_div_emotes) + tinsert (BossFrame.EmoteWidgets, bar_div_emotes) - 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) + 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) scrollframe.Update = refresh_emotes scrollframe:Hide() - _detalhes.gump:ReskinSlider(scrollframe, 3) + _detalhes.gump:ReskinSlider (scrollframe, 3) -- - tinsert(BossFrame.EmoteWidgets, scrollframe) + tinsert (BossFrame.EmoteWidgets, scrollframe) - local row_on_enter = function(self) - self:SetBackdrop({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16}) - self:SetBackdropColor(1, 1, 1, .6) + local row_on_enter = function (self) + self:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16}) + self:SetBackdropColor (1, 1, 1, .6) if (self.righttext:IsTruncated()) then GameCooltip:Reset() - GameCooltip:AddLine(self.righttext:GetText()) - GameCooltip:SetOwner(self, "bottomleft", "topleft", 42, -9) + GameCooltip:AddLine (self.righttext:GetText()) + GameCooltip:SetOwner (self, "bottomleft", "topleft", 42, -9) GameCooltip:Show() end end - local row_on_leave = function(self) - self:SetBackdrop({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16}) - self:SetBackdropColor(1, 1, 1, .3) + local row_on_leave = function (self) + self:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16}) + self:SetBackdropColor (1, 1, 1, .3) GameCooltip:Hide() end - local row_on_mouse_up = function(self) + local row_on_mouse_up = function (self) --report local text = self.righttext:GetText() - local timeString = self.lefttext:GetText() + local time = self.lefttext:GetText() local reportFunc = function() -- remove textures - text = text:gsub("(|T).*(|t)", "") + text = text:gsub ("(|T).*(|t)", "") -- remove colors - text = text:gsub("|c%x?%x?%x?%x?%x?%x?%x?%x?", "") - text = text:gsub("|r", "") + text = text:gsub ("|c%x?%x?%x?%x?%x?%x?%x?%x?", "") + text = text:gsub ("|r", "") -- replace links for _, spellid in text:gmatch ("(|Hspell:)(.-)(|h)") do - local spell = tonumber(spellid) - local link = GetSpellLink(spell) - text = text:gsub("(|Hspell).*(|h)", link) + local spell = tonumber (spellid) + local link = GetSpellLink (spell) + text = text:gsub ("(|Hspell).*(|h)", link) end -- remove unit links - text = text:gsub("(|Hunit).-(|h)", "") + text = text:gsub ("(|Hunit).-(|h)", "") -- remove the left space - text = text:gsub("^%s$", "") + text = text:gsub ("^%s$", "") - EncounterDetails:SendReportLines ({"Details! Encounter Emote at " .. timeString, "\"" .. text .. "\""}) + EncounterDetails:SendReportLines ({"Details! Encounter Emote at " .. time, "\"" .. text .. "\""}) end EncounterDetails:SendReportWindow (reportFunc) end for i = 1, CONST_EMOTES_MAX_LINES do - local line = CreateFrame("frame", nil, BossFrame,"BackdropTemplate") + local line = CreateFrame ("frame", nil, BossFrame,"BackdropTemplate") local y = (i-1) * 15 * -1 - 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: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.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.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.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: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) + 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) line:Hide() end --select emote segment - local emotes_segment_label = DetailsFrameWork:CreateLabel(BossFrame, "Segment:", 11, nil, "GameFontHighlightSmall") - emotes_segment_label:SetPoint("topleft", BossFrame, "topleft", 10, -85) + local emotes_segment_label = DetailsFrameWork:CreateLabel (BossFrame, "Segment:", 11, nil, "GameFontHighlightSmall") + emotes_segment_label:SetPoint ("topleft", BossFrame, "topleft", 10, -85) - local on_emote_Segment_select = function(_, _, segment) + local on_emote_Segment_select = function (_, _, segment) FauxScrollFrame_SetOffset (scrollframe, 0) emote_segment = segment scrollframe:Update() @@ -1624,31 +1629,31 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) if (not EncounterDetails.charsaved) then return t end - 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}) + 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}) end return t end local dropdown = DetailsFrameWork:NewDropDown (BossFrame, _, "$parentEmotesSegmentDropdown", "EmotesSegment", 180, 20, build_emote_segments, 1) - dropdown:SetPoint("topleft", emotes_segment_label, "bottomleft", -1, -2) - dropdown:SetTemplate(DetailsFrameWork:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) + dropdown:SetPoint ("topleft", emotes_segment_label, "bottomleft", -1, -2) + dropdown:SetTemplate (DetailsFrameWork:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) - tinsert(BossFrame.EmoteWidgets, dropdown) - tinsert(BossFrame.EmoteWidgets, emotes_segment_label) + tinsert (BossFrame.EmoteWidgets, dropdown) + tinsert (BossFrame.EmoteWidgets, emotes_segment_label) --search box - local emotes_search_label = DetailsFrameWork:CreateLabel(BossFrame, "Search:", 11, nil, "GameFontHighlightSmall") - emotes_search_label:SetPoint("topleft", BossFrame, "topleft", 10, -130) + local emotes_search_label = DetailsFrameWork:CreateLabel (BossFrame, "Search:", 11, nil, "GameFontHighlightSmall") + emotes_search_label:SetPoint ("topleft", BossFrame, "topleft", 10, -130) - local emotes_search_results_label = DetailsFrameWork:CreateLabel(BossFrame, "", 11, nil, "GameFontNormal", "SearchResults") - emotes_search_results_label:SetPoint("topleft", BossFrame, "topleft", 10, -190) + local emotes_search_results_label = DetailsFrameWork:CreateLabel (BossFrame, "", 11, nil, "GameFontNormal", "SearchResults") + emotes_search_results_label:SetPoint ("topleft", BossFrame, "topleft", 10, -190) -- - 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") + 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") - search:SetHook("OnTextChanged", function() + search:SetHook ("OnTextChanged", function() searching = search:GetText() if (searching == "") then searching = nil @@ -1662,24 +1667,24 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) end end) - local reset = DetailsFrameWork:NewButton(BossFrame, nil, "$parentResetSearchBoxtButton", "ResetSearchBox", 16, 16, function() - search:SetText("") + local reset = DetailsFrameWork:NewButton (BossFrame, nil, "$parentResetSearchBoxtButton", "ResetSearchBox", 16, 16, function() + search:SetText ("") end) - 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) + 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) reset.tooltip = "Reset Search" - tinsert(BossFrame.EmoteWidgets, search) - tinsert(BossFrame.EmoteWidgets, reset) - tinsert(BossFrame.EmoteWidgets, emotes_search_label) + tinsert (BossFrame.EmoteWidgets, search) + tinsert (BossFrame.EmoteWidgets, reset) + tinsert (BossFrame.EmoteWidgets, emotes_search_label) -- report button - local report_emote_button = DetailsFrameWork:NewButton(BossFrame, nil, "$parentReportEmoteButton", "ReportEmoteButton", 180, 20, function() - local reportFunc = function(IsCurrent, IsReverse, AmtLines) + local report_emote_button = DetailsFrameWork:NewButton (BossFrame, nil, "$parentReportEmoteButton", "ReportEmoteButton", 180, 20, function() + local reportFunc = function (IsCurrent, IsReverse, AmtLines) local segment = EncounterDetails.charsaved.emotes and EncounterDetails.charsaved.emotes [emote_segment] if (segment) then @@ -1689,28 +1694,28 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) for index = 1, 16 do local bar = emote_lines [index] if (bar:IsShown() and added < AmtLines) then - local timeString = bar.lefttext:GetText() + local time = bar.lefttext:GetText() local text = bar.righttext:GetText() --"|Hunit:77182:Oregorger|hOregorger prepares to cast |cFFFF0000|Hspell:156879|h[Blackrock Barrage]|h|r." -- remove textures - text = text:gsub("(|T).*(|t)", "") + text = text:gsub ("(|T).*(|t)", "") -- remove colors - text = text:gsub("|c%x?%x?%x?%x?%x?%x?%x?%x?", "") - text = text:gsub("|r", "") + text = text:gsub ("|c%x?%x?%x?%x?%x?%x?%x?%x?", "") + text = text:gsub ("|r", "") -- replace links for _, spellid in text:gmatch ("(|Hspell:)(.-)(|h)") do - local spell = tonumber(spellid) - local link = GetSpellLink(spell) - text = text:gsub("(|Hspell).*(|h)", link) + local spell = tonumber (spellid) + local link = GetSpellLink (spell) + text = text:gsub ("(|Hspell).*(|h)", link) end -- remove unit links - text = text:gsub("(|Hunit).-(|h)", "") + text = text:gsub ("(|Hunit).-(|h)", "") -- remove the left space - text = text:gsub("^%s$", "") + text = text:gsub ("^%s$", "") - tinsert(EncounterDetails.report_lines, timeString .. " " .. text) + tinsert (EncounterDetails.report_lines, time .. " " .. text) added = added + 1 if (added == AmtLines) then @@ -1721,7 +1726,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) EncounterDetails:SendReportLines (EncounterDetails.report_lines) else - EncounterDetails:Msg("There is nothing to report.") + EncounterDetails:Msg ("There is nothing to report.") end end @@ -1730,30 +1735,30 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) 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) - report_emote_button:SetTemplate(DetailsFrameWork:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) + report_emote_button:SetTemplate (DetailsFrameWork:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) - report_emote_button:SetPoint("topleft", search, "bottomleft", 0, -4) + report_emote_button:SetPoint ("topleft", search, "bottomleft", 0, -4) report_emote_button:Disable() - tinsert(BossFrame.EmoteWidgets, report_emote_button) + tinsert (BossFrame.EmoteWidgets, report_emote_button) -- - for _, widget in pairs(BossFrame.EmoteWidgets) do + for _, widget in pairs (BossFrame.EmoteWidgets) do widget:Hide() end - 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) + 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) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---auras weakauras +--> auras weakauras BossFrame.EnemySpellsWidgets = {} - --spells and auras ~auras ~spell ~weakaura �ura + --> spells and auras ~auras ~spell ~weakaura �ura local CONST_MAX_AURA_LINES = 21 @@ -1761,17 +1766,17 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) local spell_blocks = {} local bossmods_blocks = {} - local on_focus_gain = function(self) + local on_focus_gain = function (self) self:HighlightText() end - local on_focus_lost = function(self) + local on_focus_lost = function (self) self:HighlightText (0, 0) end - local on_enter_spell = function(self) + local on_enter_spell = function (self) if (self.MyObject._spellid) then - GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT") + GameTooltip:SetOwner (self, "ANCHOR_TOPLEFT") if (type(self.MyObject._spellid) == "string") then local spellId = self.MyObject._spellid:gsub("%a", "") @@ -1784,89 +1789,89 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) end GameTooltip:Show() - self:SetBackdropColor(1, 1, 1, .5) - self:SetBackdropBorderColor(0, 0, 0, 1) + self:SetBackdropColor (1, 1, 1, .5) + self:SetBackdropBorderColor (0, 0, 0, 1) return true end end - local on_leave_spell = function(self, capsule) + local on_leave_spell = function (self, capsule) GameTooltip:Hide() - self:SetBackdropColor(.3, .3, .3, .5) + self:SetBackdropColor (.3, .3, .3, .5) end - local create_aura_func = function(self, button, spellid, encounter_id) + local create_aura_func = function (self, button, spellid, encounter_id) local name, _, icon = EncounterDetails.getspellinfo (spellid) EncounterDetails:OpenAuraPanel (spellid, name, self and self.MyObject._icon.texture, encounter_id) end - local info_onenter = function(self) + local info_onenter = function (self) local spellid = self._spellid local info = EncounterDetails.EnemySpellPool [spellid] if (info) then - _detalhes:CooltipPreset(2) - GameCooltip:SetOption("FixedWidth", false) + _detalhes:CooltipPreset (2) + GameCooltip:SetOption ("FixedWidth", false) - for token, _ in pairs(info.token) do - GameCooltip:AddLine("event:", token, 1, nil, "white") + for token, _ in pairs (info.token) do + GameCooltip:AddLine ("event:", token, 1, nil, "white") end - GameCooltip:AddLine("source:", info.source, 1, nil, "white") - GameCooltip:AddLine("school:", EncounterDetails:GetSpellSchoolFormatedName (info.school), 1, nil, "white") + GameCooltip:AddLine ("source:", info.source, 1, nil, "white") + GameCooltip:AddLine ("school:", EncounterDetails:GetSpellSchoolFormatedName (info.school), 1, nil, "white") if (info.type) then - GameCooltip:AddLine("aura type:", info.type, 1, nil, "white") + GameCooltip:AddLine ("aura type:", info.type, 1, nil, "white") end - GameCooltip:ShowCooltip(self, "tooltip") + GameCooltip:ShowCooltip (self, "tooltip") end - self:SetBackdropColor(1, 1, 1, .5) + self:SetBackdropColor (1, 1, 1, .5) end - local info_onleave = function(self) + local info_onleave = function (self) GameCooltip:Hide() - self:SetBackdropColor(.3, .3, .3, .5) + self:SetBackdropColor (.3, .3, .3, .5) end - local bossModsTitle = DetailsFrameWork:CreateLabel(BossFrame, "Boss Mods Time Bars:", 12, "orange") + local bossModsTitle = DetailsFrameWork:CreateLabel (BossFrame, "Boss Mods Time Bars:", 12, "orange") bossModsTitle:SetPoint(10, -85) - tinsert(BossFrame.EnemySpellsWidgets, bossModsTitle) + tinsert (BossFrame.EnemySpellsWidgets, bossModsTitle) bossModsTitle:Hide() - local bossSpellsTitle = DetailsFrameWork:CreateLabel(BossFrame, "Boss Spells and Auras:", 12, "orange") + local bossSpellsTitle = DetailsFrameWork:CreateLabel (BossFrame, "Boss Spells and Auras:", 12, "orange") bossSpellsTitle:SetPoint(444, -85) - tinsert(BossFrame.EnemySpellsWidgets, bossSpellsTitle) + tinsert (BossFrame.EnemySpellsWidgets, bossSpellsTitle) bossSpellsTitle:Hide() --create boss mods list for i = 1, CONST_MAX_AURA_LINES do - local anchor_frame = CreateFrame("frame", "BossFrameBossModsAnchor" .. i, BossFrame, "BackdropTemplate") + local anchor_frame = CreateFrame ("frame", "BossFrameBossModsAnchor" .. i, BossFrame, "BackdropTemplate") - local spellicon = DetailsFrameWork:NewImage(anchor_frame, [[Interface\ICONS\TEMP]], 19, 19, "background", nil, "icon", "$parentIcon") + local spellicon = DetailsFrameWork:NewImage (anchor_frame, [[Interface\ICONS\TEMP]], 19, 19, "background", nil, "icon", "$parentIcon") --timerId - 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) + 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) --ability name - 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) + 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) - local create_aura = DetailsFrameWork:NewButton(anchor_frame, nil, "$parentCreateAuraButton", "AuraButton", 90, 18, create_aura_func, nil, nil, nil, "Make Aura") - create_aura:SetTemplate(AurasButtonTemplate) + local create_aura = DetailsFrameWork:NewButton (anchor_frame, nil, "$parentCreateAuraButton", "AuraButton", 90, 18, create_aura_func, nil, nil, nil, "Make Aura") + create_aura:SetTemplate (AurasButtonTemplate) - 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) + 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) spellid:SetBackdropBorderColor(0, 0, 0) spellname:SetBackdropBorderColor(0, 0, 0) @@ -1877,53 +1882,53 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) anchor_frame.aurabutton = create_aura anchor_frame.aurabutton._icon = spellicon - tinsert(bossmods_blocks, anchor_frame) - tinsert(BossFrame.EnemySpellsWidgets, anchor_frame) + tinsert (bossmods_blocks, anchor_frame) + tinsert (BossFrame.EnemySpellsWidgets, anchor_frame) anchor_frame:Hide() end --create buff list for i = 1, CONST_MAX_AURA_LINES do - local anchor_frame = CreateFrame("frame", "BossFrameSpellAnchor" .. i, BossFrame, "BackdropTemplate") + 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 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 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) + 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) + --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 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 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) + 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) anchor_frame.icon = spellicon anchor_frame.spellid = spellid @@ -1932,24 +1937,24 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) anchor_frame.aurabutton._icon = spellicon anchor_frame.info = spellinfo - tinsert(spell_blocks, anchor_frame) - tinsert(BossFrame.EnemySpellsWidgets, anchor_frame) + tinsert (spell_blocks, anchor_frame) + tinsert (BossFrame.EnemySpellsWidgets, anchor_frame) anchor_frame:Hide() end local update_enemy_spells = function() - local combat = EncounterDetails:GetCombat(EncounterDetails._segment) + local combat = EncounterDetails:GetCombat (EncounterDetails._segment) local spell_list = {} if (combat) then for i, npc in combat[1]:ListActors() do --damage if (npc:IsNeutralOrEnemy()) then - for spellid, spell in pairs(npc.spells._ActorTable) do + for spellid, spell in pairs (npc.spells._ActorTable) do if (spellid > 10) then local name, _, icon = EncounterDetails.getspellinfo (spellid) - tinsert(spell_list, {spellid, name, icon, nil, npc.serial}) + tinsert (spell_list, {spellid, name, icon, nil, npc.serial}) end end end @@ -1958,10 +1963,10 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) for i, npc in combat[2]:ListActors() do --heal if (npc:IsNeutralOrEnemy()) then - for spellid, spell in pairs(npc.spells._ActorTable) do + for spellid, spell in pairs (npc.spells._ActorTable) do if (spellid > 10) then local name, _, icon = EncounterDetails.getspellinfo (spellid) - tinsert(spell_list, {spellid, name, icon, true, npc.serial}) + tinsert (spell_list, {spellid, name, icon, true, npc.serial}) end end end @@ -1988,7 +1993,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) wipe(already_added) local timersToAdd = {} - for timerId, timerTable in pairs(db.encounter_timers_dbm) do + for timerId, timerTable in pairs (db.encounter_timers_dbm) do if (timerTable.id == encounter_id) then local spellId = timerTable [7] local spellIcon = timerTable [5] @@ -2001,12 +2006,12 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) if (spell and not already_added[spell]) then if (spell > 40000) then local spellname, _, spellicon = _GetSpellInfo(spell) - tinsert(timersToAdd, {label = spellname, value = {timerTable[2], spellname, spellIcon or spellicon, timerTable.id, timerTable[7]}, icon = spellIcon or spellicon}) + tinsert (timersToAdd, {label = spellname, value = {timerTable[2], spellname, spellIcon or spellicon, timerTable.id, timerTable[7]}, icon = spellIcon or spellicon}) 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) - tinsert(timersToAdd, {label = sectionInfo.title, value = {timerTable[2], sectionInfo.title, spellIcon or sectionInfo.abilityIcon, timerTable.id, timerTable[7]}, icon = spellIcon or sectionInfo.abilityIcon}) + tinsert (timersToAdd, {label = sectionInfo.title, value = {timerTable[2], sectionInfo.title, spellIcon or sectionInfo.abilityIcon, timerTable.id, timerTable[7]}, icon = spellIcon or sectionInfo.abilityIcon}) end already_added[spell] = true @@ -2055,7 +2060,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) end end - local refresh_spellauras = function(self) + local refresh_spellauras = function (self) local pool = EncounterDetails_SpellAurasScroll.spell_pool local encounter_id = EncounterDetails_SpellAurasScroll.encounter_id @@ -2079,14 +2084,14 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) local is_heal = data [4] if (is_heal) then - bar.spellid:SetBackdropBorderColor(0, 1, 0) - bar.spellname:SetBackdropBorderColor(0, 1, 0) + bar.spellid:SetBackdropBorderColor (0, 1, 0) + bar.spellname:SetBackdropBorderColor (0, 1, 0) else - bar.spellid:SetBackdropBorderColor(0, 0, 0) - bar.spellname:SetBackdropBorderColor(0, 0, 0) + bar.spellid:SetBackdropBorderColor (0, 0, 0) + bar.spellname:SetBackdropBorderColor (0, 0, 0) end - bar.aurabutton:SetClickFunction(create_aura_func, data [1], encounter_id) + bar.aurabutton:SetClickFunction (create_aura_func, data [1], encounter_id) else bar:Hide() @@ -2097,28 +2102,28 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) end - 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) + 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) spell_scrollframe.Update = refresh_spellauras spell_scrollframe:Hide() EncounterDetails.SpellScrollframe = spell_scrollframe _G.DetailsFramework:ReskinSlider(spell_scrollframe) - tinsert(BossFrame.EnemySpellsWidgets, spell_scrollframe) + tinsert (BossFrame.EnemySpellsWidgets, spell_scrollframe) EncounterDetails.update_enemy_spells = update_enemy_spells - 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) + 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) bossmods_scrollframe.Update = refresh_bossmods_timers bossmods_scrollframe:Hide() EncounterDetails.BossModsScrollframe = bossmods_scrollframe - tinsert(BossFrame.EnemySpellsWidgets, bossmods_scrollframe) + tinsert (BossFrame.EnemySpellsWidgets, bossmods_scrollframe) EncounterDetails.update_bossmods = function() bossmods_scrollframe:Update() end @@ -2129,20 +2134,20 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) wipe (already_added) local encounter_id = EncounterDetails_SpellAurasScroll.encounter_id - for timer_id, timer_table in pairs(db.encounter_timers_bw) do + for timer_id, timer_table in pairs (db.encounter_timers_bw) do if (timer_table.id == encounter_id) then local spell = timer_id if (spell and not already_added [spell]) then - local int_spell = tonumber(spell) + local int_spell = tonumber (spell) if (not int_spell) then - 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}) + 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}) elseif (int_spell < 0) then - 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}) + 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}) else - 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}) + 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}) end already_added [spell] = true @@ -2156,9 +2161,9 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -- ~phases -local PhaseFrame = CreateFrame("frame", "EncounterDetailsPhaseFrame", BossFrame, "BackdropTemplate") +local PhaseFrame = CreateFrame ("frame", "EncounterDetailsPhaseFrame", BossFrame, "BackdropTemplate") PhaseFrame:SetAllPoints() -PhaseFrame:SetFrameLevel(BossFrame:GetFrameLevel()+1) +PhaseFrame:SetFrameLevel (BossFrame:GetFrameLevel()+1) PhaseFrame.DamageTable = {} PhaseFrame.HealingTable = {} PhaseFrame.LastPhaseSelected = 1 @@ -2170,20 +2175,20 @@ local ScrollWidth, ScrollHeight, ScrollLineAmount, ScrollLineHeight = 250, 420, local PhasesY = -88 local AnchorY = -120 -PhaseFrame:SetScript("OnShow", function() +PhaseFrame:SetScript ("OnShow", function() PhaseFrame.OnSelectPhase (1) end) function PhaseFrame:ClearAll() --disable all buttons for i = 1, #PhaseFrame.PhaseButtons do - PhaseFrame.PhaseButtons[i]:SetTemplate(PhaseButtonTemplate) + PhaseFrame.PhaseButtons[i]:SetTemplate (PhaseButtonTemplate) PhaseFrame.PhaseButtons[i]:Disable() end --update damage and healing scrolls - table.wipe(PhaseFrame.DamageTable) - table.wipe(PhaseFrame.HealingTable) + table.wipe (PhaseFrame.DamageTable) + table.wipe (PhaseFrame.HealingTable) --refresh the scroll PhaseFrame.Damage_Scroll:Refresh() @@ -2193,7 +2198,7 @@ function PhaseFrame:ClearAll() PhaseFrame:ClearPhaseBars() end -local selectSegment = function(_, _, phaseSelected) +local selectSegment = function (_, _, phaseSelected) PhaseFrame ["OnSelectPhase"] (phaseSelected) end @@ -2202,7 +2207,7 @@ function PhaseFrame.OnSelectPhase (phaseSelected) PhaseFrame:ClearAll() --get the selected segment - PhaseFrame.CurrentSegment = EncounterDetails:GetCombat(EncounterDetails._segment) + PhaseFrame.CurrentSegment = EncounterDetails:GetCombat (EncounterDetails._segment) if (not PhaseFrame.CurrentSegment) then return end @@ -2217,20 +2222,20 @@ function PhaseFrame.OnSelectPhase (phaseSelected) PhaseFrame.LastPhaseSelected = phaseSelected local phases = PhaseFrame:GetPhaseTimers (PhaseFrame.CurrentSegment, true) - for buttonIndex, phase in ipairs(phases) do + for buttonIndex, phase in ipairs (phases) do local button = PhaseFrame.PhaseButtons [buttonIndex] if (phase == phaseSelected) then - button:SetTemplate(PhaseButtonTemplateHighlight) + button:SetTemplate (PhaseButtonTemplateHighlight) else - button:SetTemplate(PhaseButtonTemplate) + button:SetTemplate (PhaseButtonTemplate) if (PhaseFrame.CurrentSegment.PhaseData.damage [phase]) then button:Enable() else button:Disable() end end - button:SetText(phase) - button:SetClickFunction(selectSegment, phase) + button:SetText (phase) + button:SetClickFunction (selectSegment, phase) end if (not phaseData.damage [phaseSelected]) then @@ -2239,15 +2244,15 @@ function PhaseFrame.OnSelectPhase (phaseSelected) end --update damage and healing scrolls - table.wipe(PhaseFrame.DamageTable) - for charName, amount in pairs(phaseData.damage [phaseSelected]) do - tinsert(PhaseFrame.DamageTable, {charName, amount}) + table.wipe (PhaseFrame.DamageTable) + for charName, amount in pairs (phaseData.damage [phaseSelected]) do + tinsert (PhaseFrame.DamageTable, {charName, amount}) end table.sort (PhaseFrame.DamageTable, function(a, b) return a[2] > b[2] end) - table.wipe(PhaseFrame.HealingTable) - for charName, amount in pairs(phaseData.heal [phaseSelected]) do - tinsert(PhaseFrame.HealingTable, {charName, amount}) + table.wipe (PhaseFrame.HealingTable) + for charName, amount in pairs (phaseData.heal [phaseSelected]) do + tinsert (PhaseFrame.HealingTable, {charName, amount}) end table.sort (PhaseFrame.HealingTable, function(a, b) return a[2] > b[2] end) @@ -2258,74 +2263,74 @@ function PhaseFrame.OnSelectPhase (phaseSelected) PhaseFrame:UpdatePhaseBars() end -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") +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") -local report_damage = function(IsCurrent, IsReverse, AmtLines) +local report_damage = function (IsCurrent, IsReverse, AmtLines) local result = {} - local reportFunc = function(IsCurrent, IsReverse, AmtLines) + local reportFunc = function (IsCurrent, IsReverse, AmtLines) AmtLines = AmtLines + 1 if (#result > AmtLines) then for i = #result, AmtLines+1, -1 do - tremove(result, i) + tremove (result, i) end end EncounterDetails:SendReportLines (result) end - tinsert(result, "Details!: Damage for Phase " .. PhaseFrame.LastPhaseSelected .. " of " .. (PhaseFrame.CurrentSegment and PhaseFrame.CurrentSegment.is_boss and PhaseFrame.CurrentSegment.is_boss.name or "Unknown") .. ":") + tinsert (result, "Details!: Damage for Phase " .. PhaseFrame.LastPhaseSelected .. " of " .. (PhaseFrame.CurrentSegment and PhaseFrame.CurrentSegment.is_boss and PhaseFrame.CurrentSegment.is_boss.name or "Unknown") .. ":") for i = 1, #PhaseFrame.DamageTable do - tinsert(result, EncounterDetails:GetOnlyName(PhaseFrame.DamageTable[i][1]) .. ": " .. _detalhes:ToK (_math_floor(PhaseFrame.DamageTable [i][2]))) + tinsert (result, EncounterDetails:GetOnlyName (PhaseFrame.DamageTable[i][1]) .. ": " .. _detalhes:ToK (_math_floor (PhaseFrame.DamageTable [i][2]))) end EncounterDetails:SendReportWindow (reportFunc, nil, nil, true) end -local Report_DamageButton = _detalhes.gump:CreateButton(PhaseFrame, report_damage, 16, 16, "report") -Report_DamageButton:SetPoint("left", DamageLabel, "left", ScrollWidth-44, 0) +local Report_DamageButton = _detalhes.gump:CreateButton (PhaseFrame, report_damage, 16, 16, "report") +Report_DamageButton:SetPoint ("left", DamageLabel, "left", ScrollWidth-44, 0) Report_DamageButton.textcolor = "gray" Report_DamageButton.textsize = 9 local report_healing = function() local result = {} - local reportFunc = function(IsCurrent, IsReverse, AmtLines) + local reportFunc = function (IsCurrent, IsReverse, AmtLines) AmtLines = AmtLines + 1 if (#result > AmtLines) then for i = #result, AmtLines+1, -1 do - tremove(result, i) + tremove (result, i) end end EncounterDetails:SendReportLines (result) end - tinsert(result, "Details!: Healing for Phase " .. PhaseFrame.LastPhaseSelected .. " of " .. (PhaseFrame.CurrentSegment and PhaseFrame.CurrentSegment.is_boss and PhaseFrame.CurrentSegment.is_boss.name or "Unknown") .. ":") + tinsert (result, "Details!: Healing for Phase " .. PhaseFrame.LastPhaseSelected .. " of " .. (PhaseFrame.CurrentSegment and PhaseFrame.CurrentSegment.is_boss and PhaseFrame.CurrentSegment.is_boss.name or "Unknown") .. ":") for i = 1, #PhaseFrame.HealingTable do - tinsert(result, EncounterDetails:GetOnlyName(PhaseFrame.HealingTable[i][1]) .. ": " .. _detalhes:ToK (_math_floor(PhaseFrame.HealingTable [i][2]))) + tinsert (result, EncounterDetails:GetOnlyName (PhaseFrame.HealingTable[i][1]) .. ": " .. _detalhes:ToK (_math_floor (PhaseFrame.HealingTable [i][2]))) end EncounterDetails:SendReportWindow (reportFunc, nil, nil, true) end -local Report_HealingButton = _detalhes.gump:CreateButton(PhaseFrame, report_healing, 16, 16, "report") -Report_HealingButton:SetPoint("left", HealLabel, "left", ScrollWidth-44, 0) +local Report_HealingButton = _detalhes.gump:CreateButton (PhaseFrame, report_healing, 16, 16, "report") +Report_HealingButton:SetPoint ("left", HealLabel, "left", ScrollWidth-44, 0) Report_HealingButton.textcolor = "gray" Report_HealingButton.textsize = 9 -PhaseSelectLabel:SetPoint("topleft", PhaseFrame, "topleft", 10, PhasesY) +PhaseSelectLabel:SetPoint ("topleft", PhaseFrame, "topleft", 10, PhasesY) -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) +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) for i = 1, 10 do - 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) + 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) end -local ScrollRefresh = function(self, data, offset, total_lines) +local ScrollRefresh = function (self, data, offset, total_lines) local formatToK = Details:GetCurrentToKFunction() local removeRealm = _detalhes.GetOnlyName @@ -2336,14 +2341,14 @@ local ScrollRefresh = function(self, data, offset, total_lines) local player = data [index] if (player) then local line = self:GetLine (i) - local texture, L, R, T, B = _detalhes:GetPlayerIcon(player[1], PhaseFrame.CurrentSegment) + local texture, L, R, T, B = _detalhes:GetPlayerIcon (player[1], PhaseFrame.CurrentSegment) - 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]) + 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]) if (actorClass) then line.statusbar:SetColor (actorClass) else @@ -2353,75 +2358,75 @@ local ScrollRefresh = function(self, data, offset, total_lines) end end -local line_onenter = function(self) - self:SetBackdropColor(unpack(BGColorDefault_Hover)) +local line_onenter = function (self) + self:SetBackdropColor (unpack (BGColorDefault_Hover)) end -local line_onleave = function(self) - self:SetBackdropColor(unpack(BGColorDefault)) +local line_onleave = function (self) + self:SetBackdropColor (unpack (BGColorDefault)) end -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) +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) - line:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - line:SetBackdropColor(unpack(BGColorDefault)) + line:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + line:SetBackdropColor (unpack (BGColorDefault)) local statusBar = DetailsFrameWork:CreateBar (line, EncounterDetails.Frame.DefaultBarTexture, 1, 1, 100) - statusBar:SetAllPoints(line) + statusBar:SetAllPoints (line) statusBar.backgroundtexture = EncounterDetails.Frame.DefaultBarTexture statusBar.backgroundcolor = {.3, .3, .3, .3} - local icon = statusBar:CreateTexture("$parentIcon", "overlay") - icon:SetSize(ScrollLineHeight, ScrollLineHeight) + local icon = statusBar:CreateTexture ("$parentIcon", "overlay") + icon:SetSize (ScrollLineHeight, ScrollLineHeight) - 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") + 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") - local done = statusBar:CreateFontString("$parentDone", "overlay", "GameFontNormal") - _detalhes.gump:SetFontSize(done, 10) - _detalhes.gump:SetFontColor(done, "white") - done:SetPoint("right", line, "right", -2, 0) + local done = statusBar:CreateFontString ("$parentDone", "overlay", "GameFontNormal") + _detalhes.gump:SetFontSize (done, 10) + _detalhes.gump:SetFontColor (done, "white") + done:SetPoint ("right", line, "right", -2, 0) line.icon = icon line.name = name line.done = done line.statusbar = statusBar - name:SetHeight(10) - name:SetJustifyH("left") + name:SetHeight (10) + name:SetJustifyH ("left") 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) -Damage_Scroll:SetPoint("topleft", DamageLabel.widget, "bottomleft", 0, -4) -Heal_Scroll:SetPoint("topleft", HealLabel.widget, "bottomleft", 0, -4) +Damage_Scroll:SetPoint ("topleft", DamageLabel.widget, "bottomleft", 0, -4) +Heal_Scroll:SetPoint ("topleft", HealLabel.widget, "bottomleft", 0, -4) -_detalhes.gump:ReskinSlider(Damage_Scroll, 4) -_detalhes.gump:ReskinSlider(Heal_Scroll, 4) +_detalhes.gump:ReskinSlider (Damage_Scroll, 4) +_detalhes.gump:ReskinSlider (Heal_Scroll, 4) for i = 1, ScrollLineAmount do Damage_Scroll:CreateLine (ScrollCreateLine) end PhaseFrame.Damage_Scroll = Damage_Scroll -Damage_Scroll:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16}) -Damage_Scroll:SetBackdropColor(0, 0, 0, .4) +Damage_Scroll:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16}) +Damage_Scroll:SetBackdropColor (0, 0, 0, .4) for i = 1, ScrollLineAmount do Heal_Scroll:CreateLine (ScrollCreateLine) end PhaseFrame.Heal_Scroll = Heal_Scroll -Heal_Scroll:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16}) -Heal_Scroll:SetBackdropColor(0, 0, 0, .4) +Heal_Scroll:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16}) +Heal_Scroll:SetBackdropColor (0, 0, 0, .4) ---------------------------------------------------------- @@ -2429,82 +2434,82 @@ Heal_Scroll:SetBackdropColor(0, 0, 0, .4) PhaseFrame.PhasesBars = {} PhaseFrame.PhasesSegmentCompare = {} -local PhaseBarOnEnter = function(self) +local PhaseBarOnEnter = function (self) PhaseFrame:UpdateSegmentCompareBars (self.phase) - self:SetBackdropColor(unpack(BGColorDefault_Hover)) + self:SetBackdropColor (unpack (BGColorDefault_Hover)) end -local PhaseBarOnLeave = function(self) +local PhaseBarOnLeave = function (self) PhaseFrame:ClearSegmentCompareBars() - self:SetBackdropColor(unpack(BGColorDefault)) + self:SetBackdropColor (unpack (BGColorDefault)) end -local PhaseBarOnClick = function(self) +local PhaseBarOnClick = function (self) --report end --cria as linhas mostrando o tempo decorride de cada phase for i = 1, 10 do - 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) + 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)) + 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) + 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) + icon:SetPoint ("left", line, "left", 2, 0) + name:SetPoint ("left", icon, "right", 2, 0) + done:SetPoint ("right", line, "right", -3, 0) line.icon = icon line.name = name line.done = done - name:SetHeight(10) - name:SetJustifyH("left") + name:SetHeight (10) + name:SetJustifyH ("left") - tinsert(PhaseFrame.PhasesBars, line) + tinsert (PhaseFrame.PhasesBars, line) 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 - 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) + 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) - line:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - line:SetBackdropColor(unpack(BGColorDefault)) + line:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + line:SetBackdropColor (unpack (BGColorDefault)) line:Hide() - local name = line:CreateFontString("$parentName", "overlay", "GameFontNormal") - _detalhes.gump:SetFontSize(name, 9) - name:SetPoint("left", line, "left", 2, 0) + local name = line:CreateFontString ("$parentName", "overlay", "GameFontNormal") + _detalhes.gump:SetFontSize (name, 9) + name:SetPoint ("left", line, "left", 2, 0) - local done = line:CreateFontString("$parentDone", "overlay", "GameFontNormal") - _detalhes.gump:SetFontSize(done, 9) - done:SetPoint("right", line, "right", -2, 0) + local done = line:CreateFontString ("$parentDone", "overlay", "GameFontNormal") + _detalhes.gump:SetFontSize (done, 9) + done:SetPoint ("right", line, "right", -2, 0) line.name = name line.done = done - name:SetHeight(10) - name:SetJustifyH("left") + name:SetHeight (10) + name:SetJustifyH ("left") - tinsert(PhaseFrame.PhasesSegmentCompare, line) + tinsert (PhaseFrame.PhasesSegmentCompare, line) end function PhaseFrame:ClearPhaseBars() for i = 1, #PhaseFrame.PhasesBars do local bar = PhaseFrame.PhasesBars[i] - bar.name:SetText("") - bar.done:SetText("") + bar.name:SetText ("") + bar.done:SetText ("") bar.phase = nil bar:Hide() end @@ -2521,7 +2526,7 @@ function PhaseFrame:GetPhaseTimers (segment, ordered) segment = segment or PhaseFrame.CurrentSegment for phaseIT = 1, #segment.PhaseData do - local phase, startAt = unpack(segment.PhaseData [phaseIT]) --phase iterator + local phase, startAt = unpack (segment.PhaseData [phaseIT]) --phase iterator 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 @@ -2529,10 +2534,10 @@ function PhaseFrame:GetPhaseTimers (segment, ordered) if (ordered) then local order = {} - for phase, _ in pairs(t) do - tinsert(order, phase) + for phase, _ in pairs (t) do + tinsert (order, phase) end - table.sort (order, function(a, b) return a < b end) + table.sort (order, function (a, b) return a < b end) return order, t end @@ -2543,10 +2548,10 @@ end function PhaseFrame:UpdatePhaseBars() local timers, hash = PhaseFrame:GetPhaseTimers (PhaseFrame.CurrentSegment, true) local i = 1 - for index, phase in ipairs(timers) do + for index, phase in ipairs (timers) do local timer = hash [phase] - PhaseFrame.PhasesBars [i].name:SetText("|cFFC0C0C0Phase:|r |cFFFFFFFF" .. phase) - PhaseFrame.PhasesBars [i].done:SetText(_detalhes.gump:IntegerToTimer(timer)) + PhaseFrame.PhasesBars [i].name:SetText ("|cFFC0C0C0Phase:|r |cFFFFFFFF" .. phase) + PhaseFrame.PhasesBars [i].done:SetText (_detalhes.gump:IntegerToTimer (timer)) PhaseFrame.PhasesBars [i].phase = phase PhaseFrame.PhasesBars [i]:Show() i = i + 1 @@ -2561,7 +2566,7 @@ function PhaseFrame:UpdateSegmentCompareBars (phase) local bossID = segmentTable:GetBossInfo() and segmentTable:GetBossInfo().id local index = 1 - for i, segment in ipairs(_detalhes:GetCombatSegments()) do + for i, segment in ipairs (_detalhes:GetCombatSegments()) do if (segment:GetBossInfo() and segment:GetBossInfo().id == bossID) then local bar = PhaseFrame.PhasesSegmentCompare [index] @@ -2569,20 +2574,20 @@ function PhaseFrame:UpdateSegmentCompareBars (phase) if (timers [phase]) then if (segment ~= segmentTable) then - 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") + 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") else - 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") + 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") end else - bar.name:SetText("Segment " .. i .. ":") - _detalhes.gump:SetFontColor(bar.name, "red") - bar.done:SetText("--x--x--") + bar.name:SetText ("Segment " .. i .. ":") + _detalhes.gump:SetFontColor (bar.name, "red") + bar.done:SetText ("--x--x--") end bar:Show() @@ -2611,13 +2616,13 @@ end local backdrop = {edgeFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, edgeSize = 1, insets = {left = 1, right = 1, top = 0, bottom = 1}} - --Selecionar o segmento + --> Selecionar o segmento - local buildSegmentosMenu = function(self) + local buildSegmentosMenu = function (self) local historico = _detalhes.tabela_historico.tabelas local return_table = {} - for index, combate in ipairs(historico) do + for index, combate in ipairs (historico) do 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} @@ -2627,37 +2632,37 @@ end return return_table end - local segmentos_string = DetailsFrameWork:NewLabel(frame, nil, nil, "segmentosString", "Segment:", "GameFontNormal", 12) - segmentos_string:SetPoint("bottomleft", frame, "bottomleft", 20, 16) + local segmentos_string = DetailsFrameWork:NewLabel (frame, nil, nil, "segmentosString", "Segment:", "GameFontNormal", 12) + segmentos_string:SetPoint ("bottomleft", frame, "bottomleft", 20, 16) -- ~dropdown local segmentos = DetailsFrameWork:NewDropDown (frame, _, "$parentSegmentsDropdown", "segmentosDropdown", 160, 20, buildSegmentosMenu, nil) - segmentos:SetPoint("left", segmentos_string, "right", 2, 0) - segmentos:SetTemplate(DetailsFrameWork:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) + segmentos:SetPoint ("left", segmentos_string, "right", 2, 0) + segmentos:SetTemplate (DetailsFrameWork:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) - --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")) + --> 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")) options:SetIcon ([[Interface\Buttons\UI-OptionsButton]], 14, 14, nil, {0, 1, 0, 1}, nil, 3) - --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) + --> 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) BossFrame.MacroEditBox:HookScript ("OnEditFocusGained", function() - C_Timer.After(0, function() BossFrame.MacroEditBox:HighlightText() end) + C_Timer.After (0, function() BossFrame.MacroEditBox:HighlightText() end) end) - 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) + 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) - --Caixa do Dano total tomado pela Raid + --> Caixa do Dano total tomado pela Raid -- ~containers ~damagetaken @@ -2670,105 +2675,105 @@ end local BOX_HEIGHT_UPPER = CONST_BOX_HEIGHT --175 - local container_damagetaken_window = CreateFrame("ScrollFrame", "Details_Boss_ContainerDamageTaken", frame,"BackdropTemplate") + local container_damagetaken_window = CreateFrame ("ScrollFrame", "Details_Boss_ContainerDamageTaken", frame,"BackdropTemplate") set_backdrop (container_damagetaken_window) - local container_damagetaken_frame = CreateFrame("Frame", "Details_Boss_FrameDamageTaken", container_damagetaken_window,"BackdropTemplate") + local container_damagetaken_frame = CreateFrame ("Frame", "Details_Boss_FrameDamageTaken", container_damagetaken_window,"BackdropTemplate") frame.Widgets [#frame.Widgets+1] = container_damagetaken_window - container_damagetaken_frame:SetScript("OnMouseDown", mouse_down) - container_damagetaken_frame:SetScript("OnMouseUp", mouse_up) + container_damagetaken_frame:SetScript ("OnMouseDown", mouse_down) + container_damagetaken_frame:SetScript ("OnMouseUp", mouse_up) container_damagetaken_frame.barras = {} --label titulo & background - 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) + 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) frame.Widgets [#frame.Widgets+1] = dano_recebido_bg - 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) + 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) - container_damagetaken_frame:SetBackdrop(backdrop) - container_damagetaken_frame:SetBackdropBorderColor(0,0,0,0) - container_damagetaken_frame:SetBackdropColor(0, 0, 0, 0.6) + container_damagetaken_frame:SetBackdrop (backdrop) + container_damagetaken_frame:SetBackdropBorderColor (0,0,0,0) + container_damagetaken_frame:SetBackdropColor (0, 0, 0, 0.6) - 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) + 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) - container_damagetaken_window:SetWidth(BOX_WIDTH) - container_damagetaken_window:SetHeight(BOX_HEIGHT) - container_damagetaken_window:SetScrollChild(container_damagetaken_frame) - container_damagetaken_window:SetPoint("TOPLEFT", frame, "TOPLEFT", 10, -92) + container_damagetaken_window:SetWidth (BOX_WIDTH) + container_damagetaken_window:SetHeight (BOX_HEIGHT) + container_damagetaken_window:SetScrollChild (container_damagetaken_frame) + container_damagetaken_window:SetPoint ("TOPLEFT", frame, "TOPLEFT", 10, -92) 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 - _detalhes.gump:ReskinSlider(container_damagetaken_window) + _detalhes.gump:ReskinSlider (container_damagetaken_window) 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 - --Caixa das Habilidades do boss + --> Caixa das Habilidades do boss --~ability ~damage taken by spell - local container_habilidades_window = CreateFrame("ScrollFrame", "Details_Boss_ContainerHabilidades", frame,"BackdropTemplate") + local container_habilidades_window = CreateFrame ("ScrollFrame", "Details_Boss_ContainerHabilidades", frame,"BackdropTemplate") set_backdrop (container_habilidades_window) - 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) + 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) container_habilidades_frame.barras = {} --label titulo % background - 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) + 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) frame.Widgets [#frame.Widgets+1] = habilidades_inimigas_bg frame.Widgets [#frame.Widgets+1] = container_habilidades_window frame.Widgets [#frame.Widgets+1] = container_habilidades_frame - 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) + 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) - container_habilidades_frame:SetBackdrop(backdrop) - container_habilidades_frame:SetBackdropBorderColor(0,0,0,0) - container_habilidades_frame:SetBackdropColor(0, 0, 0, 0.6) + container_habilidades_frame:SetBackdrop (backdrop) + container_habilidades_frame:SetBackdropBorderColor (0,0,0,0) + container_habilidades_frame:SetBackdropColor (0, 0, 0, 0.6) - 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) + 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) - container_habilidades_window:SetWidth(BOX_WIDTH) - container_habilidades_window:SetHeight(BOX_HEIGHT) - container_habilidades_window:SetScrollChild(container_habilidades_frame) - container_habilidades_window:SetPoint("TOPLEFT", container_damagetaken_window, "bottomleft", 0, CONST_BOX_VERTICAL_SPACING) --LOCATION + container_habilidades_window:SetWidth (BOX_WIDTH) + container_habilidades_window:SetHeight (BOX_HEIGHT) + container_habilidades_window:SetScrollChild (container_habilidades_frame) + container_habilidades_window:SetPoint ("TOPLEFT", container_damagetaken_window, "bottomleft", 0, CONST_BOX_VERTICAL_SPACING) --LOCATION 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 - _detalhes.gump:ReskinSlider(container_habilidades_window) + _detalhes.gump:ReskinSlider (container_habilidades_window) container_habilidades_window.gump = container_habilidades_frame container_habilidades_frame.window = container_habilidades_window @@ -2776,90 +2781,90 @@ end frame.overall_habilidades = container_habilidades_window - --Caixa dos Adds + --> Caixa dos Adds -- ~adds �dds local BOX_WIDTH = 270 local BOX_HEIGHT = CONST_BOX_HEIGHT --173 - local container_adds_window = CreateFrame("ScrollFrame", "Details_Boss_ContainerAdds", frame,"BackdropTemplate") + local container_adds_window = CreateFrame ("ScrollFrame", "Details_Boss_ContainerAdds", frame,"BackdropTemplate") set_backdrop (container_adds_window) - local container_adds_frame = CreateFrame("Frame", "Details_Boss_FrameAdds", container_adds_window, "BackdropTemplate") + local container_adds_frame = CreateFrame ("Frame", "Details_Boss_FrameAdds", container_adds_window, "BackdropTemplate") frame.Widgets [#frame.Widgets+1] = container_adds_frame frame.Widgets [#frame.Widgets+1] = container_adds_window container_adds_frame.barras = {} - local adds_total_string = DetailsFrameWork:CreateLabel(container_adds_window, "damage taken") + local adds_total_string = DetailsFrameWork:CreateLabel (container_adds_window, "damage taken") adds_total_string.textcolor = "gray" adds_total_string.textsize = 9 - adds_total_string:SetPoint("bottomright", container_adds_window, "topright", 0, 3) + adds_total_string:SetPoint ("bottomright", container_adds_window, "topright", 0, 3) - 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) + 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) - container_adds_window:SetWidth(BOX_WIDTH) - container_adds_window:SetHeight(BOX_HEIGHT_UPPER) - container_adds_window:SetScrollChild(container_adds_frame) - container_adds_window:SetPoint("TOPLEFT", container_damagetaken_window, "topright", CONST_BOX_HORIZONTAL_SPACING, 0) + container_adds_window:SetWidth (BOX_WIDTH) + container_adds_window:SetHeight (BOX_HEIGHT_UPPER) + container_adds_window:SetScrollChild (container_adds_frame) + container_adds_window:SetPoint ("TOPLEFT", container_damagetaken_window, "topright", CONST_BOX_HORIZONTAL_SPACING, 0) - 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) + 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) 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 - _detalhes.gump:ReskinSlider(container_adds_window) + _detalhes.gump:ReskinSlider (container_adds_window) 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 - --Caixa dos interrupts (kicks) + --> Caixa dos interrupts (kicks) -- ~interrupt - local container_interrupt_window = CreateFrame("ScrollFrame", "Details_Boss_Containerinterrupt", frame,"BackdropTemplate") + local container_interrupt_window = CreateFrame ("ScrollFrame", "Details_Boss_Containerinterrupt", frame,"BackdropTemplate") set_backdrop (container_interrupt_window) - local container_interrupt_frame = CreateFrame("Frame", "Details_Boss_Frameinterrupt", container_interrupt_window, "BackdropTemplate") + local container_interrupt_frame = CreateFrame ("Frame", "Details_Boss_Frameinterrupt", container_interrupt_window, "BackdropTemplate") - local interrupt_total_string = DetailsFrameWork:CreateLabel(container_interrupt_window, "interrupts / casts") + local interrupt_total_string = DetailsFrameWork:CreateLabel (container_interrupt_window, "interrupts / casts") interrupt_total_string.textcolor = "gray" interrupt_total_string.textsize = 9 - interrupt_total_string:SetPoint("bottomright", container_interrupt_window, "topright", 0, 3) + interrupt_total_string:SetPoint ("bottomright", container_interrupt_window, "topright", 0, 3) frame.Widgets [#frame.Widgets+1] = container_interrupt_window frame.Widgets [#frame.Widgets+1] = container_interrupt_frame - container_interrupt_frame:SetScript("OnMouseDown", mouse_down) - container_interrupt_frame:SetScript("OnMouseUp", mouse_up) + container_interrupt_frame:SetScript ("OnMouseDown", mouse_down) + container_interrupt_frame:SetScript ("OnMouseUp", mouse_up) container_interrupt_frame.barras = {} - 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) + 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) - container_interrupt_window:SetWidth(BOX_WIDTH) - container_interrupt_window:SetHeight(BOX_HEIGHT_UPPER) - container_interrupt_window:SetScrollChild(container_interrupt_frame) - container_interrupt_window:SetPoint("TOPLEFT", container_adds_window, "TOPRIGHT", CONST_BOX_HORIZONTAL_SPACING, 0) + container_interrupt_window:SetWidth (BOX_WIDTH) + container_interrupt_window:SetHeight (BOX_HEIGHT_UPPER) + container_interrupt_window:SetScrollChild (container_interrupt_frame) + container_interrupt_window:SetPoint ("TOPLEFT", container_adds_window, "TOPRIGHT", CONST_BOX_HORIZONTAL_SPACING, 0) - 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) + 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) 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 - _detalhes.gump:ReskinSlider(container_interrupt_window) + _detalhes.gump:ReskinSlider (container_interrupt_window) container_interrupt_window.gump = container_interrupt_frame @@ -2867,95 +2872,95 @@ end container_interrupt_window.ultimo = 0 frame.overall_interrupt = container_interrupt_window - --Caixa dos Dispells + --> Caixa dos Dispells -- ~dispel - local container_dispell_window = CreateFrame("ScrollFrame", "Details_Boss_Containerdispell", frame,"BackdropTemplate") + local container_dispell_window = CreateFrame ("ScrollFrame", "Details_Boss_Containerdispell", frame,"BackdropTemplate") set_backdrop (container_dispell_window) - local container_dispell_frame = CreateFrame("Frame", "Details_Boss_Framedispell", container_dispell_window, "BackdropTemplate") + local container_dispell_frame = CreateFrame ("Frame", "Details_Boss_Framedispell", container_dispell_window, "BackdropTemplate") - local dispell_total_string = DetailsFrameWork:CreateLabel(container_dispell_window, "total dispels") + local dispell_total_string = DetailsFrameWork:CreateLabel (container_dispell_window, "total dispels") dispell_total_string.textcolor = "gray" dispell_total_string.textsize = 9 - dispell_total_string:SetPoint("bottomright", container_dispell_window, "topright", 0, 3) + dispell_total_string:SetPoint ("bottomright", container_dispell_window, "topright", 0, 3) frame.Widgets [#frame.Widgets+1] = container_dispell_window frame.Widgets [#frame.Widgets+1] = container_dispell_frame - container_dispell_frame:SetScript("OnMouseDown", mouse_down) - container_dispell_frame:SetScript("OnMouseUp", mouse_up) + container_dispell_frame:SetScript ("OnMouseDown", mouse_down) + container_dispell_frame:SetScript ("OnMouseUp", mouse_up) container_dispell_frame.barras = {} - 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) + 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) - container_dispell_window:SetWidth(BOX_WIDTH) - container_dispell_window:SetHeight(BOX_HEIGHT_UPPER) - container_dispell_window:SetScrollChild(container_dispell_frame) - container_dispell_window:SetPoint("TOPLEFT", container_adds_window, "BOTTOMLEFT", 0, CONST_BOX_VERTICAL_SPACING) + container_dispell_window:SetWidth (BOX_WIDTH) + container_dispell_window:SetHeight (BOX_HEIGHT_UPPER) + container_dispell_window:SetScrollChild (container_dispell_frame) + container_dispell_window:SetPoint ("TOPLEFT", container_adds_window, "BOTTOMLEFT", 0, CONST_BOX_VERTICAL_SPACING) - 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) + 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) 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 - _detalhes.gump:ReskinSlider(container_dispell_window) + _detalhes.gump:ReskinSlider (container_dispell_window) 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 - --Caixa das mortes + --> Caixa das mortes -- ~mortes ~deaths ~dead - local container_dead_window = CreateFrame("ScrollFrame", "Details_Boss_ContainerDead", frame,"BackdropTemplate") + local container_dead_window = CreateFrame ("ScrollFrame", "Details_Boss_ContainerDead", frame,"BackdropTemplate") set_backdrop (container_dead_window) - local container_dead_frame = CreateFrame("Frame", "Details_Boss_FrameDead", container_dead_window, "BackdropTemplate") + local container_dead_frame = CreateFrame ("Frame", "Details_Boss_FrameDead", container_dead_window, "BackdropTemplate") - local dead_total_string = DetailsFrameWork:CreateLabel(container_dead_window, "time of death") + local dead_total_string = DetailsFrameWork:CreateLabel (container_dead_window, "time of death") dead_total_string.textcolor = "gray" dead_total_string.textsize = 9 - dead_total_string:SetPoint("bottomright", container_dead_window, "topright", 0, 3) + dead_total_string:SetPoint ("bottomright", container_dead_window, "topright", 0, 3) frame.Widgets [#frame.Widgets+1] = container_dead_window frame.Widgets [#frame.Widgets+1] = container_dead_frame - container_dead_frame:SetScript("OnMouseDown", mouse_down) - container_dead_frame:SetScript("OnMouseUp", mouse_up) + container_dead_frame:SetScript ("OnMouseDown", mouse_down) + container_dead_frame:SetScript ("OnMouseUp", mouse_up) container_dead_frame.barras = {} - 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) + 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) - container_dead_frame:SetWidth(BOX_WIDTH) - container_dead_frame:SetHeight(BOX_HEIGHT) + container_dead_frame:SetWidth (BOX_WIDTH) + container_dead_frame:SetHeight (BOX_HEIGHT) - container_dead_frame:EnableMouse(true) - container_dead_frame:SetResizable(false) - container_dead_frame:SetMovable(true) + container_dead_frame:EnableMouse (true) + container_dead_frame:SetResizable (false) + container_dead_frame:SetMovable (true) - container_dead_window:SetWidth(BOX_WIDTH) - container_dead_window:SetHeight(BOX_HEIGHT_UPPER) - container_dead_window:SetScrollChild(container_dead_frame) - container_dead_window:SetPoint("TOPLEFT", container_dispell_window, "TOPRIGHT", CONST_BOX_HORIZONTAL_SPACING, 0) + container_dead_window:SetWidth (BOX_WIDTH) + container_dead_window:SetHeight (BOX_HEIGHT_UPPER) + container_dead_window:SetScrollChild (container_dead_frame) + container_dead_window:SetPoint ("TOPLEFT", container_dispell_window, "TOPRIGHT", CONST_BOX_HORIZONTAL_SPACING, 0) - 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) + 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) 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 - _detalhes.gump:ReskinSlider(container_dead_window) + _detalhes.gump:ReskinSlider (container_dead_window) container_dead_window.gump = container_dead_frame container_dead_frame.window = container_dead_window @@ -2964,14 +2969,14 @@ end --emotes frame - local emote_frame = CreateFrame("frame", "DetailsEncountersEmoteFrame", UIParent, "BackdropTemplate") - 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_frame = CreateFrame ("frame", "DetailsEncountersEmoteFrame", UIParent, "BackdropTemplate") + 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, @@ -2983,18 +2988,18 @@ end ["CHAT_MSG_MONSTER_YELL"] = 7, } - emote_frame:SetScript("OnEvent", function(...) + emote_frame:SetScript ("OnEvent", function (...) if (not EncounterDetails.current_whisper_table) then return end - local combat = EncounterDetails:GetCombat("current") + local combat = EncounterDetails:GetCombat ("current") --local arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 = ... - --print("2 =", arg2, "3 =", arg3, "4 =", arg4, "5 =", arg5, "6 =", arg6, "7 =", arg7, "8 =", arg8, "9 =", arg9) + --print ("2 =", arg2, "3 =", arg3, "4 =", arg4, "5 =", arg5, "6 =", arg6, "7 =", arg7, "8 =", arg8, "9 =", arg9) if (combat and EncounterDetails:IsInCombat() and EncounterDetails:GetZoneType() == "raid") then local arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 = ... - tinsert(EncounterDetails.current_whisper_table, {combat:GetCombatTime(), arg3, arg4, emote_table [arg2]}) + tinsert (EncounterDetails.current_whisper_table, {combat:GetCombatTime(), arg3, arg4, emote_table [arg2]}) end end) diff --git a/plugins/Details_RaidCheck/Details_RaidCheck.lua b/plugins/Details_RaidCheck/Details_RaidCheck.lua index 0bdd3fbd..da7aa5aa 100644 --- a/plugins/Details_RaidCheck/Details_RaidCheck.lua +++ b/plugins/Details_RaidCheck/Details_RaidCheck.lua @@ -212,6 +212,7 @@ local CreatePluginFrames = function() {text = "Food", width = 45}, {text = "Flask", width = 45}, {text = "Rune", width = 45}, + {text = "M+ Score", width = 60}, --{text = "Pre-Pot Last Try", width = 100}, --{text = "Using Details!", width = 100}, } @@ -294,6 +295,9 @@ local CreatePluginFrames = function() --no rune local runeIndicator = DF:CreateImage(line, "", scrollLineHeight, scrollLineHeight) + --mythic+ + local mythicPlusIndicator = DF:CreateLabel(line) + --no pre pot --local PrePotIndicator = DF:CreateImage (line, "", scroll_line_height, scroll_line_height) --using details! @@ -306,6 +310,7 @@ local CreatePluginFrames = function() line:AddFrameToHeaderAlignment(foodIndicator) line:AddFrameToHeaderAlignment(flaskIndicator) line:AddFrameToHeaderAlignment(runeIndicator) + line:AddFrameToHeaderAlignment(mythicPlusIndicator) --line:AddFrameToHeaderAlignment(PrePotIndicator) --line:AddFrameToHeaderAlignment(DetailsIndicator) @@ -323,6 +328,7 @@ local CreatePluginFrames = function() line.FlaskIndicator = flaskIndicator line.FlaskTierIndicator = flaskTierIndicator line.RuneIndicator = runeIndicator + line.MythicPlusIndicator = mythicPlusIndicator --line.PrePotIndicator = PrePotIndicator --line.DetailsIndicator = DetailsIndicator @@ -407,8 +413,6 @@ local CreatePluginFrames = function() line.TalentsRow:ClearIcons() - --print("dssd", playerTable.Talents) - if (playerTable.Talents) then for i = 1, #playerTable.Talents do local talent = playerTable.Talents[i] @@ -454,6 +458,9 @@ local CreatePluginFrames = function() line.RuneIndicator.texture = playerTable.Rune and [[Interface\Scenarios\ScenarioIcon-Check]] or "" --line.PrePotIndicator.texture = playerTable.PrePot and [[Interface\Scenarios\ScenarioIcon-Check]] or "" --line.DetailsIndicator.texture = playerTable.UseDetails and [[Interface\Scenarios\ScenarioIcon-Check]] or "" + + --mythic+ score + line.MythicPlusIndicator.text = playerTable.MythicPlusScore and playerTable.MythicPlusScore > 0 and playerTable.MythicPlusScore or "" end end end @@ -638,6 +645,26 @@ local CreatePluginFrames = function() end end + local mythicPlusScore = 0 + local RaiderIO = _G.RaiderIO + + if (RaiderIO) then + local playerName, playerRealm = unitNameWithRealm:match("(.+)%-(.+)") + local faction = UnitFactionGroup(unitNameWithRealm) + faction = faction == "Horde" and 2 or 1 + + --local rioProfile = RaiderIO.GetProfile(playerName, playerRealm, faction == "Horde" and 2 or 1) + local rioProfile = RaiderIO.GetProfile(playerName, playerRealm) or RaiderIO.GetProfile(unitName, GetRealmName()) + + if (rioProfile and rioProfile.mythicKeystoneProfile) then + local mythicPlusProfile = rioProfile.mythicKeystoneProfile + local previousScore = mythicPlusProfile.previousScore or 0 + local currentScore = mythicPlusProfile.currentScore or 0 + mythicPlusScore = previousScore and previousScore > currentScore and previousScore or currentScore + mythicPlusScore = mythicPlusScore or currentScore + end + end + --order by class > alphabetically by the unit name unitClassID = (((unitClassID or 0) + 128) ^ 4) + tonumber(string.byte (unitName, 1) .. "" .. string.byte(unitName, 2)) @@ -656,6 +683,7 @@ local CreatePluginFrames = function() Rune = DetailsRaidCheck.havefocusaug_table[unitSerial], Eating = DetailsRaidCheck.iseating_table[unitSerial], UseDetails = Details.trusted_characters[unitSerial], + MythicPlusScore = mythicPlusScore, }) end @@ -683,6 +711,20 @@ local CreatePluginFrames = function() end end + local mythicPlusScore = 0 + local RaiderIO = _G.RaiderIO + + if (RaiderIO) then + local rioProfile = RaiderIO.GetProfile(unitName, GetRealmName()) + if (rioProfile and rioProfile.mythicKeystoneProfile) then + local mythicPlusProfile = rioProfile.mythicKeystoneProfile + local previousScore = mythicPlusProfile.previousScore or 0 + local currentScore = mythicPlusProfile.currentScore or 0 + mythicPlusScore = previousScore and previousScore > currentScore and previousScore or currentScore + mythicPlusScore = mythicPlusScore or currentScore + end + end + tinsert (PlayerData, {unitName, unitClassID, Name = unitName, UnitNameRealm = unitNameWithRealm, @@ -698,6 +740,7 @@ local CreatePluginFrames = function() Rune = DetailsRaidCheck.havefocusaug_table[unitSerial], Eating = DetailsRaidCheck.iseating_table[unitSerial], UseDetails = Details.trusted_characters[unitSerial], + MythicPlusScore = mythicPlusScore, }) end @@ -795,7 +838,7 @@ local CreatePluginFrames = function() local unitSerial = UnitGUID(unitId) local function handleAuraBuff(aura) - local auraInfo = C_UnitAuras.GetAuraDataByAuraInstanceID("player", aura.auraInstanceID) + local auraInfo = C_UnitAuras.GetAuraDataByAuraInstanceID(unitId, aura.auraInstanceID) if (auraInfo) then local buffName = auraInfo.name local spellId = auraInfo.spellId diff --git a/plugins/Details_Streamer/Details_Streamer.lua b/plugins/Details_Streamer/Details_Streamer.lua index 512913b1..66f4d99e 100644 --- a/plugins/Details_Streamer/Details_Streamer.lua +++ b/plugins/Details_Streamer/Details_Streamer.lua @@ -2411,7 +2411,7 @@ function StreamOverlay:OnEvent (_, event, ...) update_speed = 0.05, }, - is_first_run = true, + is_first_run = false, } StreamOverlay.DefaultConfigTable = default_options_table @@ -2428,76 +2428,7 @@ function StreamOverlay:OnEvent (_, event, ...) StreamOverlay:SetPluginDescription ("Show in real time the spells you are casting.\n\nThe viewer can now follow what you are doing, what spells you are casting, learn your rotation.\n\nAlso tells who is the target and its class/spec on raiding or role if you are in arena.\n\nWhen you die, the panel is filled with your death log.") - if (StreamOverlay.db.is_first_run) then --problem with setting the plugin as disabled - if (Details:GetTutorialCVar ("STREAMER_PLUGIN_FIRSTRUN")) then - Details:DisablePlugin ("DETAILS_PLUGIN_STREAM_OVERLAY") - StreamOverlay.db.is_first_run = false - else - Details:DisablePlugin ("DETAILS_PLUGIN_STREAM_OVERLAY") - end - end - - if (StreamOverlay.db.is_first_run and not Details:GetTutorialCVar ("STREAMER_PLUGIN_FIRSTRUN")) then - local show_frame = function() - - if ((DetailsWelcomeWindow and DetailsWelcomeWindow:IsShown()) or not StreamOverlay.db.is_first_run) then - return - end - - StreamOverlay.ShowWelcomeFrame:Cancel() - - local welcomeWindow = CreateFrame ("frame", "StreamOverlayWelcomeWindow", UIParent, "BackdropTemplate") - welcomeWindow:SetPoint ("center", UIParent, "center") - welcomeWindow:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - welcomeWindow:SetBackdropColor (0, 0, 0, 0.5) - welcomeWindow:SetBackdropBorderColor (0, 0, 0, 1) - welcomeWindow:SetSize (740, 270) - DetailsFramework:ApplyStandardBackdrop(welcomeWindow) - - local icon = welcomeWindow:CreateTexture (nil, "overlay") - icon:SetTexture ([[Interface\MINIMAP\MOVIERECORDINGICON]]) - local title = welcomeWindow:CreateFontString (nil, "overlay", "GameFontNormal") - title:SetText ("Details!: Action Tracker (plugin)") - StreamOverlay:SetFontSize (title, 20) - - local youtubeTwitchIcons = welcomeWindow:CreateTexture(nil, "overlay") - youtubeTwitchIcons:SetTexture([[Interface\AddOns\Details\images\icons2]]) - youtubeTwitchIcons:SetTexCoord(0, 109/512, 370/512, 413/512) - youtubeTwitchIcons:SetSize(109, 413 - 370) - youtubeTwitchIcons:SetPoint("topleft", welcomeWindow, "topleft", 123, -61) - - local text1 = welcomeWindow:CreateFontString (nil, "overlay", "GameFontNormal") - text1:SetText ("SHOW TO YOUR VIEWERS YOUR ROTATION\nThis way they can learn while watching your content") - local text2 = welcomeWindow:CreateFontString (nil, "overlay", "GameFontNormal") - text2:SetText ("Use the command:") - local text3 = welcomeWindow:CreateFontString (nil, "overlay", "GameFontNormal") - text3:SetText ("/streamer") - DetailsFramework:SetFontSize(text3, 16) - - icon:SetPoint ("topleft", welcomeWindow, "topleft", 10, -20) - title:SetPoint ("left", icon, "right", 10, 0) - - text1:SetPoint ("topleft", welcomeWindow, "topleft", 10, -120) - text2:SetPoint ("center", text1, "center", 0, -40) - text3:SetPoint ("center", text2, "center", 0, -16) - - local image1 = welcomeWindow:CreateTexture(nil, "overlay") - image1:SetTexture([[Interface\AddOns\Details_Streamer\streamer_plugin_lines]]) - image1:SetPoint("topleft", welcomeWindow, "topleft", 410, -6) - image1:SetSize(512, 256) - - local close_func = function() - StreamOverlay.db.is_first_run = false - Details:SetTutorialCVar ("STREAMER_PLUGIN_FIRSTRUN", true) - welcomeWindow:Hide() - end - - local close = Details.gump:CreateButton (welcomeWindow, close_func, 120, 20, "Okay", nil, nil, nil, nil, nil, nil, Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) - close:SetPoint ("center", text3, "center", 0, -50) - end - - --StreamOverlay.ShowWelcomeFrame = C_Timer.NewTicker (5, show_frame) - end + StreamOverlay.db.is_first_run = false --wipe (StreamOverlay.db) SOF:RegisterEvent ("PLAYER_LOGOUT")