diff --git a/API.txt b/API.txt index 9d2298c0..de95609d 100644 --- a/API.txt +++ b/API.txt @@ -662,7 +662,7 @@ there is two ways for do this: end end - table.sort (actorsAmount, function (a,b) return a.total > b.total end) + table.sort (actorsAmount, function(a,b) return a.total > b.total end) 2 - replacing the member "custom" on the actor: diff --git a/Libs/DF/auras.lua b/Libs/DF/auras.lua index 63ddf765..ab16dc6a 100644 --- a/Libs/DF/auras.lua +++ b/Libs/DF/auras.lua @@ -73,7 +73,7 @@ function DF:LoadAllSpells (hashMap, indexTable, allSpellsSameName) C_Timer.After (0, function() if (hashMap and not indexTable) then for i = 1, CONST_MAX_SPELLS do - local spellName = GetSpellInfo (i) + local spellName = GetSpellInfo(i) if (spellName) then hashMap [lower (spellName)] = i end @@ -81,7 +81,7 @@ function DF:LoadAllSpells (hashMap, indexTable, allSpellsSameName) elseif (not hashMap and indexTable) then for i = 1, CONST_MAX_SPELLS do - local spellName = GetSpellInfo (i) + local spellName = GetSpellInfo(i) if (spellName) then indexTable [#indexTable+1] = lower (spellName) end @@ -91,7 +91,7 @@ function DF:LoadAllSpells (hashMap, indexTable, allSpellsSameName) --DF_CALC_PERFORMANCE() if (allSpellsSameName) then for i = 1, CONST_MAX_SPELLS do - local spellName = GetSpellInfo (i) + local spellName = GetSpellInfo(i) if (spellName) then spellName = lower (spellName) indexTable [#indexTable + 1] = spellName @@ -108,7 +108,7 @@ function DF:LoadAllSpells (hashMap, indexTable, allSpellsSameName) end else for i = 1, CONST_MAX_SPELLS do - local spellName = GetSpellInfo (i) + local spellName = GetSpellInfo(i) if (spellName) then spellName = lower (spellName) indexTable [#indexTable + 1] = spellName @@ -155,7 +155,7 @@ end local AuraTrackerMetaFunctions = _G[DF.GlobalWidgetControlNames["aura_tracker"]] --create panels -local on_profile_changed = function (self, newdb) +local on_profile_changed = function(self, newdb) self.db = newdb @@ -232,7 +232,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t ------------- - local on_switch_tracking_method = function (self) + local on_switch_tracking_method = function(self) local method = self.Method f.db.aura_tracker.track_method = method @@ -304,7 +304,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t --store a table with spell name as key and in the value an index table with spell IDs local AllSpellsSameName = {} - local load_all_spells = function (self, capsule) + local load_all_spells = function(self, capsule) if (not next (AllSpellsMap)) then DF:LoadAllSpells (AllSpellsMap, AllSpellNames, AllSpellsSameName) @@ -369,8 +369,8 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t debuff_name_blacklist_entry.tooltip = "Enter the debuff name using lower case letters." f_auto.AddDebuffBlacklistTextBox = debuff_name_blacklist_entry - local same_name_spells_add = function (spellID, t) - local spellName = GetSpellInfo (spellID) + local same_name_spells_add = function(spellID, t) + local spellName = GetSpellInfo(spellID) if (spellName) then if (not next (AllSpellsMap)) then load_all_spells() @@ -389,11 +389,11 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t end DF.AddSpellWithSameName = same_name_spells_add - local get_spellID_from_string = function (text) + local get_spellID_from_string = function(text) --check if the user entered a spell ID local isSpellID = tonumber (text) if (isSpellID and isSpellID > 1 and isSpellID < 10000000) then - local isValidSpellID = GetSpellInfo (isSpellID) + local isValidSpellID = GetSpellInfo(isSpellID) if (isValidSpellID) then return isSpellID else @@ -691,7 +691,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t --options passed to the create aura panel local width, height, row_height = options.width, options.height, options.row_height - local autoTrackList_LineOnEnter = function (self, capsule, value) + local autoTrackList_LineOnEnter = function(self, capsule, value) local flag = self.Flag value = value or self.SpellID @@ -701,7 +701,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t GameCooltip2:SetOwner (self, "left", "right", 2, 0) GameCooltip2:SetOption ("TextSize", 10) - local spellName, _, spellIcon = GetSpellInfo (value) + local spellName, _, spellIcon = GetSpellInfo(value) if (spellName) then GameCooltip2:AddLine (spellName .. " (" .. value .. ")") GameCooltip2:AddIcon (spellIcon, 1, 1, 14, 14, .1, .9, .1, .9) @@ -709,7 +709,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t GameCooltip2:Show() else - local spellName = GetSpellInfo (value) + local spellName = GetSpellInfo(value) if (spellName) then local spellsWithSameName = db.aura_cache_by_name [lower (spellName)] @@ -724,7 +724,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t GameCooltip2:SetOption ("TextSize", 10) for i, spellID in ipairs (spellsWithSameName) do - local spellName, _, spellIcon = GetSpellInfo (spellID) + local spellName, _, spellIcon = GetSpellInfo(spellID) if (spellName) then GameCooltip2:AddLine (spellName .. " (" .. spellID .. ")") GameCooltip2:AddIcon (spellIcon, 1, 1, 14, 14, .1, .9, .1, .9) @@ -749,9 +749,9 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t local backdropColor = {.8, .8, .8, 0.2} local backdropColor_OnEnter = {.8, .8, .8, 0.4} - local createAuraScrollBox = function (parent, name, member, title, db, removeFunc) + local createAuraScrollBox = function(parent, name, member, title, db, removeFunc) - local updateFunc = function (self, data, offset, totalLines) + local updateFunc = function(self, data, offset, totalLines) for i = 1, totalLines do local index = i + offset local auraTable = data [index] @@ -776,21 +776,21 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t end end - local lineOnEnter = function (self) + local lineOnEnter = function(self) self:SetBackdropColor (unpack (backdropColor_OnEnter)) --GameTooltip:SetOwner (self, "ANCHOR_CURSOR") - --GameTooltip:SetSpellByID (self.SpellID) + --GameTooltip:SetSpellByID(self.SpellID) --GameTooltip:AddLine (" ") --GameTooltip:Show() end - local lineOnLeave = function (self) + local lineOnLeave = function(self) self:SetBackdropColor (unpack (backdropColor)) --GameTooltip:Hide() end - local onRemoveClick = function (self) + local onRemoveClick = function(self) local spellID = self:GetParent().SpellID db [spellID] = nil db ["".. (spellID or "")] = nil -- cleanup... @@ -800,7 +800,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t end end - local createLineFunc = function (self, index) + local createLineFunc = function(self, index) local line = CreateFrame ("button", "$parentLine" .. index, self, "BackdropTemplate") line:SetPoint ("topleft", self, "topleft", 1, - ((index - 1) * (lineHeight + 1)) - 1) line:SetSize (scrollWidth - 2, lineHeight) @@ -835,7 +835,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t end local scroll = DF:CreateScrollBox (parent, name, updateFunc, db, scrollWidth, scrollHeight, lineAmount, lineHeight) - DF:ReskinSlider (scroll) + DF:ReskinSlider(scroll) parent [member] = scroll scroll.OriginalData = db @@ -843,7 +843,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t local t = {} local added = {} for spellID, flag in pairs (scroll.OriginalData) do - local spellName, _, spellIcon = GetSpellInfo (spellID) + local spellName, _, spellIcon = GetSpellInfo(spellID) if (spellName and not added[tonumber(spellID) or 0]) then local lowerSpellName = spellName:lower() tinsert (t, {spellID, spellName, spellIcon, lowerSpellName, flag}) @@ -851,7 +851,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t end end - table.sort (t, function (t1, t2) return t1[4] < t2[4] end) + table.sort (t, function(t1, t2) return t1[4] < t2[4] end) self:SetData (t) self:Refresh() @@ -952,23 +952,23 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t local backdrop_color = {.8, .8, .8, 0.2} local backdrop_color_on_enter = {.8, .8, .8, 0.4} - local line_onenter = function (self) + local line_onenter = function(self) self:SetBackdropColor (unpack (backdrop_color_on_enter)) - local spellid = select (7, GetSpellInfo (self.value)) + local spellid = select (7, GetSpellInfo(self.value)) if (spellid) then GameTooltip:SetOwner (self, "ANCHOR_CURSOR") - GameTooltip:SetSpellByID (spellid) + GameTooltip:SetSpellByID(spellid) GameTooltip:AddLine (" ") GameTooltip:Show() end end - local line_onleave = function (self) + local line_onleave = function(self) self:SetBackdropColor (unpack (backdrop_color)) GameTooltip:Hide() end - local onclick_remove_button = function (self) + local onclick_remove_button = function(self) local spell = self:GetParent().value local data = self:GetParent():GetParent():GetData() @@ -982,7 +982,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t self:GetParent():GetParent():Refresh() end - local scroll_createline = function (self, index) + local scroll_createline = function(self, index) local line = CreateFrame ("button", "$parentLine" .. index, self, "BackdropTemplate") line:SetPoint ("topleft", self, "topleft", 1, -((index-1)*(scroll_line_height+1)) - 1) line:SetSize (scroll_width - 2, scroll_line_height) @@ -1013,13 +1013,13 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t return line end - local scroll_refresh = function (self, data, offset, total_lines) + local scroll_refresh = function(self, data, offset, total_lines) for i = 1, total_lines do local index = i + offset local aura = data [index] if (aura) then local line = self:GetLine (i) - local name, _, icon = GetSpellInfo (aura) + local name, _, icon = GetSpellInfo(aura) line.value = aura if (name) then line.name:SetText (name) @@ -1035,7 +1035,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t local buffs_added = self:CreateScrollBox (f_manual, "$parentBuffsAdded", scroll_refresh, f.db.aura_tracker.buff, scroll_width, scroll_height, scroll_lines, scroll_line_height) buffs_added:SetPoint ("topleft", f_manual, "topleft", 0, y) - DF:ReskinSlider (buffs_added) + DF:ReskinSlider(buffs_added) for i = 1, scroll_lines do buffs_added:CreateLine (scroll_createline) @@ -1043,7 +1043,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t local debuffs_added = self:CreateScrollBox (f_manual, "$parentDebuffsAdded", scroll_refresh, f.db.aura_tracker.debuff, scroll_width, scroll_height, scroll_lines, scroll_line_height) debuffs_added:SetPoint ("topleft", f_manual, "topleft", width+30, y) - DF:ReskinSlider (debuffs_added) + DF:ReskinSlider(debuffs_added) for i = 1, scroll_lines do debuffs_added:CreateLine (scroll_createline) @@ -1182,7 +1182,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t local export_buff_button = self:CreateButton (f_manual, function() local str = "" for _, spellId in ipairs (f.db.aura_tracker.buff) do - local spellName = GetSpellInfo (spellId) + local spellName = GetSpellInfo(spellId) if (spellName) then str = str .. spellName .. "; " end @@ -1196,7 +1196,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t local export_debuff_button = self:CreateButton (f_manual, function() local str = "" for _, spellId in ipairs (f.db.aura_tracker.debuff) do - local spellName = GetSpellInfo (spellId) + local spellName = GetSpellInfo(spellId) if (spellName) then str = str .. spellName .. "; " end @@ -1246,7 +1246,7 @@ function DF:GetAllPlayerSpells (include_lower_case) local index = offset + i local spellType, spellId = GetSpellBookItemInfo (index, "player") if (spellType == "SPELL") then - local spellName = GetSpellInfo (spellId) + local spellName = GetSpellInfo(spellId) tinsert (playerSpells, spellName) if (include_lower_case) then tinsert (playerSpells, lower (spellName)) diff --git a/Libs/DF/button.lua b/Libs/DF/button.lua index 11b4fe89..3082208f 100644 --- a/Libs/DF/button.lua +++ b/Libs/DF/button.lua @@ -125,7 +125,7 @@ DF:Mixin(ButtonMetaFunctions, DF.FrameMixin) ButtonMetaFunctions.GetMembers["textfont"] = gmember_textfont --alias ButtonMetaFunctions.GetMembers["textsize"] = gmember_textsize --alias - ButtonMetaFunctions.__index = function (_table, _member_requested) + ButtonMetaFunctions.__index = function(_table, _member_requested) local func = ButtonMetaFunctions.GetMembers [_member_requested] if (func) then @@ -143,12 +143,12 @@ DF:Mixin(ButtonMetaFunctions, DF.FrameMixin) ------------------------------------------------------------------------------------------------------------------------------------------------------------------- --tooltip - local smember_tooltip = function (_object, _value) + local smember_tooltip = function(_object, _value) return _object:SetTooltip (_value) end --show - local smember_show = function (_object, _value) + local smember_show = function(_object, _value) if (_value) then return _object:Show() else @@ -157,7 +157,7 @@ DF:Mixin(ButtonMetaFunctions, DF.FrameMixin) end --hide - local smember_hide = function (_object, _value) + local smember_hide = function(_object, _value) if (not _value) then return _object:Show() else @@ -166,53 +166,53 @@ DF:Mixin(ButtonMetaFunctions, DF.FrameMixin) end --frame width - local smember_width = function (_object, _value) + local smember_width = function(_object, _value) return _object.button:SetWidth (_value) end --frame height - local smember_height = function (_object, _value) + local smember_height = function(_object, _value) return _object.button:SetHeight (_value) end --text - local smember_text = function (_object, _value) + local smember_text = function(_object, _value) return _object.button.text:SetText (_value) end --function - local smember_function = function (_object, _value) + local smember_function = function(_object, _value) return rawset(_object, "func", _value) end --param1 - local smember_param1 = function (_object, _value) + local smember_param1 = function(_object, _value) return rawset(_object, "param1", _value) end --param2 - local smember_param2 = function (_object, _value) + local smember_param2 = function(_object, _value) return rawset(_object, "param2", _value) end --text color - local smember_textcolor = function (_object, _value) + local smember_textcolor = function(_object, _value) local _value1, _value2, _value3, _value4 = DF:ParseColors (_value) return _object.button.text:SetTextColor (_value1, _value2, _value3, _value4) end --text font - local smember_textfont = function (_object, _value) + local smember_textfont = function(_object, _value) return DF:SetFontFace (_object.button.text, _value) end --text size - local smember_textsize = function (_object, _value) + local smember_textsize = function(_object, _value) return DF:SetFontSize (_object.button.text, _value) end --texture - local smember_texture = function (_object, _value) + local smember_texture = function(_object, _value) if (type (_value) == "table") then local _value1, _value2, _value3, _value4 = unpack (_value) if (_value1) then @@ -237,7 +237,7 @@ DF:Mixin(ButtonMetaFunctions, DF.FrameMixin) end --locked - local smember_locked = function (_object, _value) + local smember_locked = function(_object, _value) if (_value) then _object.button:SetMovable (false) return rawset(_object, "is_locked", true) @@ -249,7 +249,7 @@ DF:Mixin(ButtonMetaFunctions, DF.FrameMixin) end --text align - local smember_textalign = function (_object, _value) + local smember_textalign = function(_object, _value) if (_value == "left" or _value == "<") then _object.button.text:SetPoint ("left", _object.button, "left", 2, 0) _object.capsule_textalign = "left" @@ -282,7 +282,7 @@ DF:Mixin(ButtonMetaFunctions, DF.FrameMixin) ButtonMetaFunctions.SetMembers ["locked"] = smember_locked ButtonMetaFunctions.SetMembers ["textalign"] = smember_textalign - ButtonMetaFunctions.__newindex = function (_table, _key, _value) + ButtonMetaFunctions.__newindex = function(_table, _key, _value) local func = ButtonMetaFunctions.SetMembers [_key] if (func) then return func (_table, _value) diff --git a/Libs/DF/fw.lua b/Libs/DF/fw.lua index 0fdfc7fb..b118a3be 100644 --- a/Libs/DF/fw.lua +++ b/Libs/DF/fw.lua @@ -1,6 +1,6 @@ -local dversion = 377 +local dversion = 379 local major, minor = "DetailsFramework-1.0", dversion local DF, oldminor = LibStub:NewLibrary(major, minor) @@ -184,7 +184,7 @@ function DF:GetRoleByClassicTalentTree() local MIN_SPECS = 4 --put the spec with more talent point to the top - table.sort(pointsPerSpec, function (t1, t2) return t1[2] > t2[2] end) + table.sort(pointsPerSpec, function(t1, t2) return t1[2] > t2[2] end) --get the spec with more points spent local spec = pointsPerSpec[1] @@ -1374,6 +1374,7 @@ end if (text) then if (useColon) then text = text .. ":" + return text else return text end @@ -1551,6 +1552,8 @@ end end end + local extraPaddingY = 0 + if (not widgetTable.novolatile) then --step a line if (widgetTable.type == "blank" or widgetTable.type == "space") then @@ -1667,6 +1670,13 @@ end if (widgetTable.boxfirst or useBoxFirstOnAllWidgets) then switch:SetPoint (currentXOffset, currentYOffset) switch.hasLabel:SetPoint ("left", switch, "right", 2) + + local nextWidgetTable = menuOptions[index+1] + if (nextWidgetTable) then + if (nextWidgetTable.type ~= "blank" and nextWidgetTable.type ~= "breakline" and nextWidgetTable.type ~= "toggle" and nextWidgetTable.type ~= "color") then + extraPaddingY = 4 + end + end else switch.hasLabel:SetPoint (currentXOffset, currentYOffset) switch:SetPoint ("left", switch.hasLabel, "right", 2) @@ -1893,6 +1903,10 @@ end end end + if (extraPaddingY > 0) then + currentYOffset = currentYOffset - extraPaddingY + end + if (widgetTable.type == "breakline" or currentYOffset < height) then currentYOffset = yOffset currentXOffset = currentXOffset + maxColumnWidth + 20 @@ -2077,12 +2091,12 @@ end local nextWidgetTable = menuOptions[index+1] if (nextWidgetTable) then if (nextWidgetTable.type ~= "blank" and nextWidgetTable.type ~= "breakline" and nextWidgetTable.type ~= "toggle" and nextWidgetTable.type ~= "color") then - extraPaddingY = 3 + extraPaddingY = 4 end end else label:SetPoint(currentXOffset, currentYOffset) - switch:SetPoint("left", label, "right", 2) + switch:SetPoint("left", label, "right", 2, 0) end switch.hasLabel = label @@ -2396,7 +2410,7 @@ end frame:RegisterEvent ("PLAYER_REGEN_DISABLED") frame:RegisterEvent ("PLAYER_REGEN_ENABLED") - frame:SetScript ("OnEvent", function (self, event) + frame:SetScript ("OnEvent", function(self, event) if (event == "PLAYER_REGEN_DISABLED") then in_combat_background:Show() in_combat_label:Show() @@ -2424,7 +2438,7 @@ end TutorialAlertFrame:SetFrameStrata ("TOOLTIP") TutorialAlertFrame:Hide() - TutorialAlertFrame:SetScript ("OnMouseUp", function (self) + TutorialAlertFrame:SetScript ("OnMouseUp", function(self) if (self.clickfunc and type (self.clickfunc) == "function") then self.clickfunc() end @@ -2442,7 +2456,7 @@ end TutorialAlertFrame:Show() end - local refresh_options = function (self) + local refresh_options = function(self) for _, widget in ipairs (self.widget_list) do if (widget._get) then if (widget.widget_type == "label") then @@ -2467,7 +2481,7 @@ end end end - local get_frame_by_id = function (self, id) + local get_frame_by_id = function(self, id) return self.widgetids [id] end @@ -3054,7 +3068,7 @@ local FrameshakeUpdateFrame = DetailsFrameworkFrameshakeControl or CreateFrame ( --> store the frame which has frame shakes registered FrameshakeUpdateFrame.RegisteredFrames = FrameshakeUpdateFrame.RegisteredFrames or {} -FrameshakeUpdateFrame.RegisterFrame = function (newFrame) +FrameshakeUpdateFrame.RegisterFrame = function(newFrame) --> add the frame into the registered frames to update DF.table.addunique (FrameshakeUpdateFrame.RegisteredFrames, newFrame) end @@ -3062,7 +3076,7 @@ end --forward declared local frameshake_do_update -FrameshakeUpdateFrame:SetScript ("OnUpdate", function (self, deltaTime) +FrameshakeUpdateFrame:SetScript ("OnUpdate", function(self, deltaTime) for i = 1, #FrameshakeUpdateFrame.RegisteredFrames do local parent = FrameshakeUpdateFrame.RegisteredFrames [i] --> check if there's a shake running @@ -3079,7 +3093,7 @@ FrameshakeUpdateFrame:SetScript ("OnUpdate", function (self, deltaTime) end) -local frameshake_shake_finished = function (parent, shakeObject) +local frameshake_shake_finished = function(parent, shakeObject) if (shakeObject.IsPlaying) then shakeObject.IsPlaying = false shakeObject.TimeLeft = 0 @@ -3117,7 +3131,7 @@ local frameshake_shake_finished = function (parent, shakeObject) end --already declared above the update function -frameshake_do_update = function (parent, shakeObject, deltaTime) +frameshake_do_update = function(parent, shakeObject, deltaTime) --> check delta time deltaTime = deltaTime or 0 @@ -3193,12 +3207,12 @@ frameshake_do_update = function (parent, shakeObject, deltaTime) end end -local frameshake_stop = function (parent, shakeObject) +local frameshake_stop = function(parent, shakeObject) frameshake_shake_finished (parent, shakeObject) end --> scale direction scales the X and Y coordinates, scale strength scales the amplitude and frequency -local frameshake_play = function (parent, shakeObject, scaleDirection, scaleAmplitude, scaleFrequency, scaleDuration) +local frameshake_play = function(parent, shakeObject, scaleDirection, scaleAmplitude, scaleFrequency, scaleDuration) --> check if is already playing if (shakeObject.TimeLeft > 0) then @@ -3271,7 +3285,7 @@ local frameshake_play = function (parent, shakeObject, scaleDirection, scaleAmpl frameshake_do_update (parent, shakeObject) end -local frameshake_set_config = function (parent, shakeObject, duration, amplitude, frequency, absoluteSineX, absoluteSineY, scaleX, scaleY, fadeInTime, fadeOutTime, anchorPoints) +local frameshake_set_config = function(parent, shakeObject, duration, amplitude, frequency, absoluteSineX, absoluteSineY, scaleX, scaleY, fadeInTime, fadeOutTime, anchorPoints) shakeObject.Amplitude = amplitude or shakeObject.Amplitude shakeObject.Frequency = frequency or shakeObject.Frequency shakeObject.Duration = duration or shakeObject.Duration @@ -3348,7 +3362,7 @@ end ----------------------------- --> glow overlay -local glow_overlay_play = function (self) +local glow_overlay_play = function(self) if (not self:IsShown()) then self:Show() end @@ -3361,7 +3375,7 @@ local glow_overlay_play = function (self) end end -local glow_overlay_stop = function (self) +local glow_overlay_stop = function(self) if (self.animOut:IsPlaying()) then self.animOut:Stop() end @@ -3373,7 +3387,7 @@ local glow_overlay_stop = function (self) end end -local glow_overlay_setcolor = function (self, antsColor, glowColor) +local glow_overlay_setcolor = function(self, antsColor, glowColor) if (antsColor) then local r, g, b, a = DF:ParseColors (antsColor) self.ants:SetVertexColor (r, g, b, a) @@ -3393,11 +3407,11 @@ local glow_overlay_setcolor = function (self, antsColor, glowColor) end end -local glow_overlay_onshow = function (self) +local glow_overlay_onshow = function(self) glow_overlay_play (self) end -local glow_overlay_onhide = function (self) +local glow_overlay_onhide = function(self) glow_overlay_stop (self) end @@ -3437,7 +3451,7 @@ function DF:CreateGlowOverlay (parent, antsColor, glowColor) end --> custom glow with ants animation -local ants_set_texture_offset = function (self, leftOffset, rightOffset, topOffset, bottomOffset) +local ants_set_texture_offset = function(self, leftOffset, rightOffset, topOffset, bottomOffset) leftOffset = leftOffset or 0 rightOffset = rightOffset or 0 topOffset = topOffset or 0 @@ -3469,7 +3483,7 @@ function DF:CreateAnts (parent, antTable, leftOffset, rightOffset, topOffset, bo f.AntTable = antTable - f:SetScript ("OnUpdate", function (self, deltaTime) + f:SetScript ("OnUpdate", function(self, deltaTime) AnimateTexCoords (t, self.AntTable.TextureWidth, self.AntTable.TextureHeight, self.AntTable.TexturePartsWidth, self.AntTable.TexturePartsHeight, self.AntTable.AmountParts, deltaTime, self.AntTable.Throttle or 0.025) end) @@ -3489,7 +3503,7 @@ local default_border_color1 = .5 local default_border_color2 = .3 local default_border_color3 = .1 -local SetBorderAlpha = function (self, alpha1, alpha2, alpha3) +local SetBorderAlpha = function(self, alpha1, alpha2, alpha3) self.Borders.Alpha1 = alpha1 or self.Borders.Alpha1 self.Borders.Alpha2 = alpha2 or self.Borders.Alpha2 self.Borders.Alpha3 = alpha3 or self.Borders.Alpha3 @@ -3505,7 +3519,7 @@ local SetBorderAlpha = function (self, alpha1, alpha2, alpha3) end end -local SetBorderColor = function (self, r, g, b) +local SetBorderColor = function(self, r, g, b) for _, texture in ipairs (self.Borders.Layer1) do texture:SetColorTexture (r, g, b) end @@ -3517,7 +3531,7 @@ local SetBorderColor = function (self, r, g, b) end end -local SetLayerVisibility = function (self, layer1Shown, layer2Shown, layer3Shown) +local SetLayerVisibility = function(self, layer1Shown, layer2Shown, layer3Shown) for _, texture in ipairs (self.Borders.Layer1) do texture:SetShown (layer1Shown) @@ -3829,144 +3843,106 @@ function DF:CreateBorderWithSpread (parent, alpha1, alpha2, alpha3, size, spread end -function DF:ReskinSlider (slider, heightOffset) +function DF:ReskinSlider(slider, heightOffset) if (slider.slider) then - slider.cima:SetNormalTexture ([[Interface\Buttons\Arrow-Up-Up]]) - slider.cima:SetPushedTexture ([[Interface\Buttons\Arrow-Up-Down]]) - slider.cima:SetDisabledTexture ([[Interface\Buttons\Arrow-Up-Disabled]]) + slider.cima:SetNormalTexture([[Interface\Buttons\Arrow-Up-Up]]) + slider.cima:SetPushedTexture([[Interface\Buttons\Arrow-Up-Down]]) + slider.cima:SetDisabledTexture([[Interface\Buttons\Arrow-Up-Disabled]]) slider.cima:GetNormalTexture():ClearAllPoints() slider.cima:GetPushedTexture():ClearAllPoints() slider.cima:GetDisabledTexture():ClearAllPoints() - slider.cima:GetNormalTexture():SetPoint ("center", slider.cima, "center", 1, 1) - slider.cima:GetPushedTexture():SetPoint ("center", slider.cima, "center", 1, 1) - slider.cima:GetDisabledTexture():SetPoint ("center", slider.cima, "center", 1, 1) - slider.cima:SetSize (16, 16) - --[=[ - slider.cima:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]]}) - slider.cima:SetBackdropColor (0, 0, 0, 0.3) - slider.cima:SetBackdropBorderColor (0, 0, 0, 1) - ]=] - - slider.baixo:SetNormalTexture ([[Interface\Buttons\Arrow-Down-Up]]) - slider.baixo:SetPushedTexture ([[Interface\Buttons\Arrow-Down-Down]]) - slider.baixo:SetDisabledTexture ([[Interface\Buttons\Arrow-Down-Disabled]]) + slider.cima:GetNormalTexture():SetPoint("center", slider.cima, "center", 1, 1) + slider.cima:GetPushedTexture():SetPoint("center", slider.cima, "center", 1, 1) + slider.cima:GetDisabledTexture():SetPoint("center", slider.cima, "center", 1, 1) + slider.cima:SetSize(16, 16) + + slider.baixo:SetNormalTexture([[Interface\Buttons\Arrow-Down-Up]]) + slider.baixo:SetPushedTexture([[Interface\Buttons\Arrow-Down-Down]]) + slider.baixo:SetDisabledTexture([[Interface\Buttons\Arrow-Down-Disabled]]) slider.baixo:GetNormalTexture():ClearAllPoints() slider.baixo:GetPushedTexture():ClearAllPoints() slider.baixo:GetDisabledTexture():ClearAllPoints() - slider.baixo:GetNormalTexture():SetPoint ("center", slider.baixo, "center", 1, -5) - slider.baixo:GetPushedTexture():SetPoint ("center", slider.baixo, "center", 1, -5) - slider.baixo:GetDisabledTexture():SetPoint ("center", slider.baixo, "center", 1, -5) - slider.baixo:SetSize (16, 16) - --[=[ - slider.baixo:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]]}) - slider.baixo:SetBackdropColor (0, 0, 0, 0.35) - slider.baixo:SetBackdropBorderColor (0, 0, 0, 1) - - slider.slider:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]]}) - slider.slider:SetBackdropColor (0, 0, 0, 0.35) - slider.slider:SetBackdropBorderColor (0, 0, 0, 1) - ]=] - - --slider.slider:Altura (164) - slider.slider:cimaPoint (0, 13) - slider.slider:baixoPoint (0, -13) - slider.slider.thumb:SetTexture ([[Interface\AddOns\Details\images\icons2]]) - slider.slider.thumb:SetTexCoord (482/512, 492/512, 104/512, 120/512) - slider.slider.thumb:SetSize (12, 12) - slider.slider.thumb:SetVertexColor (0.6, 0.6, 0.6, 0.95) + slider.baixo:GetNormalTexture():SetPoint("center", slider.baixo, "center", 1, -5) + slider.baixo:GetPushedTexture():SetPoint("center", slider.baixo, "center", 1, -5) + slider.baixo:GetDisabledTexture():SetPoint("center", slider.baixo, "center", 1, -5) + slider.baixo:SetSize(16, 16) + + slider.slider:cimaPoint(0, 13) + slider.slider:baixoPoint(0, -13) + slider.slider.thumb:SetTexture([[Interface\AddOns\Details\images\icons2]]) + slider.slider.thumb:SetTexCoord(482/512, 492/512, 104/512, 120/512) + slider.slider.thumb:SetSize(12, 12) + slider.slider.thumb:SetVertexColor(0.6, 0.6, 0.6, 0.95) else --up button - local offset = 1 --space between the scrollbox and the scrollar do local normalTexture = slider.ScrollBar.ScrollUpButton.Normal - normalTexture:SetTexture ([[Interface\Buttons\Arrow-Up-Up]]) - normalTexture:SetTexCoord (0, 1, .2, 1) + normalTexture:SetTexture([[Interface\Buttons\Arrow-Up-Up]]) + normalTexture:SetTexCoord(0, 1, .2, 1) - normalTexture:SetPoint ("topleft", slider.ScrollBar.ScrollUpButton, "topleft", offset, 0) - normalTexture:SetPoint ("bottomright", slider.ScrollBar.ScrollUpButton, "bottomright", offset, 0) + normalTexture:SetPoint("topleft", slider.ScrollBar.ScrollUpButton, "topleft", offset, 0) + normalTexture:SetPoint("bottomright", slider.ScrollBar.ScrollUpButton, "bottomright", offset, 0) local pushedTexture = slider.ScrollBar.ScrollUpButton.Pushed - pushedTexture:SetTexture ([[Interface\Buttons\Arrow-Up-Down]]) - pushedTexture:SetTexCoord (0, 1, .2, 1) + pushedTexture:SetTexture([[Interface\Buttons\Arrow-Up-Down]]) + pushedTexture:SetTexCoord(0, 1, .2, 1) - pushedTexture:SetPoint ("topleft", slider.ScrollBar.ScrollUpButton, "topleft", offset, 0) - pushedTexture:SetPoint ("bottomright", slider.ScrollBar.ScrollUpButton, "bottomright", offset, 0) + pushedTexture:SetPoint("topleft", slider.ScrollBar.ScrollUpButton, "topleft", offset, 0) + pushedTexture:SetPoint("bottomright", slider.ScrollBar.ScrollUpButton, "bottomright", offset, 0) local disabledTexture = slider.ScrollBar.ScrollUpButton.Disabled - disabledTexture:SetTexture ([[Interface\Buttons\Arrow-Up-Disabled]]) - disabledTexture:SetTexCoord (0, 1, .2, 1) - disabledTexture:SetAlpha (.5) + disabledTexture:SetTexture([[Interface\Buttons\Arrow-Up-Disabled]]) + disabledTexture:SetTexCoord(0, 1, .2, 1) + disabledTexture:SetAlpha(.5) - disabledTexture:SetPoint ("topleft", slider.ScrollBar.ScrollUpButton, "topleft", offset, 0) - disabledTexture:SetPoint ("bottomright", slider.ScrollBar.ScrollUpButton, "bottomright", offset, 0) + disabledTexture:SetPoint("topleft", slider.ScrollBar.ScrollUpButton, "topleft", offset, 0) + disabledTexture:SetPoint("bottomright", slider.ScrollBar.ScrollUpButton, "bottomright", offset, 0) - slider.ScrollBar.ScrollUpButton:SetSize (16, 16) - --[=[ - slider.ScrollBar.ScrollUpButton:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = "Interface\\Tooltips\\UI-Tooltip-Background"}) - slider.ScrollBar.ScrollUpButton:SetBackdropColor (0, 0, 0, 0.3) - slider.ScrollBar.ScrollUpButton:SetBackdropBorderColor (0, 0, 0, 1) - ]=] - --it was having problems with the texture anchor when calling ClearAllPoints() and setting new points different from the original - --now it is using the same points from the original with small offsets tp align correctly + slider.ScrollBar.ScrollUpButton:SetSize(16, 16) end --down button do local normalTexture = slider.ScrollBar.ScrollDownButton.Normal - normalTexture:SetTexture ([[Interface\Buttons\Arrow-Down-Up]]) - normalTexture:SetTexCoord (0, 1, 0, .8) + normalTexture:SetTexture([[Interface\Buttons\Arrow-Down-Up]]) + normalTexture:SetTexCoord(0, 1, 0, .8) - normalTexture:SetPoint ("topleft", slider.ScrollBar.ScrollDownButton, "topleft", offset, -4) - normalTexture:SetPoint ("bottomright", slider.ScrollBar.ScrollDownButton, "bottomright", offset, -4) + normalTexture:SetPoint("topleft", slider.ScrollBar.ScrollDownButton, "topleft", offset, -4) + normalTexture:SetPoint("bottomright", slider.ScrollBar.ScrollDownButton, "bottomright", offset, -4) local pushedTexture = slider.ScrollBar.ScrollDownButton.Pushed - pushedTexture:SetTexture ([[Interface\Buttons\Arrow-Down-Down]]) - pushedTexture:SetTexCoord (0, 1, 0, .8) + pushedTexture:SetTexture([[Interface\Buttons\Arrow-Down-Down]]) + pushedTexture:SetTexCoord(0, 1, 0, .8) - pushedTexture:SetPoint ("topleft", slider.ScrollBar.ScrollDownButton, "topleft", offset, -4) - pushedTexture:SetPoint ("bottomright", slider.ScrollBar.ScrollDownButton, "bottomright", offset, -4) + pushedTexture:SetPoint("topleft", slider.ScrollBar.ScrollDownButton, "topleft", offset, -4) + pushedTexture:SetPoint("bottomright", slider.ScrollBar.ScrollDownButton, "bottomright", offset, -4) local disabledTexture = slider.ScrollBar.ScrollDownButton.Disabled - disabledTexture:SetTexture ([[Interface\Buttons\Arrow-Down-Disabled]]) - disabledTexture:SetTexCoord (0, 1, 0, .8) - disabledTexture:SetAlpha (.5) + disabledTexture:SetTexture([[Interface\Buttons\Arrow-Down-Disabled]]) + disabledTexture:SetTexCoord(0, 1, 0, .8) + disabledTexture:SetAlpha(.5) - disabledTexture:SetPoint ("topleft", slider.ScrollBar.ScrollDownButton, "topleft", offset, -4) - disabledTexture:SetPoint ("bottomright", slider.ScrollBar.ScrollDownButton, "bottomright", offset, -4) + disabledTexture:SetPoint("topleft", slider.ScrollBar.ScrollDownButton, "topleft", offset, -4) + disabledTexture:SetPoint("bottomright", slider.ScrollBar.ScrollDownButton, "bottomright", offset, -4) slider.ScrollBar.ScrollDownButton:SetSize (16, 16) - --[=[ - slider.ScrollBar.ScrollDownButton:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = "Interface\\Tooltips\\UI-Tooltip-Background"}) - slider.ScrollBar.ScrollDownButton:SetBackdropColor (0, 0, 0, 0.3) - slider.ScrollBar.ScrollDownButton:SetBackdropBorderColor (0, 0, 0, 1) - ]=] - - -- - --slider.ScrollBar.ScrollDownButton:SetPoint ("top", slider.ScrollBar, "bottom", 0, 0) end --if the parent has a editbox, this is a code editor if (slider:GetParent().editbox) then - slider.ScrollBar:SetPoint ("TOPLEFT", slider, "TOPRIGHT", 12 + offset, -6) - slider.ScrollBar:SetPoint ("BOTTOMLEFT", slider, "BOTTOMRIGHT", 12 + offset, 6 + (heightOffset and heightOffset*-1 or 0)) + slider.ScrollBar:SetPoint("TOPLEFT", slider, "TOPRIGHT", 12 + offset, -6) + slider.ScrollBar:SetPoint("BOTTOMLEFT", slider, "BOTTOMRIGHT", 12 + offset, 6 + (heightOffset and heightOffset*-1 or 0)) else - slider.ScrollBar:SetPoint ("TOPLEFT", slider, "TOPRIGHT", 6, -16) - slider.ScrollBar:SetPoint ("BOTTOMLEFT", slider, "BOTTOMRIGHT", 6, 16 + (heightOffset and heightOffset*-1 or 0)) + slider.ScrollBar:SetPoint("TOPLEFT", slider, "TOPRIGHT", 6, -16) + slider.ScrollBar:SetPoint("BOTTOMLEFT", slider, "BOTTOMRIGHT", 6, 16 + (heightOffset and heightOffset*-1 or 0)) end - slider.ScrollBar.ThumbTexture:SetColorTexture (.5, .5, .5, .3) - slider.ScrollBar.ThumbTexture:SetSize (12, 8) - - -- - --[=[ - slider.ScrollBar:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = "Interface\\Tooltips\\UI-Tooltip-Background"}) - slider.ScrollBar:SetBackdropColor (0, 0, 0, 0.35) - slider.ScrollBar:SetBackdropBorderColor (0, 0, 0, 1) - ]=] + slider.ScrollBar.ThumbTexture:SetColorTexture(.5, .5, .5, .3) + slider.ScrollBar.ThumbTexture:SetSize(12, 8) end end @@ -4004,7 +3980,7 @@ function DF:GetClassSpecIDs (class) return specs_per_class [class] end -local dispatch_error = function (context, errortext) +local dispatch_error = function(context, errortext) DF:Msg ( (context or "") .. " |cFFFF9900error|r: " .. (errortext or "")) end @@ -4074,7 +4050,7 @@ function DF_CALC_PERFORMANCE() local F = CreateFrame ("frame") local T = GetTime() local J = false - F:SetScript ("OnUpdate", function (self, deltaTime) + F:SetScript ("OnUpdate", function(self, deltaTime) if (not J) then J = true return @@ -4646,7 +4622,7 @@ if (not DetailsFrameworkDeltaTimeFrame) then end local deltaTimeFrame = DetailsFrameworkDeltaTimeFrame -deltaTimeFrame:SetScript ("OnUpdate", function (self, deltaTime) +deltaTimeFrame:SetScript ("OnUpdate", function(self, deltaTime) self.deltaTime = deltaTime end) @@ -4727,11 +4703,11 @@ DF.DebugMixin = { debug = true, - CheckPoint = function (self, checkPointName, ...) + CheckPoint = function(self, checkPointName, ...) print (self:GetName(), checkPointName, ...) end, - CheckVisibilityState = function (self, widget) + CheckVisibilityState = function(self, widget) self = widget or self @@ -4744,7 +4720,7 @@ DF.DebugMixin = { print ("shown:", self:IsShown(), "visible:", self:IsVisible(), "alpha:", self:GetAlpha(), "size:", width, height, "points:", numPoints) end, - CheckStack = function (self) + CheckStack = function(self) local stack = debugstack() Details:Dump (stack) end, @@ -4973,7 +4949,7 @@ end end DF.DefaultSecureScriptEnvironmentHandle = { - __index = function (env, key) + __index = function(env, key) if (forbiddenFunction[key]) then return nil diff --git a/Libs/DF/help.lua b/Libs/DF/help.lua index 0825fba0..c8e545f9 100644 --- a/Libs/DF/help.lua +++ b/Libs/DF/help.lua @@ -14,7 +14,7 @@ local HelpMetaFunctions = {} local get_members_function_index = {} - HelpMetaFunctions.__index = function (_table, _member_requested) + HelpMetaFunctions.__index = function(_table, _member_requested) local func = get_members_function_index [_member_requested] if (func) then @@ -31,7 +31,7 @@ local HelpMetaFunctions = {} local set_members_function_index = {} - HelpMetaFunctions.__newindex = function (_table, _key, _value) + HelpMetaFunctions.__newindex = function(_table, _key, _value) local func = set_members_function_index [_key] if (func) then return func (_table, _value) @@ -83,7 +83,7 @@ function DF:NewHelp (parent, width, height, x, y, buttonWidth, buttonHeight, nam local idx = getmetatable (helpButton).__index for funcName, funcAddress in pairs (idx) do if (not HelpMetaFunctions [funcName]) then - HelpMetaFunctions [funcName] = function (object, ...) + HelpMetaFunctions [funcName] = function(object, ...) local x = loadstring ( "return _G."..object.button:GetName()..":"..funcName.."(...)") return x (...) end diff --git a/Libs/DF/label.lua b/Libs/DF/label.lua index 40f6337d..6e34e620 100644 --- a/Libs/DF/label.lua +++ b/Libs/DF/label.lua @@ -202,7 +202,7 @@ detailsFramework:Mixin(LabelMetaFunctions, detailsFramework.SetPointMixin) LabelMetaFunctions.SetMembers["textsize"] = smember_textsize--alias LabelMetaFunctions.SetMembers["shadow"] = smember_outline LabelMetaFunctions.SetMembers["outline"] = smember_outline--alias - LabelMetaFunctions.SetMembers["rotation"] = smember_rotation--alias + LabelMetaFunctions.SetMembers["rotation"] = smember_rotation LabelMetaFunctions.__newindex = function(object, key, value) local func = LabelMetaFunctions.SetMembers[key] @@ -296,7 +296,7 @@ detailsFramework:Mixin(LabelMetaFunctions, detailsFramework.SetPointMixin) local idx = getmetatable(labelObject.label).__index for funcName, funcAddress in pairs(idx) do if (not LabelMetaFunctions[funcName]) then - LabelMetaFunctions[funcName] = function (object, ...) + LabelMetaFunctions[funcName] = function(object, ...) local x = loadstring( "return _G['"..object.label:GetName().."']:"..funcName.."(...)") return x(...) end diff --git a/Libs/DF/mixins.lua b/Libs/DF/mixins.lua index 4395d5b4..f51ae067 100644 --- a/Libs/DF/mixins.lua +++ b/Libs/DF/mixins.lua @@ -222,7 +222,7 @@ detailsFramework.SetPointMixin = { --mixin for options functions detailsFramework.OptionsFunctions = { - SetOption = function (self, optionName, optionValue) + SetOption = function(self, optionName, optionValue) if (self.options) then self.options [optionName] = optionValue else @@ -235,11 +235,11 @@ detailsFramework.OptionsFunctions = { end end, - GetOption = function (self, optionName) + GetOption = function(self, optionName) return self.options and self.options [optionName] end, - GetAllOptions = function (self) + GetAllOptions = function(self) if (self.options) then local optionsTable = {} for key, _ in pairs (self.options) do @@ -251,7 +251,7 @@ detailsFramework.OptionsFunctions = { end end, - BuildOptionsTable = function (self, defaultOptions, userOptions) + BuildOptionsTable = function(self, defaultOptions, userOptions) self.options = self.options or {} detailsFramework.table.deploy (self.options, userOptions or {}) detailsFramework.table.deploy (self.options, defaultOptions or {}) @@ -299,6 +299,7 @@ detailsFramework.PayloadMixin = { detailsFramework.ScrollBoxFunctions = { Refresh = function(self) --hide all frames and tag as not in use + self._LinesInUse = 0 for index, frame in ipairs(self.Frames) do frame:Hide() frame._InUse = nil @@ -322,13 +323,25 @@ detailsFramework.ScrollBoxFunctions = { self:Show() - if (self.HideScrollBar) then - local frameName = self:GetName() - if (frameName) then + local frameName = self:GetName() + if (frameName) then + if (self.HideScrollBar) then local scrollBar = _G[frameName .. "ScrollBar"] if (scrollBar) then scrollBar:Hide() end + else + --[=[ --maybe in the future I visit this again + local scrollBar = _G[frameName .. "ScrollBar"] + local height = self:GetHeight() + local totalLinesRequired = #self.data + local linesShown = self._LinesInUse + + local percent = linesShown / totalLinesRequired + local thumbHeight = height * percent + scrollBar.ThumbTexture:SetSize(12, thumbHeight) + print("thumbHeight:", thumbHeight) + --]=] end end return self.Frames @@ -367,6 +380,8 @@ detailsFramework.ScrollBoxFunctions = { if (line) then line._InUse = true end + + self._LinesInUse = self._LinesInUse + 1 return line end, @@ -538,10 +553,10 @@ detailsFramework.ScrollBoxFunctions = { } local SortMember = "" -local SortByMember = function (t1, t2) +local SortByMember = function(t1, t2) return t1[SortMember] > t2[SortMember] end -local SortByMemberReverse = function (t1, t2) +local SortByMemberReverse = function(t1, t2) return t1[SortMember] < t2[SortMember] end diff --git a/Libs/DF/normal_bar.lua b/Libs/DF/normal_bar.lua index f37735dd..3825ee56 100644 --- a/Libs/DF/normal_bar.lua +++ b/Libs/DF/normal_bar.lua @@ -49,7 +49,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] ------------------------------------------------------------------------------------------------------------ --> metatables - BarMetaFunctions.__call = function (_table, value) + BarMetaFunctions.__call = function(_table, value) if (not value) then return _table.statusbar:GetValue() else @@ -57,7 +57,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] end end - BarMetaFunctions.__add = function (v1, v2) + BarMetaFunctions.__add = function(v1, v2) if (_type (v1) == "table") then local v = v1.statusbar:GetValue() v = v + v2 @@ -69,7 +69,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] end end - BarMetaFunctions.__sub = function (v1, v2) + BarMetaFunctions.__sub = function(v1, v2) if (_type (v1) == "table") then local v = v1.statusbar:GetValue() v = v - v2 @@ -89,58 +89,58 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] return _object:GetTooltip() end --> shown - local gmember_shown = function (_object) + local gmember_shown = function(_object) return _object.statusbar:IsShown() end --> frame width - local gmember_width = function (_object) + local gmember_width = function(_object) return _object.statusbar:GetWidth() end --> frame height - local gmember_height = function (_object) + local gmember_height = function(_object) return _object.statusbar:GetHeight() end --> value - local gmember_value = function (_object) + local gmember_value = function(_object) return _object.statusbar:GetValue() end --> right text - local gmember_rtext = function (_object) + local gmember_rtext = function(_object) return _object.textright:GetText() end --> left text - local gmember_ltext = function (_object) + local gmember_ltext = function(_object) return _object.textleft:GetText() end --> left color - local gmember_color = function (_object) + local gmember_color = function(_object) local r, g, b, a = _object._texture:GetVertexColor() return r, g, b, a end --> icon - local gmember_icon = function (_object) + local gmember_icon = function(_object) return _object._icon:GetTexture() end --> texture - local gmember_texture = function (_object) + local gmember_texture = function(_object) return _object._texture:GetTexture() end --> font size - local gmember_textsize = function (_object) + local gmember_textsize = function(_object) local _, fontsize = _object.textleft:GetFont() return fontsize end --> font face - local gmember_textfont = function (_object) + local gmember_textfont = function(_object) local fontface = _object.textleft:GetFont() return fontface end --> font color - local gmember_textcolor = function (_object) + local gmember_textcolor = function(_object) return _object.textleft:GetTextColor() end --> alpha - local gmember_alpha= function (_object) + local gmember_alpha= function(_object) return _object:GetAlpha() end @@ -163,7 +163,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] BarMetaFunctions.GetMembers ["textcolor"] = gmember_textcolor --alias BarMetaFunctions.GetMembers ["alpha"] = gmember_alpha - BarMetaFunctions.__index = function (_table, _member_requested) + BarMetaFunctions.__index = function(_table, _member_requested) local func = BarMetaFunctions.GetMembers [_member_requested] if (func) then @@ -183,11 +183,11 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] --> tooltip - local smember_tooltip = function (_object, _value) + local smember_tooltip = function(_object, _value) return _object:SetTooltip (_value) end --> show - local smember_shown = function (_object, _value) + local smember_shown = function(_object, _value) if (_value) then return _object:Show() else @@ -195,7 +195,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] end end --> hide - local smember_hide = function (_object, _value) + local smember_hide = function(_object, _value) if (_value) then return _object:Hide() else @@ -203,28 +203,28 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] end end --> width - local smember_width = function (_object, _value) + local smember_width = function(_object, _value) return _object.statusbar:SetWidth (_value) end --> height - local smember_height = function (_object, _value) + local smember_height = function(_object, _value) return _object.statusbar:SetHeight (_value) end --> statusbar value - local smember_value = function (_object, _value) + local smember_value = function(_object, _value) _object.statusbar:SetValue (_value) return _object.div:SetPoint ("left", _object.statusbar, "left", _value * (_object.statusbar:GetWidth()/100) - 16, 0) end --> right text - local smember_rtext = function (_object, _value) + local smember_rtext = function(_object, _value) return _object.textright:SetText (_value) end --> left text - local smember_ltext = function (_object, _value) + local smember_ltext = function(_object, _value) return _object.textleft:SetText (_value) end --> color - local smember_color = function (_object, _value) + local smember_color = function(_object, _value) local _value1, _value2, _value3, _value4 = DF:ParseColors (_value) _object.statusbar:SetStatusBarColor (_value1, _value2, _value3, _value4) @@ -236,12 +236,12 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] return _object._texture:SetVertexColor (_value1, _value2, _value3, _value4) end --> background color - local smember_backgroundcolor = function (_object, _value) + local smember_backgroundcolor = function(_object, _value) local _value1, _value2, _value3, _value4 = DF:ParseColors (_value) return _object.background:SetVertexColor (_value1, _value2, _value3, _value4) end --> icon - local smember_icon = function (_object, _value) + local smember_icon = function(_object, _value) if (type (_value) == "table") then local _value1, _value2 = _unpack (_value) _object._icon:SetTexture (_value1) @@ -254,7 +254,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] return end --> texture - local smember_texture = function (_object, _value) + local smember_texture = function(_object, _value) if (type (_value) == "table") then local _value1, _value2 = _unpack (_value) _object._texture:SetTexture (_value1) @@ -284,7 +284,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] return end --> background texture - local smember_backgroundtexture = function (_object, _value) + local smember_backgroundtexture = function(_object, _value) if (_value:find ("\\")) then _object.background:SetTexture (_value) else @@ -298,28 +298,28 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] return end --> font face - local smember_textfont = function (_object, _value) + local smember_textfont = function(_object, _value) DF:SetFontFace (_object.textleft, _value) return DF:SetFontFace (_object.textright, _value) end --> font size - local smember_textsize = function (_object, _value) + local smember_textsize = function(_object, _value) DF:SetFontSize (_object.textleft, _value) return DF:SetFontSize (_object.textright, _value) end --> font color - local smember_textcolor = function (_object, _value) + local smember_textcolor = function(_object, _value) local _value1, _value2, _value3, _value4 = DF:ParseColors (_value) _object.textleft:SetTextColor (_value1, _value2, _value3, _value4) return _object.textright:SetTextColor (_value1, _value2, _value3, _value4) end --> outline (shadow) - local smember_outline = function (_object, _value) + local smember_outline = function(_object, _value) DF:SetFontOutline (_object.textleft, _value) return DF:SetFontOutline (_object.textright, _value) end --> alpha - local smember_alpha= function (_object, _value) + local smember_alpha= function(_object, _value) return _object:SetAlpha (_value) end @@ -346,7 +346,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] BarMetaFunctions.SetMembers["outline"] = smember_outline --alias BarMetaFunctions.SetMembers["alpha"] = smember_alpha - BarMetaFunctions.__newindex = function (_table, _key, _value) + BarMetaFunctions.__newindex = function(_table, _key, _value) local func = BarMetaFunctions.SetMembers [_key] if (func) then @@ -488,7 +488,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] ------------------------------------------------------------------------------------------------------------ --> scripts - local OnEnter = function (frame) + local OnEnter = function(frame) local capsule = frame.MyObject local kill = capsule:RunHooksForWidget ("OnEnter", frame, capsule) if (kill) then @@ -505,7 +505,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] end - local OnLeave = function (frame) + local OnLeave = function(frame) local capsule = frame.MyObject local kill = capsule:RunHooksForWidget ("OnLeave", frame, capsule) if (kill) then @@ -519,7 +519,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] end end - local OnHide = function (frame) + local OnHide = function(frame) local capsule = frame.MyObject local kill = capsule:RunHooksForWidget ("OnHide", frame, capsule) if (kill) then @@ -527,7 +527,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] end end - local OnShow = function (frame) + local OnShow = function(frame) local capsule = frame.MyObject local kill = capsule:RunHooksForWidget ("OnShow", frame, capsule) if (kill) then @@ -535,7 +535,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] end end - local OnMouseDown = function (frame, button) + local OnMouseDown = function(frame, button) local capsule = frame.MyObject local kill = capsule:RunHooksForWidget ("OnMouseDown", frame, button, capsule) if (kill) then @@ -550,7 +550,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] end end - local OnMouseUp = function (frame, button) + local OnMouseUp = function(frame, button) local capsule = frame.MyObject local kill = capsule:RunHooksForWidget ("OnMouseUp", frame, button, capsule) if (kill) then @@ -602,7 +602,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] end end - local OnUpdate = function (self, elapsed) + local OnUpdate = function(self, elapsed) --> percent of elapsed local pct = abs (self.end_timer - GetTime() - self.tempo) / self.tempo @@ -691,7 +691,7 @@ function DetailsFrameworkNormalBar_OnCreate (self) return true end -local build_statusbar = function (self) +local build_statusbar = function(self) self:SetSize (300, 14) @@ -808,7 +808,7 @@ function DF:NewBar (parent, container, name, member, w, h, value, texture_name) local idx = getmetatable (BarObject.statusbar).__index for funcName, funcAddress in pairs (idx) do if (not BarMetaFunctions [funcName]) then - BarMetaFunctions [funcName] = function (object, ...) + BarMetaFunctions [funcName] = function(object, ...) local x = loadstring ( "return _G['"..object.statusbar:GetName().."']:"..funcName.."(...)") return x (...) end diff --git a/Libs/DF/panel.lua b/Libs/DF/panel.lua index e002d941..53292ffb 100644 --- a/Libs/DF/panel.lua +++ b/Libs/DF/panel.lua @@ -82,7 +82,7 @@ local default_framelayout_options = { --> mixin for frame layout DF.LayoutFrame = { - AnchorTo = function (self, anchor, point, x, y) + AnchorTo = function(self, anchor, point, x, y) if (point == "top") then self:ClearAllPoints() self:SetPoint ("bottom", anchor, "top", x or 0, y or 0) @@ -101,7 +101,7 @@ DF.LayoutFrame = { end end, - ArrangeFrames = function (self, frameList, options) + ArrangeFrames = function(self, frameList, options) if (not frameList) then frameList = {self:GetChildren()} @@ -206,7 +206,7 @@ DF.LayoutFrame = { ------------------------------------------------------------------------------------------------------------ --> metatables - PanelMetaFunctions.__call = function (_table, value) + PanelMetaFunctions.__call = function(_table, value) --> nothing to do return true end @@ -215,31 +215,31 @@ DF.LayoutFrame = { --> members --> tooltip - local gmember_tooltip = function (_object) + local gmember_tooltip = function(_object) return _object:GetTooltip() end --> shown - local gmember_shown = function (_object) + local gmember_shown = function(_object) return _object:IsShown() end --> backdrop color - local gmember_color = function (_object) + local gmember_color = function(_object) return _object.frame:GetBackdropColor() end --> backdrop table - local gmember_backdrop = function (_object) + local gmember_backdrop = function(_object) return _object.frame:GetBackdrop() end --> frame width - local gmember_width = function (_object) + local gmember_width = function(_object) return _object.frame:GetWidth() end --> frame height - local gmember_height = function (_object) + local gmember_height = function(_object) return _object.frame:GetHeight() end --> locked - local gmember_locked = function (_object) + local gmember_locked = function(_object) return _rawget (_object, "is_locked") end @@ -252,7 +252,7 @@ DF.LayoutFrame = { PanelMetaFunctions.GetMembers ["height"] = gmember_height PanelMetaFunctions.GetMembers ["locked"] = gmember_locked - PanelMetaFunctions.__index = function (_table, _member_requested) + PanelMetaFunctions.__index = function(_table, _member_requested) local func = PanelMetaFunctions.GetMembers [_member_requested] if (func) then @@ -269,11 +269,11 @@ DF.LayoutFrame = { --> tooltip - local smember_tooltip = function (_object, _value) + local smember_tooltip = function(_object, _value) return _object:SetTooltip (_value) end --> show - local smember_show = function (_object, _value) + local smember_show = function(_object, _value) if (_value) then return _object:Show() else @@ -281,7 +281,7 @@ DF.LayoutFrame = { end end --> hide - local smember_hide = function (_object, _value) + local smember_hide = function(_object, _value) if (not _value) then return _object:Show() else @@ -289,21 +289,21 @@ DF.LayoutFrame = { end end --> backdrop color - local smember_color = function (_object, _value) + local smember_color = function(_object, _value) local _value1, _value2, _value3, _value4 = DF:ParseColors (_value) return _object:SetBackdropColor (_value1, _value2, _value3, _value4) end --> frame width - local smember_width = function (_object, _value) + local smember_width = function(_object, _value) return _object.frame:SetWidth (_value) end --> frame height - local smember_height = function (_object, _value) + local smember_height = function(_object, _value) return _object.frame:SetHeight (_value) end --> locked - local smember_locked = function (_object, _value) + local smember_locked = function(_object, _value) if (_value) then _object.frame:SetMovable (false) return _rawset (_object, "is_locked", true) @@ -315,12 +315,12 @@ DF.LayoutFrame = { end --> backdrop - local smember_backdrop = function (_object, _value) + local smember_backdrop = function(_object, _value) return _object.frame:SetBackdrop (_value) end --> close with right button - local smember_right_close = function (_object, _value) + local smember_right_close = function(_object, _value) return _rawset (_object, "rightButtonClose", _value) end @@ -335,7 +335,7 @@ DF.LayoutFrame = { PanelMetaFunctions.SetMembers["locked"] = smember_locked PanelMetaFunctions.SetMembers["close_with_right"] = smember_right_close - PanelMetaFunctions.__newindex = function (_table, _key, _value) + PanelMetaFunctions.__newindex = function(_table, _key, _value) local func = PanelMetaFunctions.SetMembers [_key] if (func) then return func (_table, _value) @@ -495,7 +495,7 @@ DF.LayoutFrame = { ------------------------------------------------------------------------------------------------------------ --> scripts - local OnEnter = function (frame) + local OnEnter = function(frame) local capsule = frame.MyObject local kill = capsule:RunHooksForWidget ("OnEnter", frame, capsule) if (kill) then @@ -512,7 +512,7 @@ DF.LayoutFrame = { end end - local OnLeave = function (frame) + local OnLeave = function(frame) local capsule = frame.MyObject local kill = capsule:RunHooksForWidget ("OnLeave", frame, capsule) if (kill) then @@ -525,7 +525,7 @@ DF.LayoutFrame = { end - local OnHide = function (frame) + local OnHide = function(frame) local capsule = frame.MyObject local kill = capsule:RunHooksForWidget ("OnHide", frame, capsule) if (kill) then @@ -533,7 +533,7 @@ DF.LayoutFrame = { end end - local OnShow = function (frame) + local OnShow = function(frame) local capsule = frame.MyObject local kill = capsule:RunHooksForWidget ("OnShow", frame, capsule) if (kill) then @@ -541,7 +541,7 @@ DF.LayoutFrame = { end end - local OnMouseDown = function (frame, button) + local OnMouseDown = function(frame, button) local capsule = frame.MyObject local kill = capsule:RunHooksForWidget ("OnMouseDown", frame, button, capsule) if (kill) then @@ -564,7 +564,7 @@ DF.LayoutFrame = { end - local OnMouseUp = function (frame, button) + local OnMouseUp = function(frame, button) local capsule = frame.MyObject local kill = capsule:RunHooksForWidget ("OnMouseUp", frame, button, capsule) if (kill) then @@ -645,7 +645,7 @@ function DF:NewPanel (parent, container, name, member, w, h, backdrop, backdropc local idx = getmetatable (PanelObject.frame).__index for funcName, funcAddress in pairs (idx) do if (not PanelMetaFunctions [funcName]) then - PanelMetaFunctions [funcName] = function (object, ...) + PanelMetaFunctions [funcName] = function(object, ...) local x = loadstring ( "return _G['"..object.frame:GetName().."']:"..funcName.."(...)") return x (...) end @@ -696,20 +696,20 @@ end ------------fill panel -local button_on_enter = function (self) +local button_on_enter = function(self) self.MyObject._icon:SetBlendMode ("ADD") if (self.MyObject.onenter_func) then pcall (self.MyObject.onenter_func, self.MyObject) end end -local button_on_leave = function (self) +local button_on_leave = function(self) self.MyObject._icon:SetBlendMode ("BLEND") if (self.MyObject.onleave_func) then pcall (self.MyObject.onleave_func, self.MyObject) end end -local add_row = function (self, t, need_update) +local add_row = function(self, t, need_update) local index = #self.rows+1 local thisrow = DF:NewPanel (self, self, "$parentHeader_" .. self._name .. index, nil, 1, 20) @@ -739,7 +739,7 @@ local add_row = function (self, t, need_update) end end -local align_rows = function (self) +local align_rows = function(self) local rows_shown = 0 for index, row in ipairs (self.rows) do @@ -934,7 +934,7 @@ local align_rows = function (self) self.showing_amt = rows_shown end -local update_rows = function (self, updated_rows) +local update_rows = function(self, updated_rows) for i = 1, #updated_rows do local t = updated_rows [i] @@ -1022,13 +1022,13 @@ local update_rows = function (self, updated_rows) end -local create_panel_text = function (self, row) +local create_panel_text = function(self, row) row.text_total = row.text_total + 1 local text = DF:NewLabel (row, nil, self._name .. "$parentLabel" .. row.text_total, "text" .. row.text_total) tinsert (row.text_available, text) end -local create_panel_entry = function (self, row) +local create_panel_entry = function(self, row) row.entry_total = row.entry_total + 1 local editbox = DF:NewTextEntry (row, nil, "$parentEntry" .. row.entry_total, "entry", 120, 20) editbox.align = "left" @@ -1059,7 +1059,7 @@ local create_panel_entry = function (self, row) tinsert (row.entry_available, editbox) end -local create_panel_checkbox = function (self, row) +local create_panel_checkbox = function(self, row) --row.checkbox_available row.checkbox_total = row.checkbox_total + 1 @@ -1070,7 +1070,7 @@ local create_panel_checkbox = function (self, row) tinsert (row.checkbox_available, switch) end -local create_panel_button = function (self, row) +local create_panel_button = function(self, row) row.button_total = row.button_total + 1 local button = DF:NewButton (row, nil, "$parentButton" .. row.button_total, "button" .. row.button_total, 120, 20) @@ -1087,12 +1087,12 @@ local create_panel_button = function (self, row) tinsert (row.button_available, button) end -local icon_onclick = function (texture, iconbutton) +local icon_onclick = function(texture, iconbutton) iconbutton._icon.texture = texture iconbutton.func (iconbutton.index, texture) end -local create_panel_icon = function (self, row) +local create_panel_icon = function(self, row) row.icon_total = row.icon_total + 1 local iconbutton = DF:NewButton (row, nil, "$parentIconButton" .. row.icon_total, "iconbutton", 22, 20) @@ -1112,23 +1112,23 @@ local create_panel_icon = function (self, row) tinsert (row.icon_available, iconbutton) end -local create_panel_texture = function (self, row) +local create_panel_texture = function(self, row) row.texture_total = row.texture_total + 1 local texture = DF:NewImage (row, nil, 20, 20, "artwork", nil, "_icon" .. row.texture_total, "$parentIcon" .. row.texture_total) tinsert (row.texture_available, texture) end -local set_fill_function = function (self, func) +local set_fill_function = function(self, func) self._fillfunc = func end -local set_total_function = function (self, func) +local set_total_function = function(self, func) self._totalfunc = func end -local drop_header_function = function (self) +local drop_header_function = function(self) wipe (self.rows) end -local fillpanel_update_size = function (self, elapsed) +local fillpanel_update_size = function(self, elapsed) local panel = self.MyObject panel._width = panel:GetWidth() @@ -1145,13 +1145,12 @@ end -- ~fillpanel --alias -function DF:CreateFillPanel (parent, rows, w, h, total_lines, fill_row, autowidth, options, member, name) - return DF:NewFillPanel (parent, rows, name, member, w, h, total_lines, fill_row, autowidth, options) +function DF:CreateFillPanel(parent, rows, w, h, total_lines, fill_row, autowidth, options, member, name) + return DF:NewFillPanel(parent, rows, name, member, w, h, total_lines, fill_row, autowidth, options) end -function DF:NewFillPanel (parent, rows, name, member, w, h, total_lines, fill_row, autowidth, options) - - local panel = DF:NewPanel (parent, parent, name, member, w, h) +function DF:NewFillPanel(parent, rows, name, member, w, h, total_lines, fill_row, autowidth, options) + local panel = DF:NewPanel(parent, parent, name, member, w, h) panel.backdrop = nil options = options or {rowheight = 20} @@ -1179,21 +1178,19 @@ function DF:NewFillPanel (parent, rows, name, member, w, h, total_lines, fill_ro panel._totalfunc = total_lines panel._autowidth = autowidth - panel:SetScript ("OnSizeChanged", function() - panel:SetScript ("OnUpdate", fillpanel_update_size) + panel:SetScript("OnSizeChanged", function() + panel:SetScript("OnUpdate", fillpanel_update_size) end) - for index, t in ipairs (rows) do - panel.AddRow (panel, t) + for index, t in ipairs(rows) do + panel.AddRow(panel, t) end - local refresh_fillbox = function (self) - - local offset = FauxScrollFrame_GetOffset (self) - local filled_lines = panel._totalfunc (panel) + local refresh_fillbox = function(self) + local offset = FauxScrollFrame_GetOffset(self) + local filled_lines = panel._totalfunc(panel) for index = 1, #self.lines do - local row = self.lines [index] if (index <= filled_lines) then @@ -1384,7 +1381,7 @@ function DF:NewFillPanel (parent, rows, name, member, w, h, total_lines, fill_ro end local scrollframe = CreateFrame ("scrollframe", name .. "Scroll", panel.widget, "FauxScrollFrameTemplate", "BackdropTemplate") - scrollframe:SetScript ("OnVerticalScroll", function (self, offset) FauxScrollFrame_OnVerticalScroll (self, offset, 20, panel.Refresh) end) + scrollframe:SetScript ("OnVerticalScroll", function(self, offset) FauxScrollFrame_OnVerticalScroll (self, offset, 20, panel.Refresh) end) scrollframe:SetPoint ("topleft", panel.widget, "topleft", 0, -21) scrollframe:SetPoint ("topright", panel.widget, "topright", -23, -21) scrollframe:SetPoint ("bottomleft", panel.widget, "bottomleft") @@ -1393,7 +1390,7 @@ function DF:NewFillPanel (parent, rows, name, member, w, h, total_lines, fill_ro panel.scrollframe = scrollframe scrollframe.lines = {} - DF:ReskinSlider (scrollframe) + DF:ReskinSlider(scrollframe) --create lines function panel:UpdateRowAmount() @@ -1510,14 +1507,14 @@ function DF:IconPick (callback, close_when_select, param1, param2) DF.IconPickFrame:SetBackdropColor (24/255, 24/255, 24/255, .8) DF.IconPickFrame:SetFrameLevel (5000) - DF.IconPickFrame:SetScript ("OnMouseDown", function (self) + DF.IconPickFrame:SetScript ("OnMouseDown", function(self) if (not self.isMoving) then DF.IconPickFrame:StartMoving() self.isMoving = true end end) - DF.IconPickFrame:SetScript ("OnMouseUp", function (self) + DF.IconPickFrame:SetScript ("OnMouseUp", function(self) if (self.isMoving) then DF.IconPickFrame:StopMovingOrSizing() self.isMoving = nil @@ -1675,13 +1672,13 @@ function DF:IconPick (callback, close_when_select, param1, param2) end end - local onEnter = function (self) + local onEnter = function(self) DF.IconPickFrame.preview:SetPoint ("bottom", self, "top", 0, 2) DF.IconPickFrame.preview.icon:SetTexture(self.icon:GetTexture()) DF.IconPickFrame.preview:Show() self.icon:SetBlendMode ("ADD") end - local onLeave = function (self) + local onLeave = function(self) DF.IconPickFrame.preview:Hide() self.icon:SetBlendMode ("BLEND") end @@ -1853,7 +1850,7 @@ end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -local simple_panel_mouse_down = function (self, button) +local simple_panel_mouse_down = function(self, button) if (button == "RightButton") then if (self.IsMoving) then self.IsMoving = false @@ -1872,7 +1869,7 @@ local simple_panel_mouse_down = function (self, button) self:StartMoving() end end -local simple_panel_mouse_up = function (self, button) +local simple_panel_mouse_up = function(self, button) if (self.IsMoving) then self.IsMoving = false self:StopMovingOrSizing() @@ -1881,11 +1878,11 @@ local simple_panel_mouse_up = function (self, button) end end end -local simple_panel_settitle = function (self, title) +local simple_panel_settitle = function(self, title) self.Title:SetText (title) end -local simple_panel_close_click = function (self) +local simple_panel_close_click = function(self) self:GetParent():GetParent():Hide() end @@ -2065,10 +2062,10 @@ end local Panel1PxBackdrop = {bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 64, edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, insets = {left = 2, right = 2, top = 3, bottom = 3}} -local Panel1PxOnClickClose = function (self) +local Panel1PxOnClickClose = function(self) self:GetParent():Hide() end -local Panel1PxOnToggleLock = function (self) +local Panel1PxOnToggleLock = function(self) if (self.IsLocked) then self.IsLocked = false self:SetMovable (true) @@ -2097,15 +2094,15 @@ local Panel1PxOnToggleLock = function (self) end end end -local Panel1PxOnClickLock = function (self) +local Panel1PxOnClickLock = function(self) local f = self:GetParent() Panel1PxOnToggleLock (f) end -local Panel1PxSetTitle = function (self, text) +local Panel1PxSetTitle = function(self, text) self.Title:SetText (text or "") end -local Panel1PxSetLocked= function (self, lock_state) +local Panel1PxSetLocked= function(self, lock_state) if (type (lock_state) ~= "boolean") then return end @@ -2120,7 +2117,7 @@ local Panel1PxSetLocked= function (self, lock_state) end end -local Panel1PxReadConfig = function (self) +local Panel1PxReadConfig = function(self) local db = self.db if (db) then db.IsLocked = db.IsLocked or false @@ -2164,11 +2161,11 @@ function DF:RestoreFramePosition (frame) end end -local Panel1PxSavePosition= function (self) +local Panel1PxSavePosition= function(self) DF:SavePositionOnScreen (self) end -local Panel1PxHasPosition = function (self) +local Panel1PxHasPosition = function(self) local db = self.db if (db) then if (db.position and db.position.x and (db.position.x ~= 0 or db.position.y ~= 0)) then @@ -2376,7 +2373,7 @@ function DF:ShowTextPromptPanel (message, callback) f:RegisterForDrag ("LeftButton") f:SetScript ("OnDragStart", function() f:StartMoving() end) f:SetScript ("OnDragStop", function() f:StopMovingOrSizing() end) - f:SetScript ("OnMouseDown", function (self, button) if (button == "RightButton") then f.EntryBox:ClearFocus() f:Hide() end end) + f:SetScript ("OnMouseDown", function(self, button) if (button == "RightButton") then f.EntryBox:ClearFocus() f:Hide() end end) tinsert (UISpecialFrames, "DetailsFrameworkPrompt") DF:CreateTitleBar (f, "Prompt!") @@ -2451,12 +2448,12 @@ function DF:CreateOptionsButton (parent, callback, name) b:SetAlpha (0.7) b:SetScript ("OnClick", callback) - b:SetScript ("OnEnter", function (self) + b:SetScript ("OnEnter", function(self) GameCooltip2:Reset() GameCooltip2:AddLine ("Options") GameCooltip2:ShowCooltip (self, "tooltip") end) - b:SetScript ("OnLeave", function (self) + b:SetScript ("OnLeave", function(self) GameCooltip2:Hide() end) @@ -2471,12 +2468,12 @@ function DF:CreateFeedbackButton (parent, callback, name) local b = CreateFrame ("button", name, parent, "BackdropTemplate") b:SetSize (12, 13) b:SetScript ("OnClick", callback) - b:SetScript ("OnEnter", function (self) + b:SetScript ("OnEnter", function(self) GameCooltip2:Reset() GameCooltip2:AddLine ("Send Feedback") GameCooltip2:ShowCooltip (self, "tooltip") end) - b:SetScript ("OnLeave", function (self) + b:SetScript ("OnLeave", function(self) GameCooltip2:Hide() end) @@ -2488,14 +2485,14 @@ end local backdrop_fb_line = {bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, tile = true, tileSize = 64, insets = {left = 2, right = 2, top = 2, bottom = 2}} -local on_enter_feedback = function (self) +local on_enter_feedback = function(self) self:SetBackdropColor (1, 1, 0, 0.5) end -local on_leave_feedback = function (self) +local on_leave_feedback = function(self) self:SetBackdropColor (0, 0, 0, 0.3) end -local on_click_feedback = function (self) +local on_click_feedback = function(self) local feedback_link_textbox = DF.feedback_link_textbox @@ -2531,7 +2528,7 @@ local on_click_feedback = function (self) feedback_link_textbox:SetFrameLevel (self:GetFrameLevel()+2) end -local feedback_get_fb_line = function (self) +local feedback_get_fb_line = function(self) local line = self.feedback_lines [self.next_feedback] if (not line) then @@ -2565,7 +2562,7 @@ local feedback_get_fb_line = function (self) return line end -local on_click_feedback = function (self) +local on_click_feedback = function(self) local feedback_link_textbox = DF.feedback_link_textbox @@ -2601,7 +2598,7 @@ local on_click_feedback = function (self) feedback_link_textbox:SetFrameLevel (self:GetFrameLevel()+2) end -local on_enter_addon = function (self) +local on_enter_addon = function(self) if (self.tooltip) then GameCooltip2:Preset (2) GameCooltip2:AddLine ("|cFFFFFF00" .. self.name .. "|r") @@ -2611,13 +2608,13 @@ local on_enter_addon = function (self) end self.icon:SetBlendMode ("ADD") end -local on_leave_addon = function (self) +local on_leave_addon = function(self) if (self.tooltip) then GameCooltip2:Hide() end self.icon:SetBlendMode ("BLEND") end -local on_click_addon = function (self) +local on_click_addon = function(self) local addon_link_textbox = DF.addon_link_textbox if (not addon_link_textbox) then @@ -2652,7 +2649,7 @@ local on_click_addon = function (self) addon_link_textbox:SetFrameLevel (self:GetFrameLevel()+2) end -local feedback_get_addons_line = function (self) +local feedback_get_addons_line = function(self) local line = self.addons_lines [self.next_addons] if (not line) then @@ -2687,7 +2684,7 @@ local feedback_get_addons_line = function (self) end local default_coords = {0, 1, 0, 1} -local feedback_add_fb = function (self, table) +local feedback_add_fb = function(self, table) local line = self:GetFeedbackLine() line.icon:SetTexture (table.icon) line.icon:SetTexCoord (unpack (table.coords or default_coords)) @@ -2696,7 +2693,7 @@ local feedback_add_fb = function (self, table) line:Show() end -local feedback_add_addon = function (self, table) +local feedback_add_addon = function(self, table) local block = self:GetAddonsLine() block.icon:SetTexture (table.icon) block.icon:SetTexCoord (unpack (table.coords or default_coords)) @@ -2706,7 +2703,7 @@ local feedback_add_addon = function (self, table) block:Show() end -local feedback_hide_all = function (self) +local feedback_hide_all = function(self) self.next_feedback = 1 self.next_addons = 1 @@ -2790,7 +2787,7 @@ end local chart_panel_backdrop = {bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", edgeSize = 32, insets = {left = 5, right = 5, top = 5, bottom = 5}} -local chart_panel_align_timelabels = function (self, elapsed_time) +local chart_panel_align_timelabels = function(self, elapsed_time) self.TimeScale = elapsed_time @@ -2835,7 +2832,7 @@ local chart_panel_align_timelabels = function (self, elapsed_time) end -local chart_panel_set_scale = function (self, amt, func, text) +local chart_panel_set_scale = function(self, amt, func, text) if (type (amt) ~= "number") then return end @@ -2856,11 +2853,11 @@ local chart_panel_set_scale = function (self, amt, func, text) end end -local chart_panel_can_move = function (self, can) +local chart_panel_can_move = function(self, can) self.can_move = can end -local chart_panel_overlay_reset = function (self) +local chart_panel_overlay_reset = function(self) self.OverlaysAmount = 1 for index, pack in ipairs (self.Overlays) do for index2, texture in ipairs (pack) do @@ -2869,7 +2866,7 @@ local chart_panel_overlay_reset = function (self) end end -local chart_panel_reset = function (self) +local chart_panel_reset = function(self) self.Graphic:ResetData() self.Graphic.max_value = 0 @@ -2891,7 +2888,7 @@ local chart_panel_reset = function (self) chart_panel_overlay_reset (self) end -local chart_panel_enable_line = function (f, thisbox) +local chart_panel_enable_line = function(f, thisbox) local index = thisbox.index local type = thisbox.type @@ -2947,7 +2944,7 @@ local chart_panel_enable_line = function (f, thisbox) end end -local create_box = function (self, next_box) +local create_box = function(self, next_box) local thisbox = {} self.BoxLabels [next_box] = thisbox @@ -2995,7 +2992,7 @@ local create_box = function (self, next_box) end -local realign_labels = function (self) +local realign_labels = function(self) if (not self.ShowHeader) then for _, box in ipairs (self.BoxLabels) do @@ -3044,7 +3041,7 @@ local realign_labels = function (self) end -local chart_panel_add_label = function (self, color, name, type, number) +local chart_panel_add_label = function(self, color, name, type, number) local next_box = self.BoxLabelsAmount local thisbox = self.BoxLabels [next_box] @@ -3075,7 +3072,7 @@ local chart_panel_add_label = function (self, color, name, type, number) end local line_default_color = {1, 1, 1} -local draw_overlay = function (self, this_overlay, overlayData, color) +local draw_overlay = function(self, this_overlay, overlayData, color) local pixel = self.Graphic:GetWidth() / self.TimeScale local index = 1 @@ -3108,7 +3105,7 @@ local draw_overlay = function (self, this_overlay, overlayData, color) end -local chart_panel_add_overlay = function (self, overlayData, color, name, icon) +local chart_panel_add_overlay = function(self, overlayData, color, name, icon) if (not self.TimeScale) then error ("Use SetTime (time) before adding an overlay.") @@ -3144,7 +3141,7 @@ function calc_cubeweight (i, j, d) return w end -local calc_lowess_smoothing = function (self, data, bandwidth) +local calc_lowess_smoothing = function(self, data, bandwidth) local length = #data local newData = {} @@ -3191,7 +3188,7 @@ local calc_lowess_smoothing = function (self, data, bandwidth) return newData end -local calc_stddev = function (self, data) +local calc_stddev = function(self, data) local total = 0 for i = 1, #data do total = total + data[i] @@ -3217,7 +3214,7 @@ local reset_SMA = function() end local calc_SMA -calc_SMA = function (a, b, ...) +calc_SMA = function(a, b, ...) if (b) then return calc_SMA (a + b, ...) else @@ -3225,7 +3222,7 @@ calc_SMA = function (a, b, ...) end end -local do_SMA = function (value, max_value) +local do_SMA = function(value, max_value) if (#SMA_table == 10) then tremove (SMA_table, 1) @@ -3244,7 +3241,7 @@ local do_SMA = function (value, max_value) end -local chart_panel_onresize = function (self) +local chart_panel_onresize = function(self) local width, height = self:GetSize() local spacement = width - 78 - 60 spacement = spacement / 16 @@ -3265,7 +3262,7 @@ local chart_panel_onresize = function (self) self.Graphic:SetPoint ("topleft", self, "topleft", 108, -35) end -local chart_panel_add_data = function (self, graphicData, color, name, elapsed_time, lineTexture, smoothLevel, firstIndex) +local chart_panel_add_data = function(self, graphicData, color, name, elapsed_time, lineTexture, smoothLevel, firstIndex) local f = self self = self.Graphic @@ -3405,25 +3402,25 @@ end -local chart_panel_vlines_on = function (self) +local chart_panel_vlines_on = function(self) for i = 1, 17 do local label = self.TimeLabels [i] label.line:Show() end end -local chart_panel_vlines_off = function (self) +local chart_panel_vlines_off = function(self) for i = 1, 17 do local label = self.TimeLabels [i] label.line:Hide() end end -local chart_panel_set_title = function (self, title) +local chart_panel_set_title = function(self, title) self.chart_title.text = title end -local chart_panel_mousedown = function (self, button) +local chart_panel_mousedown = function(self, button) if (button == "LeftButton" and self.can_move) then if (not self.isMoving) then self:StartMoving() @@ -3435,18 +3432,18 @@ local chart_panel_mousedown = function (self, button) end end end -local chart_panel_mouseup = function (self, button) +local chart_panel_mouseup = function(self, button) if (button == "LeftButton" and self.isMoving) then self:StopMovingOrSizing() self.isMoving = nil end end -local chart_panel_hide_close_button = function (self) +local chart_panel_hide_close_button = function(self) self.CloseButton:Hide() end -local chart_panel_right_click_close = function (self, value) +local chart_panel_right_click_close = function(self, value) if (type (value) == "boolean") then if (value) then self.no_right_click_close = nil @@ -3588,7 +3585,7 @@ end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -- ~gframe -local gframe_on_enter_line = function (self) +local gframe_on_enter_line = function(self) self:SetBackdropColor (0, 0, 0, 0) local parent = self:GetParent() @@ -3601,7 +3598,7 @@ local gframe_on_enter_line = function (self) end end -local gframe_on_leave_line = function (self) +local gframe_on_leave_line = function(self) self:SetBackdropColor (0, 0, 0, .6) local parent = self:GetParent() @@ -3614,7 +3611,7 @@ local gframe_on_leave_line = function (self) end end -local gframe_create_line = function (self) +local gframe_create_line = function(self) local index = #self._lines+1 local f = CreateFrame ("frame", nil, self, "BackdropTemplate") @@ -3672,7 +3669,7 @@ local gframe_create_line = function (self) return f end -local gframe_getline = function (self, index) +local gframe_getline = function(self, index) local line = self._lines [index] if (not line) then line = gframe_create_line (self) @@ -3680,7 +3677,7 @@ local gframe_getline = function (self, index) return line end -local gframe_reset = function (self) +local gframe_reset = function(self) for i, line in ipairs (self._lines) do line:Hide() end @@ -3693,7 +3690,7 @@ local gframe_reset = function (self) end end -local gframe_update = function (self, lines) +local gframe_update = function(self, lines) local g = LibStub:GetLibrary ("LibGraph-2.0") local h = self:GetHeight()/100 @@ -3816,7 +3813,7 @@ DF.TabContainerFunctions = {} local button_tab_template = DF.table.copy ({}, DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) button_tab_template.backdropbordercolor = nil -DF.TabContainerFunctions.CreateUnderlineGlow = function (button) +DF.TabContainerFunctions.CreateUnderlineGlow = function(button) local selectedGlow = button:CreateTexture (nil, "background", nil, -4) selectedGlow:SetPoint ("topleft", button.widget, "bottomleft", -7, 0) selectedGlow:SetPoint ("topright", button.widget, "bottomright", 7, 0) @@ -3829,7 +3826,7 @@ DF.TabContainerFunctions.CreateUnderlineGlow = function (button) button.selectedUnderlineGlow = selectedGlow end -DF.TabContainerFunctions.OnMouseDown = function (self, button) +DF.TabContainerFunctions.OnMouseDown = function(self, button) --> search for UIParent local f = DF:FindHighestParent (self) local container = self:GetParent() @@ -3857,7 +3854,7 @@ DF.TabContainerFunctions.OnMouseDown = function (self, button) end end -DF.TabContainerFunctions.OnMouseUp = function (self, button) +DF.TabContainerFunctions.OnMouseUp = function(self, button) local f = DF:FindHighestParent (self) if (f.IsMoving) then f:StopMovingOrSizing() @@ -3865,7 +3862,7 @@ DF.TabContainerFunctions.OnMouseUp = function (self, button) end end -DF.TabContainerFunctions.SelectIndex = function (self, fixedParam, menuIndex) +DF.TabContainerFunctions.SelectIndex = function(self, fixedParam, menuIndex) local mainFrame = self.AllFrames and self or self.mainFrame or self:GetParent() for i = 1, #mainFrame.AllFrames do @@ -3895,11 +3892,11 @@ DF.TabContainerFunctions.SelectIndex = function (self, fixedParam, menuIndex) end end -DF.TabContainerFunctions.SetIndex = function (self, index) +DF.TabContainerFunctions.SetIndex = function(self, index) self.CurrentIndex = index end -local tab_container_on_show = function (self) +local tab_container_on_show = function(self) local index = self.CurrentIndex self.SelectIndex (self.AllButtons[index], nil, index) end @@ -4038,23 +4035,23 @@ end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -- ~listbox -local simple_list_box_ResetWidgets = function (self) +local simple_list_box_ResetWidgets = function(self) for _, widget in ipairs (self.widgets) do widget:Hide() end self.nextWidget = 1 end -local simple_list_box_onenter = function (self, capsule) +local simple_list_box_onenter = function(self, capsule) self:GetParent().options.onenter (self, capsule, capsule.value) end -local simple_list_box_onleave = function (self, capsule) +local simple_list_box_onleave = function(self, capsule) self:GetParent().options.onleave (self, capsule, capsule.value) GameTooltip:Hide() end -local simple_list_box_GetOrCreateWidget = function (self) +local simple_list_box_GetOrCreateWidget = function(self) local index = self.nextWidget local widget = self.widgets [index] if (not widget) then @@ -4080,7 +4077,7 @@ local simple_list_box_GetOrCreateWidget = function (self) return widget end -local simple_list_box_RefreshWidgets = function (self) +local simple_list_box_RefreshWidgets = function(self) self:ResetWidgets() local amt = 0 for value, _ in pairs (self.list_table) do @@ -4159,12 +4156,12 @@ local default_options = { backdrop_color = {1, 1, 1, .5}, panel_border_color = {0, 0, 0, 0.5}, - onenter = function (self, capsule) + onenter = function(self, capsule) if (capsule) then capsule.textcolor = "white" end end, - onleave = function (self, capsule) + onleave = function(self, capsule) if (capsule) then capsule.textcolor = self:GetParent().options.textcolor end @@ -4172,7 +4169,7 @@ local default_options = { end, } -local simple_list_box_SetData = function (self, t) +local simple_list_box_SetData = function(self, t) self.list_table = t end @@ -4185,7 +4182,7 @@ function DF:CreateSimpleListBox (parent, name, title, empty_text, list_table, on f.SetData = simple_list_box_SetData f.nextWidget = 1 f.list_table = list_table - f.func = function (self, button, value) + f.func = function(self, button, value) --onclick (value) DF:QuickDispatch (onclick, value) f:Refresh() @@ -4199,7 +4196,7 @@ function DF:CreateSimpleListBox (parent, name, title, empty_text, list_table, on if (f.options.x_button_func) then local original_X_function = f.options.x_button_func - f.options.x_button_func = function (self, button, value) + f.options.x_button_func = function(self, button, value) DF:QuickDispatch (original_X_function, value) f:Refresh() end @@ -4343,7 +4340,7 @@ local keysToMouse = { ["type16"] = "Button16", } -local keybind_set_data = function (self, new_data_table) +local keybind_set_data = function(self, new_data_table) self.Data = new_data_table self.keybindScroll:UpdateScroll() end @@ -4397,7 +4394,7 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ new_keybind_frame.CurrentKeybindEditingSet = new_keybind_frame.Data [new_keybind_frame.EditingSpec] local allSpecButtons = {} - local switch_spec = function (self, button, specID) + local switch_spec = function(self, button, specID) new_keybind_frame.EditingSpec = specID new_keybind_frame.CurrentKeybindEditingSet = new_keybind_frame.Data [specID] @@ -4467,7 +4464,7 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ enter_the_key.text:SetPoint ("center", enter_the_key, "center") enter_the_key:Hide() - local registerKeybind = function (self, key) + local registerKeybind = function(self, key) if (ignoredKeys [key]) then return end @@ -4494,7 +4491,7 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ DF:QuickDispatch (callback) end - local set_keybind_key = function (self, button, keybindIndex) + local set_keybind_key = function(self, button, keybindIndex) if (new_keybind_frame.IsListening) then key = mouseKeys [button] or button return registerKeybind (new_keybind_frame, key) @@ -4507,19 +4504,19 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ enter_the_key:SetPoint ("bottom", self, "top") end - local new_key_bind = function (self, button, specID) + local new_key_bind = function(self, button, specID) tinsert (new_keybind_frame.CurrentKeybindEditingSet, {key = "-none-", action = "_target", actiontext = ""}) FauxScrollFrame_SetOffset (new_keybind_frame.keybindScroll, max (#new_keybind_frame.CurrentKeybindEditingSet-SCROLL_ROLL_AMOUNT, 0)) new_keybind_frame.keybindScroll:UpdateScroll() end - local set_action_text = function (keybindIndex, _, text) + local set_action_text = function(keybindIndex, _, text) local keybind = new_keybind_frame.CurrentKeybindEditingSet [keybindIndex] keybind.actiontext = text DF:QuickDispatch (callback) end - local set_action_on_espace_press = function (textentry, capsule) + local set_action_on_espace_press = function(textentry, capsule) capsule = capsule or textentry.MyObject local keybind = new_keybind_frame.CurrentKeybindEditingSet [capsule.CurIndex] textentry:SetText (keybind.actiontext) @@ -4535,7 +4532,7 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ ["_macro"] = false, } - local change_key_action = function (self, keybindIndex, value) + local change_key_action = function(self, keybindIndex, value) local keybind = new_keybind_frame.CurrentKeybindEditingSet [keybindIndex] keybind.action = value new_keybind_frame.keybindScroll:UpdateScroll() @@ -4553,7 +4550,7 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ local dispelString = "\n" for specID, spellid in pairs (dispel) do local specid, specName = DetailsFramework.GetSpecializationInfoByID (specID) - local spellName = GetSpellInfo (spellid) + local spellName = GetSpellInfo(spellid) dispelString = dispelString .. "|cFFE5E5E5" .. (specName or "") .. "|r: |cFFFFFFFF" .. spellName .. "\n" end dispel = dispelString @@ -4571,7 +4568,7 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ } end - local copy_keybind = function (self, button, keybindIndex) + local copy_keybind = function(self, button, keybindIndex) local keybind = new_keybind_frame.CurrentKeybindEditingSet [keybindIndex] for specID, t in pairs (new_keybind_frame.Data) do if (specID ~= new_keybind_frame.EditingSpec) then @@ -4584,7 +4581,7 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ DF:QuickDispatch (callback) end - local delete_keybind = function (self, button, keybindIndex) + local delete_keybind = function(self, button, keybindIndex) tremove (new_keybind_frame.CurrentKeybindEditingSet, keybindIndex) new_keybind_frame.keybindScroll:UpdateScroll() DF:QuickDispatch (callback) @@ -4596,7 +4593,7 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ createNewKeybind:SetPoint ("topleft", newTitle, "bottomleft", 0, -10) --createNewKeybind:SetIcon ([[Interface\Buttons\UI-GuildButton-PublicNote-Up]]) - local update_keybind_list = function (self) + local update_keybind_list = function(self) local keybinds = new_keybind_frame.CurrentKeybindEditingSet FauxScrollFrame_Update (self, #keybinds, SCROLL_ROLL_AMOUNT, 21) @@ -4650,17 +4647,17 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ - keybindScroll:SetScript ("OnVerticalScroll", function (self, offset) + keybindScroll:SetScript ("OnVerticalScroll", function(self, offset) FauxScrollFrame_OnVerticalScroll (self, offset, 21, update_keybind_list) end) keybindScroll.UpdateScroll = update_keybind_list local backdropColor = {.3, .3, .3, .3} local backdropColorOnEnter = {.6, .6, .6, .6} - local on_enter = function (self) + local on_enter = function(self) self:SetBackdropColor (unpack (backdropColorOnEnter)) end - local on_leave = function (self) + local on_leave = function(self) self:SetBackdropColor (unpack (backdropColor)) end @@ -4706,7 +4703,7 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ local index = offset + i local spellType, spellId = GetSpellBookItemInfo (index, "player") if (spellType == "SPELL") then - local spellName = GetSpellInfo (spellId) + local spellName = GetSpellInfo(spellId) tinsert (playerSpells, spellName) end end @@ -4892,7 +4889,7 @@ end DF.TitleFunctions = { - SetTitle = function (self, titleText, titleColor, font, size) + SetTitle = function(self, titleText, titleColor, font, size) self.TitleLabel:SetText (titleText or self.TitleLabel:GetText()) if (titleColor) then @@ -4962,7 +4959,7 @@ end DF.IconRowFunctions = { - GetIcon = function (self) + GetIcon = function(self) local iconFrame = self.IconPool [self.NextIcon] if (not iconFrame) then @@ -5039,7 +5036,7 @@ DF.IconRowFunctions = { end, --adds only if not existing already in the cache - AddSpecificIcon = function (self, identifierKey, spellId, borderColor, startTime, duration, forceTexture, descText, count, debuffType, caster, canStealOrPurge, spellName, isBuff) + AddSpecificIcon = function(self, identifierKey, spellId, borderColor, startTime, duration, forceTexture, descText, count, debuffType, caster, canStealOrPurge, spellName, isBuff) if not identifierKey or identifierKey == "" then return end @@ -5051,9 +5048,9 @@ DF.IconRowFunctions = { end end, - SetIcon = function (self, spellId, borderColor, startTime, duration, forceTexture, descText, count, debuffType, caster, canStealOrPurge, spellName, isBuff, modRate) + SetIcon = function(self, spellId, borderColor, startTime, duration, forceTexture, descText, count, debuffType, caster, canStealOrPurge, spellName, isBuff, modRate) - local actualSpellName, _, spellIcon = GetSpellInfo (spellId) + local actualSpellName, _, spellIcon = GetSpellInfo(spellId) if forceTexture then spellIcon = forceTexture @@ -5172,7 +5169,7 @@ DF.IconRowFunctions = { end end, - OnIconTick = function (self, deltaTime) + OnIconTick = function(self, deltaTime) local now = GetTime() if (self.lastUpdateCooldown + 0.05) <= now then self.timeRemaining = self.expirationTime - now @@ -5189,7 +5186,7 @@ DF.IconRowFunctions = { end end, - FormatCooldownTime = function (formattedTime) + FormatCooldownTime = function(formattedTime) if (formattedTime >= 3600) then formattedTime = floor (formattedTime / 3600) .. "h" @@ -5202,7 +5199,7 @@ DF.IconRowFunctions = { return formattedTime end, - FormatCooldownTimeDecimal = function (formattedTime) + FormatCooldownTimeDecimal = function(formattedTime) if formattedTime < 10 then return ("%.1f"):format(formattedTime) elseif formattedTime < 60 then @@ -5216,7 +5213,7 @@ DF.IconRowFunctions = { end end, - RemoveSpecificIcon = function (self, identifierKey) + RemoveSpecificIcon = function(self, identifierKey) if not identifierKey or identifierKey == "" then return end @@ -5244,7 +5241,7 @@ DF.IconRowFunctions = { end, - ClearIcons = function (self, resetBuffs, resetDebuffs) + ClearIcons = function(self, resetBuffs, resetDebuffs) resetBuffs = resetBuffs ~= false resetDebuffs = resetDebuffs ~= false table.wipe (self.AuraCache) @@ -5273,7 +5270,7 @@ DF.IconRowFunctions = { end, - AlignAuraIcons = function (self) + AlignAuraIcons = function(self) local iconPool = self.IconPool local iconAmount = #iconPool @@ -5317,7 +5314,7 @@ DF.IconRowFunctions = { end, - GetIconGrowDirection = function (self) + GetIconGrowDirection = function(self) local side = self.options.anchor.side if (side == 1) then @@ -5349,7 +5346,7 @@ DF.IconRowFunctions = { end end, - OnOptionChanged = function (self, optionName) + OnOptionChanged = function(self, optionName) self:SetBackdropColor (unpack (self.options.backdrop_color)) self:SetBackdropBorderColor (unpack (self.options.backdrop_border_color)) end, @@ -5845,7 +5842,7 @@ local default_radiogroup_options = { } DF.RadioGroupCoreFunctions = { - Disable = function (self) + Disable = function(self) local frameList = self:GetAllCheckboxes() for _, checkbox in ipairs(frameList) do checkbox = checkbox.GetCapsule and checkbox:GetCapsule() or checkbox @@ -5853,7 +5850,7 @@ DF.RadioGroupCoreFunctions = { end end, - Enable = function (self) + Enable = function(self) local frameList = self:GetAllCheckboxes() for _, checkbox in ipairs(frameList) do checkbox = checkbox.GetCapsule and checkbox:GetCapsule() or checkbox @@ -6075,7 +6072,7 @@ function DF:CreateLoadFilterParser (callback) f:RegisterEvent ("ENCOUNTER_START") f:RegisterEvent ("PLAYER_REGEN_ENABLED") - f:SetScript ("OnEvent", function (self, event, ...) + f:SetScript ("OnEvent", function(self, event, ...) if (event == "ENCOUNTER_START") then local encounterID = ... f.EncounterIDCached = encounterID @@ -6338,14 +6335,14 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) --when the user click on an option or when the panel is opened --check if there's an option enabled and fadein all options, fadeout otherwise - f.OnRadioStateChanged = function (radioGroup, subConfigTable) + f.OnRadioStateChanged = function(radioGroup, subConfigTable) subConfigTable.Enabled = nil subConfigTable.Enabled = next (subConfigTable) and true or nil radioGroup:SetFadeState (subConfigTable.Enabled) end --create the radio group for character class - f.OnRadioCheckboxClick = function (self, key, value) + f.OnRadioCheckboxClick = function(self, key, value) --hierarchy: DBKey ["class"] key ["HUNTER"] value TRUE local DBKey = self:GetParent().DBKey f.OptionsTable [DBKey] [key and key .. ""] = value and true or nil @@ -6434,7 +6431,7 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) otherTalents.Texture = DF:CreateImage (otherTalents, [[Interface\BUTTONS\AdventureGuideMicrobuttonAlert]], 24, 24) otherTalents.Texture:SetAllPoints() - local removeTalent = function (_, _, talentID) + local removeTalent = function(_, _, talentID) f.OptionsTable.talent [talentID] = nil GameCooltip2:Hide() f.OnRadioStateChanged (talentGroup, f.OptionsTable [talentGroup.DBKey]) @@ -6467,8 +6464,8 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) otherTalents.CoolTip = { Type = "menu", BuildFunc = buildTalentMenu, - OnEnterFunc = function (self) end, - OnLeaveFunc = function (self) end, + OnEnterFunc = function(self) end, + OnLeaveFunc = function(self) end, FixedValue = "none", ShowSpeed = 0.05, Options = function() @@ -6534,7 +6531,7 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) otherTalents.Texture = DF:CreateImage (otherTalents, [[Interface\BUTTONS\AdventureGuideMicrobuttonAlert]], 24, 24) otherTalents.Texture:SetAllPoints() - local removeTalent = function (_, _, talentID) + local removeTalent = function(_, _, talentID) f.OptionsTable.pvptalent [talentID] = nil GameCooltip2:Hide() f.OnRadioStateChanged (pvpTalentGroup, f.OptionsTable [pvpTalentGroup.DBKey]) @@ -6567,8 +6564,8 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) otherTalents.CoolTip = { Type = "menu", BuildFunc = buildTalentMenu, - OnEnterFunc = function (self) end, - OnLeaveFunc = function (self) end, + OnEnterFunc = function(self) end, + OnLeaveFunc = function(self) end, FixedValue = "none", ShowSpeed = 0.05, Options = function() @@ -6660,7 +6657,7 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) end --text entries functions - local textEntryRefresh = function (self) + local textEntryRefresh = function(self) local idList = f.OptionsTable [self.DBKey] self:SetText ("") for _, id in pairs(idList) do @@ -6671,7 +6668,7 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) self:SetText (self:GetText():gsub ("^ ", "")) end - local textEntryOnEnterPressed = function (_, self) + local textEntryOnEnterPressed = function(_, self) wipe (f.OptionsTable [self.DBKey]) local text = self:GetText() @@ -6781,7 +6778,7 @@ end --> simple data scroll DF.DataScrollFunctions = { - RefreshScroll = function (self, data, offset, totalLines) + RefreshScroll = function(self, data, offset, totalLines) local filter = self.Filter local currentData = {} if (type (filter) == "string" and filter ~= "") then @@ -6812,7 +6809,7 @@ DF.DataScrollFunctions = { end end, - CreateLine = function (self, index) + CreateLine = function(self, index) --create a new line local line = CreateFrame ("button", "$parentLine" .. index, self, "BackdropTemplate") line.Update = self.options.update_line_func @@ -6858,18 +6855,18 @@ DF.DataScrollFunctions = { return line end, - LineOnEnter = function (self) + LineOnEnter = function(self) self:SetBackdropColor (unpack (self.backdrop_color_highlight)) end, - LineOnLeave = function (self) + LineOnLeave = function(self) self:SetBackdropColor (unpack (self.backdrop_color)) end, - OnClick = function (self) + OnClick = function(self) end, - UpdateLine = function (line, lineIndex, data) + UpdateLine = function(line, lineIndex, data) local parent = line:GetParent() if (parent.options.show_title) then @@ -6928,7 +6925,7 @@ function DF:CreateDataScrollFrame (parent, name, options) --scroll frame local newScroll = DF:CreateScrollBox (parent, name, optionsTable.refresh_func, optionsTable.data, optionsTable.width, optionsTable.height, optionsTable.line_amount, optionsTable.line_height) - DF:ReskinSlider (newScroll) + DF:ReskinSlider(newScroll) DF:Mixin (newScroll, DF.OptionsFunctions) DF:Mixin (newScroll, DF.LayoutFrame) @@ -7118,11 +7115,11 @@ end --]=] DF.StatusBarFunctions = { - SetTexture = function (self, texture) + SetTexture = function(self, texture) self.barTexture:SetTexture (texture) end, - GetTexture = function (self) + GetTexture = function(self) return self.barTexture:GetTexture() end, @@ -7142,12 +7139,12 @@ DF.StatusBarFunctions = { return self.barTexture:GetTexCoord() end, - SetColor = function (self, r, g, b, a) + SetColor = function(self, r, g, b, a) r, g, b, a = DF:ParseColors (r, g, b, a) self:SetStatusBarColor (r, g, b, a) end, - GetColor = function (self) + GetColor = function(self) return self:GetStatusBarColor() end, @@ -7435,7 +7432,7 @@ DF.StatusBarFunctions = { } --> setup the castbar to be used by another unit - healthBarMetaFunctions.SetUnit = function (self, unit, displayedUnit) + healthBarMetaFunctions.SetUnit = function(self, unit, displayedUnit) if (self.unit ~= unit or self.displayedUnit ~= displayedUnit or unit == nil) then self.unit = unit @@ -7500,7 +7497,7 @@ DF.StatusBarFunctions = { end end - healthBarMetaFunctions.Initialize = function (self) + healthBarMetaFunctions.Initialize = function(self) PixelUtil.SetWidth (self, self.Settings.Width, 1) PixelUtil.SetHeight (self, self.Settings.Height, 1) @@ -7526,10 +7523,10 @@ DF.StatusBarFunctions = { end --call every tick - healthBarMetaFunctions.OnTick = function (self, deltaTime) end --if overrided, set 'CanTick' to true on the settings table + healthBarMetaFunctions.OnTick = function(self, deltaTime) end --if overrided, set 'CanTick' to true on the settings table --when an event happen for this unit, send it to the apropriate function - healthBarMetaFunctions.OnEvent = function (self, event, ...) + healthBarMetaFunctions.OnEvent = function(self, event, ...) local eventFunc = self [event] if (eventFunc) then --the function doesn't receive which event was, only 'self' and the parameters @@ -7538,7 +7535,7 @@ DF.StatusBarFunctions = { end --when the unit max health is changed - healthBarMetaFunctions.UpdateMaxHealth = function (self) + healthBarMetaFunctions.UpdateMaxHealth = function(self) local maxHealth = UnitHealthMax (self.displayedUnit) self:SetMinMaxValues (0, maxHealth) self.currentHealthMax = maxHealth @@ -7561,7 +7558,7 @@ DF.StatusBarFunctions = { end --health and absorbs prediction - healthBarMetaFunctions.UpdateHealPrediction = function (self) + healthBarMetaFunctions.UpdateHealPrediction = function(self) local currentHealth = self.currentHealth local currentHealthMax = self.currentHealthMax local healthPercent = currentHealth / currentHealthMax @@ -7631,42 +7628,42 @@ DF.StatusBarFunctions = { end --> Health Events - healthBarMetaFunctions.PLAYER_ENTERING_WORLD = function (self, ...) + healthBarMetaFunctions.PLAYER_ENTERING_WORLD = function(self, ...) self:UpdateMaxHealth() self:UpdateHealth() self:UpdateHealPrediction() end - healthBarMetaFunctions.UNIT_HEALTH = function (self, ...) + healthBarMetaFunctions.UNIT_HEALTH = function(self, ...) self:UpdateHealth() self:UpdateHealPrediction() end - healthBarMetaFunctions.UNIT_HEALTH_FREQUENT = function (self, ...) + healthBarMetaFunctions.UNIT_HEALTH_FREQUENT = function(self, ...) self:UpdateHealth() self:UpdateHealPrediction() end - healthBarMetaFunctions.UNIT_MAXHEALTH = function (self, ...) + healthBarMetaFunctions.UNIT_MAXHEALTH = function(self, ...) self:UpdateMaxHealth() self:UpdateHealth() self:UpdateHealPrediction() end - healthBarMetaFunctions.UNIT_HEAL_PREDICTION = function (self, ...) + healthBarMetaFunctions.UNIT_HEAL_PREDICTION = function(self, ...) self:UpdateMaxHealth() self:UpdateHealth() self:UpdateHealPrediction() end - healthBarMetaFunctions.UNIT_ABSORB_AMOUNT_CHANGED = function (self, ...) + healthBarMetaFunctions.UNIT_ABSORB_AMOUNT_CHANGED = function(self, ...) self:UpdateMaxHealth() self:UpdateHealth() self:UpdateHealPrediction() end - healthBarMetaFunctions.UNIT_HEAL_ABSORB_AMOUNT_CHANGED = function (self, ...) + healthBarMetaFunctions.UNIT_HEAL_ABSORB_AMOUNT_CHANGED = function(self, ...) self:UpdateMaxHealth() self:UpdateHealth() self:UpdateHealPrediction() @@ -7773,7 +7770,7 @@ DF.PowerFrameFunctions = { }, --> setup the castbar to be used by another unit - SetUnit = function (self, unit, displayedUnit) + SetUnit = function(self, unit, displayedUnit) if (self.unit ~= unit or self.displayedUnit ~= displayedUnit or unit == nil) then self.unit = unit self.displayedUnit = displayedUnit or unit @@ -7815,7 +7812,7 @@ DF.PowerFrameFunctions = { end end, - Initialize = function (self) + Initialize = function(self) PixelUtil.SetWidth (self, self.Settings.Width) PixelUtil.SetHeight (self, self.Settings.Height) @@ -7839,10 +7836,10 @@ DF.PowerFrameFunctions = { end, --> call every tick - OnTick = function (self, deltaTime) end, --if overrided, set 'CanTick' to true on the settings table + OnTick = function(self, deltaTime) end, --if overrided, set 'CanTick' to true on the settings table --> when an event happen for this unit, send it to the apropriate function - OnEvent = function (self, event, ...) + OnEvent = function(self, event, ...) local eventFunc = self [event] if (eventFunc) then --the function doesn't receive which event was, only 'self' and the parameters @@ -7850,7 +7847,7 @@ DF.PowerFrameFunctions = { end end, - UpdatePowerBar = function (self) + UpdatePowerBar = function(self) self:UpdatePowerInfo() self:UpdateMaxPower() self:UpdatePower() @@ -7858,7 +7855,7 @@ DF.PowerFrameFunctions = { end, --> power update - UpdateMaxPower = function (self) + UpdateMaxPower = function(self) self.currentPowerMax = UnitPowerMax (self.displayedUnit, self.powerType) self:SetMinMaxValues (self.minPower, self.currentPowerMax) @@ -7866,7 +7863,7 @@ DF.PowerFrameFunctions = { self:Hide() end end, - UpdatePower = function (self) + UpdatePower = function(self) self.currentPower = UnitPower (self.displayedUnit, self.powerType) PixelUtil.SetStatusBarValue (self, self.currentPower) @@ -7876,7 +7873,7 @@ DF.PowerFrameFunctions = { end, --> when a event different from unit_power_update is triggered, update which type of power the unit should show - UpdatePowerInfo = function (self) + UpdatePowerInfo = function(self) if (IS_WOW_PROJECT_MAINLINE and self.Settings.ShowAlternatePower) then -- not available in classic local barID = UnitPowerBarID(self.displayedUnit) local barInfo = GetUnitPowerBarInfoByID(barID) @@ -7894,7 +7891,7 @@ DF.PowerFrameFunctions = { end, --> tint the bar with the color of the power, e.g. blue for a mana bar - UpdatePowerColor = function (self) + UpdatePowerColor = function(self) if (not UnitIsConnected (self.unit)) then self:SetStatusBarColor (.5, .5, .5) return @@ -7924,27 +7921,27 @@ DF.PowerFrameFunctions = { end, --> events - PLAYER_ENTERING_WORLD = function (self, ...) + PLAYER_ENTERING_WORLD = function(self, ...) self:UpdatePowerBar() end, - UNIT_DISPLAYPOWER = function (self, ...) + UNIT_DISPLAYPOWER = function(self, ...) self:UpdatePowerBar() end, - UNIT_POWER_BAR_SHOW = function (self, ...) + UNIT_POWER_BAR_SHOW = function(self, ...) self:UpdatePowerBar() end, - UNIT_POWER_BAR_HIDE = function (self, ...) + UNIT_POWER_BAR_HIDE = function(self, ...) self:UpdatePowerBar() end, - UNIT_MAXPOWER = function (self, ...) + UNIT_MAXPOWER = function(self, ...) self:UpdateMaxPower() self:UpdatePower() end, - UNIT_POWER_UPDATE = function (self, ...) + UNIT_POWER_UPDATE = function(self, ...) self:UpdatePower() end, - UNIT_POWER_FREQUENT = function (self, ...) + UNIT_POWER_FREQUENT = function(self, ...) self:UpdatePower() end, } @@ -8071,7 +8068,7 @@ DF.CastFrameFunctions = { SparkOffset = 0, }, - Initialize = function (self) + Initialize = function(self) self.unit = "unutilized unit" self.lazyUpdateCooldown = self.Settings.LazyUpdateCooldown self.Colors = self.Settings.Colors @@ -8106,13 +8103,13 @@ DF.CastFrameFunctions = { self.fadeInAnimation.alpha1:SetDuration (self.Settings.FadeInTime) end, - SetDefaultColor = function (self, colorType, r, g, b, a) + SetDefaultColor = function(self, colorType, r, g, b, a) assert (type (colorType) == "string", "DetailsFramework: CastBar:SetDefaultColor require a string in the first argument.") self.Colors [colorType]:SetColor (r, g, b, a) end, --> this get a color suggestion based on the type of cast being shown in the cast bar - GetCastColor = function (self) + GetCastColor = function(self) if (not self.canInterrupt) then return self.Colors.NonInterruptible @@ -8134,13 +8131,13 @@ DF.CastFrameFunctions = { end, --> update all colors of the cast bar - UpdateCastColor = function (self) + UpdateCastColor = function(self) local castColor = self:GetCastColor() self:SetColor (castColor) --SetColor handles with ParseColors() end, --> initial checks to know if this is a valid cast and should show the cast bar, if this fails the cast bar won't show - IsValid = function (self, unit, castName, isTradeSkill, ignoreVisibility) + IsValid = function(self, unit, castName, isTradeSkill, ignoreVisibility) if (not ignoreVisibility and not self:IsShown()) then return false end @@ -8160,7 +8157,7 @@ DF.CastFrameFunctions = { --> handle the interrupt state of the cast --> this does not change the cast bar color because this function is called inside the start cast where is already handles the cast color - UpdateInterruptState = function (self) + UpdateInterruptState = function(self) if (self.Settings.ShowShield and not self.canInterrupt) then self.BorderShield:Show() else @@ -8169,7 +8166,7 @@ DF.CastFrameFunctions = { end, --> this check if the cast did reach 100% in the statusbar, mostly called from OnTick - CheckCastIsDone = function (self, event, isFinished) + CheckCastIsDone = function(self, event, isFinished) --> check max value if (not isFinished and not self.finished) then @@ -8206,7 +8203,7 @@ DF.CastFrameFunctions = { end, --> setup the castbar to be used by another unit - SetUnit = function (self, unit, displayedUnit) + SetUnit = function(self, unit, displayedUnit) if (self.unit ~= unit or self.displayedUnit ~= displayedUnit or unit == nil) then self.unit = unit self.displayedUnit = displayedUnit or unit @@ -8273,7 +8270,7 @@ DF.CastFrameFunctions = { end, --> executed after a scheduled to hide timer is done - DoScheduledHide = function (timerObject) + DoScheduledHide = function(timerObject) timerObject.castBar.scheduledHideTime = nil --just to make sure it isn't casting @@ -8286,18 +8283,18 @@ DF.CastFrameFunctions = { end end, - HasScheduledHide = function (self) + HasScheduledHide = function(self) return self.scheduledHideTime and not self.scheduledHideTime:IsCancelled() end, - CancelScheduleToHide = function (self) + CancelScheduleToHide = function(self) if (self:HasScheduledHide()) then self.scheduledHideTime:Cancel() end end, --> after an interrupt, do not immediately hide the cast bar, let it up for short amount of time to give feedback to the player - ScheduleToHide = function (self, delay) + ScheduleToHide = function(self, delay) if (not delay) then if (self.scheduledHideTime and not self.scheduledHideTime:IsCancelled()) then self.scheduledHideTime:Cancel() @@ -8316,7 +8313,7 @@ DF.CastFrameFunctions = { self.scheduledHideTime.castBar = self end, - OnHide = function (self) + OnHide = function(self) --> just in case some other effects made it have a different alpha since SetUnit won't load if the unit is the same. self:SetAlpha (1) --> cancel any timer to hide scheduled @@ -8325,7 +8322,7 @@ DF.CastFrameFunctions = { --> just update the current value if a spell is being cast since it wasn't running its tick function during the hide state --> everything else should be in the correct state - OnShow = function (self) + OnShow = function(self) self.flashTexture:Hide() if (self.unit) then @@ -8355,7 +8352,7 @@ DF.CastFrameFunctions = { end, --it's triggering several events since it's not registered for the unit with RegisterUnitEvent - OnEvent = function (self, event, ...) + OnEvent = function(self, event, ...) local arg1 = ... local unit = self.unit @@ -8376,7 +8373,7 @@ DF.CastFrameFunctions = { end end, - OnTick_LazyTick = function (self) + OnTick_LazyTick = function(self) --> run the lazy tick if allowed if (self.Settings.CanLazyTick) then --> update the cast time @@ -8403,7 +8400,7 @@ DF.CastFrameFunctions = { end, --> tick function for regular casts - OnTick_Casting = function (self, deltaTime) + OnTick_Casting = function(self, deltaTime) self.value = self.value + deltaTime if (self:CheckCastIsDone()) then @@ -8421,7 +8418,7 @@ DF.CastFrameFunctions = { end, --> tick function for channeling casts - OnTick_Channeling = function (self, deltaTime) + OnTick_Channeling = function(self, deltaTime) self.value = self.value - deltaTime if (self:CheckCastIsDone()) then @@ -8437,7 +8434,7 @@ DF.CastFrameFunctions = { return true end, - OnTick = function (self, deltaTime) + OnTick = function(self, deltaTime) if (self.casting) then if (not self:OnTick_Casting (deltaTime)) then return @@ -8465,31 +8462,31 @@ DF.CastFrameFunctions = { end, --> animation start script - Animation_FadeOutStarted = function (self) + Animation_FadeOutStarted = function(self) end, --> animation finished script - Animation_FadeOutFinished = function (self) + Animation_FadeOutFinished = function(self) local castBar = self:GetParent() castBar:SetAlpha (1) castBar:Hide() end, --> animation start script - Animation_FadeInStarted = function (self) + Animation_FadeInStarted = function(self) end, --> animation finished script - Animation_FadeInFinished = function (self) + Animation_FadeInFinished = function(self) local castBar = self:GetParent() castBar:Show() castBar:SetAlpha (1) end, --> animation calls - Animation_FadeOut = function (self) + Animation_FadeOut = function(self) self:ScheduleToHide (false) if (self.fadeInAnimation:IsPlaying()) then @@ -8501,7 +8498,7 @@ DF.CastFrameFunctions = { end end, - Animation_FadeIn = function (self) + Animation_FadeIn = function(self) self:ScheduleToHide (false) if (self.fadeOutAnimation:IsPlaying()) then @@ -8513,13 +8510,13 @@ DF.CastFrameFunctions = { end end, - Animation_Flash = function (self) + Animation_Flash = function(self) if (not self.flashAnimation:IsPlaying()) then self.flashAnimation:Play() end end, - Animation_StopAllAnimations = function (self) + Animation_StopAllAnimations = function(self) if (self.flashAnimation:IsPlaying()) then self.flashAnimation:Stop() end @@ -8533,7 +8530,7 @@ DF.CastFrameFunctions = { end end, - PLAYER_ENTERING_WORLD = function (self, unit, arg1) + PLAYER_ENTERING_WORLD = function(self, unit, arg1) local isChannel = UnitChannelInfo (unit) local isRegularCast = UnitCastingInfo (unit) @@ -8558,7 +8555,7 @@ DF.CastFrameFunctions = { end end, - UpdateCastingInfo = function (self, unit) + UpdateCastingInfo = function(self, unit) local name, text, texture, startTime, endTime, isTradeSkill, castID, notInterruptible, spellID = UnitCastingInfo (unit) --> is valid? @@ -8613,14 +8610,14 @@ DF.CastFrameFunctions = { end, - UNIT_SPELLCAST_START = function (self, unit) + UNIT_SPELLCAST_START = function(self, unit) self:UpdateCastingInfo(unit) self:RunHooksForWidget ("OnCastStart", self, self.unit, "UNIT_SPELLCAST_START") end, - UpdateChannelInfo = function (self, unit, ...) + UpdateChannelInfo = function(self, unit, ...) local name, text, texture, startTime, endTime, isTradeSkill, notInterruptible, spellID = UnitChannelInfo (unit) --> is valid? @@ -8676,14 +8673,14 @@ DF.CastFrameFunctions = { end, - UNIT_SPELLCAST_CHANNEL_START = function (self, unit, ...) + UNIT_SPELLCAST_CHANNEL_START = function(self, unit, ...) self:UpdateChannelInfo(unit, ...) self:RunHooksForWidget ("OnCastStart", self, self.unit, "UNIT_SPELLCAST_CHANNEL_START") end, - UNIT_SPELLCAST_STOP = function (self, unit, ...) + UNIT_SPELLCAST_STOP = function(self, unit, ...) local unitID, castID, spellID = ... if (self.castID == castID) then self.Spark:Hide() @@ -8714,7 +8711,7 @@ DF.CastFrameFunctions = { end end, - UNIT_SPELLCAST_CHANNEL_STOP = function (self, unit, ...) + UNIT_SPELLCAST_CHANNEL_STOP = function(self, unit, ...) local unitID, castID, spellID = ... if (self.channeling and castID == self.castID) then @@ -8746,7 +8743,7 @@ DF.CastFrameFunctions = { end end, - UNIT_SPELLCAST_FAILED = function (self, unit, ...) + UNIT_SPELLCAST_FAILED = function(self, unit, ...) local unitID, castID, spellID = ... if ((self.casting or self.channeling) and castID == self.castID and not self.fadeOut) then @@ -8767,7 +8764,7 @@ DF.CastFrameFunctions = { end end, - UNIT_SPELLCAST_INTERRUPTED = function (self, unit, ...) + UNIT_SPELLCAST_INTERRUPTED = function(self, unit, ...) local unitID, castID, spellID = ... if ((self.casting or self.channeling) and castID == self.castID and not self.fadeOut) then @@ -8788,7 +8785,7 @@ DF.CastFrameFunctions = { end end, - UNIT_SPELLCAST_DELAYED = function (self, unit, ...) + UNIT_SPELLCAST_DELAYED = function(self, unit, ...) local name, text, texture, startTime, endTime, isTradeSkill, castID, notInterruptible = UnitCastingInfo (unit) if (not self:IsValid (unit, name, isTradeSkill)) then @@ -8803,7 +8800,7 @@ DF.CastFrameFunctions = { self:SetMinMaxValues (0, self.maxValue) end, - UNIT_SPELLCAST_CHANNEL_UPDATE = function (self, unit, ...) + UNIT_SPELLCAST_CHANNEL_UPDATE = function(self, unit, ...) local name, text, texture, startTime, endTime, isTradeSkill = UnitChannelInfo (unit) if (not self:IsValid (unit, name, isTradeSkill)) then @@ -8825,14 +8822,14 @@ DF.CastFrameFunctions = { end, --> cast changed its state to interruptable - UNIT_SPELLCAST_INTERRUPTIBLE = function (self, unit, ...) + UNIT_SPELLCAST_INTERRUPTIBLE = function(self, unit, ...) self.canInterrupt = true self:UpdateCastColor() self:UpdateInterruptState() end, --> cast changed its state to non interruptable - UNIT_SPELLCAST_NOT_INTERRUPTIBLE = function (self, unit, ...) + UNIT_SPELLCAST_NOT_INTERRUPTIBLE = function(self, unit, ...) self.canInterrupt = false self:UpdateCastColor() self:UpdateInterruptState() @@ -8845,7 +8842,7 @@ local LibCC = LibStub ("LibClassicCasterino", true) if IS_WOW_PROJECT_CLASSIC_ERA and LibCC then local fCast = CreateFrame("frame") - local getCastBar = function (unitId) + local getCastBar = function(unitId) local plateFrame = C_NamePlate.GetNamePlateForUnit (unitId) if (not plateFrame) then return @@ -8859,48 +8856,48 @@ if IS_WOW_PROJECT_CLASSIC_ERA and LibCC then return castBar end - local triggerCastEvent = function (castBar, event, unitId, ...) + local triggerCastEvent = function(castBar, event, unitId, ...) if (castBar and castBar.OnEvent) then castBar.OnEvent (castBar, event, unitId) end end - local funcCast = function (event, unitId, ...) + local funcCast = function(event, unitId, ...) local castBar = getCastBar (unitId) if (castBar) then triggerCastEvent (castBar, event, unitId) end end - fCast.UNIT_SPELLCAST_START = function (self, event, unitId, ...) + fCast.UNIT_SPELLCAST_START = function(self, event, unitId, ...) triggerCastEvent (getCastBar (unitId), event, unitId) end - fCast.UNIT_SPELLCAST_STOP = function (self, event, unitId, ...) + fCast.UNIT_SPELLCAST_STOP = function(self, event, unitId, ...) triggerCastEvent (getCastBar (unitId), event, unitId) end - fCast.UNIT_SPELLCAST_DELAYED = function (self, event, unitId, ...) + fCast.UNIT_SPELLCAST_DELAYED = function(self, event, unitId, ...) triggerCastEvent (getCastBar (unitId), event, unitId) end - fCast.UNIT_SPELLCAST_FAILED = function (self, event, unitId, ...) + fCast.UNIT_SPELLCAST_FAILED = function(self, event, unitId, ...) triggerCastEvent (getCastBar (unitId), event, unitId) end - fCast.UNIT_SPELLCAST_INTERRUPTED = function (self, event, unitId, ...) + fCast.UNIT_SPELLCAST_INTERRUPTED = function(self, event, unitId, ...) triggerCastEvent (getCastBar (unitId), event, unitId) end - fCast.UNIT_SPELLCAST_CHANNEL_START = function (self, event, unitId, ...) + fCast.UNIT_SPELLCAST_CHANNEL_START = function(self, event, unitId, ...) triggerCastEvent (getCastBar (unitId), event, unitId) end - fCast.UNIT_SPELLCAST_CHANNEL_UPDATE = function (self, event, unitId, ...) + fCast.UNIT_SPELLCAST_CHANNEL_UPDATE = function(self, event, unitId, ...) triggerCastEvent (getCastBar (unitId), event, unitId) end - fCast.UNIT_SPELLCAST_CHANNEL_STOP = function (self, event, unitId, ...) + fCast.UNIT_SPELLCAST_CHANNEL_STOP = function(self, event, unitId, ...) triggerCastEvent (getCastBar (unitId), event, unitId) end @@ -9024,14 +9021,14 @@ end --]=] DF.BorderFunctions = { - SetBorderColor = function (self, r, g, b, a) + SetBorderColor = function(self, r, g, b, a) r, g, b, a = DF:ParseColors (r, g, b, a) for _, texture in ipairs (self.allTextures) do texture:SetVertexColor (r, g, b, a) end end, - SetBorderThickness = function (self, newThickness) + SetBorderThickness = function(self, newThickness) PixelUtil.SetWidth (self.leftBorder, newThickness, newThickness) PixelUtil.SetWidth (self.rightBorder, newThickness, newThickness) PixelUtil.SetHeight (self.topBorder, newThickness, newThickness) @@ -9118,7 +9115,7 @@ end --> unit frame --> return true if the unit has been claimed by another player (health bar is gray) - local unit_is_tap_denied = function (unit) + local unit_is_tap_denied = function(unit) return unit and not UnitPlayerControlled (unit) and UnitIsTapDenied (unit) end @@ -9179,7 +9176,7 @@ end ["UNIT_THREAT_LIST_UPDATE"] = true, }, - Initialize = function (self) + Initialize = function(self) self.border:SetBorderColor (self.Settings.BorderColor) PixelUtil.SetWidth (self, self.Settings.Width, 1) @@ -9195,12 +9192,12 @@ end PixelUtil.SetHeight (self.castBar, self.Settings.CastBarHeight, 1) end, - SetHealthBarColor = function (self, r, g, b, a) + SetHealthBarColor = function(self, r, g, b, a) self.healthBar:SetColor (r, g, b, a) end, --> register all events which will be used by the unit frame - RegisterEvents = function (self) + RegisterEvents = function(self) --> register events for index, eventTable in ipairs (self.UnitFrameEvents) do local event, isUnitEvent = unpack (eventTable) @@ -9226,7 +9223,7 @@ end end, --> unregister events, called when this unit frame losses its unit - UnregisterEvents = function (self) + UnregisterEvents = function(self) for index, eventTable in ipairs (self.UnitFrameEvents) do local event, firstUnit, secondUnit = unpack (eventTable) self:UnregisterEvent (event) @@ -9238,10 +9235,10 @@ end end, --> call every tick - OnTick = function (self, deltaTime) end, --if overrided, set 'CanTick' to true on the settings table + OnTick = function(self, deltaTime) end, --if overrided, set 'CanTick' to true on the settings table --> when an event happen for this unit, send it to the apropriate function - OnEvent = function (self, event, ...) + OnEvent = function(self, event, ...) --> run the function for this event local eventFunc = self [event] if (eventFunc) then @@ -9258,14 +9255,14 @@ end end end, - OnHide = function (self) + OnHide = function(self) if (self.Settings.ClearUnitOnHide) then self:SetUnit (nil) end end, --> run if the unit currently shown is different than the new one - SetUnit = function (self, unit) + SetUnit = function(self, unit) if (unit ~= self.unit or unit == nil) then self.unit = unit --absolute unit self.displayedUnit = unit --~todo rename to 'displayedUnit' for back compatibility with older scripts in Plater @@ -9314,7 +9311,7 @@ end --> if the unit is controlling a vehicle, need to show the vehicle instead --> .unit and .displayedUnit is always the same execept when the unit is controlling a vehicle, then .displayedUnit is the unitID for the vehicle --> todo: see what 'UnitTargetsVehicleInRaidUI' is, there's a call for this in the CompactUnitFrame.lua but zero documentation - CheckVehiclePossession = function (self) + CheckVehiclePossession = function(self) --> this unit is possessing a vehicle? local unitPossessVehicle = (IS_WOW_PROJECT_MAINLINE) and UnitHasVehicleUI (self.unit) or false if (unitPossessVehicle) then @@ -9348,7 +9345,7 @@ end end, --> find a color for the health bar, if a color has been passed in the arguments use it instead, 'CanModifyHealhBarColor' must be true for this function run - UpdateHealthColor = function (self, r, g, b) + UpdateHealthColor = function(self, r, g, b) --> check if color changes is disabled if (not self.Settings.CanModifyHealhBarColor) then @@ -9438,7 +9435,7 @@ end end, --> misc - UpdateName = function (self) + UpdateName = function(self) if (not self.Settings.ShowUnitName) then return end @@ -9451,7 +9448,7 @@ end --> this runs when the player it self changes its target, need to update the current target overlay --> todo: add focus overlay - UpdateTargetOverlay = function (self) + UpdateTargetOverlay = function(self) if (not self.Settings.ShowTargetOverlay) then self.targetOverlay:Hide() return @@ -9464,7 +9461,7 @@ end end end, - UpdateAllWidgets = function (self) + UpdateAllWidgets = function(self) if (UnitExists (self.displayedUnit)) then local unit = self.unit local displayedUnit = self.displayedUnit @@ -9488,7 +9485,7 @@ end end, --> update the unit frame and its widgets - UpdateUnitFrame = function (self) + UpdateUnitFrame = function(self) local unitInVehicle = self:CheckVehiclePossession() --> if the unit is inside a vehicle, the vehicle possession function will call an update on all widgets @@ -9498,47 +9495,47 @@ end end, --> event handles - PLAYER_ENTERING_WORLD = function (self, ...) + PLAYER_ENTERING_WORLD = function(self, ...) self:UpdateUnitFrame() end, --> update overlays when the player changes its target - PLAYER_TARGET_CHANGED = function (self, ...) + PLAYER_TARGET_CHANGED = function(self, ...) self:UpdateTargetOverlay() end, --> unit received a name update - UNIT_NAME_UPDATE = function (self, ...) + UNIT_NAME_UPDATE = function(self, ...) self:UpdateName() end, --> this is registered only if .settings.ColorByAggro is true - UNIT_THREAT_LIST_UPDATE = function (self, ...) + UNIT_THREAT_LIST_UPDATE = function(self, ...) if (self.Settings.ColorByAggro) then self:UpdateHealthColor() end end, --> vehicle - UNIT_ENTERED_VEHICLE = function (self, ...) + UNIT_ENTERED_VEHICLE = function(self, ...) self:UpdateUnitFrame() end, - UNIT_EXITED_VEHICLE = function (self, ...) + UNIT_EXITED_VEHICLE = function(self, ...) self:UpdateUnitFrame() end, --> pet - UNIT_PET = function (self, ...) + UNIT_PET = function(self, ...) self:UpdateUnitFrame() end, --> player connection - UNIT_CONNECTION = function (self, ...) + UNIT_CONNECTION = function(self, ...) if (UnitIsConnected (self.unit)) then self:UpdateUnitFrame() end end, - PARTY_MEMBER_ENABLE = function (self, ...) + PARTY_MEMBER_ENABLE = function(self, ...) if (UnitIsConnected (self.unit)) then self:UpdateName() end @@ -9652,17 +9649,17 @@ local timeline_options = { title_template = "ORANGE_FONT_TEMPLATE", text_tempate = "OPTIONS_FONT_TEMPLATE", - on_enter = function (self) + on_enter = function(self) self:SetBackdropColor (unpack (self.backdrop_color_highlight)) end, - on_leave = function (self) + on_leave = function(self) self:SetBackdropColor (unpack (self.backdrop_color)) end, - block_on_enter = function (self) + block_on_enter = function(self) end, - block_on_leave = function (self) + block_on_leave = function(self) end, } @@ -9687,7 +9684,7 @@ local elapsedtime_frame_options = { DF.TimeLineElapsedTimeFunctions = { --get a label and update its appearance - GetLabel = function (self, index) + GetLabel = function(self, index) local label = self.labels [index] if (not label) then @@ -9714,13 +9711,13 @@ DF.TimeLineElapsedTimeFunctions = { return label end, - Reset = function (self) + Reset = function(self) for i = 1, #self.labels do self.labels [i]:Hide() end end, - Refresh = function (self, elapsedTime, scale) + Refresh = function(self, elapsedTime, scale) local parent = self:GetParent() self:SetHeight (self.options.height) @@ -9775,7 +9772,7 @@ end DF.TimeLineBlockFunctions = { --self is the line - SetBlock = function (self, index, blockInfo) + SetBlock = function(self, index, blockInfo) --get the block information --see what is the current scale --adjust the block position @@ -9792,7 +9789,7 @@ DF.TimeLineBlockFunctions = { end, - SetBlocksFromData = function (self) + SetBlocksFromData = function(self) local parent = self:GetParent():GetParent() local data = parent.data local defaultColor = parent.defaultColor --guarantee to have a value @@ -9901,7 +9898,7 @@ DF.TimeLineBlockFunctions = { end end, - GetBlock = function (self, index) + GetBlock = function(self, index) local block = self.blocks [index] if (not block) then block = CreateFrame ("frame", nil, self, "BackdropTemplate") @@ -9936,7 +9933,7 @@ DF.TimeLineBlockFunctions = { return block end, - Reset = function (self) + Reset = function(self) --attention, it doesn't reset icon texture, text and background color for i = 1, #self.blocks do self.blocks [i]:Hide() @@ -9946,7 +9943,7 @@ DF.TimeLineBlockFunctions = { } DF.TimeLineFunctions = { - GetLine = function (self, index) + GetLine = function(self, index) local line = self.lines [index] if (not line) then --create a new line @@ -9999,13 +9996,13 @@ DF.TimeLineFunctions = { return line end, - ResetAllLines = function (self) + ResetAllLines = function(self) for i = 1, #self.lines do self.lines [i]:Reset() end end, - AdjustScale = function (self, index) + AdjustScale = function(self, index) end, @@ -10074,7 +10071,7 @@ DF.TimeLineFunctions = { self.elapsedTimeFrame:Refresh (self.data.length, self.currentScale) end, - SetData = function (self, data) + SetData = function(self, data) self.data = data self:RefreshTimeLine() end, @@ -10299,7 +10296,7 @@ function DF:ShowErrorMessage (errorMessage, titleText) f:RegisterForDrag ("LeftButton") f:SetScript ("OnDragStart", function() f:StartMoving() end) f:SetScript ("OnDragStop", function() f:StopMovingOrSizing() end) - f:SetScript ("OnMouseDown", function (self, button) if (button == "RightButton") then f:Hide() end end) + f:SetScript ("OnMouseDown", function(self, button) if (button == "RightButton") then f:Hide() end end) tinsert (UISpecialFrames, "DetailsFrameworkErrorMessagePanel") DF.ErrorMessagePanel = f diff --git a/Libs/DF/slider.lua b/Libs/DF/slider.lua index 2a922bc7..ae22dce3 100644 --- a/Libs/DF/slider.lua +++ b/Libs/DF/slider.lua @@ -208,7 +208,7 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) DFSliderMetaFunctions.SetMembers["fractional"] = smember_fractional DFSliderMetaFunctions.SetMembers["value"] = smember_value - DFSliderMetaFunctions.__newindex = function (object, key, value) + DFSliderMetaFunctions.__newindex = function(object, key, value) local func = DFSliderMetaFunctions.SetMembers[key] if (func) then return func(object, value) @@ -313,7 +313,7 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) ------------------------------------------------------------------------------------------------------------ --> scripts - local OnEnter = function (slider) + local OnEnter = function(slider) if (rawget (slider.MyObject, "lockdown")) then return end @@ -344,7 +344,7 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) end end - local OnLeave = function (slider) + local OnLeave = function(slider) if (rawget (slider.MyObject, "lockdown")) then return @@ -412,23 +412,23 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) buttonPlus:SetFrameStrata (f:GetFrameStrata()) buttonMinor:SetFrameStrata (f:GetFrameStrata()) - buttonPlus:SetScript ("OnEnter", function (self) + buttonPlus:SetScript ("OnEnter", function(self) if (f.isGoingToHide) then f:SetScript ("OnUpdate", nil) f.isGoingToHide = false end end) - buttonMinor:SetScript ("OnEnter", function (self) + buttonMinor:SetScript ("OnEnter", function(self) if (f.isGoingToHide) then f:SetScript ("OnUpdate", nil) f.isGoingToHide = false end end) - buttonPlus:SetScript ("OnLeave", function (self) + buttonPlus:SetScript ("OnLeave", function(self) f:PrepareToHide() end) - buttonMinor:SetScript ("OnLeave", function (self) + buttonMinor:SetScript ("OnLeave", function(self) f:PrepareToHide() end) @@ -488,7 +488,7 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) end - buttonPlus:SetScript ("OnMouseUp", function (self) + buttonPlus:SetScript ("OnMouseUp", function(self) if (not buttonPlus.got_click) then plus_button_script() end @@ -496,7 +496,7 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) self:SetScript ("OnUpdate", nil) end) - local on_update = function (self, elapsed) + local on_update = function(self, elapsed) timer = timer + elapsed if (timer > 0.4) then change_timer = change_timer + elapsed @@ -507,7 +507,7 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) end end end - buttonPlus:SetScript ("OnMouseDown", function (self) + buttonPlus:SetScript ("OnMouseDown", function(self) timer = 0 change_timer = 0 self:SetScript ("OnUpdate", on_update) @@ -539,7 +539,7 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) end end - buttonMinor:SetScript ("OnMouseUp", function (self) + buttonMinor:SetScript ("OnMouseUp", function(self) if (not buttonMinor.got_click) then minor_button_script() end @@ -547,7 +547,7 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) self:SetScript ("OnUpdate", nil) end) - local on_update = function (self, elapsed) + local on_update = function(self, elapsed) timer = timer + elapsed if (timer > 0.4) then change_timer = change_timer + elapsed @@ -558,13 +558,13 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) end end end - buttonMinor:SetScript ("OnMouseDown", function (self) + buttonMinor:SetScript ("OnMouseDown", function(self) timer = 0 change_timer = 0 self:SetScript ("OnUpdate", on_update) end) - local do_precision = function (text) + local do_precision = function(text) if (type (text) == "string" and text:find ("%.")) then local left, right = strsplit (".", text) left = tonumber (left) @@ -645,7 +645,7 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) end end - local OnMouseDown = function (slider, button) + local OnMouseDown = function(slider, button) slider.MyObject.IsValueChanging = true local capsule = slider.MyObject @@ -659,7 +659,7 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) end end - local OnMouseUp = function (slider, button) + local OnMouseUp = function(slider, button) slider.MyObject.IsValueChanging = nil local capsule = slider.MyObject @@ -669,7 +669,7 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) end end - local OnHide = function (slider) + local OnHide = function(slider) local capsule = slider.MyObject local kill = capsule:RunHooksForWidget ("OnHide", slider, capsule) if (kill) then @@ -683,7 +683,7 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) end end - local OnShow = function (slider) + local OnShow = function(slider) local capsule = slider.MyObject local kill = capsule:RunHooksForWidget ("OnShow", slider, capsule) if (kill) then @@ -694,7 +694,7 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) local table_insert = table.insert local table_remove = table.remove - local OnValueChanged = function (slider) + local OnValueChanged = function(slider) local amt if (slider.MyObject.useDecimals) then @@ -743,7 +743,7 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) ------------------------------------------------------------------------------------------------------------ --> object constructor -local SwitchOnClick = function (self, button, forced_value, value) +local SwitchOnClick = function(self, button, forced_value, value) local slider = self.MyObject @@ -804,7 +804,7 @@ local SwitchOnClick = function (self, button, forced_value, value) end -local default_switch_func = function (self, passed_value) +local default_switch_func = function(self, passed_value) if (self.value) then return false else @@ -812,11 +812,11 @@ local default_switch_func = function (self, passed_value) end end -local switch_get_value = function (self) +local switch_get_value = function(self) return self.value end -local switch_set_value = function (self, value) +local switch_set_value = function(self, value) if (self.switch_func) then value = self:switch_func (value) end @@ -824,11 +824,11 @@ local switch_set_value = function (self, value) SwitchOnClick (self.widget, nil, true, value) end -local switch_set_fixparameter = function (self, value) +local switch_set_fixparameter = function(self, value) rawset (self, "FixedValue", value) end -local switch_disable = function (self) +local switch_disable = function(self) if (self.is_checkbox) then self.checked_texture:Hide() @@ -845,7 +845,7 @@ local switch_disable = function (self) self:SetAlpha (.4) rawset (self, "lockdown", true) end -local switch_enable = function (self) +local switch_enable = function(self) if (self.is_checkbox) then if (rawget (self, "value")) then self.checked_texture:Show() @@ -866,11 +866,11 @@ local switch_enable = function (self) return rawset (self, "lockdown", false) end -local set_switch_func = function (self, newFunction) +local set_switch_func = function(self, newFunction) self.OnSwitch = newFunction end -local set_as_checkbok = function (self) +local set_as_checkbok = function(self) if self.is_checkbox and self.checked_texture then return end local checked = self:CreateTexture (self:GetName() .. "CheckTexture", "overlay") checked:SetTexture ([[Interface\Buttons\UI-CheckBox-Check]]) @@ -1126,7 +1126,7 @@ function DF:NewSlider (parent, container, name, member, w, h, min, max, step, de local idx = getmetatable (SliderObject.slider).__index for funcName, funcAddress in pairs (idx) do if (not DFSliderMetaFunctions [funcName]) then - DFSliderMetaFunctions [funcName] = function (object, ...) + DFSliderMetaFunctions [funcName] = function(object, ...) local x = loadstring ( "return _G['"..object.slider:GetName().."']:"..funcName.."(...)") return x (...) end diff --git a/Libs/DF/split_bar.lua b/Libs/DF/split_bar.lua index 7558d58a..e261611d 100644 --- a/Libs/DF/split_bar.lua +++ b/Libs/DF/split_bar.lua @@ -47,7 +47,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] ------------------------------------------------------------------------------------------------------------ --> metatables - SplitBarMetaFunctions.__call = function (_table, value) + SplitBarMetaFunctions.__call = function(_table, value) if (not value) then return _table.statusbar:GetValue() else @@ -56,7 +56,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] end end - SplitBarMetaFunctions.__add = function (v1, v2) + SplitBarMetaFunctions.__add = function(v1, v2) if (_type (v1) == "table") then local v = v1.statusbar:GetValue() v = v + v2 @@ -70,7 +70,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] end end - SplitBarMetaFunctions.__sub = function (v1, v2) + SplitBarMetaFunctions.__sub = function(v1, v2) if (_type (v1) == "table") then local v = v1.statusbar:GetValue() v = v - v2 @@ -92,61 +92,61 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] return _object:GetTooltip() end --> shown - local gmember_shown = function (_object) + local gmember_shown = function(_object) return _object.statusbar:IsShown() end --> frame width - local gmember_width = function (_object) + local gmember_width = function(_object) return _object.statusbar:GetWidth() end --> frame height - local gmember_height = function (_object) + local gmember_height = function(_object) return _object.statusbar:GetHeight() end --> value - local gmember_value = function (_object) + local gmember_value = function(_object) return _object.statusbar:GetValue() end --> right text - local gmember_rtext = function (_object) + local gmember_rtext = function(_object) return _object.textright:GetText() end --> left text - local gmember_ltext = function (_object) + local gmember_ltext = function(_object) return _object.textleft:GetText() end --> right color - local gmember_rcolor = function (_object) + local gmember_rcolor = function(_object) return _object.rightTexture.original_colors end --> left color - local gmember_lcolor = function (_object) + local gmember_lcolor = function(_object) return _object.texture.original_colors end --> right icon - local gmember_ricon = function (_object) + local gmember_ricon = function(_object) return _object.iconright:GetTexture() end --> left icon - local gmember_licon = function (_object) + local gmember_licon = function(_object) return _object.iconleft:GetTexture() end --> texture - local gmember_texture = function (_object) + local gmember_texture = function(_object) return _object.texture:GetTexture() end --> font size - local gmember_textsize = function (_object) + local gmember_textsize = function(_object) local _, fontsize = _object.textleft:GetFont() return fontsize end --> font face - local gmember_textfont = function (_object) + local gmember_textfont = function(_object) local fontface = _object.textleft:GetFont() return fontface end --> font color - local gmember_textcolor = function (_object) + local gmember_textcolor = function(_object) return _object.textleft:GetTextColor() end @@ -170,7 +170,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] SplitBarMetaFunctions.GetMembers ["textfont"] = gmember_textfont --alias SplitBarMetaFunctions.GetMembers ["textcolor"] = gmember_textcolor --alias - SplitBarMetaFunctions.__index = function (_table, _member_requested) + SplitBarMetaFunctions.__index = function(_table, _member_requested) local func = SplitBarMetaFunctions.GetMembers [_member_requested] if (func) then @@ -188,11 +188,11 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> tooltip - local smember_tooltip = function (_object, _value) + local smember_tooltip = function(_object, _value) return _object:SetTooltip (_value) end --> show - local smember_shown = function (_object, _value) + local smember_shown = function(_object, _value) if (_value) then return _object:Show() else @@ -200,7 +200,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] end end --> hide - local smember_hide = function (_object, _value) + local smember_hide = function(_object, _value) if (_value) then return _object:Hide() else @@ -208,34 +208,34 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] end end --> width - local smember_width = function (_object, _value) + local smember_width = function(_object, _value) return _object.statusbar:SetWidth (_value) end --> height - local smember_height = function (_object, _value) + local smember_height = function(_object, _value) return _object.statusbar:SetHeight (_value) end --> statusbar value - local smember_value = function (_object, _value) + local smember_value = function(_object, _value) _object.statusbar:SetValue (_value) return _object.spark:SetPoint ("left", _object.statusbar, "left", _value * (_object.statusbar:GetWidth()/100) - 18, 0) end --> right text - local smember_rtext = function (_object, _value) + local smember_rtext = function(_object, _value) return _object.textright:SetText (_value) end --> left text - local smember_ltext = function (_object, _value) + local smember_ltext = function(_object, _value) return _object.textleft:SetText (_value) end --> right color - local smember_rcolor = function (_object, _value) + local smember_rcolor = function(_object, _value) local _value1, _value2, _value3, _value4 = DF:ParseColors (_value) _object.rightTexture.original_colors = {_value1, _value2, _value3, _value4} return _object.rightTexture:SetVertexColor (_value1, _value2, _value3, _value4) end --> left color - local smember_lcolor = function (_object, _value) + local smember_lcolor = function(_object, _value) local _value1, _value2, _value3, _value4 = DF:ParseColors (_value) _object.statusbar:SetStatusBarColor (_value1, _value2, _value3, _value4) @@ -243,7 +243,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] return _object.texture:SetVertexColor (_value1, _value2, _value3, _value4) end --> right icon - local smember_ricon = function (_object, _value) + local smember_ricon = function(_object, _value) if (type (_value) == "table") then local _value1, _value2 = _unpack (_value) _object.iconright:SetTexture (_value1) @@ -256,7 +256,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] return end --> left icon - local smember_licon = function (_object, _value) + local smember_licon = function(_object, _value) if (type (_value) == "table") then local _value1, _value2 = _unpack (_value) _object.iconleft:SetTexture (_value1) @@ -269,7 +269,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] return end --> texture - local smember_texture = function (_object, _value) + local smember_texture = function(_object, _value) if (type (_value) == "table") then local _value1, _value2 = _unpack (_value) _object.texture:SetTexture (_value1) @@ -285,17 +285,17 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] return end --> font face - local smember_textfont = function (_object, _value) + local smember_textfont = function(_object, _value) DF:SetFontFace (_object.textleft, _value) return DF:SetFontFace (_object.textright, _value) end --> font size - local smember_textsize = function (_object, _value) + local smember_textsize = function(_object, _value) DF:SetFontSize (_object.textleft, _value) return DF:SetFontSize (_object.textright, _value) end --> font color - local smember_textcolor = function (_object, _value) + local smember_textcolor = function(_object, _value) local _value1, _value2, _value3, _value4 = DF:ParseColors (_value) _object.textleft:SetTextColor (_value1, _value2, _value3, _value4) return _object.textright:SetTextColor (_value1, _value2, _value3, _value4) @@ -321,7 +321,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] SplitBarMetaFunctions.SetMembers ["textfont"] = smember_textfont --alias SplitBarMetaFunctions.SetMembers ["textcolor"] = smember_textcolor --alias - SplitBarMetaFunctions.__newindex = function (_table, _key, _value) + SplitBarMetaFunctions.__newindex = function(_table, _key, _value) local func = SplitBarMetaFunctions.SetMembers [_key] if (func) then return func (_table, _value) @@ -562,7 +562,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] ------------------------------------------------------------------------------------------------------------ --> scripts - local OnEnter = function (frame) + local OnEnter = function(frame) local capsule = frame.MyObject local kill = capsule:RunHooksForWidget ("OnEnter", frame, capsule) if (kill) then @@ -576,7 +576,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] end end - local OnLeave = function (frame) + local OnLeave = function(frame) local capsule = frame.MyObject local kill = capsule:RunHooksForWidget ("OnLeave", frame, capsule) if (kill) then @@ -588,7 +588,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] end end - local OnHide = function (frame) + local OnHide = function(frame) local capsule = frame.MyObject local kill = capsule:RunHooksForWidget ("OnHide", frame, capsule) if (kill) then @@ -596,7 +596,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] end end - local OnShow = function (frame) + local OnShow = function(frame) local capsule = frame.MyObject local kill = capsule:RunHooksForWidget ("OnShow", frame, capsule) if (kill) then @@ -604,7 +604,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] end end - local OnMouseDown = function (frame, button) + local OnMouseDown = function(frame, button) local capsule = frame.MyObject local kill = capsule:RunHooksForWidget ("OnMouseDown", frame, button, capsule) if (kill) then @@ -619,7 +619,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] end end - local OnMouseUp = function (frame, button) + local OnMouseUp = function(frame, button) local capsule = frame.MyObject local kill = capsule:RunHooksForWidget ("OnMouseUp", frame, button, capsule) if (kill) then @@ -632,7 +632,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] end end - local OnSizeChanged = function (statusbar) + local OnSizeChanged = function(statusbar) statusbar.MyObject.spark:SetPoint ("left", statusbar, "left", statusbar:GetValue() * (statusbar:GetWidth()/100) - 18, 0) statusbar.MyObject.rightTexture:SetWidth(statusbar:GetWidth() - statusbar.MyObject.texture:GetWidth()) end @@ -651,7 +651,7 @@ function DF:CreateSplitBar(parent, width, height, member, name) return DF:NewSplitBar(parent, nil, name, member, width, height) end -local build_statusbar = function (self) +local build_statusbar = function(self) self:SetSize (300, 14) @@ -757,7 +757,7 @@ function DF:NewSplitBar (parent, container, name, member, w, h) local idx = getmetatable (SplitBarObject.statusbar).__index for funcName, funcAddress in pairs (idx) do if (not SplitBarMetaFunctions [funcName]) then - SplitBarMetaFunctions [funcName] = function (object, ...) + SplitBarMetaFunctions [funcName] = function(object, ...) local x = loadstring ( "return _G['"..object.statusbar:GetName().."']:"..funcName.."(...)") return x (...) end diff --git a/Libs/DF/textentry.lua b/Libs/DF/textentry.lua index 1e1f4a88..c486a181 100644 --- a/Libs/DF/textentry.lua +++ b/Libs/DF/textentry.lua @@ -285,7 +285,7 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1 ------------------------------------------------------------------------------------------------------------ --> scripts and hooks - local OnEnter = function (textentry) + local OnEnter = function(textentry) local capsule = textentry.MyObject local kill = capsule:RunHooksForWidget ("OnEnter", textentry, capsule) @@ -307,7 +307,7 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1 end end - local OnLeave = function (textentry) + local OnLeave = function(textentry) local capsule = textentry.MyObject local kill = capsule:RunHooksForWidget ("OnLeave", textentry, capsule) @@ -326,7 +326,7 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1 end end - local OnHide = function (textentry) + local OnHide = function(textentry) local capsule = textentry.MyObject local kill = capsule:RunHooksForWidget ("OnHide", textentry, capsule) @@ -335,7 +335,7 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1 end end - local OnShow = function (textentry) + local OnShow = function(textentry) local capsule = textentry.MyObject local kill = capsule:RunHooksForWidget ("OnShow", textentry, capsule) @@ -377,7 +377,7 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1 end end - local OnEscapePressed = function (textentry) + local OnEscapePressed = function(textentry) local capsule = textentry.MyObject local kill = capsule:RunHooksForWidget ("OnEscapePressed", textentry, capsule, capsule.text) @@ -451,7 +451,7 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1 end end - local OnTextChanged = function (textentry, byUser) + local OnTextChanged = function(textentry, byUser) local capsule = textentry.MyObject local kill = capsule:RunHooksForWidget ("OnTextChanged", textentry, byUser, capsule) @@ -460,7 +460,7 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1 end end - local OnTabPressed = function (textentry) + local OnTabPressed = function(textentry) local capsule = textentry.MyObject @@ -582,7 +582,7 @@ function DF:NewTextEntry (parent, container, name, member, w, h, func, param1, p local idx = getmetatable (TextEntryObject.editbox).__index for funcName, funcAddress in pairs (idx) do if (not TextEntryMetaFunctions [funcName]) then - TextEntryMetaFunctions [funcName] = function (object, ...) + TextEntryMetaFunctions [funcName] = function(object, ...) local x = loadstring ( "return _G['"..object.editbox:GetName().."']:"..funcName.."(...)") return x (...) end @@ -688,16 +688,16 @@ function DF:NewSpellEntry (parent, func, w, h, param1, param2, member, name) return editbox end -local function_gettext = function (self) +local function_gettext = function(self) return self.editbox:GetText() end -local function_settext = function (self, text) +local function_settext = function(self, text) return self.editbox:SetText (text) end -local function_clearfocus = function (self) +local function_clearfocus = function(self) return self.editbox:ClearFocus() end -local function_setfocus = function (self) +local function_setfocus = function(self) return self.editbox:SetFocus (true) end @@ -812,7 +812,7 @@ local function ColorSelection ( self, ColorCode ) end -- end of the block --------------------- -local get_last_word = function (self) +local get_last_word = function(self) self.lastword = "" local cursor_pos = self.editbox:GetCursorPosition() local text = self.editbox:GetText() @@ -828,7 +828,7 @@ local get_last_word = function (self) end --On Text Changed -local AutoComplete_OnTextChanged = function (editboxWidget, byUser, capsule) +local AutoComplete_OnTextChanged = function(editboxWidget, byUser, capsule) capsule = capsule or editboxWidget.MyObject or editboxWidget local chars_now = editboxWidget:GetText():len() @@ -848,7 +848,7 @@ local AutoComplete_OnTextChanged = function (editboxWidget, byUser, capsule) capsule.characters_count = chars_now end -local AutoComplete_OnSpacePressed = function (editboxWidget, capsule) +local AutoComplete_OnSpacePressed = function(editboxWidget, capsule) capsule = capsule or editboxWidget.MyObject or editboxWidget -- if (not gotMatch) then @@ -856,11 +856,11 @@ local AutoComplete_OnSpacePressed = function (editboxWidget, capsule) -- end end -local AutoComplete_OnEscapePressed = function (editboxWidget) +local AutoComplete_OnEscapePressed = function(editboxWidget) editboxWidget.end_selection = nil end -local AutoComplete_OnEnterPressed = function (editboxWidget) +local AutoComplete_OnEnterPressed = function(editboxWidget) local capsule = editboxWidget.MyObject or editboxWidget if (editboxWidget.end_selection) then @@ -886,7 +886,7 @@ local AutoComplete_OnEnterPressed = function (editboxWidget) end -local AutoComplete_OnEditFocusGained = function (editboxWidget) +local AutoComplete_OnEditFocusGained = function(editboxWidget) local capsule = editboxWidget.MyObject or editboxWidget capsule:GetLastWord() --print ("last word:", editboxWidget.lastword) @@ -895,7 +895,7 @@ local AutoComplete_OnEditFocusGained = function (editboxWidget) capsule.characters_count = editboxWidget:GetText():len() end -local OptimizeAutoCompleteTable = function (self, wordList) +local OptimizeAutoCompleteTable = function(self, wordList) local optimizedTable = {} local lower = string.lower @@ -926,7 +926,7 @@ local OptimizeAutoCompleteTable = function (self, wordList) wordList.Optimized = optimizedTable end -local AutoComplete_OnChar = function (editboxWidget, char, capsule) +local AutoComplete_OnChar = function(editboxWidget, char, capsule) if (char == "") then return end @@ -1110,7 +1110,7 @@ function DF:NewSpecialLuaEditorEntry (parent, w, h, member, name, nointent, show scrollframe:SetPoint ("bottomright", borderframe, "bottomright", -10, 10) --when the lua code field scrolls, make the lua field scroll too - scrollframe:SetScript ("OnVerticalScroll", function (self, offset) + scrollframe:SetScript ("OnVerticalScroll", function(self, offset) scrollframeNumberLines:SetVerticalScroll(scrollframe:GetVerticalScroll()) scrollframeNumberLines.ScrollBar:Hide() end) @@ -1122,7 +1122,7 @@ function DF:NewSpecialLuaEditorEntry (parent, w, h, member, name, nointent, show scrollframeNumberLines.editbox:SetJustifyH ("left") scrollframeNumberLines.editbox:SetJustifyV ("top") - scrollframeNumberLines:SetScript ("OnSizeChanged", function (self) + scrollframeNumberLines:SetScript ("OnSizeChanged", function(self) scrollframeNumberLines.editbox:SetSize (self:GetSize()) scrollframeNumberLines.ScrollBar:Hide() end) @@ -1149,7 +1149,7 @@ function DF:NewSpecialLuaEditorEntry (parent, w, h, member, name, nointent, show borderframe.SetAsAutoComplete = TextEntryMetaFunctions.SetAsAutoComplete - scrollframe:SetScript ("OnSizeChanged", function (self) + scrollframe:SetScript ("OnSizeChanged", function(self) scrollframe.editbox:SetSize (self:GetSize()) end) diff --git a/Libs/DF/timebar.lua b/Libs/DF/timebar.lua index db0faa7e..c9ff4899 100644 --- a/Libs/DF/timebar.lua +++ b/Libs/DF/timebar.lua @@ -52,7 +52,7 @@ local TimeBarMetaFunctions = _G[DF.GlobalWidgetControlNames["timebar"]] TimeBarMetaFunctions.SetMembers = TimeBarMetaFunctions.SetMembers or {} TimeBarMetaFunctions.GetMembers = TimeBarMetaFunctions.GetMembers or {} -TimeBarMetaFunctions.__index = function (table, key) +TimeBarMetaFunctions.__index = function(table, key) local func = TimeBarMetaFunctions.GetMembers[key] if (func) then return func(table, key) diff --git a/Libs/LibCompress/LibCompress.lua b/Libs/LibCompress/LibCompress.lua index c75a470c..ce83a0dc 100644 --- a/Libs/LibCompress/LibCompress.lua +++ b/Libs/LibCompress/LibCompress.lua @@ -509,7 +509,7 @@ end -- lookuptable (cached between calls) local lshiftMask = {} setmetatable(lshiftMask, { - __index = function (t, k) + __index = function(t, k) local v = bit_lshift(1, k) rawset(t, k, v) return v @@ -519,7 +519,7 @@ setmetatable(lshiftMask, { -- lookuptable (cached between calls) local lshiftMinusOneMask = {} setmetatable(lshiftMinusOneMask, { - __index = function (t, k) + __index = function(t, k) local v = bit_lshift(1, k) - 1 rawset(t, k, v) return v @@ -644,7 +644,7 @@ function LibCompress:DecompressHuffman(compressed) local bitfield_len = 0 local map = {} -- only table not reused in Huffman decode. setmetatable(map, { - __index = function (t, k) + __index = function(t, k) local v = {} rawset(t, k, v) return v @@ -696,7 +696,7 @@ function LibCompress:DecompressHuffman(compressed) -- But do return an empty table to prevent runtime errors. (instead of returning nil) local mt = {} setmetatable(map, { - __index = function (t, k) + __index = function(t, k) return mt end }) diff --git a/Libs/NickTag-1.0/NickTag-1.0.lua b/Libs/NickTag-1.0/NickTag-1.0.lua index 91ec9b0a..6b336625 100644 --- a/Libs/NickTag-1.0/NickTag-1.0.lua +++ b/Libs/NickTag-1.0/NickTag-1.0.lua @@ -480,13 +480,13 @@ end return from > #s and "" or s:match(".*%S", from) end -- - local titlecase = function (first, rest) + local titlecase = function(first, rest) return first:upper()..rest:lower() end -- local have_repeated = false local count_spaces = 0 - local check_repeated = function (char) + local check_repeated = function(char) if (char == " ") then have_repeated = true elseif (string.len (char) > 2) then @@ -858,7 +858,7 @@ do name:SetText (UnitName ("player")) --- - local OnClickFunction = function (button) + local OnClickFunction = function(button) if (button.isAvatar) then local avatar = NickTag.avatar_pool [button.IconID] _G.AvatarPickFrameAvatarPreview:SetTexture ( avatar [1] ) @@ -884,7 +884,7 @@ do okey:SetPoint ("bottomright", avatar_pick_frame, "bottomright", -37, 12) okey:SetText ("Accept") okey:SetFrameLevel (avatar_pick_frame:GetFrameLevel()+2) - okey:SetScript ("OnClick", function (self) + okey:SetScript ("OnClick", function(self) avatar_pick_frame:Hide() if (avatar_pick_frame.callback) then avatar_pick_frame.callback (avatar_pick_frame.selected_avatar, {0, 1, 0, 1}, avatar_pick_frame.selected_background, avatar_pick_frame.selected_texcoord, avatar_pick_frame.selected_color) @@ -895,7 +895,7 @@ do change_color:SetText ("Color") change_color:SetFrameLevel (avatar_pick_frame:GetFrameLevel()+2) - change_color:SetScript ("OnClick", function (self) + change_color:SetScript ("OnClick", function(self) ColorPickerFrame.func = selectedColor ColorPickerFrame.hasOpacity = false ColorPickerFrame:SetParent (avatar_pick_frame) @@ -940,7 +940,7 @@ do background_list:SetWidth (275) background_list:SetHeight (140) - local avatar_scroll_update = function (self) + local avatar_scroll_update = function(self) local numMacroIcons = #NickTag.avatar_pool local macroPopupIcon, macroPopupButton, index, texture local macroPopupOffset = FauxScrollFrame_GetOffset (avatar_list) @@ -964,7 +964,7 @@ do end FauxScrollFrame_Update (avatar_list, numMacroIcons , 3, 64) end - local background_scroll_update = function (self) + local background_scroll_update = function(self) local numMacroIcons = #NickTag.background_pool local macroPopupIcon, macroPopupButton, index, texture local macroPopupOffset = FauxScrollFrame_GetOffset (background_list) @@ -989,10 +989,10 @@ do FauxScrollFrame_Update (background_list, numMacroIcons , 3, 40) end - avatar_list:SetScript ("OnVerticalScroll", function (self, offset) + avatar_list:SetScript ("OnVerticalScroll", function(self, offset) FauxScrollFrame_OnVerticalScroll (avatar_list, offset, 64, avatar_scroll_update) end) - background_list:SetScript ("OnVerticalScroll", function (self, offset) + background_list:SetScript ("OnVerticalScroll", function(self, offset) FauxScrollFrame_OnVerticalScroll (background_list, offset, 40, background_scroll_update) end) diff --git a/boot.lua b/boot.lua index c5625f67..7e21c3ca 100644 --- a/boot.lua +++ b/boot.lua @@ -46,6 +46,9 @@ return Details.gameVersionPrefix .. Details.build_counter .. "." .. Details.acounter .. "." .. alphaId .. "(" .. Details.game_version .. ")" end + --namespace for the player breakdown window + Details.PlayerBreakdown = {} + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> initialization stuff local _ @@ -938,42 +941,45 @@ do --> register textures and fonts for shared media local SharedMedia = LibStub:GetLibrary ("LibSharedMedia-3.0") --default bars - SharedMedia:Register ("statusbar", "Details D'ictum", [[Interface\AddOns\Details\images\bar4]]) - SharedMedia:Register ("statusbar", "Details Vidro", [[Interface\AddOns\Details\images\bar4_vidro]]) - SharedMedia:Register ("statusbar", "Details D'ictum (reverse)", [[Interface\AddOns\Details\images\bar4_reverse]]) - --flat bars - SharedMedia:Register ("statusbar", "Details Serenity", [[Interface\AddOns\Details\images\bar_serenity]]) - SharedMedia:Register ("statusbar", "BantoBar", [[Interface\AddOns\Details\images\BantoBar]]) - SharedMedia:Register ("statusbar", "Skyline", [[Interface\AddOns\Details\images\bar_skyline]]) - SharedMedia:Register ("statusbar", "WorldState Score", [[Interface\WorldStateFrame\WORLDSTATEFINALSCORE-HIGHLIGHT]]) - SharedMedia:Register ("statusbar", "DGround", [[Interface\AddOns\Details\images\bar_background]]) - SharedMedia:Register ("statusbar", "Details Flat", [[Interface\AddOns\Details\images\bar_background]]) - SharedMedia:Register ("statusbar", "Splitbar", [[Interface\AddOns\Details\images\bar_textures\split_bar]]) - SharedMedia:Register ("statusbar", "Details2020", [[Interface\AddOns\Details\images\bar_textures\texture2020]]) - - --window bg and bar border - SharedMedia:Register ("background", "Details Ground", [[Interface\AddOns\Details\images\background]]) - SharedMedia:Register ("border", "Details BarBorder 1", [[Interface\AddOns\Details\images\border_1]]) - SharedMedia:Register ("border", "Details BarBorder 2", [[Interface\AddOns\Details\images\border_2]]) - SharedMedia:Register ("border", "Details BarBorder 3", [[Interface\AddOns\Details\images\border_3]]) - SharedMedia:Register ("border", "1 Pixel", [[Interface\Buttons\WHITE8X8]]) - --misc fonts - SharedMedia:Register ("font", "Oswald", [[Interface\Addons\Details\fonts\Oswald-Regular.ttf]]) - SharedMedia:Register ("font", "Nueva Std Cond", [[Interface\Addons\Details\fonts\Nueva Std Cond.ttf]]) - SharedMedia:Register ("font", "Accidental Presidency", [[Interface\Addons\Details\fonts\Accidental Presidency.ttf]]) - SharedMedia:Register ("font", "TrashHand", [[Interface\Addons\Details\fonts\TrashHand.TTF]]) - SharedMedia:Register ("font", "Harry P", [[Interface\Addons\Details\fonts\HARRYP__.TTF]]) - SharedMedia:Register ("font", "FORCED SQUARE", [[Interface\Addons\Details\fonts\FORCED SQUARE.ttf]]) - - SharedMedia:Register ("sound", "d_gun1", [[Interface\Addons\Details\sounds\sound_gun2.ogg]]) - SharedMedia:Register ("sound", "d_gun2", [[Interface\Addons\Details\sounds\sound_gun3.ogg]]) - SharedMedia:Register ("sound", "d_jedi1", [[Interface\Addons\Details\sounds\sound_jedi1.ogg]]) - SharedMedia:Register ("sound", "d_whip1", [[Interface\Addons\Details\sounds\sound_whip1.ogg]]) + SharedMedia:Register("statusbar", "Details D'ictum", [[Interface\AddOns\Details\images\bar4]]) + SharedMedia:Register("statusbar", "Details Vidro", [[Interface\AddOns\Details\images\bar4_vidro]]) + SharedMedia:Register("statusbar", "Details D'ictum (reverse)", [[Interface\AddOns\Details\images\bar4_reverse]]) - SharedMedia:Register ("sound", "Details Threat Warning Volume 1", [[Interface\Addons\Details\sounds\threat_warning_1.ogg]]) - SharedMedia:Register ("sound", "Details Threat Warning Volume 2", [[Interface\Addons\Details\sounds\threat_warning_2.ogg]]) - SharedMedia:Register ("sound", "Details Threat Warning Volume 3", [[Interface\Addons\Details\sounds\threat_warning_3.ogg]]) - SharedMedia:Register ("sound", "Details Threat Warning Volume 4", [[Interface\Addons\Details\sounds\threat_warning_4.ogg]]) + --flat bars + SharedMedia:Register("statusbar", "Details Serenity", [[Interface\AddOns\Details\images\bar_serenity]]) + SharedMedia:Register("statusbar", "BantoBar", [[Interface\AddOns\Details\images\BantoBar]]) + SharedMedia:Register("statusbar", "Skyline", [[Interface\AddOns\Details\images\bar_skyline]]) + SharedMedia:Register("statusbar", "WorldState Score", [[Interface\WorldStateFrame\WORLDSTATEFINALSCORE-HIGHLIGHT]]) + SharedMedia:Register("statusbar", "DGround", [[Interface\AddOns\Details\images\bar_background]]) + SharedMedia:Register("statusbar", "Details Flat", [[Interface\AddOns\Details\images\bar_background]]) + SharedMedia:Register("statusbar", "Splitbar", [[Interface\AddOns\Details\images\bar_textures\split_bar]]) + SharedMedia:Register("statusbar", "Details2020", [[Interface\AddOns\Details\images\bar_textures\texture2020]]) + SharedMedia:Register("statusbar", "Left White Gradient", [[Interface\AddOns\Details\images\bar_textures\gradient_white_10percent_left]]) + + --window bg and bar order + SharedMedia:Register("background", "Details Ground", [[Interface\AddOns\Details\images\background]]) + SharedMedia:Register("border", "Details BarBorder 1", [[Interface\AddOns\Details\images\border_1]]) + SharedMedia:Register("border", "Details BarBorder 2", [[Interface\AddOns\Details\images\border_2]]) + SharedMedia:Register("border", "Details BarBorder 3", [[Interface\AddOns\Details\images\border_3]]) + SharedMedia:Register("border", "1 Pixel", [[Interface\Buttons\WHITE8X8]]) + + --misc fonts + SharedMedia:Register("font", "Oswald", [[Interface\Addons\Details\fonts\Oswald-Regular.ttf]]) + SharedMedia:Register("font", "Nueva Std Cond", [[Interface\Addons\Details\fonts\Nueva Std Cond.ttf]]) + SharedMedia:Register("font", "Accidental Presidency", [[Interface\Addons\Details\fonts\Accidental Presidency.ttf]]) + SharedMedia:Register("font", "TrashHand", [[Interface\Addons\Details\fonts\TrashHand.TTF]]) + SharedMedia:Register("font", "Harry P", [[Interface\Addons\Details\fonts\HARRYP__.TTF]]) + SharedMedia:Register("font", "FORCED SQUARE", [[Interface\Addons\Details\fonts\FORCED SQUARE.ttf]]) + + SharedMedia:Register("sound", "d_gun1", [[Interface\Addons\Details\sounds\sound_gun2.ogg]]) + SharedMedia:Register("sound", "d_gun2", [[Interface\Addons\Details\sounds\sound_gun3.ogg]]) + SharedMedia:Register("sound", "d_jedi1", [[Interface\Addons\Details\sounds\sound_jedi1.ogg]]) + SharedMedia:Register("sound", "d_whip1", [[Interface\Addons\Details\sounds\sound_whip1.ogg]]) + + SharedMedia:Register("sound", "Details Threat Warning Volume 1", [[Interface\Addons\Details\sounds\threat_warning_1.ogg]]) + SharedMedia:Register("sound", "Details Threat Warning Volume 2", [[Interface\Addons\Details\sounds\threat_warning_2.ogg]]) + SharedMedia:Register("sound", "Details Threat Warning Volume 3", [[Interface\Addons\Details\sounds\threat_warning_3.ogg]]) + SharedMedia:Register("sound", "Details Threat Warning Volume 4", [[Interface\Addons\Details\sounds\threat_warning_4.ogg]]) diff --git a/classes/class_combat.lua b/classes/class_combat.lua index fe46a57d..68fcc8e9 100644 --- a/classes/class_combat.lua +++ b/classes/class_combat.lua @@ -40,7 +40,7 @@ --> api functions --combat (container type, actor name) - _detalhes.call_combate = function (self, class_type, name) + _detalhes.call_combate = function(self, class_type, name) local container = self[class_type] local index_mapa = container._NameIndexTable [name] local actor = container._ActorTable [index_mapa] @@ -664,7 +664,7 @@ tabela_combate.shadow = nil end - combate.__sub = function (combate1, combate2) + combate.__sub = function(combate1, combate2) if (combate1 ~= _detalhes.tabela_overall) then return @@ -739,7 +739,7 @@ end - combate.__add = function (combate1, combate2) + combate.__add = function(combate1, combate2) local all_containers = {combate2 [class_type_dano]._ActorTable, combate2 [class_type_cura]._ActorTable, combate2 [class_type_e_energy]._ActorTable, combate2 [class_type_misc]._ActorTable} local custom_combat diff --git a/classes/class_custom.lua b/classes/class_custom.lua index 1b31eacf..3f0f6aa9 100644 --- a/classes/class_custom.lua +++ b/classes/class_custom.lua @@ -169,7 +169,7 @@ --> get the attribute local attribute = custom_object:GetAttribute() --"damagedone" - --> get the custom function (actor, source, target, spellid) + --> get the custom function(actor, source, target, spellid) local func = atributo_custom [attribute] --> get the combat container @@ -249,9 +249,9 @@ if (actor.id) then if (actor.id == 1) then - actor.report_name = GetSpellLink (6603) + actor.report_name = GetSpellLink(6603) elseif (actor.id > 10) then - actor.report_name = GetSpellLink (actor.id) + actor.report_name = GetSpellLink(actor.id) else actor.report_name = actor.nome end @@ -755,7 +755,7 @@ function atributo_custom:ResetCustomActorContainer() for _, actor in _ipairs (self._ActorTable) do actor.value = actor.value - _math_floor (actor.value) - --actor.value = _detalhes:GetOrderNumber (actor.nome) + --actor.value = _detalhes:GetOrderNumber(actor.nome) end end @@ -880,7 +880,7 @@ if (icon_cache [actor.nome]) then newActor.icon = icon_cache [actor.nome] else - local _, _, icon = _GetSpellInfo (actor.id) + local _, _, icon = _GetSpellInfo(actor.id) if (icon) then icon_cache [actor.nome] = icon newActor.icon = icon @@ -924,7 +924,7 @@ }, {__index = atributo_custom}) end - local custom_sort = function (t1, t2) + local custom_sort = function(t1, t2) return t1.value > t2.value end function atributo_custom:Sort (container) @@ -964,7 +964,7 @@ end if (actor.id) then - _detalhes:AddTooltipSpellHeaderText (select (1, _GetSpellInfo (actor.id)), "yellow", 1, select (3, _GetSpellInfo (actor.id)), 0.90625, 0.109375, 0.15625, 0.875) + _detalhes:AddTooltipSpellHeaderText (select (1, _GetSpellInfo(actor.id)), "yellow", 1, select (3, _GetSpellInfo(actor.id)), 0.90625, 0.109375, 0.15625, 0.875) else _detalhes:AddTooltipSpellHeaderText (custom_object:GetName(), "yellow", 1, custom_object:GetIcon(), 0.90625, 0.109375, 0.15625, 0.875) end @@ -1272,7 +1272,7 @@ if (debuff_uptime_container) then local focus_potion = debuff_uptime_container [DETAILS_FOCUS_POTION_ID] if (focus_potion) then - local name, _, icon = GetSpellInfo (DETAILS_FOCUS_POTION_ID) + local name, _, icon = GetSpellInfo(DETAILS_FOCUS_POTION_ID) GameCooltip:AddLine (name, 1) --> can use only 1 focus potion (can't be pre-potion) _detalhes:AddTooltipBackgroundStatusbar() GameCooltip:AddIcon (icon, 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height) @@ -1286,7 +1286,7 @@ local potionUsed = buff_uptime_container [spellId] if (potionUsed) then - local name, _, icon = GetSpellInfo (spellId) + local name, _, icon = GetSpellInfo(spellId) GameCooltip:AddLine (name, potionUsed.activedamt) _detalhes:AddTooltipBackgroundStatusbar() GameCooltip:AddIcon (icon, 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height) @@ -1367,28 +1367,28 @@ local hs = actor:GetSpell (6262) if (hs) then GameCooltip:AddLine (select (1, GetSpellInfo(6262)), _detalhes:ToK(hs.total)) - GameCooltip:AddIcon (select (3, GetSpellInfo (6262)), 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height) + GameCooltip:AddIcon (select (3, GetSpellInfo(6262)), 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height) GameCooltip:AddStatusBar (100, 1, R, G, B, A) end local pot = actor:GetSpell (DETAILS_HEALTH_POTION_ID) if (pot) then GameCooltip:AddLine (select (1, GetSpellInfo(DETAILS_HEALTH_POTION_ID)), _detalhes:ToK(pot.total)) - GameCooltip:AddIcon (select (3, GetSpellInfo (DETAILS_HEALTH_POTION_ID)), 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height) + GameCooltip:AddIcon (select (3, GetSpellInfo(DETAILS_HEALTH_POTION_ID)), 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height) GameCooltip:AddStatusBar (100, 1, R, G, B, A) end local pot = actor:GetSpell (DETAILS_HEALTH_POTION2_ID) if (pot) then GameCooltip:AddLine (select (1, GetSpellInfo(DETAILS_HEALTH_POTION2_ID)), _detalhes:ToK(pot.total)) - GameCooltip:AddIcon (select (3, GetSpellInfo (DETAILS_HEALTH_POTION2_ID)), 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height) + GameCooltip:AddIcon (select (3, GetSpellInfo(DETAILS_HEALTH_POTION2_ID)), 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height) GameCooltip:AddStatusBar (100, 1, R, G, B, A) end local pot = actor:GetSpell (DETAILS_REJU_POTION_ID) if (pot) then GameCooltip:AddLine (select (1, GetSpellInfo(DETAILS_REJU_POTION_ID)), _detalhes:ToK(pot.total)) - GameCooltip:AddIcon (select (3, GetSpellInfo (DETAILS_REJU_POTION_ID)), 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height) + GameCooltip:AddIcon (select (3, GetSpellInfo(DETAILS_REJU_POTION_ID)), 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height) GameCooltip:AddStatusBar (100, 1, R, G, B, A) end @@ -1591,7 +1591,7 @@ table.sort (spells, _detalhes.Sort2) for index, spell in ipairs (spells) do - local name, _, icon = GetSpellInfo (spell [1]) + local name, _, icon = GetSpellInfo(spell [1]) GameCooltip:AddLine (name, spell [2]) _detalhes:AddTooltipBackgroundStatusbar() GameCooltip:AddIcon (icon, 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height) @@ -1733,7 +1733,7 @@ table.sort (spells, _detalhes.Sort2) for index, spell in ipairs (spells) do - local name, _, icon = GetSpellInfo (spell [1]) + local name, _, icon = GetSpellInfo(spell [1]) GameCooltip:AddLine (name, spell [2]) _detalhes:AddTooltipBackgroundStatusbar() GameCooltip:AddIcon (icon, 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height) @@ -1894,9 +1894,9 @@ local spell_cast = misc_actor.spell_cast and misc_actor.spell_cast [spell.id] if (not spell_cast and misc_actor.spell_cast) then - local spellname = GetSpellInfo (spell.id) + local spellname = GetSpellInfo(spell.id) for casted_spellid, amount in pairs (misc_actor.spell_cast) do - local casted_spellname = GetSpellInfo (casted_spellid) + local casted_spellname = GetSpellInfo(casted_spellid) if (casted_spellname == spellname) then spell_cast = amount .. " (|cFFFFFF00?|r)" end @@ -2388,7 +2388,7 @@ for i, t in ipairs (sortedList) do local spellID, total = unpack (t) if (total > 1) then - local spellName, _, spellIcon = Details.GetSpellInfo (spellID) + local spellName, _, spellIcon = Details.GetSpellInfo(spellID) local spellPercent = total / playerTotal * 100 local formatedSpellPercent = format("%.1f", spellPercent) diff --git a/classes/class_damage.lua b/classes/class_damage.lua index a466c4ec..47ff2792 100644 --- a/classes/class_damage.lua +++ b/classes/class_damage.lua @@ -1,5 +1,5 @@ --- damage object +--damage object local Details = _G.Details local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) local Translit = LibStub ("LibTranslit-1.0") @@ -7,9 +7,9 @@ local _ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> local pointers +--local pointers - local _cstr = string.format --lua local + local format = string.format --lua local local _math_floor = math.floor --lua local local _table_sort = table.sort --lua local local _table_insert = table.insert --lua local @@ -22,20 +22,20 @@ local _math_min = math.min --lua local local _math_max = math.max --lua local local _math_abs = math.abs --lua local - local _bit_band = bit.band --lua local - local _unpack = unpack --lua local + local bitBand = bit.band --lua local + local unpack = unpack --lua local local _type = type --lua local local GameTooltip = GameTooltip --api local local _IsInRaid = IsInRaid --api local local _IsInGroup = IsInGroup --api local - + local GetSpellInfo = GetSpellInfo --api local local _GetSpellInfo = Details.getspellinfo --details api - local _string_replace = Details.string.replace --details api + local stringReplace = Details.string.replace --details api --show more information about spells local debugmode = false - + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> constants @@ -55,12 +55,12 @@ local class_type = Details.atributos.dano local ToKFunctions = Details.ToKFunctions - local SelectedToKFunction = ToKFunctions [1] - + local SelectedToKFunction = ToKFunctions[1] + local UsingCustomLeftText = false local UsingCustomRightText = false - - local FormatTooltipNumber = ToKFunctions [8] + + local FormatTooltipNumber = ToKFunctions[8] local TooltipMaximizedMethod = 1 --local CLASS_ICON_TCOORDS = _G.CLASS_ICON_TCOORDS @@ -68,19 +68,19 @@ Details.tooltip_key_overlay1 = {1, 1, 1, .2} Details.tooltip_key_overlay2 = {1, 1, 1, .5} - + Details.tooltip_key_size_width = 24 Details.tooltip_key_size_height = 10 local enemies_background = {value = 100, color = {0.1960, 0.1960, 0.1960, 0.8697}, texture = "Interface\\AddOns\\Details\\images\\bar_background2"} - + local headerColor = {1, 0.9, 0.0, 1} local info = Details.playerDetailWindow local keyName local OBJECT_TYPE_PLAYER = 0x00000400 - + local ntable = {} --temp local vtable = {} --temp local tooltip_void_zone_temp = {} --temp @@ -88,325 +88,337 @@ local bs_index_table = {} --temp local bs_tooltip_table local frags_tooltip_table - + local tooltip_temp_table = {} local OBJECT_TYPE_FRIENDLY_NPC = 0x00000A18 + local ignoredEnemyNpcsTable = { + [31216] = true, --mirror image + [53006] = true, --spirit link totem + [63508] = true, --xuen + [73967] = true, --xuen + } + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> exported functions +--exported functions ---[[exported]] function Details:CreateActorLastEventTable() - local t = { {}, {}, {}, {}, {}, {}, {}, {} } - t.n = 1 - return t - end - - function atributo_damage:CreateFFTable (target_name) - local new_table = {total = 0, spells = {}} - self.friendlyfire [target_name] = new_table - return new_table - end - ---[[exported]] function Details:CreateActorAvoidanceTable (no_overall) - if (no_overall) then - local t = {["ALL"] = 0, ["DODGE"] = 0, ["PARRY"] = 0, ["HITS"] = 0, ["ABSORB"] = 0, --quantas vezes foi dodge, parry, quandos hits tomou, quantos absorbs teve - ["FULL_HIT"] = 0, ["FULL_ABSORBED"] = 0, ["PARTIAL_ABSORBED"] = 0, --full hit full absorbed and partial absortion - ["FULL_HIT_AMT"] = 0, ["PARTIAL_ABSORB_AMT"] = 0, ["ABSORB_AMT"] = 0, ["FULL_ABSORB_AMT"] = 0, --amounts - ["BLOCKED_HITS"] = 0, ["BLOCKED_AMT"] = 0, --amount of hits blocked - amout of damage mitigated - } - return t - else - local t = { - overall = {["ALL"] = 0, ["DODGE"] = 0, ["PARRY"] = 0, ["HITS"] = 0, ["ABSORB"] = 0, --quantas vezes foi dodge, parry, quandos hits tomou, quantos absorbs teve - ["FULL_HIT"] = 0, ["FULL_ABSORBED"] = 0, ["PARTIAL_ABSORBED"] = 0, --full hit full absorbed and partial absortion - ["FULL_HIT_AMT"] = 0, ["PARTIAL_ABSORB_AMT"] = 0, ["ABSORB_AMT"] = 0, ["FULL_ABSORB_AMT"] = 0, --amounts - ["BLOCKED_HITS"] = 0, ["BLOCKED_AMT"] = 0, --amount of hits blocked - amout of damage mitigated - } - } - return t - end +function Details:CreateActorLastEventTable() --[[exported]] + local t = { {}, {}, {}, {}, {}, {}, {}, {} } + t.n = 1 + return t +end + +function atributo_damage:CreateFFTable(targetName) --[[exported]] + local newTable = {total = 0, spells = {}} + self.friendlyfire[targetName] = newTable + return newTable +end + +function Details:CreateActorAvoidanceTable(noOverall) --[[exported]] + if (noOverall) then + local avoidanceTable = {["ALL"] = 0, ["DODGE"] = 0, ["PARRY"] = 0, ["HITS"] = 0, ["ABSORB"] = 0, --quantas vezes foi dodge, parry, quandos hits tomou, quantos absorbs teve + ["FULL_HIT"] = 0, ["FULL_ABSORBED"] = 0, ["PARTIAL_ABSORBED"] = 0, --full hit full absorbed and partial absortion + ["FULL_HIT_AMT"] = 0, ["PARTIAL_ABSORB_AMT"] = 0, ["ABSORB_AMT"] = 0, ["FULL_ABSORB_AMT"] = 0, --amounts + ["BLOCKED_HITS"] = 0, ["BLOCKED_AMT"] = 0, --amount of hits blocked - amout of damage mitigated + } + return avoidanceTable + else + local avoidanceTable = { + overall = {["ALL"] = 0, ["DODGE"] = 0, ["PARRY"] = 0, ["HITS"] = 0, ["ABSORB"] = 0, --quantas vezes foi dodge, parry, quandos hits tomou, quantos absorbs teve + ["FULL_HIT"] = 0, ["FULL_ABSORBED"] = 0, ["PARTIAL_ABSORBED"] = 0, --full hit full absorbed and partial absortion + ["FULL_HIT_AMT"] = 0, ["PARTIAL_ABSORB_AMT"] = 0, ["ABSORB_AMT"] = 0, ["FULL_ABSORB_AMT"] = 0, --amounts + ["BLOCKED_HITS"] = 0, ["BLOCKED_AMT"] = 0, --amount of hits blocked - amout of damage mitigated + } + } + return avoidanceTable + end +end + +function Details.SortGroup(container, keyName2) --[[exported]] + keyName = keyName2 + return _table_sort(container, Details.SortKeyGroup) +end + +function Details.SortKeyGroup (table1, table2) --[[exported]] + if (table1.grupo and table2.grupo) then + return table1[keyName] > table2[keyName] + + elseif (table1.grupo and not table2.grupo) then + return true + + elseif (not table1.grupo and table2.grupo) then + return false + + else + return table1[keyName] > table2[keyName] + end +end + + +function Details.SortKeySimple(table1, table2) --[[exported]] + return table1[keyName] > table2[keyName] +end + + +function Details:ContainerSort (container, amount, keyName2) --[[exported]] + keyName = keyName2 + _table_sort(container, Details.SortKeySimple) + + if (amount) then + for i = amount, 1, -1 do --> de tr�s pra frente + if (container[i][keyName] < 1) then + amount = amount-1 + else + break end + end ---[[exported]] function Details.SortGroup (container, keyName2) - keyName = keyName2 - return _table_sort (container, Details.SortKeyGroup) - end + return amount + end +end ---[[exported]] function Details.SortKeyGroup (table1, table2) - if (table1.grupo and table2.grupo) then - return table1 [keyName] > table2 [keyName] +function Details:IsGroupPlayer() --[[exported]] + return self.grupo +end - elseif (table1.grupo and not table2.grupo) then - return true - elseif (not table1.grupo and table2.grupo) then - return false +function Details:IsPetOrGuardian() --[[exported]] + return self.owner and true or false +end - else - return table1 [keyName] > table2 [keyName] - end - end +function Details:IsPlayer() --[[exported]] + if (self.flag_original) then + if (bitBand(self.flag_original, OBJECT_TYPE_PLAYER) ~= 0) then + return true + end + end + return false +end ---[[exported]] function Details.SortKeySimple (table1, table2) - return table1 [keyName] > table2 [keyName] - end - ---[[exported]] function Details:ContainerSort (container, amount, keyName2) - keyName = keyName2 - _table_sort (container, Details.SortKeySimple) - - if (amount) then - for i = amount, 1, -1 do --> de tr�s pra frente - if (container[i][keyName] < 1) then - amount = amount-1 - else - break - end - end - - return amount - end - end - ---[[ exported]] function Details:IsGroupPlayer() - return self.grupo - end - ---[[ exported]] function Details:IsPetOrGuardian() - return self.owner and true or false - end - ---[[ exported]] function Details:IsPlayer() - if (self.flag_original) then - if (_bit_band (self.flag_original, OBJECT_TYPE_PLAYER) ~= 0) then - return true - end - end +function Details:IsNeutralOrEnemy() --[[exported]] + if (self.flag_original) then + if (bitBand(self.flag_original, 0x00000060) ~= 0) then + local npcid1 = Details:GetNpcIdFromGuid(self.serial) + if (ignoredEnemyNpcsTable[npcid1]) then return false end + return true + end + end + return false +end - local ignored_enemy_npcs = { - [31216] = true, --mirror image - [53006] = true, --spirit link totem - [63508] = true, --xuen - [73967] = true, --xuen - } - - -- Night-Twisted Brute - Creature-0-3024-1228-19402-85241-00001E2097 - ---[[ exported]] function Details:IsNeutralOrEnemy() - if (self.flag_original) then - if (_bit_band (self.flag_original, 0x00000060) ~= 0) then - local npcid1 = Details:GetNpcIdFromGuid (self.serial) - if (ignored_enemy_npcs [npcid1]) then - return false - end - return true - end - end - return false - end - - function Details:IsFriendlyNpc() - local flag = self.flag_original - if (flag) then - if (bit.band(flag, 0x00000008) ~= 0) then - if (bit.band(flag, 0x00000010) ~= 0) then - if (bit.band(flag, 0x00000800) ~= 0) then - return true - end - end - end - end - return false - end - ---[[ exported]] function Details:IsEnemy() - if (self.flag_original) then - if (_bit_band (self.flag_original, 0x00000060) ~= 0) then - local npcid1 = Details:GetNpcIdFromGuid (self.serial) - if (ignored_enemy_npcs [npcid1]) then - return false - end - return true - end - end - return false - end - ---[[ exported]] function Details:GetSpellList() - return self.spells._ActorTable - end - - -- enemies (sort function) - local sortEnemies = function (t1, t2) - local a = _bit_band (t1.flag_original, 0x00000060) - local b = _bit_band (t2.flag_original, 0x00000060) - - if (a ~= 0 and b ~= 0) then - local npcid1 = Details:GetNpcIdFromGuid (t1.serial) - local npcid2 = Details:GetNpcIdFromGuid (t2.serial) - - if (not ignored_enemy_npcs [npcid1] and not ignored_enemy_npcs [npcid2]) then - return t1.damage_taken > t2.damage_taken - elseif (ignored_enemy_npcs [npcid1] and not ignored_enemy_npcs [npcid2]) then - return false - elseif (not ignored_enemy_npcs [npcid1] and ignored_enemy_npcs [npcid2]) then - return true - else - return t1.damage_taken > t2.damage_taken - end - - elseif (a ~= 0 and b == 0) then +function Details:IsFriendlyNpc() --[[exported]] + local flag = self.flag_original + if (flag) then + if (bitBand(flag, 0x00000008) ~= 0) then + if (bitBand(flag, 0x00000010) ~= 0) then + if (bitBand(flag, 0x00000800) ~= 0) then return true - elseif (a == 0 and b ~= 0) then - return false end - + end + end + end + return false +end + +function Details:IsEnemy() --[[exported]] + if (self.flag_original) then + if (bitBand(self.flag_original, 0x00000060) ~= 0) then + local npcId = Details:GetNpcIdFromGuid(self.serial) + if (ignoredEnemyNpcsTable[npcId]) then return false end + return true + end + end + return false +end + +function Details:GetSpellList() --[[ exported]] + return self.spells._ActorTable +end ---[[exported]] function Details:ContainerSortEnemies (container, amount, keyName2) +--enemies(sort function) +local sortEnemies = function(t1, t2) + local a = bitBand(t1.flag_original, 0x00000060) + local b = bitBand(t2.flag_original, 0x00000060) - keyName = keyName2 - - _table_sort (container, sortEnemies) - - local total = 0 - - for index, player in _ipairs (container) do - local npcid1 = Details:GetNpcIdFromGuid (player.serial) - --p rint (player.nome, npcid1, ignored_enemy_npcs [npcid1]) - if (_bit_band (player.flag_original, 0x00000060) ~= 0 and not ignored_enemy_npcs [npcid1]) then --> � um inimigo - total = total + player [keyName] - else - amount = index-1 - break - end - end - - return amount, total - end + if (a ~= 0 and b ~= 0) then + local npcid1 = Details:GetNpcIdFromGuid(t1.serial) + local npcid2 = Details:GetNpcIdFromGuid(t2.serial) + + if (not ignoredEnemyNpcsTable[npcid1] and not ignoredEnemyNpcsTable[npcid2]) then + return t1.damage_taken > t2.damage_taken + + elseif (ignoredEnemyNpcsTable[npcid1] and not ignoredEnemyNpcsTable[npcid2]) then + return false + + elseif (not ignoredEnemyNpcsTable[npcid1] and ignoredEnemyNpcsTable[npcid2]) then + return true + else + return t1.damage_taken > t2.damage_taken + end + + elseif (a ~= 0 and b == 0) then + return true + + elseif (a == 0 and b ~= 0) then + return false + end + + return false +end + +function Details:ContainerSortEnemies (container, amount, keyName2) --[[exported]] + keyName = keyName2 + + _table_sort(container, sortEnemies) + + local total = 0 + + for index, player in _ipairs (container) do + local npcid1 = Details:GetNpcIdFromGuid(player.serial) + --p rint (player.nome, npcid1, ignored_enemy_npcs [npcid1]) + if (bitBand(player.flag_original, 0x00000060) ~= 0 and not ignoredEnemyNpcsTable [npcid1]) then --> � um inimigo + total = total + player [keyName] + else + amount = index-1 + break + end + end + + return amount, total +end + +function Details:TooltipForCustom (barra) --[[exported]] + GameCooltip:AddLine (Loc ["STRING_LEFT_CLICK_SHARE"]) + return true +end ---[[Exported]] function Details:TooltipForCustom (barra) - GameCooltip:AddLine (Loc ["STRING_LEFT_CLICK_SHARE"]) - return true - end - --[[ Void Zone Sort]] - local void_zone_sort = function (t1, t2) - if (t1.damage == t2.damage) then - return t1.nome <= t2.nome - else - return t1.damage > t2.damage - end - end +local void_zone_sort = function(t1, t2) + if (t1.damage == t2.damage) then + return t1.nome <= t2.nome + else + return t1.damage > t2.damage + end +end ---[[exported]] function Details.Sort1 (table1, table2) - return table1 [1] > table2 [1] - end - ---[[exported]] function Details.Sort2 (table1, table2) - return table1 [2] > table2 [2] - end - ---[[exported]] function Details.Sort3 (table1, table2) - return table1 [3] > table2 [3] - end - ---[[exported]] function Details.Sort4 (table1, table2) - return table1 [4] > table2 [4] - end - ---[[exported]] function Details.Sort4Reverse (table1, table2) - if (not table2) then - return true - end - return table1 [4] < table2 [4] - end +function Details.Sort1 (table1, table2) --[[exported]] + return table1[1] > table2[1] +end ---[[exported]] function Details:GetBarColor(actor) - actor = actor or self +function Details.Sort2 (table1, table2) --[[exported]] + return table1[2] > table2[2] +end - if (actor.monster) then - return _unpack(Details.class_colors.ENEMY) +function Details.Sort3 (table1, table2) --[[exported]] + return table1[3] > table2[3] +end - elseif (actor.customColor) then - return _unpack(actor.customColor) +function Details.Sort4 (table1, table2) --[[exported]] + return table1[4] > table2[4] +end - elseif (actor.spellicon) then - return 0.729, 0.917, 1 +function Details.Sort4Reverse (table1, table2) --[[exported]] + if (not table2) then + return true + end + return table1[4] < table2[4] +end - elseif (actor.owner) then - return _unpack(Details.class_colors[actor.owner.classe or "UNKNOW"]) +function Details:GetBarColor(actor) --[[exported]] + actor = actor or self - elseif (actor.arena_team and Details.color_by_arena_team) then - if (actor.arena_team == 0) then - return _unpack(Details.class_colors.ARENA_GREEN) - else - return _unpack(Details.class_colors.ARENA_YELLOW) - end + if (actor.monster) then + return unpack(Details.class_colors.ENEMY) - else - if (not is_player_class [actor.classe] and actor.flag_original and _bit_band (actor.flag_original, 0x00000020) ~= 0) then --> neutral - return _unpack(Details.class_colors.NEUTRAL) - elseif (actor.color) then - return _unpack(actor.color) - else - return _unpack(Details.class_colors [actor.classe or "UNKNOW"]) - end - end - end + elseif (actor.customColor) then + return unpack(actor.customColor) + + elseif (actor.spellicon) then + return 0.729, 0.917, 1 + + elseif (actor.owner) then + return unpack(Details.class_colors[actor.owner.classe or "UNKNOW"]) + + elseif (actor.arena_team and Details.color_by_arena_team) then + if (actor.arena_team == 0) then + return unpack(Details.class_colors.ARENA_GREEN) + else + return unpack(Details.class_colors.ARENA_YELLOW) + end + + else + if (not is_player_class[actor.classe] and actor.flag_original and bitBand(actor.flag_original, 0x00000020) ~= 0) then --> neutral + return unpack(Details.class_colors.NEUTRAL) + + elseif (actor.color) then + return unpack(actor.color) + + else + return unpack(Details.class_colors[actor.classe or "UNKNOW"]) + end + end +end + +function Details:GetSpellLink(spellid) --[[exported]] + if (_type(spellid) ~= "number") then + return spellid + end + + if (spellid == 1) then --melee + return GetSpellLink(6603) + + elseif (spellid == 2) then --autoshot + return GetSpellLink(75) + + elseif (spellid > 10) then + return GetSpellLink(spellid) + else + local spellname = _GetSpellInfo(spellid) + return spellname + end +end + +function Details:GameTooltipSetSpellByID(spellid) --[[exported]] + if (spellid == 1) then + GameTooltip:SetSpellByID(6603) + + elseif (spellid == 2) then + GameTooltip:SetSpellByID(75) + + elseif (spellid > 10) then + GameTooltip:SetSpellByID(spellid) + + else + GameTooltip:SetSpellByID(spellid) + end +end ---[[exported]] function Details:GetSpellLink (spellid) - if (_type (spellid) ~= "number") then - return spellid - end - if (spellid == 1) then --melee - return GetSpellLink (6603) - elseif (spellid == 2) then --autoshot - return GetSpellLink (75) - elseif (spellid > 10) then - return GetSpellLink (spellid) - else - local spellname = _GetSpellInfo (spellid) - return spellname - end - end - ---[[exported]] function Details:GameTooltipSetSpellByID (spellid) - if (spellid == 1) then - GameTooltip:SetSpellByID (6603) - elseif (spellid == 2) then - GameTooltip:SetSpellByID (75) - elseif (spellid > 10) then - GameTooltip:SetSpellByID (spellid) - else - GameTooltip:SetSpellByID (spellid) - end - end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> class constructor +--class constructor function atributo_damage:NovaTabela (serial, nome, link) - local alphabetical = Details:GetOrderNumber (nome) - + local alphabetical = Details:GetOrderNumber(nome) + --> constructor local _new_damageActor = { - + tipo = class_type, - + total = alphabetical, totalabsorbed = alphabetical, total_without_pet = alphabetical, custom = 0, - + damage_taken = alphabetical, damage_from = {}, - + dps_started = false, last_event = 0, on_hold = false, @@ -416,32 +428,32 @@ end_time = nil, start_time = 0, - + pets = {}, - + raid_targets = {}, - + friendlyfire_total = 0, friendlyfire = {}, targets = {}, spells = container_habilidades:NovoContainer (container_damage) } - + _setmetatable (_new_damageActor, atributo_damage) - + return _new_damageActor end - - + + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> special cases -- dps (calculate dps for actors) function atributo_damage:ContainerRefreshDps (container, combat_time) - + local total = 0 - + if (Details.time_type == 2 or not Details:CaptureGet ("damage")) then for _, actor in _ipairs (container) do if (actor.grupo) then @@ -457,15 +469,15 @@ total = total + actor.last_dps end end - + return total - end + end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> damage taken by spell - + local byspell_tooltip_background = {value = 100, color = {0.1960, 0.1960, 0.1960, 0.9097}, texture = [[Interface\AddOns\Details\images\bar_background2]]} - + function Details:ToolTipBySpell (instance, tabela, thisLine, keydown) local GameCooltip = GameCooltip @@ -473,7 +485,7 @@ local from_spell = tabela [1] --spellid local from_spellname if (from_spell) then - from_spellname = select (1, GetSpellInfo (from_spell)) + from_spellname = select (1, GetSpellInfo(from_spell)) end --> get a list of all damage actors @@ -494,15 +506,15 @@ for index, character in ipairs (AllDamageCharacters) do if (is_custom_spell) then - for playername, ff_table in pairs (character.friendlyfire) do + for playername, ff_table in pairs(character.friendlyfire) do if (ff_table.spells [from_spell]) then local damage_actor = combat (1, playername) local heal_actor = combat (2, playername) - + if ((damage_actor or heal_actor) and ( (damage_actor and damage_actor:IsPlayer()) or (heal_actor and heal_actor:IsPlayer()))) then - + local got - + for index, t in ipairs (Targets) do if (t[1] == playername) then t[2] = t[2] + ff_table.spells [from_spell] @@ -514,7 +526,7 @@ break end end - + if (not got) then Targets [#Targets+1] = {playername, ff_table.spells [from_spell]} total = total + ff_table.spells [from_spell] @@ -526,12 +538,12 @@ end end else - for playername, ff_table in pairs (character.friendlyfire) do - for spellid, amount in pairs (ff_table.spells) do - local spellname = select (1, GetSpellInfo (spellid)) + for playername, ff_table in pairs(character.friendlyfire) do + for spellid, amount in pairs(ff_table.spells) do + local spellname = select (1, GetSpellInfo(spellid)) if (spellname == from_spellname) then local damage_actor = combat (1, playername) - local heal_actor = combat (2, playername) + local heal_actor = combat (2, playername) if ((damage_actor or heal_actor) and ( (damage_actor and damage_actor:IsPlayer()) or (heal_actor and heal_actor:IsPlayer()))) then local got for index, t in ipairs (Targets) do @@ -545,30 +557,30 @@ break end end - + if (not got) then Targets [#Targets+1] = {playername, amount} total = total + amount if (amount > top) then top = amount end - end + end end - end + end end end end - + --> search actors which used the spell shown in the bar local spell = character.spells._ActorTable [from_spell] - + if (spell) then - for targetname, amount in pairs (spell.targets) do - + for targetname, amount in pairs(spell.targets) do + local got = false local damage_actor = combat (1, targetname) local heal_actor = combat (2, targetname) - + if ( (damage_actor or heal_actor) and ( (damage_actor and damage_actor:IsPlayer()) or (heal_actor and heal_actor:IsPlayer()) ) ) then for index, t in ipairs (Targets) do if (t[1] == targetname) then @@ -581,7 +593,7 @@ break end end - + if (not got) then Targets [#Targets+1] = {targetname, amount} total = total + amount @@ -592,18 +604,18 @@ end end end - + if (not is_custom_spell) then - for spellid, spell in pairs (character.spells._ActorTable) do + for spellid, spell in pairs(character.spells._ActorTable) do if (spellid ~= from_spell) then - local spellname = select (1, GetSpellInfo (spellid)) + local spellname = select (1, GetSpellInfo(spellid)) if (spellname == from_spellname) then - for targetname, amount in pairs (spell.targets) do - + for targetname, amount in pairs(spell.targets) do + local got = false local damage_actor = combat (1, targetname) local heal_actor = combat (2, targetname) - + if ( (damage_actor or heal_actor) and ( (damage_actor and damage_actor:IsPlayer()) or (heal_actor and heal_actor:IsPlayer()) ) ) then for index, t in ipairs (Targets) do if (t[1] == targetname) then @@ -616,7 +628,7 @@ break end end - + if (not got) then Targets [#Targets+1] = {targetname, amount} total = total + amount @@ -626,9 +638,9 @@ end end end - end - end - end + end + end + end end end @@ -638,22 +650,22 @@ GameCooltip:SetOption ("StatusBarTexture", "Interface\\AddOns\\Details\\images\\bar_serenity") - local spellname, _, spellicon = select (1, _GetSpellInfo (from_spell)) + local spellname, _, spellicon = select (1, _GetSpellInfo(from_spell)) GameCooltip:AddLine (spellname .. " " .. Loc ["STRING_CUSTOM_ATTRIBUTE_DAMAGE"], nil, nil, headerColor, nil, 10) GameCooltip:AddIcon (spellicon, 1, 1, 14, 14, 0.078125, 0.921875, 0.078125, 0.921875) GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_shift]], 1, 2, Details.tooltip_key_size_width, Details.tooltip_key_size_height, 0, 1, 0, 0.640625, Details.tooltip_key_overlay2) Details:AddTooltipHeaderStatusbar (1, 1, 1, 0.5) - + local top = Targets[1] and Targets[1][2] local lineHeight = Details.tooltip.line_height - + for index, t in ipairs (Targets) do - GameCooltip:AddLine (Details:GetOnlyName(t[1]), Details:ToK (t[2]) .. " (" .. _cstr ("%.1f", t[2]/total*100) .. "%)") + GameCooltip:AddLine (Details:GetOnlyName(t[1]), Details:ToK(t[2]) .. " (" .. format ("%.1f", t[2]/total*100) .. "%)") local class, _, _, _, _, r, g, b = Details:GetClass (t[1]) - + GameCooltip:AddStatusBar (t[2]/top*100, 1, r, g, b, 0.8, false, byspell_tooltip_background) - + if (class) then local specID = Details:GetSpec (t[1]) if (specID) then @@ -663,7 +675,7 @@ local texture, l, r, t, b = Details:GetClassIcon (class) GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small_alpha", 1, 1, lineHeight, lineHeight, l, r, t, b) end - + elseif (t[1] == Loc ["STRING_TARGETS_OTHER1"]) then GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small_alpha", 1, 1, lineHeight, lineHeight, 0.25, 0.49609375, 0.75, 1) end @@ -671,22 +683,22 @@ GameCooltip:AddLine (" ") Details:AddTooltipReportLineText() - + GameCooltip:SetOption ("YSpacingMod", 0) GameCooltip:SetOwner (thisLine) GameCooltip:Show() - + end - + local function RefreshBarraBySpell (tabela, barra, instancia) atributo_damage:AtualizarBySpell (tabela, tabela.minha_barra, barra.colocacao, instancia) end - local on_switch_DTBS_show = function (instance) + local on_switch_DTBS_show = function(instance) instance:TrocaTabela (instance, true, 1, 8) return true end - + local DTBS_search_code = [[ --> get the parameters passed local combat, instance_container, instance = ... @@ -694,11 +706,11 @@ local total, top, amount = 0, 0, 0 --> hold the targets local Targets = {} - + local from_spell = @SPELLID@ local from_spellname if (from_spell) then - from_spellname = select (1, GetSpellInfo (from_spell)) + from_spellname = select (1, GetSpellInfo(from_spell)) end --> get a list of all damage actors @@ -712,17 +724,17 @@ end for index, character in ipairs (AllDamageCharacters) do - + if (is_custom_spell) then - for playername, ff_table in pairs (character.friendlyfire) do + for playername, ff_table in pairs(character.friendlyfire) do if (ff_table.spells [from_spell]) then local damage_actor = combat (1, playername) local heal_actor = combat (2, playername) - + if ((damage_actor or heal_actor) and ( (damage_actor and damage_actor:IsPlayer()) or (heal_actor and heal_actor:IsPlayer()))) then - + local got - + for index, t in ipairs (Targets) do if (t[1] == playername) then t[2] = t[2] + ff_table.spells [from_spell] @@ -733,7 +745,7 @@ break end end - + if (not got) then Targets [#Targets+1] = {playername, ff_table.spells [from_spell], damage_actor or heal_actor} if (ff_table.spells [from_spell] > top) then @@ -744,13 +756,13 @@ end end else - - for playername, ff_table in pairs (character.friendlyfire) do - for spellid, amount in pairs (ff_table.spells) do - local spellname = select (1, GetSpellInfo (spellid)) + + for playername, ff_table in pairs(character.friendlyfire) do + for spellid, amount in pairs(ff_table.spells) do + local spellname = select (1, GetSpellInfo(spellid)) if (spellname == from_spellname) then local damage_actor = combat (1, playername) - local heal_actor = combat (2, playername) + local heal_actor = combat (2, playername) if ((damage_actor or heal_actor) and ( (damage_actor and damage_actor:IsPlayer()) or (heal_actor and heal_actor:IsPlayer()))) then local got for index, t in ipairs (Targets) do @@ -763,30 +775,30 @@ break end end - + if (not got) then Targets [#Targets+1] = {playername, amount, damage_actor or heal_actor} if (amount > top) then top = amount end - end + end end - end + end end end end - + --> search actors which used the spell shown in the bar local spell = character.spells._ActorTable [from_spell] - + if (spell) then - for targetname, amount in pairs (spell.targets) do - + for targetname, amount in pairs(spell.targets) do + local got = false - + local damage_actor = combat (1, targetname) local heal_actor = combat (2, targetname) - + if ( (damage_actor or heal_actor) and ( (damage_actor and damage_actor:IsPlayer()) or (heal_actor and heal_actor:IsPlayer()) ) ) then for index, t in ipairs (Targets) do if (t[1] == targetname) then @@ -807,19 +819,19 @@ end end end - + if (not is_custom_spell) then - for spellid, spell in pairs (character.spells._ActorTable) do + for spellid, spell in pairs(character.spells._ActorTable) do if (spellid ~= from_spell) then - local spellname = select (1, GetSpellInfo (spellid)) + local spellname = select (1, GetSpellInfo(spellid)) if (spellname == from_spellname) then - for targetname, amount in pairs (spell.targets) do - + for targetname, amount in pairs(spell.targets) do + local got = false - + local damage_actor = combat (1, targetname) local heal_actor = combat (2, targetname) - + if ( (damage_actor or heal_actor) and ( (damage_actor and damage_actor:IsPlayer()) or (heal_actor and heal_actor:IsPlayer()) ) ) then for index, t in ipairs (Targets) do if (t[1] == targetname) then @@ -839,15 +851,15 @@ end end end - end - end - end - end - + end + end + end + end + end table.sort (Targets, Details.Sort2) - + local amount = 0 for index, t in ipairs (Targets) do instance_container:AddValue (t[3], t[2]) @@ -856,13 +868,13 @@ end return total, top, amount - ]] - + ]] + local function ShowDTBSInWindow (spell, instance) - local spellname, _, icon = _GetSpellInfo (spell [1]) + local spellname, _, icon = _GetSpellInfo(spell [1]) local custom_name = spellname .. " - " .. Loc ["STRING_CUSTOM_DTBS"] .. "" - + --check if already exists for index, CustomObject in _ipairs (Details.custom) do if (CustomObject:GetName() == custom_name) then @@ -873,7 +885,7 @@ return instance:TrocaTabela (instance.segmento, 5, index) end end - + --create a custom for this spell local new_custom_object = { name = custom_name, @@ -889,37 +901,37 @@ notooltip = true, OnSwitchShow = on_switch_DTBS_show, } - + local new_code = DTBS_search_code new_code = new_code:gsub ("@SPELLID@", spell [1]) new_custom_object.script = new_code - + tinsert (Details.custom, new_custom_object) setmetatable (new_custom_object, Details.atributo_custom) new_custom_object.__index = Details.atributo_custom return instance:TrocaTabela (instance.segmento, 5, #Details.custom) end - - local DTBS_format_name = function (player_name) return Details:GetOnlyName (player_name) end - local DTBS_format_amount = function (amount) return Details:ToK (amount) .. " (" .. _cstr ("%.1f", amount / bs_tooltip_table.damage_total * 100) .. "%)" end - + + local DTBS_format_name = function(player_name) return Details:GetOnlyName (player_name) end + local DTBS_format_amount = function(amount) return Details:ToK(amount) .. " (" .. format ("%.1f", amount / bs_tooltip_table.damage_total * 100) .. "%)" end + function atributo_damage:ReportSingleDTBSLine (spell, instance, ShiftKeyDown, ControlKeyDown) if (ControlKeyDown) then - local spellname, _, spellicon = _GetSpellInfo (spell[1]) + local spellname, _, spellicon = _GetSpellInfo(spell[1]) return Details:OpenAuraPanel (spell[1], spellname, spellicon) elseif (ShiftKeyDown) then return ShowDTBSInWindow (spell, instance) end - - local spelllink = Details:GetSpellLink (spell [1]) + + local spelllink = Details:GetSpellLink(spell [1]) local report_table = {"Details!: " .. Loc ["STRING_CUSTOM_DTBS"] .. " " .. spelllink} - + Details:FormatReportLines (report_table, bs_tooltip_table, DTBS_format_name, DTBS_format_amount) return Details:Reportar (report_table, {_no_current = true, _no_inverse = true, _custom = true}) end - + function atributo_damage:AtualizarBySpell (tabela, whichRowLine, colocacao, instance) tabela ["byspell"] = true --> marca que esta tabela � uma tabela de frags, usado no controla na hora de montar o tooltip local thisLine = instance.barras [whichRowLine] --> pega a refer�ncia da barra na janela @@ -931,14 +943,14 @@ thisLine.minha_tabela = tabela - local spellname, _, spellicon = _GetSpellInfo (tabela [1]) + local spellname, _, spellicon = _GetSpellInfo(tabela [1]) tabela.nome = spellname --> evita dar erro ao redimencionar a janela tabela.minha_barra = whichRowLine thisLine.colocacao = colocacao - if (not _getmetatable (tabela)) then - _setmetatable (tabela, {__call = RefreshBarraBySpell}) + if (not _getmetatable (tabela)) then + _setmetatable (tabela, {__call = RefreshBarraBySpell}) tabela._custom = true end @@ -946,9 +958,9 @@ local porcentagem if (instance.row_info.percent_type == 1) then - porcentagem = _cstr ("%.1f", tabela [2] / total * 100) + porcentagem = format ("%.1f", tabela [2] / total * 100) elseif (instance.row_info.percent_type == 2) then - porcentagem = _cstr ("%.1f", tabela [2] / instance.top * 100) + porcentagem = format ("%.1f", tabela [2] / instance.top * 100) end thisLine.lineText1:SetText(colocacao .. ". " .. spellname) @@ -968,68 +980,68 @@ local bars_brackets = instance:GetBarBracket() -- if (instance.use_multi_fontstrings) then - instance:SetInLineTexts(thisLine, "", (spell_damage and SelectedToKFunction (_, spell_damage) or ""), porcentagem) + instance:SetInLineTexts(thisLine, "", (spell_damage and SelectedToKFunction(_, spell_damage) or ""), porcentagem) else - thisLine.lineText4:SetText ((spell_damage and SelectedToKFunction (_, spell_damage) or "") .. bars_brackets[1] .. porcentagem .. bars_brackets[2]) + thisLine.lineText4:SetText((spell_damage and SelectedToKFunction(_, spell_damage) or "") .. bars_brackets[1] .. porcentagem .. bars_brackets[2]) end thisLine.lineText1:SetTextColor(1, 1, 1, 1) thisLine.lineText2:SetTextColor(1, 1, 1, 1) thisLine.lineText3:SetTextColor(1, 1, 1, 1) thisLine.lineText4:SetTextColor(1, 1, 1, 1) - - thisLine.lineText1:SetSize (thisLine:GetWidth() - thisLine.lineText4:GetStringWidth() - 20, 15) - + + thisLine.lineText1:SetSize(thisLine:GetWidth() - thisLine.lineText4:GetStringWidth() - 20, 15) + if (colocacao == 1) then - thisLine:SetValue (100) + thisLine:SetValue(100) else - thisLine:SetValue (tabela [2] / instance.top * 100) + thisLine:SetValue(tabela [2] / instance.top * 100) end - + if (thisLine.hidden or thisLine.fading_in or thisLine.faded) then - Details.FadeHandler.Fader (thisLine, "out") + Details.FadeHandler.Fader(thisLine, "out") end - + if (instance.row_info.texture_class_colors) then if (tabela [3] > 1) then local r, g, b = Details:GetSpellSchoolColor (tabela [3]) - thisLine.textura:SetVertexColor (r, g, b) + thisLine.textura:SetVertexColor(r, g, b) else local r, g, b = Details:GetSpellSchoolColor (0) - thisLine.textura:SetVertexColor (r, g, b) + thisLine.textura:SetVertexColor(r, g, b) end end - thisLine.icone_classe:SetTexture (spellicon) - thisLine.icone_classe:SetTexCoord (0.078125, 0.921875, 0.078125, 0.921875) - thisLine.icone_classe:SetVertexColor (1, 1, 1) + thisLine.icone_classe:SetTexture(spellicon) + thisLine.icone_classe:SetTexCoord(0.078125, 0.921875, 0.078125, 0.921875) + thisLine.icone_classe:SetVertexColor(1, 1, 1) end - + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> frags - + function Details:ToolTipFrags (instancia, frag, thisLine, keydown) local name = frag [1] local GameCooltip = GameCooltip - + --> mantendo a fun��o o mais low level poss�vel local damage_container = instancia.showing [1] - + local frag_actor = damage_container._ActorTable [damage_container._NameIndexTable [ name ]] if (frag_actor) then - + local damage_taken_table = {} local took_damage_from = frag_actor.damage_from local total_damage_taken = frag_actor.damage_taken local total = 0 - for aggressor, _ in _pairs (took_damage_from) do - + for aggressor, _ in _pairs(took_damage_from) do + local damager_actor = damage_container._ActorTable [damage_container._NameIndexTable [ aggressor ]] - + if (damager_actor and not damager_actor.owner) then --> checagem por causa do total e do garbage collector que n�o limpa os names que deram dano local target_amount = damager_actor.targets [name] if (target_amount) then @@ -1038,9 +1050,9 @@ end end end - - _table_sort (damage_taken_table, Details.Sort2) - + + _table_sort(damage_taken_table, Details.Sort2) + Details:AddTooltipSpellHeaderText (Loc ["STRING_DAMAGE_FROM"], headerColor, #damage_taken_table, [[Interface\Addons\Details\images\icons]], 0.126953125, 0.1796875, 0, 0.0546875) Details:AddTooltipHeaderStatusbar (1, 1, 1, 0.5) GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_shift]], 1, 2, Details.tooltip_key_size_width, Details.tooltip_key_size_height, 0, 1, 0, 0.640625, Details.tooltip_key_overlay2) @@ -1052,99 +1064,99 @@ min = 99 ismaximized = true end - + if (ismaximized) then GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_shift]], 1, 2, Details.tooltip_key_size_width, Details.tooltip_key_size_height, 0, 1, 0, 0.640625, Details.tooltip_key_overlay2) else GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_shift]], 1, 2, Details.tooltip_key_size_width, Details.tooltip_key_size_height, 0, 1, 0, 0.640625, Details.tooltip_key_overlay1) end - + local top = damage_taken_table[1] and damage_taken_table[1][2] frags_tooltip_table = damage_taken_table frags_tooltip_table.damage_total = total - + local lineHeight = Details.tooltip.line_height - + if (#damage_taken_table > 0) then - for i = 1, math.min (min, #damage_taken_table) do + for i = 1, math.min (min, #damage_taken_table) do local t = damage_taken_table [i] - - GameCooltip:AddLine (Details:GetOnlyName (t[1]), FormatTooltipNumber (_, t[2]) .. " (" .. _cstr ("%.1f", t[2] / total * 100) .. "%)") + + GameCooltip:AddLine (Details:GetOnlyName (t[1]), FormatTooltipNumber (_, t[2]) .. " (" .. format ("%.1f", t[2] / total * 100) .. "%)") local classe = t[3] if (not classe) then classe = "UNKNOW" end - + if (classe == "UNKNOW") then GameCooltip:AddIcon ("Interface\\LFGFRAME\\LFGROLE_BW", nil, nil, lineHeight, lineHeight, .25, .5, 0, 1) else - + local specID = Details:GetSpec (t[1]) if (specID) then local texture, l, r, t, b = Details:GetSpecIcon (specID, false) GameCooltip:AddIcon (texture, 1, 1, lineHeight, lineHeight, l, r, t, b) else - GameCooltip:AddIcon ([[Interface\AddOns\Details\images\classes_small_alpha]], nil, nil, lineHeight, lineHeight, _unpack (Details.class_coords [classe])) + GameCooltip:AddIcon ([[Interface\AddOns\Details\images\classes_small_alpha]], nil, nil, lineHeight, lineHeight, unpack(Details.class_coords [classe])) end end - + local _, _, _, _, _, r, g, b = Details:GetClass (t[1]) GameCooltip:AddStatusBar (t[2] / top * 100, 1, r, g, b, 1, false, enemies_background) end else GameCooltip:AddLine (Loc ["STRING_NO_DATA"], nil, 1, "white") - GameCooltip:AddIcon (instancia.row_info.icon_file, nil, nil, 14, 14, _unpack (Details.class_coords ["UNKNOW"])) + GameCooltip:AddIcon (instancia.row_info.icon_file, nil, nil, 14, 14, unpack(Details.class_coords ["UNKNOW"])) end - + GameCooltip:AddLine (" ") Details:AddTooltipReportLineText() - + GameCooltip:SetOption ("StatusBarTexture", "Interface\\AddOns\\Details\\images\\bar_serenity") GameCooltip:ShowCooltip() end - end - - local function RefreshBarraFrags (tabela, barra, instancia) - atributo_damage:AtualizarFrags (tabela, tabela.minha_barra, barra.colocacao, instancia) end - function atributo_damage:AtualizarFrags (tabela, whichRowLine, colocacao, instancia) + local function RefreshBarraFrags (tabela, barra, instancia) + atributo_damage:AtualizarFrags(tabela, tabela.minha_barra, barra.colocacao, instancia) + end + + function atributo_damage:AtualizarFrags(tabela, whichRowLine, colocacao, instancia) tabela ["frags"] = true --> marca que esta tabela � uma tabela de frags, usado no controla na hora de montar o tooltip local thisLine = instancia.barras [whichRowLine] --> pega a refer�ncia da barra na janela - + if (not thisLine) then print ("DEBUG: problema com "..whichRowLine.." "..rank) return end - + local previousData = thisLine.minha_tabela - + thisLine.minha_tabela = tabela - + tabela.nome = tabela [1] --> evita dar erro ao redimencionar a janela tabela.minha_barra = whichRowLine thisLine.colocacao = colocacao - - if (not _getmetatable (tabela)) then - _setmetatable (tabela, {__call = RefreshBarraFrags}) + + if (not _getmetatable (tabela)) then + _setmetatable (tabela, {__call = RefreshBarraFrags}) tabela._custom = true end local total = instancia.showing.totals.frags_total local porcentagem - + if (instancia.row_info.percent_type == 1) then - porcentagem = _cstr ("%.1f", tabela [2] / total * 100) + porcentagem = format ("%.1f", tabela [2] / total * 100) elseif (instancia.row_info.percent_type == 2) then - porcentagem = _cstr ("%.1f", tabela [2] / instancia.top * 100) + porcentagem = format ("%.1f", tabela [2] / instancia.top * 100) end - - thisLine.lineText1:SetText (colocacao .. ". " .. tabela [1]) + + thisLine.lineText1:SetText(colocacao .. ". " .. tabela [1]) local bars_show_data = instancia.row_info.textR_show_data local bars_brackets = instancia:GetBarBracket() - + local total_frags = tabela [2] if (not bars_show_data [1]) then total_frags = "" @@ -1154,83 +1166,83 @@ else porcentagem = porcentagem .. "%" end - + -- if (instancia.use_multi_fontstrings) then instancia:SetInLineTexts(thisLine, "", total_frags, porcentagem) else - thisLine.lineText4:SetText (total_frags .. bars_brackets[1] .. porcentagem .. bars_brackets[2]) + thisLine.lineText4:SetText(total_frags .. bars_brackets[1] .. porcentagem .. bars_brackets[2]) end - thisLine.lineText1:SetSize (thisLine:GetWidth() - thisLine.lineText4:GetStringWidth() - 20, 15) - + thisLine.lineText1:SetSize(thisLine:GetWidth() - thisLine.lineText4:GetStringWidth() - 20, 15) + if (colocacao == 1) then - thisLine:SetValue (100) + thisLine:SetValue(100) else - thisLine:SetValue (tabela [2] / instancia.top * 100) - end - - thisLine.lineText1:SetTextColor (1, 1, 1, 1) - thisLine.lineText4:SetTextColor (1, 1, 1, 1) - - if (thisLine.hidden or thisLine.fading_in or thisLine.faded) then - Details.FadeHandler.Fader (thisLine, "out") + thisLine:SetValue(tabela [2] / instancia.top * 100) end - Details:SetBarColors (thisLine, instancia, _unpack (Details.class_colors [tabela [3]])) + thisLine.lineText1:SetTextColor(1, 1, 1, 1) + thisLine.lineText4:SetTextColor(1, 1, 1, 1) + + if (thisLine.hidden or thisLine.fading_in or thisLine.faded) then + Details.FadeHandler.Fader(thisLine, "out") + end + + Details:SetBarColors (thisLine, instancia, unpack(Details.class_colors [tabela [3]])) if (tabela [3] == "UNKNOW" or tabela [3] == "UNGROUPPLAYER" or tabela [3] == "ENEMY") then - thisLine.icone_classe:SetTexture ([[Interface\AddOns\Details\images\classes_plus]]) - thisLine.icone_classe:SetTexCoord (0.50390625, 0.62890625, 0, 0.125) - thisLine.icone_classe:SetVertexColor (1, 1, 1) + thisLine.icone_classe:SetTexture([[Interface\AddOns\Details\images\classes_plus]]) + thisLine.icone_classe:SetTexCoord(0.50390625, 0.62890625, 0, 0.125) + thisLine.icone_classe:SetVertexColor(1, 1, 1) else - thisLine.icone_classe:SetTexture (instancia.row_info.icon_file) - thisLine.icone_classe:SetTexCoord (_unpack (Details.class_coords [tabela [3]])) - thisLine.icone_classe:SetVertexColor (1, 1, 1) + thisLine.icone_classe:SetTexture(instancia.row_info.icon_file) + thisLine.icone_classe:SetTexCoord(unpack(Details.class_coords [tabela [3]])) + thisLine.icone_classe:SetVertexColor(1, 1, 1) end if (thisLine.mouse_over and not instancia.baseframe.isMoving) then --> precisa atualizar o tooltip - --gump:UpdateTooltip (whichRowLine, thisLine, instancia) + --gump:UpdateTooltip(whichRowLine, thisLine, instancia) end end - + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> void zones - local on_switch_AVZ_show = function (instance) + local on_switch_AVZ_show = function(instance) instance:TrocaTabela (instance, true, 1, 7) return true end - - local AVZ_search_code = [[ + + local AVZ_search_code = [[ --> get the parameters passed local combat, instance_container, instance = ... --> declade the values to return local total, top, amount = 0, 0, 0 - + local actor_name = "@ACTORNAME@" local actor = combat (4, actor_name) - + if (not actor) then return 0, 0, 0 end - + local damage_actor = combat (1, actor.damage_twin) - + local habilidade local alvos - + if (damage_actor) then habilidade = damage_actor.spells._ActorTable [actor.damage_spellid] end if (habilidade) then alvos = habilidade.targets end - + local container = actor.debuff_uptime_targets local tooltip_void_zone_temp = {} - - for target_name, debuff_table in pairs (container) do + + for target_name, debuff_table in pairs(container) do if (alvos) then local damage_alvo = alvos [target_name] if (damage_alvo) then @@ -1242,33 +1254,33 @@ debuff_table.damage = 0 end end - + local i = 1 - for target_name, debuff_table in pairs (container) do - local t = tooltip_void_zone_temp [i] + for target_name, debuff_table in pairs(container) do + local t = tooltip_void_zone_temp [i] if (not t) then t = {} tinsert (tooltip_void_zone_temp, t) end - + local target_actor = combat (1, target_name) or combat (2, target_name) or combat (4, target_name) t[1] = target_name t[2] = debuff_table.damage t[3] = debuff_table t[4] = target_actor - + i = i + 1 end - + --> sort no container: table.sort (tooltip_void_zone_temp, Details.sort_tooltip_void_zones) for index, t in ipairs (tooltip_void_zone_temp) do instance_container:AddValue (t[4], t[2]) - + local custom_actor = instance_container:GetActorTable (t[4]) custom_actor.uptime = t[3].uptime - + total = total + t[2] amount = amount + 1 if (t[2] > top) then @@ -1278,11 +1290,11 @@ return total, top, amount ]] - + local AVZ_total_code = [[ local value, top, total, combat, instance, custom_actor = ... local uptime = custom_actor.uptime or 0 - + local minutos, segundos = floor (uptime / 60), floor (uptime % 60) if (minutos > 0) then uptime = "" .. minutos .. "m " .. segundos .. "s" .. "" @@ -1290,16 +1302,16 @@ uptime = "" .. segundos .. "s" .. "" end - return Details:ToK2 (value) .. " - " .. uptime .. " " + return Details:ToK2(value) .. " - " .. uptime .. " " ]] - + local function ShowVoidZonesInWindow (actor, instance) - + local spellid = tooltip_void_zone_temp.spellid - - local spellname, _, icon = _GetSpellInfo (spellid) + + local spellname, _, icon = _GetSpellInfo(spellid) local custom_name = spellname .. " - " .. Loc ["STRING_ATTRIBUTE_DAMAGE_DEBUFFS_REPORT"] .. "" - + --check if already exists for index, CustomObject in _ipairs (Details.custom) do if (CustomObject:GetName() == custom_name) then @@ -1310,7 +1322,7 @@ return instance:TrocaTabela (instance.segmento, 5, index) end end - + --create a custom for this spell local new_custom_object = { name = custom_name, @@ -1326,43 +1338,43 @@ notooltip = true, OnSwitchShow = on_switch_AVZ_show, } - + local new_code = AVZ_search_code new_code = new_code:gsub ("@ACTORNAME@", actor.nome) new_custom_object.script = new_code - + local new_total_code = AVZ_total_code new_total_code = new_total_code:gsub ("@ACTORNAME@", actor.nome) new_total_code = new_total_code:gsub ("@SPELLID@", spellid) new_custom_object.total_script = new_total_code - + tinsert (Details.custom, new_custom_object) setmetatable (new_custom_object, Details.atributo_custom) new_custom_object.__index = Details.atributo_custom - + return instance:TrocaTabela (instance.segmento, 5, #Details.custom) end - + function atributo_damage:ReportSingleVoidZoneLine (actor, instance, ShiftKeyDown, ControlKeyDown) - + local spellid = tooltip_void_zone_temp.spellid - + if (ControlKeyDown) then - local spellname, _, spellicon = _GetSpellInfo (spellid) + local spellname, _, spellicon = _GetSpellInfo(spellid) return Details:OpenAuraPanel (spellid, spellname, spellicon) elseif (ShiftKeyDown) then return ShowVoidZonesInWindow (actor, instance) end - - local spelllink = Details:GetSpellLink (spellid) + + local spelllink = Details:GetSpellLink(spellid) local report_table = {"Details!: " .. spelllink .. " " .. Loc ["STRING_ATTRIBUTE_DAMAGE_DEBUFFS_REPORT"]} - + local t = {} for index, void_table in ipairs (tooltip_void_zone_temp) do --ir� reportar dano zero tamb�m if (void_table[1] and type (void_table[1]) == "string" and void_table[2] and void_table[3] and type (void_table[3]) == "table") then local actor_table = {Details:GetOnlyName (void_table[1])} - local m, s = _math_floor (void_table[3].uptime / 60), _math_floor (void_table[3].uptime % 60) + local m, s = _math_floor(void_table[3].uptime / 60), _math_floor(void_table[3].uptime % 60) if (m > 0) then actor_table [2] = FormatTooltipNumber (_, void_table[3].damage) .. " (" .. m .. "m " .. s .. "s" .. ")" else @@ -1371,13 +1383,13 @@ t [#t+1] = actor_table end end - + Details:FormatReportLines (report_table, t) - + return Details:Reportar (report_table, {_no_current = true, _no_inverse = true, _custom = true}) end - local sort_tooltip_void_zones = function (tabela1, tabela2) + local sort_tooltip_void_zones = function(tabela1, tabela2) if (tabela1 [2] > tabela2 [2]) then return true elseif (tabela1 [2] == tabela2 [2]) then @@ -1393,25 +1405,25 @@ end end Details.sort_tooltip_void_zones = sort_tooltip_void_zones - - + + function Details:ToolTipVoidZones (instancia, actor, barra, keydown) - + local damage_actor = instancia.showing[1]:PegarCombatente (_, actor.damage_twin) local habilidade local alvos - + if (damage_actor) then habilidade = damage_actor.spells._ActorTable [actor.damage_spellid] end - + if (habilidade) then alvos = habilidade.targets end - + local container = actor.debuff_uptime_targets - - for target_name, debuff_table in _pairs (container) do + + for target_name, debuff_table in _pairs(container) do if (alvos) then local damage_alvo = alvos [target_name] if (damage_alvo) then @@ -1423,66 +1435,66 @@ debuff_table.damage = 0 end end - + for i = 1, #tooltip_void_zone_temp do local t = tooltip_void_zone_temp [i] t[1] = "" t[2] = 0 t[3] = 0 end - + local i = 1 - for target_name, debuff_table in _pairs (container) do - local t = tooltip_void_zone_temp [i] + for target_name, debuff_table in _pairs(container) do + local t = tooltip_void_zone_temp [i] if (not t) then t = {} tinsert (tooltip_void_zone_temp, t) end - + t[1] = target_name t[2] = debuff_table.damage t[3] = debuff_table - + i = i + 1 end - + --> sort no container: - _table_sort (tooltip_void_zone_temp, sort_tooltip_void_zones) + _table_sort(tooltip_void_zone_temp, sort_tooltip_void_zones) --> monta o cooltip local GameCooltip = GameCooltip - - local spellname, _, spellicon = _GetSpellInfo (actor.damage_spellid) + + local spellname, _, spellicon = _GetSpellInfo(actor.damage_spellid) Details:AddTooltipSpellHeaderText (spellname .. " " .. Loc ["STRING_VOIDZONE_TOOLTIP"], headerColor, #tooltip_void_zone_temp, spellicon, 0.078125, 0.921875, 0.078125, 0.921875) Details:AddTooltipHeaderStatusbar (1, 1, 1, 0.5) GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_shift]], 1, 2, Details.tooltip_key_size_width, Details.tooltip_key_size_height, 0, 1, 0, 0.640625, Details.tooltip_key_overlay2) - --for target_name, debuff_table in _pairs (container) do + --for target_name, debuff_table in _pairs(container) do local first = tooltip_void_zone_temp [1] and tooltip_void_zone_temp [1][3] if (type (first) == "table") then first = first.damage end - + tooltip_void_zone_temp.spellid = actor.damage_spellid tooltip_void_zone_temp.current_actor = actor - + local lineHeight = Details.tooltip.line_height - + for index, t in _ipairs (tooltip_void_zone_temp) do - + if (t[3] == 0) then break end - + local debuff_table = t[3] - local minutos, segundos = _math_floor (debuff_table.uptime / 60), _math_floor (debuff_table.uptime % 60) + local minutos, segundos = _math_floor(debuff_table.uptime / 60), _math_floor(debuff_table.uptime % 60) if (minutos > 0) then GameCooltip:AddLine (Details:GetOnlyName (t[1]), FormatTooltipNumber (_, debuff_table.damage) .. " (" .. minutos .. "m " .. segundos .. "s" .. ")") else GameCooltip:AddLine (Details:GetOnlyName (t[1]), FormatTooltipNumber (_, debuff_table.damage) .. " (" .. segundos .. "s" .. ")") end - + local classe = Details:GetClass (t[1]) if (classe) then local specID = Details:GetSpec (t[1]) @@ -1490,28 +1502,28 @@ local texture, l, r, t, b = Details:GetSpecIcon (specID, false) GameCooltip:AddIcon (texture, 1, 1, lineHeight, lineHeight, l, r, t, b) else - GameCooltip:AddIcon ([[Interface\AddOns\Details\images\classes_small_alpha]], nil, nil, lineHeight, lineHeight, unpack (Details.class_coords [classe])) + GameCooltip:AddIcon ([[Interface\AddOns\Details\images\classes_small_alpha]], nil, nil, lineHeight, lineHeight, unpack(Details.class_coords [classe])) end else GameCooltip:AddIcon ("Interface\\LFGFRAME\\LFGROLE_BW", nil, nil, lineHeight, lineHeight, .25, .5, 0, 1) end - + local _, _, _, _, _, r, g, b = Details:GetClass (t[1]) if (first == 0) then first = 0.0000000001 end GameCooltip:AddStatusBar (debuff_table.damage / first * 100, 1, r, g, b, 1, false, enemies_background) --Details:AddTooltipBackgroundStatusbar() - + end - + GameCooltip:AddLine (" ") Details:AddTooltipReportLineText() - + GameCooltip:SetOption ("StatusBarTexture", "Interface\\AddOns\\Details\\images\\bar_serenity") - + GameCooltip:ShowCooltip() - + end local function RefreshBarraVoidZone (tabela, barra, instancia) @@ -1522,39 +1534,39 @@ --> pega a refer�ncia da barra na janela local thisLine = instancia.barras [whichRowLine] - + if (not thisLine) then print ("DEBUG: problema com "..whichRowLine.." "..rank) return end - + self._refresh_window = RefreshBarraVoidZone - + local previousData = thisLine.minha_tabela - + thisLine.minha_tabela = self - + self.minha_barra = whichRowLine thisLine.colocacao = colocacao - + local total = instancia.showing.totals.voidzone_damage local combat_time = instancia.showing:GetCombatTime() - local dps = _math_floor (self.damage / combat_time) - - local formated_damage = SelectedToKFunction (_, self.damage) - local formated_dps = SelectedToKFunction (_, dps) - + local dps = _math_floor(self.damage / combat_time) + + local formated_damage = SelectedToKFunction(_, self.damage) + local formated_dps = SelectedToKFunction(_, dps) + local porcentagem - + if (instancia.row_info.percent_type == 1) then total = max (total, 0.0001) - porcentagem = _cstr ("%.1f", self.damage / total * 100) + porcentagem = format ("%.1f", self.damage / total * 100) elseif (instancia.row_info.percent_type == 2) then local top = max (instancia.top, 0.0001) - porcentagem = _cstr ("%.1f", self.damage / top * 100) + porcentagem = format ("%.1f", self.damage / top * 100) end - + local bars_show_data = instancia.row_info.textR_show_data local bars_brackets = instancia:GetBarBracket() local bars_separator = instancia:GetBarSeparator() @@ -1573,38 +1585,38 @@ local rightText = formated_damage .. bars_brackets[1] .. formated_dps .. bars_separator .. porcentagem .. bars_brackets[2] if (UsingCustomRightText) then - thisLine.lineText4:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_damage, formated_dps, porcentagem, self, instancia.showing, instancia, rightText)) + thisLine.lineText4:SetText(stringReplace(instancia.row_info.textR_custom_text, formated_damage, formated_dps, porcentagem, self, instancia.showing, instancia, rightText)) else if (instancia.use_multi_fontstrings) then instancia:SetInLineTexts(thisLine, formated_damage, formated_dps, porcentagem) else - thisLine.lineText4:SetText (rightText) + thisLine.lineText4:SetText(rightText) end end - thisLine.lineText1:SetText (colocacao .. ". " .. self.nome) - thisLine.lineText1:SetSize (thisLine:GetWidth() - thisLine.lineText4:GetStringWidth() - 20, 15) - - thisLine.lineText1:SetTextColor (1, 1, 1, 1) - thisLine.lineText4:SetTextColor (1, 1, 1, 1) - - thisLine:SetValue (100) - + thisLine.lineText1:SetText(colocacao .. ". " .. self.nome) + thisLine.lineText1:SetSize(thisLine:GetWidth() - thisLine.lineText4:GetStringWidth() - 20, 15) + + thisLine.lineText1:SetTextColor(1, 1, 1, 1) + thisLine.lineText4:SetTextColor(1, 1, 1, 1) + + thisLine:SetValue(100) + if (thisLine.hidden or thisLine.fading_in or thisLine.faded) then - Details.FadeHandler.Fader (thisLine, "out") + Details.FadeHandler.Fader(thisLine, "out") end - - local _, _, icon = GetSpellInfo (self.damage_spellid) + + local _, _, icon = GetSpellInfo(self.damage_spellid) local school_color = Details.school_colors [self.spellschool] if (not school_color) then school_color = Details.school_colors ["unknown"] end - - Details:SetBarColors (thisLine, instancia, _unpack (school_color)) - - thisLine.icone_classe:SetTexture (icon) - thisLine.icone_classe:SetTexCoord (0.078125, 0.921875, 0.078125, 0.921875) - thisLine.icone_classe:SetVertexColor (1, 1, 1) + + Details:SetBarColors (thisLine, instancia, unpack(school_color)) + + thisLine.icone_classe:SetTexture(icon) + thisLine.icone_classe:SetTexCoord(0.078125, 0.921875, 0.078125, 0.921875) + thisLine.icone_classe:SetVertexColor(1, 1, 1) if (thisLine.mouse_over and not instancia.baseframe.isMoving) then --need call a refresh function @@ -1613,119 +1625,127 @@ end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> main refresh function +--main refresh function +function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exportar, refreshRequired) + local showing = combatObject[class_type] --o que esta sendo mostrado -> [1] - dano [2] - cura --pega o container com ._NameIndexTable ._ActorTable -function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, exportar, refresh_needed) - - local showing = tabela_do_combate [class_type] --> o que esta sendo mostrado -> [1] - dano [2] - cura --> pega o container com ._NameIndexTable ._ActorTable - - --> n�o h� barras para mostrar -- not have something to show - if (#showing._ActorTable < 1) then - + --not have something to show + if (#showing._ActorTable < 1) then if (Details.debug and false) then Details.showing_ActorTable_Timer = Details.showing_ActorTable_Timer or 0 if (time() > Details.showing_ActorTable_Timer) then - Details:Msg ("(debug) nothing to show -> #showing._ActorTable < 1") - Details.showing_ActorTable_Timer = time()+5 + Details:Msg("(debug) nothing to show -> #showing._ActorTable < 1") + Details.showing_ActorTable_Timer = time() + 5 end end - - --> colocado isso recentemente para fazer as barras de dano sumirem na troca de atributo - return Details:EsconderBarrasNaoUsadas (instancia, showing), "", 0, 0 + + --colocado isso recentemente para fazer as barras de dano sumirem na troca de atributo + return Details:EsconderBarrasNaoUsadas(instancia, showing), "", 0, 0 end - - --> total + + --total local total = 0 - --> top actor #1 + --top actor #1 instancia.top = 0 - - local using_cache = false - - local sub_atributo = instancia.sub_atributo --> o que esta sendo mostrado nesta inst�ncia - local conteudo = showing._ActorTable --> pega a lista de jogadores -- get actors table from container - local amount = #conteudo - local modo = instancia.modo - - --> pega qual a sub key que ser� usada --sub keys + + local isUsingCache = false + local subAttribute = instancia.sub_atributo + local actorTableContent = showing._ActorTable + local amount = #actorTableContent + local windowMode = instancia.modo + + --pega qual a sub key que ser� usada --sub keys if (exportar) then - - if (_type (exportar) == "boolean") then - if (sub_atributo == 1) then --> DAMAGE DONE + if (_type(exportar) == "boolean") then + if (subAttribute == 1) then --DAMAGE DONE keyName = "total" - elseif (sub_atributo == 2) then --> DPS + + elseif (subAttribute == 2) then --DPS keyName = "last_dps" - elseif (sub_atributo == 3) then --> TAMAGE TAKEN + + elseif (subAttribute == 3) then --TAMAGE TAKEN keyName = "damage_taken" - if (Details.damage_taken_everything) then - modo = modo_ALL - end - elseif (sub_atributo == 4) then --> FRIENDLY FIRE + if (Details.damage_taken_everything) then + windowMode = modo_ALL + end + + elseif (subAttribute == 4) then --FRIENDLY FIRE keyName = "friendlyfire_total" - elseif (sub_atributo == 5) then --> FRAGS + + elseif (subAttribute == 5) then --FRAGS keyName = "frags" - elseif (sub_atributo == 6) then --> ENEMIES + + elseif (subAttribute == 6) then --ENEMIES keyName = "enemies" - elseif (sub_atributo == 7) then --> AURAS VOIDZONES + + elseif (subAttribute == 7) then --AURAS VOIDZONES keyName = "voidzones" - - elseif (sub_atributo == 8) then --> BY SPELL + + elseif (subAttribute == 8) then --BY SPELL keyName = "damage_taken_by_spells" end else keyName = exportar.key - modo = exportar.modo + windowMode = exportar.modo end - elseif (instancia.atributo == 5) then --> custom + + elseif (instancia.atributo == 5) then --custom keyName = "custom" - total = tabela_do_combate.totals [instancia.customName] + total = combatObject.totals [instancia.customName] + else - if (sub_atributo == 1) then --> DAMAGE DONE + if (subAttribute == 1) then --DAMAGE DONE keyName = "total" - elseif (sub_atributo == 2) then --> DPS + + elseif (subAttribute == 2) then --DPS keyName = "last_dps" - elseif (sub_atributo == 3) then --> TAMAGE TAKEN + + elseif (subAttribute == 3) then --TAMAGE TAKEN keyName = "damage_taken" if (Details.damage_taken_everything) then - modo = modo_ALL + windowMode = modo_ALL end - elseif (sub_atributo == 4) then --> FRIENDLY FIRE + + elseif (subAttribute == 4) then --FRIENDLY FIRE keyName = "friendlyfire_total" - elseif (sub_atributo == 5) then --> FRAGS + + elseif (subAttribute == 5) then --FRAGS keyName = "frags" - elseif (sub_atributo == 6) then --> ENEMIES + + elseif (subAttribute == 6) then --ENEMIES keyName = "enemies" - elseif (sub_atributo == 7) then --> AURAS VOIDZONES + + elseif (subAttribute == 7) then --AURAS VOIDZONES keyName = "voidzones" - elseif (sub_atributo == 8) then --> BY SPELL + elseif (subAttribute == 8) then --BY SPELL keyName = "damage_taken_by_spells" end end - - if (keyName == "frags") then - + + if (keyName == "frags") then local frags = instancia.showing.frags local frags_total_kills = 0 local index = 0 - - for fragName, fragAmount in _pairs (frags) do - + + for fragName, fragAmount in _pairs(frags) do + index = index + 1 - + local fragged_actor = showing._NameIndexTable [fragName] --> get index local actor_classe if (fragged_actor) then fragged_actor = showing._ActorTable [fragged_actor] --> get object actor_classe = fragged_actor.classe end - + if (fragged_actor and fragged_actor.monster) then actor_classe = "ENEMY" elseif (not actor_classe) then actor_classe = "UNGROUPPLAYER" end - + if (ntable [index]) then ntable [index] [1] = fragName ntable [index] [2] = fragAmount @@ -1733,83 +1753,81 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex else ntable [index] = {fragName, fragAmount, actor_classe} end - + frags_total_kills = frags_total_kills + fragAmount - end - + local tsize = #ntable if (index < tsize) then for i = index+1, tsize do ntable [i][2] = 0 end end - + instancia.top = 0 if (tsize > 0) then - _table_sort (ntable, Details.Sort2) + _table_sort(ntable, Details.Sort2) instancia.top = ntable [1][2] end - + total = index - - if (exportar) then + + if (exportar) then local export = {} - for i = 1, index do + for i = 1, index do export [i] = {ntable[i][1], ntable[i][2], ntable[i][3]} end return export end - + if (total < 1) then instancia:EsconderScrollBar() - return Details:EndRefresh (instancia, total, tabela_do_combate, showing) --> retorna a tabela que precisa ganhar o refresh + return Details:EndRefresh(instancia, total, combatObject, showing) --> retorna a tabela que precisa ganhar o refresh end - - tabela_do_combate.totals.frags_total = frags_total_kills - - instancia:RefreshScrollBar (total) - + + combatObject.totals.frags_total = frags_total_kills + + instancia:RefreshScrollBar(total) + local whichRowLine = 1 local lineContainer = instancia.barras - - for i = instancia.barraS[1], instancia.barraS[2], 1 do - atributo_damage:AtualizarFrags (ntable[i], whichRowLine, i, instancia) + for i = instancia.barraS[1], instancia.barraS[2], 1 do + atributo_damage:AtualizarFrags(ntable[i], whichRowLine, i, instancia) whichRowLine = whichRowLine+1 end - - return Details:EndRefresh (instancia, total, tabela_do_combate, showing) --> retorna a tabela que precisa ganhar o refresh - - elseif (keyName == "damage_taken_by_spells") then - + + return Details:EndRefresh(instancia, total, combatObject, showing) --> retorna a tabela que precisa ganhar o refresh + + elseif (keyName == "damage_taken_by_spells") then + local bs_index, total = 0, 0 wipe (bs_index_table) - - local combat = tabela_do_combate + + local combat = combatObject local AllDamageCharacters = combat:GetActorList (DETAILS_ATTRIBUTE_DAMAGE) --> do a loop amoung the actors for index, character in ipairs (AllDamageCharacters) do - + --> is the actor a player? if (character:IsPlayer()) then - for source_name, _ in pairs (character.damage_from) do - + for source_name, _ in pairs(character.damage_from) do + local source = combat (1, source_name) - + if (source) then --> came from an enemy if (not source:IsPlayer()) then - + local AllSpells = source:GetSpellList() - for spellid, spell in pairs (AllSpells) do + for spellid, spell in pairs(AllSpells) do local on_player = spell.targets [character.nome] - + if (on_player and on_player >= 1) then - - local spellname = _GetSpellInfo (spellid) + + local spellname = _GetSpellInfo(spellid) if (spellname) then local has_index = bs_index_table [spellname] local this_spell @@ -1821,10 +1839,10 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex if (this_spell) then this_spell [1] = spellid this_spell [2] = 0 - this_spell [3] = spell.spellschool or Details.spell_school_cache [select (1, GetSpellInfo (spellid))] or 1 + this_spell [3] = spell.spellschool or Details.spell_school_cache [select (1, GetSpellInfo(spellid))] or 1 bs_index_table [spellname] = bs_index else - this_spell = {spellid, 0, spell.spellschool or Details.spell_school_cache [select (1, GetSpellInfo (spellid))] or 1} + this_spell = {spellid, 0, spell.spellschool or Details.spell_school_cache [select (1, GetSpellInfo(spellid))] or 1} bs_table [bs_index] = this_spell bs_index_table [spellname] = bs_index end @@ -1836,15 +1854,15 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex end end end - + elseif (source:IsGroupPlayer()) then -- friendly fire - + local AllSpells = source.friendlyfire [character.nome] and source.friendlyfire [character.nome].spells if (AllSpells) then -- se n�o existir pode ter vindo de um pet, talvez - for spellid, on_player in pairs (AllSpells) do + for spellid, on_player in pairs(AllSpells) do if (on_player and on_player >= 1) then - - local spellname = _GetSpellInfo (spellid) + + local spellname = _GetSpellInfo(spellid) if (spellname) then local has_index = bs_index_table [spellname] local this_spell @@ -1856,10 +1874,10 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex if (this_spell) then this_spell [1] = spellid this_spell [2] = 0 - this_spell [3] = Details.spell_school_cache [select (1, GetSpellInfo (spellid))] or 1 + this_spell [3] = Details.spell_school_cache [select (1, GetSpellInfo(spellid))] or 1 bs_index_table [spellname] = bs_index else - this_spell = {spellid, 0, Details.spell_school_cache [select (1, GetSpellInfo (spellid))] or 1} + this_spell = {spellid, 0, Details.spell_school_cache [select (1, GetSpellInfo(spellid))] or 1} bs_table [bs_index] = this_spell bs_index_table [spellname] = bs_index end @@ -1872,9 +1890,9 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex end end end - end + end end - end + end end end @@ -1884,16 +1902,16 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex bs_table [i][2] = 0 end end - + instancia.top = 0 if (tsize > 0) then - _table_sort (bs_table, Details.Sort2) + _table_sort(bs_table, Details.Sort2) instancia.top = bs_table [1][2] end - + local total2 = bs_index - - if (exportar) then + + if (exportar) then local export = {} for i = 1, bs_index do -- spellid, total, spellschool @@ -1901,55 +1919,55 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex end return total, "damage", instancia.top, bs_index, export end - + if (bs_index < 1) then instancia:EsconderScrollBar() - return Details:EndRefresh (instancia, bs_index, tabela_do_combate, showing) --> retorna a tabela que precisa ganhar o refresh + return Details:EndRefresh(instancia, bs_index, combatObject, showing) --> retorna a tabela que precisa ganhar o refresh end - - tabela_do_combate.totals.by_spell = total - - instancia:RefreshScrollBar (bs_index) - + + combatObject.totals.by_spell = total + + instancia:RefreshScrollBar(bs_index) + local whichRowLine = 1 local lineContainer = instancia.barras - + --print (bs_index, #bs_table, instancia.barraS[1], instancia.barraS[2]) - - for i = instancia.barraS[1], instancia.barraS[2], 1 do + + for i = instancia.barraS[1], instancia.barraS[2], 1 do atributo_damage:AtualizarBySpell (bs_table[i], whichRowLine, i, instancia) whichRowLine = whichRowLine+1 end - - return Details:EndRefresh (instancia, bs_index, tabela_do_combate, showing) - - elseif (keyName == "voidzones") then - + + return Details:EndRefresh(instancia, bs_index, combatObject, showing) + + elseif (keyName == "voidzones") then + local index = 0 - local misc_container = tabela_do_combate [4] + local misc_container = combatObject [4] local voidzone_damage_total = 0 - + for _, actor in _ipairs (misc_container._ActorTable) do if (actor.boss_debuff) then index = index + 1 - + --pega no container de dano o actor respons�vel por aplicar o debuff local twin_damage_actor = showing._NameIndexTable [actor.damage_twin] or showing._NameIndexTable ["[*] " .. actor.damage_twin] - + if (twin_damage_actor) then local index = twin_damage_actor twin_damage_actor = showing._ActorTable [twin_damage_actor] local spell = twin_damage_actor.spells._ActorTable [actor.damage_spellid] - + if (spell) then - + --> fix spell, sometimes there is two spells with the same name, one is the cast and other is the debuff if (spell.total == 0 and not actor.damage_spellid_fixed) then - local curname = _GetSpellInfo (actor.damage_spellid) - for spellid, spelltable in _pairs (twin_damage_actor.spells._ActorTable) do + local curname = _GetSpellInfo(actor.damage_spellid) + for spellid, spelltable in _pairs(twin_damage_actor.spells._ActorTable) do if (spelltable.total > spell.total) then - local name = _GetSpellInfo (spellid) + local name = _GetSpellInfo(spellid) if (name == curname) then actor.damage_spellid = spellid spell = spelltable @@ -1958,16 +1976,16 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex end actor.damage_spellid_fixed = true end - + actor.damage = spell.total voidzone_damage_total = voidzone_damage_total + spell.total - + elseif (not actor.damage_spellid_fixed) then --not --> fix spell, if the spellid passed for debuff uptime is actully the spell id of a ability and not if the aura it self actor.damage_spellid_fixed = true local found = false - for spellid, spelltable in _pairs (twin_damage_actor.spells._ActorTable) do - local name = _GetSpellInfo (spellid) + for spellid, spelltable in _pairs(twin_damage_actor.spells._ActorTable) do + local name = _GetSpellInfo(spellid) if (actor.damage_twin:find (name)) then actor.damage = spelltable.total voidzone_damage_total = voidzone_damage_total + spelltable.total @@ -1976,7 +1994,7 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex break end end - + if (not found) then actor.damage = 0 end @@ -1986,66 +2004,66 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex else actor.damage = 0 end - + vtable [index] = actor end end - + local tsize = #vtable if (index < tsize) then for i = index+1, tsize do vtable [i] = nil end end - + if (tsize > 0 and vtable[1]) then - _table_sort (vtable, void_zone_sort) + _table_sort(vtable, void_zone_sort) instancia.top = vtable [1].damage end - total = index - - if (exportar) then + total = index + + if (exportar) then for _, t in ipairs (vtable) do - t.report_name = Details:GetSpellLink (t.damage_spellid) + t.report_name = Details:GetSpellLink(t.damage_spellid) end return voidzone_damage_total, "damage", instancia.top, total, vtable, "report_name" end - + if (total < 1) then instancia:EsconderScrollBar() - return Details:EndRefresh (instancia, total, tabela_do_combate, showing) --> retorna a tabela que precisa ganhar o refresh + return Details:EndRefresh(instancia, total, combatObject, showing) --> retorna a tabela que precisa ganhar o refresh end - - tabela_do_combate.totals.voidzone_damage = voidzone_damage_total - - instancia:RefreshScrollBar (total) - + + combatObject.totals.voidzone_damage = voidzone_damage_total + + instancia:RefreshScrollBar(total) + local whichRowLine = 1 local lineContainer = instancia.barras - for i = instancia.barraS[1], instancia.barraS[2], 1 do + for i = instancia.barraS[1], instancia.barraS[2], 1 do vtable[i]:AtualizarVoidZone (whichRowLine, i, instancia) whichRowLine = whichRowLine+1 end - - return Details:EndRefresh (instancia, total, tabela_do_combate, showing) --> retorna a tabela que precisa ganhar o refresh - + + return Details:EndRefresh(instancia, total, combatObject, showing) --> retorna a tabela que precisa ganhar o refresh + else --/run Details:Dump(Details:GetCurrentCombat():GetActor(1, "Injured Steelspine 1")) if (keyName == "enemies") then - amount, total = Details:ContainerSortEnemies (conteudo, amount, "damage_taken") + amount, total = Details:ContainerSortEnemies (actorTableContent, amount, "damage_taken") --remove actors with zero damage taken local newAmount = 0 - for i = 1, #conteudo do - if (conteudo[i].damage_taken < 1) then + for i = 1, #actorTableContent do + if (actorTableContent[i].damage_taken < 1) then newAmount = i-1 break end end --if all units shown are enemies and all have damage taken, check if newAmount is zero and #conteudo has value bigger than 0 - if (newAmount == 0 and #conteudo > 0) then + if (newAmount == 0 and #actorTableContent > 0) then amount = amount else amount = newAmount @@ -2053,102 +2071,102 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex --keyName = "damage_taken" --result of the first actor - instancia.top = conteudo[1] and conteudo[1][keyName] - - elseif (modo == modo_ALL) then --> mostrando ALL - + instancia.top = actorTableContent[1] and actorTableContent[1][keyName] + + elseif (windowMode == modo_ALL) then --> mostrando ALL + --> faz o sort da categoria e retorna o amount corrigido --print (keyName) - if (sub_atributo == 2) then + if (subAttribute == 2) then local combat_time = instancia.showing:GetCombatTime() - total = atributo_damage:ContainerRefreshDps (conteudo, combat_time) + total = atributo_damage:ContainerRefreshDps (actorTableContent, combat_time) else --> pega o total ja aplicado na tabela do combate - total = tabela_do_combate.totals [class_type] + total = combatObject.totals [class_type] end - - amount = Details:ContainerSort (conteudo, amount, keyName) - + + amount = Details:ContainerSort (actorTableContent, amount, keyName) + --> grava o total - instancia.top = conteudo[1][keyName] - - elseif (modo == modo_GROUP) then --> mostrando GROUP - + instancia.top = actorTableContent[1][keyName] + + elseif (windowMode == modo_GROUP) then --> mostrando GROUP + --> organiza as tabelas - + if (Details.in_combat and instancia.segmento == 0 and not exportar) then - using_cache = true + isUsingCache = true end - - if (using_cache) then - - conteudo = Details.cache_damage_group - - if (sub_atributo == 2) then --> dps + + if (isUsingCache) then + + actorTableContent = Details.cache_damage_group + + if (subAttribute == 2) then --> dps local combat_time = instancia.showing:GetCombatTime() - atributo_damage:ContainerRefreshDps (conteudo, combat_time) + atributo_damage:ContainerRefreshDps (actorTableContent, combat_time) end - - if (#conteudo < 1) then + + if (#actorTableContent < 1) then if (Details.debug and false) then Details.showing_ActorTable_Timer2 = Details.showing_ActorTable_Timer2 or 0 if (time() > Details.showing_ActorTable_Timer2) then - Details:Msg ("(debug) nothing to show -> #conteudo < 1 (using cache)") + Details:Msg("(debug) nothing to show -> #conteudo < 1 (using cache)") Details.showing_ActorTable_Timer2 = time()+5 end end - + return Details:EsconderBarrasNaoUsadas (instancia, showing), "", 0, 0 end - - _table_sort (conteudo, Details.SortKeySimple) - - if (conteudo[1][keyName] < 1) then + + _table_sort(actorTableContent, Details.SortKeySimple) + + if (actorTableContent[1][keyName] < 1) then amount = 0 else - instancia.top = conteudo[1][keyName] - amount = #conteudo - end - - for i = 1, amount do - total = total + conteudo[i][keyName] - end - else - if (sub_atributo == 2) then --> dps - local combat_time = instancia.showing:GetCombatTime() - atributo_damage:ContainerRefreshDps (conteudo, combat_time) + instancia.top = actorTableContent[1][keyName] + amount = #actorTableContent end - _table_sort (conteudo, Details.SortKeyGroup) + for i = 1, amount do + total = total + actorTableContent[i][keyName] + end + else + if (subAttribute == 2) then --> dps + local combat_time = instancia.showing:GetCombatTime() + atributo_damage:ContainerRefreshDps (actorTableContent, combat_time) + end + + _table_sort(actorTableContent, Details.SortKeyGroup) end -- - if (not using_cache) then - for index, player in _ipairs (conteudo) do + if (not isUsingCache) then + for index, player in _ipairs (actorTableContent) do if (player.grupo) then --> � um player e esta em grupo if (player[keyName] < 1) then --> dano menor que 1, interromper o loop amount = index - 1 break end - + total = total + player[keyName] else amount = index-1 break end end - - instancia.top = conteudo[1] and conteudo[1][keyName] + + instancia.top = actorTableContent[1] and actorTableContent[1][keyName] end end end - + --> refaz o mapa do container - if (not using_cache) then + if (not isUsingCache) then showing:remapear() end - - if (exportar) then + + if (exportar) then return total, keyName, instancia.top, amount end @@ -2156,45 +2174,45 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex if (forcar) then if (instancia.modo == 2) then --> group for i = 1, instancia.rows_fit_in_window do - Details.FadeHandler.Fader (instancia.barras [i], "in", Details.fade_speed) + Details.FadeHandler.Fader(instancia.barras [i], "in", Details.fade_speed) end end end instancia:EsconderScrollBar() --> precisaria esconder a scroll bar - + if (Details.debug and false) then Details.showing_ActorTable_Timer2 = Details.showing_ActorTable_Timer2 or 0 if (time() > Details.showing_ActorTable_Timer2) then - Details:Msg ("(debug) nothing to show -> amount < 1") + Details:Msg("(debug) nothing to show -> amount < 1") Details.showing_ActorTable_Timer2 = time()+5 end end - - return Details:EndRefresh (instancia, total, tabela_do_combate, showing) --> retorna a tabela que precisa ganhar o refresh + + return Details:EndRefresh(instancia, total, combatObject, showing) --> retorna a tabela que precisa ganhar o refresh end - instancia:RefreshScrollBar (amount) - + instancia:RefreshScrollBar(amount) + local whichRowLine = 1 local lineContainer = instancia.barras - local percentage_type = instancia.row_info.percent_type - local bars_show_data = instancia.row_info.textR_show_data - local bars_brackets = instancia:GetBarBracket() - local bars_separator = instancia:GetBarSeparator() + local percentageType = instancia.row_info.percent_type + local barsShowData = instancia.row_info.textR_show_data + local barsBrackets = instancia:GetBarBracket() + local barsSeparator = instancia:GetBarSeparator() local baseframe = instancia.baseframe - local use_animations = Details.is_using_row_animations and (not baseframe.isStretching and not forcar and not baseframe.isResizing) - + local useAnimations = Details.is_using_row_animations and (not baseframe.isStretching and not forcar and not baseframe.isResizing) + if (total == 0) then total = 0.00000001 end - + local myPos - local following = instancia.following.enabled and sub_atributo ~= 6 - + local following = instancia.following.enabled and subAttribute ~= 6 + if (following) then - if (using_cache) then + if (isUsingCache) then local pname = Details.playername - for i, actor in _ipairs (conteudo) do + for i, actor in _ipairs (actorTableContent) do if (actor.nome == pname) then myPos = i break @@ -2205,78 +2223,72 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex end end - local combat_time = instancia.showing:GetCombatTime() - + local combatTime = instancia.showing:GetCombatTime() UsingCustomLeftText = instancia.row_info.textL_enable_custom_text UsingCustomRightText = instancia.row_info.textR_enable_custom_text - - local use_total_bar = false + + local useTotalBar = false if (instancia.total_bar.enabled) then - - use_total_bar = true - + useTotalBar = true + if (instancia.total_bar.only_in_group and (not _IsInGroup() and not _IsInRaid())) then - use_total_bar = false + useTotalBar = false end - - if (sub_atributo > 4) then --enemies, frags, void zones - use_total_bar = false + + if (subAttribute > 4) then --enemies, frags, void zones + useTotalBar = false end - end - - if (sub_atributo == 2) then --> dps - instancia.player_top_dps = conteudo [1].last_dps + + if (subAttribute == 2) then --dps + instancia.player_top_dps = actorTableContent [1].last_dps instancia.player_top_dps_threshold = instancia.player_top_dps - (instancia.player_top_dps * 0.65) end - + local totalBarIsShown - + if (instancia.bars_sort_direction == 1) then --top to bottom - - if (use_total_bar and instancia.barraS[1] == 1) then - + if (useTotalBar and instancia.barraS[1] == 1) then whichRowLine = 2 - local iter_last = instancia.barraS[2] - if (iter_last == instancia.rows_fit_in_window) then - iter_last = iter_last - 1 + local iterLast = instancia.barraS[2] + if (iterLast == instancia.rows_fit_in_window) then + iterLast = iterLast - 1 end - + local row1 = lineContainer [1] row1.minha_tabela = nil - row1.lineText1:SetText (Loc ["STRING_TOTAL"]) + row1.lineText1:SetText(Loc ["STRING_TOTAL"]) if (instancia.use_multi_fontstrings) then row1.lineText2:SetText("") - row1.lineText3:SetText(Details:ToK2 (total)) - row1.lineText4:SetText(Details:ToK (total / combat_time)) + row1.lineText3:SetText(Details:ToK2(total)) + row1.lineText4:SetText(Details:ToK(total / combatTime)) else - row1.lineText4:SetText(Details:ToK2 (total) .. " (" .. Details:ToK (total / combat_time) .. ")") + row1.lineText4:SetText(Details:ToK2(total) .. " (" .. Details:ToK(total / combatTime) .. ")") end - - row1:SetValue (100) - local r, g, b = unpack (instancia.total_bar.color) - row1.textura:SetVertexColor (r, g, b) - - row1.icone_classe:SetTexture (instancia.total_bar.icon) - row1.icone_classe:SetTexCoord (0.0625, 0.9375, 0.0625, 0.9375) - - Details.FadeHandler.Fader (row1, "out") + + row1:SetValue(100) + local r, g, b = unpack(instancia.total_bar.color) + row1.textura:SetVertexColor(r, g, b) + row1.icone_classe:SetTexture(instancia.total_bar.icon) + row1.icone_classe:SetTexCoord(0.0625, 0.9375, 0.0625, 0.9375) + + Details.FadeHandler.Fader(row1, "out") totalBarIsShown = true - + if (following and myPos and myPos > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then - for i = instancia.barraS[1], iter_last-1, 1 do - if (conteudo[i]) then - conteudo[i]:RefreshLine (instancia, lineContainer, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) + for i = instancia.barraS[1], iterLast-1, 1 do + if (actorTableContent[i]) then + actorTableContent[i]:RefreshLine (instancia, lineContainer, whichRowLine, i, total, subAttribute, forcar, keyName, combatTime, percentageType, useAnimations, barsShowData, barsBrackets, barsSeparator) whichRowLine = whichRowLine+1 end end - conteudo[myPos]:RefreshLine (instancia, lineContainer, whichRowLine, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) + actorTableContent[myPos]:RefreshLine (instancia, lineContainer, whichRowLine, myPos, total, subAttribute, forcar, keyName, combatTime, percentageType, useAnimations, barsShowData, barsBrackets, barsSeparator) whichRowLine = whichRowLine+1 else - for i = instancia.barraS[1], iter_last, 1 do - if (conteudo[i]) then - conteudo[i]:RefreshLine (instancia, lineContainer, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) + for i = instancia.barraS[1], iterLast, 1 do + if (actorTableContent[i]) then + actorTableContent[i]:RefreshLine (instancia, lineContainer, whichRowLine, i, total, subAttribute, forcar, keyName, combatTime, percentageType, useAnimations, barsShowData, barsBrackets, barsSeparator) whichRowLine = whichRowLine+1 end end @@ -2284,126 +2296,126 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex else if (following and myPos and myPos > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then - for i = instancia.barraS[1], instancia.barraS[2]-1, 1 do - if (conteudo[i]) then - conteudo[i]:RefreshLine (instancia, lineContainer, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) + for i = instancia.barraS[1], instancia.barraS[2]-1, 1 do + if (actorTableContent[i]) then + actorTableContent[i]:RefreshLine (instancia, lineContainer, whichRowLine, i, total, subAttribute, forcar, keyName, combatTime, percentageType, useAnimations, barsShowData, barsBrackets, barsSeparator) whichRowLine = whichRowLine+1 end end - - conteudo[myPos]:RefreshLine (instancia, lineContainer, whichRowLine, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) + + actorTableContent[myPos]:RefreshLine (instancia, lineContainer, whichRowLine, myPos, total, subAttribute, forcar, keyName, combatTime, percentageType, useAnimations, barsShowData, barsBrackets, barsSeparator) whichRowLine = whichRowLine+1 else - for i = instancia.barraS[1], instancia.barraS[2], 1 do - if (conteudo[i]) then - - conteudo[i]:RefreshLine (instancia, lineContainer, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) + for i = instancia.barraS[1], instancia.barraS[2], 1 do + if (actorTableContent[i]) then + + actorTableContent[i]:RefreshLine (instancia, lineContainer, whichRowLine, i, total, subAttribute, forcar, keyName, combatTime, percentageType, useAnimations, barsShowData, barsBrackets, barsSeparator) whichRowLine = whichRowLine+1 end end end end - + elseif (instancia.bars_sort_direction == 2) then --bottom to top - - if (use_total_bar and instancia.barraS[1] == 1) then - + + if (useTotalBar and instancia.barraS[1] == 1) then + whichRowLine = 2 local iter_last = instancia.barraS[2] if (iter_last == instancia.rows_fit_in_window) then iter_last = iter_last - 1 end - + local row1 = lineContainer [1] row1.minha_tabela = nil - row1.lineText1:SetText (Loc ["STRING_TOTAL"]) - + row1.lineText1:SetText(Loc ["STRING_TOTAL"]) + if (instancia.use_multi_fontstrings) then row1.lineText2:SetText("") - row1.lineText3:SetText(Details:ToK2 (total)) - row1.lineText4:SetText(Details:ToK (total / combat_time)) + row1.lineText3:SetText(Details:ToK2(total)) + row1.lineText4:SetText(Details:ToK(total / combatTime)) else - row1.lineText4:SetText(Details:ToK2 (total) .. " (" .. Details:ToK (total / combat_time) .. ")") + row1.lineText4:SetText(Details:ToK2(total) .. " (" .. Details:ToK(total / combatTime) .. ")") end - row1:SetValue (100) - local r, g, b = unpack (instancia.total_bar.color) - row1.textura:SetVertexColor (r, g, b) - - row1.icone_classe:SetTexture (instancia.total_bar.icon) - row1.icone_classe:SetTexCoord (0.0625, 0.9375, 0.0625, 0.9375) - - Details.FadeHandler.Fader (row1, "out") + row1:SetValue(100) + local r, g, b = unpack(instancia.total_bar.color) + row1.textura:SetVertexColor(r, g, b) + + row1.icone_classe:SetTexture(instancia.total_bar.icon) + row1.icone_classe:SetTexCoord(0.0625, 0.9375, 0.0625, 0.9375) + + Details.FadeHandler.Fader(row1, "out") totalBarIsShown = true - + if (following and myPos and myPos > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then - conteudo[myPos]:RefreshLine (instancia, lineContainer, whichRowLine, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) + actorTableContent[myPos]:RefreshLine (instancia, lineContainer, whichRowLine, myPos, total, subAttribute, forcar, keyName, combatTime, percentageType, useAnimations, barsShowData, barsBrackets, barsSeparator) whichRowLine = whichRowLine+1 - for i = iter_last-1, instancia.barraS[1], -1 do - if (conteudo[i]) then - conteudo[i]:RefreshLine (instancia, lineContainer, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) + for i = iter_last-1, instancia.barraS[1], -1 do + if (actorTableContent[i]) then + actorTableContent[i]:RefreshLine (instancia, lineContainer, whichRowLine, i, total, subAttribute, forcar, keyName, combatTime, percentageType, useAnimations, barsShowData, barsBrackets, barsSeparator) whichRowLine = whichRowLine+1 end end else - for i = iter_last, instancia.barraS[1], -1 do - if (conteudo[i]) then - conteudo[i]:RefreshLine (instancia, lineContainer, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) + for i = iter_last, instancia.barraS[1], -1 do + if (actorTableContent[i]) then + actorTableContent[i]:RefreshLine (instancia, lineContainer, whichRowLine, i, total, subAttribute, forcar, keyName, combatTime, percentageType, useAnimations, barsShowData, barsBrackets, barsSeparator) whichRowLine = whichRowLine+1 end end end else if (following and myPos and myPos > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then - conteudo[myPos]:RefreshLine (instancia, lineContainer, whichRowLine, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) + actorTableContent[myPos]:RefreshLine (instancia, lineContainer, whichRowLine, myPos, total, subAttribute, forcar, keyName, combatTime, percentageType, useAnimations, barsShowData, barsBrackets, barsSeparator) whichRowLine = whichRowLine+1 - for i = instancia.barraS[2]-1, instancia.barraS[1], -1 do - if (conteudo[i]) then - conteudo[i]:RefreshLine (instancia, lineContainer, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) + for i = instancia.barraS[2]-1, instancia.barraS[1], -1 do + if (actorTableContent[i]) then + actorTableContent[i]:RefreshLine (instancia, lineContainer, whichRowLine, i, total, subAttribute, forcar, keyName, combatTime, percentageType, useAnimations, barsShowData, barsBrackets, barsSeparator) whichRowLine = whichRowLine+1 end end else -- /run print (Details:GetInstance(1).barraS[2]) -- vai do 5 ao 1 -- qual barra come�a no 1 -- i = 5 at� 1 -- player 5 atualiza na barra 1 / player 1 atualiza na barra 5 - for i = instancia.barraS[2], instancia.barraS[1], -1 do - if (conteudo[i]) then - conteudo[i]:RefreshLine (instancia, lineContainer, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) + for i = instancia.barraS[2], instancia.barraS[1], -1 do + if (actorTableContent[i]) then + actorTableContent[i]:RefreshLine (instancia, lineContainer, whichRowLine, i, total, subAttribute, forcar, keyName, combatTime, percentageType, useAnimations, barsShowData, barsBrackets, barsSeparator) whichRowLine = whichRowLine+1 end end end end - + end - + if (totalBarIsShown) then instancia:RefreshScrollBar(amount + 1) else instancia:RefreshScrollBar(amount) end - - if (use_animations) then + + if (useAnimations) then instancia:PerformAnimations(whichRowLine - 1) end - + --> beta, hidar barras n�o usadas durante um refresh for�ado if (forcar) then if (instancia.modo == 2) then --> group for i = whichRowLine, instancia.rows_fit_in_window do - Details.FadeHandler.Fader (instancia.barras [i], "in", Details.fade_speed) + Details.FadeHandler.Fader(instancia.barras [i], "in", Details.fade_speed) end end end - + Details.LastFullDamageUpdate = Details._tempo - + instancia:AutoAlignInLineFontStrings() - return Details:EndRefresh(instancia, total, tabela_do_combate, showing) --> retorna a tabela que precisa ganhar o refresh + return Details:EndRefresh(instancia, total, combatObject, showing) --> retorna a tabela que precisa ganhar o refresh end --[[exported]] function Details:AutoAlignInLineFontStrings() - + --if this instance is using in line texts, check the min distance and the length of strings to make them more spread appart if (self.use_multi_fontstrings and self.use_auto_align_multi_fontstrings) then local maxStringLength_StringFour = 0 @@ -2424,7 +2436,7 @@ end local stringLength = thisLine.lineText4:GetStringWidth() maxStringLength_StringFour = stringLength > maxStringLength_StringFour and stringLength or maxStringLength_StringFour end - + --check strings 2 and 3 if (thisLine.lineText2:GetText() ~= "" and thisLine.lineText3:GetText() ~= "") then --the length of the middle string determines the space between it and the next string in the left @@ -2567,14 +2579,13 @@ end -- ~atualizar ~barra ~update function atributo_damage:RefreshLine (instance, lineContainer, whichRowLine, rank, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) - - local thisLine = lineContainer [whichRowLine] - + local thisLine = lineContainer[whichRowLine] + if (not thisLine) then print ("DEBUG: problema com "..whichRowLine.." "..rank) return end - + local previousData = thisLine.minha_tabela thisLine.minha_tabela = self --store references self.minha_barra = thisLine --store references @@ -2582,55 +2593,54 @@ function atributo_damage:RefreshLine (instance, lineContainer, whichRowLine, ran thisLine.colocacao = rank self.colocacao = rank - local damage_total = self.total --total damage of this actor + local damageTotal = self.total --total damage of this actor local dps - - local porcentagem - local esta_porcentagem - + local percentString + local percentNumber + --calc the percent amount base on the percent type if (percentage_type == 1) then - porcentagem = _cstr ("%.1f", self [keyName] / total * 100) + percentString = format ("%.1f", self [keyName] / total * 100) elseif (percentage_type == 2) then - porcentagem = _cstr ("%.1f", self [keyName] / instance.top * 100) + percentString = format ("%.1f", self [keyName] / instance.top * 100) end - --> calculate the actor dps - if ( (Details.time_type == 2 and self.grupo) or not Details:CaptureGet ("damage") or instance.segmento == -1) then - if (instance.segmento == -1 and combat_time == 0) then - local p = Details.tabela_vigente (1, self.nome) - if (p) then - local t = p:Tempo() - dps = damage_total / t - self.last_dps = dps - else - dps = damage_total / combat_time - self.last_dps = dps - end + --calculate the actor dps + if ((Details.time_type == 2 and self.grupo) or not Details:CaptureGet ("damage") or instance.segmento == -1) then + if (instance.segmento == -1 and combat_time == 0) then + local p = Details.tabela_vigente (1, self.nome) + if (p) then + local t = p:Tempo() + dps = damageTotal / t + self.last_dps = dps else - dps = damage_total / combat_time + dps = damageTotal / combat_time self.last_dps = dps end else - if (not self.on_hold) then - dps = damage_total/self:Tempo() --calcula o dps deste objeto - self.last_dps = dps --salva o dps dele + dps = damageTotal / combat_time + self.last_dps = dps + end + else + if (not self.on_hold) then + dps = damageTotal/self:Tempo() --calcula o dps deste objeto + self.last_dps = dps --salva o dps dele + else + if (self.last_dps == 0) then --> n�o calculou o dps dele ainda mas entrou em standby + dps = damageTotal/self:Tempo() + self.last_dps = dps else - if (self.last_dps == 0) then --> n�o calculou o dps dele ainda mas entrou em standby - dps = damage_total/self:Tempo() - self.last_dps = dps - else - dps = self.last_dps - end + dps = self.last_dps end end - + end + --right text if (sub_atributo == 1) then --damage done - dps = _math_floor (dps) - local formated_damage = SelectedToKFunction (_, damage_total) - local formated_dps = SelectedToKFunction (_, dps) + dps = _math_floor(dps) + local formated_damage = SelectedToKFunction(_, damageTotal) + local formated_dps = SelectedToKFunction(_, dps) thisLine.ps_text = formated_dps if (not bars_show_data [1]) then @@ -2640,40 +2650,39 @@ function atributo_damage:RefreshLine (instance, lineContainer, whichRowLine, ran formated_dps = "" end if (not bars_show_data [3]) then - porcentagem = "" + percentString = "" else - porcentagem = porcentagem .. "%" + percentString = percentString .. "%" end - - local rightText = formated_damage .. bars_brackets[1] .. formated_dps .. bars_separator .. porcentagem .. bars_brackets[2] + + local rightText = formated_damage .. bars_brackets[1] .. formated_dps .. bars_separator .. percentString .. bars_brackets[2] if (UsingCustomRightText) then - thisLine.lineText4:SetText(_string_replace (instance.row_info.textR_custom_text, formated_damage, formated_dps, porcentagem, self, instance.showing, instance, rightText)) + thisLine.lineText4:SetText(stringReplace(instance.row_info.textR_custom_text, formated_damage, formated_dps, percentString, self, instance.showing, instance, rightText)) else if (instance.use_multi_fontstrings) then - instance:SetInLineTexts(thisLine, formated_damage, formated_dps, porcentagem) + instance:SetInLineTexts(thisLine, formated_damage, formated_dps, percentString) else thisLine.lineText4:SetText(rightText) end end - - esta_porcentagem = _math_floor ((damage_total/instance.top) * 100) + + percentNumber = _math_floor((damageTotal/instance.top) * 100) elseif (sub_atributo == 2) then --dps - local raw_dps = dps - dps = _math_floor (dps) - - local formated_damage = SelectedToKFunction (_, damage_total) - local formated_dps = SelectedToKFunction (_, dps) + dps = _math_floor(dps) + + local formated_damage = SelectedToKFunction(_, damageTotal) + local formated_dps = SelectedToKFunction(_, dps) thisLine.ps_text = formated_dps - + local diff_from_topdps - + if (rank > 1) then diff_from_topdps = instance.player_top_dps - raw_dps end - + local rightText if (diff_from_topdps) then local threshold = diff_from_topdps / instance.player_top_dps_threshold * 100 @@ -2682,24 +2691,24 @@ function atributo_damage:RefreshLine (instance, lineContainer, whichRowLine, ran else threshold = 5 end - + local rr, gg, bb = Details:percent_color ( threshold ) - - rr, gg, bb = Details:hex (_math_floor (rr*255)), Details:hex (_math_floor (gg*255)), "28" + + rr, gg, bb = Details:hex (_math_floor(rr*255)), Details:hex (_math_floor(gg*255)), "28" local color_percent = "" .. rr .. gg .. bb .. "" - + if (not bars_show_data [1]) then formated_dps = "" end if (not bars_show_data [2]) then color_percent = "" else - color_percent = bars_brackets[1] .. "|cFFFF4444-|r|cFF" .. color_percent .. SelectedToKFunction (_, _math_floor (diff_from_topdps)) .. "|r" .. bars_brackets[2] + color_percent = bars_brackets[1] .. "|cFFFF4444-|r|cFF" .. color_percent .. SelectedToKFunction(_, _math_floor(diff_from_topdps)) .. "|r" .. bars_brackets[2] end - + rightText = formated_dps .. color_percent + else - local icon = " |TInterface\\GROUPFRAME\\UI-Group-LeaderIcon:14:14:0:0:16:16:0:16:0:16|t " if (not bars_show_data [1]) then formated_dps = "" @@ -2707,12 +2716,12 @@ function atributo_damage:RefreshLine (instance, lineContainer, whichRowLine, ran if (not bars_show_data [2]) then icon = "" end - + rightText = formated_dps .. icon end if (UsingCustomRightText) then - thisLine.lineText4:SetText (_string_replace (instance.row_info.textR_custom_text, formated_dps, formated_damage, porcentagem, self, instance.showing, instance, rightText)) + thisLine.lineText4:SetText(stringReplace(instance.row_info.textR_custom_text, formated_dps, formated_damage, percentString, self, instance.showing, instance, rightText)) else if (instance.use_multi_fontstrings) then --instance:SetInLineTexts(thisLine, formated_damage, formated_dps, porcentagem) @@ -2722,14 +2731,13 @@ function atributo_damage:RefreshLine (instance, lineContainer, whichRowLine, ran end end - esta_porcentagem = _math_floor ((dps/instance.top) * 100) - - elseif (sub_atributo == 3) then --damage taken + percentNumber = _math_floor((dps/instance.top) * 100) + elseif (sub_atributo == 3) then --damage taken local dtps = self.damage_taken / combat_time - - local formated_damage_taken = SelectedToKFunction (_, self.damage_taken) - local formated_dtps = SelectedToKFunction (_, dtps) + + local formated_damage_taken = SelectedToKFunction(_, self.damage_taken) + local formated_dtps = SelectedToKFunction(_, dtps) thisLine.ps_text = formated_dtps if (not bars_show_data [1]) then @@ -2739,177 +2747,168 @@ function atributo_damage:RefreshLine (instance, lineContainer, whichRowLine, ran formated_dtps = "" end if (not bars_show_data [3]) then - porcentagem = "" + percentString = "" else - porcentagem = porcentagem .. "%" + percentString = percentString .. "%" end - - local rightText = formated_damage_taken .. bars_brackets[1] .. formated_dtps .. bars_separator .. porcentagem .. bars_brackets[2] + + local rightText = formated_damage_taken .. bars_brackets[1] .. formated_dtps .. bars_separator .. percentString .. bars_brackets[2] if (UsingCustomRightText) then - thisLine.lineText4:SetText (_string_replace (instance.row_info.textR_custom_text, formated_damage_taken, formated_dtps, porcentagem, self, instance.showing, instance, rightText)) + thisLine.lineText4:SetText(stringReplace(instance.row_info.textR_custom_text, formated_damage_taken, formated_dtps, percentString, self, instance.showing, instance, rightText)) else if (instance.use_multi_fontstrings) then - instance:SetInLineTexts(thisLine, formated_damage_taken, formated_dtps, porcentagem) + instance:SetInLineTexts(thisLine, formated_damage_taken, formated_dtps, percentString) else thisLine.lineText4:SetText(rightText) end end - - esta_porcentagem = _math_floor ((self.damage_taken/instance.top) * 100) - + + percentNumber = _math_floor((self.damage_taken/instance.top) * 100) + elseif (sub_atributo == 4) then --friendly fire - - local formated_friendly_fire = SelectedToKFunction (_, self.friendlyfire_total) + local formated_friendly_fire = SelectedToKFunction(_, self.friendlyfire_total) if (not bars_show_data [1]) then formated_friendly_fire = "" end if (not bars_show_data [3]) then - porcentagem = "" + percentString = "" else - porcentagem = porcentagem .. "%" + percentString = percentString .. "%" end - - local rightText = formated_friendly_fire .. bars_brackets[1] .. porcentagem .. bars_brackets[2] + + local rightText = formated_friendly_fire .. bars_brackets[1] .. percentString .. bars_brackets[2] if (UsingCustomRightText) then - thisLine.lineText4:SetText (_string_replace (instance.row_info.textR_custom_text, formated_friendly_fire, "", porcentagem, self, instance.showing, instance, rightText)) + thisLine.lineText4:SetText(stringReplace(instance.row_info.textR_custom_text, formated_friendly_fire, "", percentString, self, instance.showing, instance, rightText)) else if (instance.use_multi_fontstrings) then - instance:SetInLineTexts(thisLine, "", formated_friendly_fire, porcentagem) + instance:SetInLineTexts(thisLine, "", formated_friendly_fire, percentString) else thisLine.lineText4:SetText(rightText) end end - esta_porcentagem = _math_floor ((self.friendlyfire_total/instance.top) * 100) - + percentNumber = _math_floor((self.friendlyfire_total/instance.top) * 100) + elseif (sub_atributo == 6) then --enemies - local dtps = self.damage_taken / combat_time - - local formated_damage_taken = SelectedToKFunction (_, self.damage_taken) - local formated_dtps = SelectedToKFunction (_, dtps) - thisLine.ps_text = formated_dtps + + local formatedDamageTaken = SelectedToKFunction(_, self.damage_taken) + local formatedDtps = SelectedToKFunction(_, dtps) + thisLine.ps_text = formatedDtps if (not bars_show_data [1]) then - formated_damage_taken = "" + formatedDamageTaken = "" end if (not bars_show_data [2]) then - formated_dtps = "" + formatedDtps = "" end if (not bars_show_data [3]) then - porcentagem = "" + percentString = "" else - porcentagem = porcentagem .. "%" + percentString = percentString .. "%" end - - local rightText = formated_damage_taken .. bars_brackets[1] .. formated_dtps .. bars_separator .. porcentagem .. bars_brackets[2] + + local rightText = formatedDamageTaken .. bars_brackets[1] .. formatedDtps .. bars_separator .. percentString .. bars_brackets[2] if (UsingCustomRightText) then - thisLine.lineText4:SetText (_string_replace (instance.row_info.textR_custom_text, formated_damage_taken, formated_dtps, porcentagem, self, instance.showing, instance, rightText)) + thisLine.lineText4:SetText(stringReplace(instance.row_info.textR_custom_text, formatedDamageTaken, formatedDtps, percentString, self, instance.showing, instance, rightText)) else if (instance.use_multi_fontstrings) then - instance:SetInLineTexts(thisLine, formated_damage_taken, formated_dtps, porcentagem) + instance:SetInLineTexts(thisLine, formatedDamageTaken, formatedDtps, percentString) else thisLine.lineText4:SetText(rightText) end end - - esta_porcentagem = _math_floor ((self.damage_taken/instance.top) * 100) + + percentNumber = _math_floor((self.damage_taken/instance.top) * 100) end --need tooltip update? if (thisLine.mouse_over and not instance.baseframe.isMoving) then - gump:UpdateTooltip (whichRowLine, thisLine, instance) + gump:UpdateTooltip(whichRowLine, thisLine, instance) end if (self.need_refresh) then self.need_refresh = false forcar = true end - + actor_class_color_r, actor_class_color_g, actor_class_color_b = self:GetBarColor() - - return self:RefreshLineValue(thisLine, instance, previousData, forcar, esta_porcentagem, whichRowLine, lineContainer, use_animations) + + return self:RefreshLineValue(thisLine, instance, previousData, forcar, percentNumber, whichRowLine, lineContainer, use_animations) end ---[[ exported]] function Details:RefreshLineValue(thisLine, instance, previousData, forcar, esta_porcentagem, whichRowLine, lineContainer, use_animations) - - --> primeiro colocado + +function Details:RefreshLineValue(thisLine, instance, previousData, isForceRefresh, percent, whichRowLine, lineContainer, useAnimations) --[[ exported]] if (thisLine.colocacao == 1) then - --aqui thisLine.animacao_ignorar = true - - if (not previousData or previousData ~= thisLine.minha_tabela or forcar) then - thisLine:SetValue (100) - + + if (not previousData or previousData ~= thisLine.minha_tabela or isForceRefresh) then + thisLine:SetValue(100) + if (thisLine.hidden or thisLine.fading_in or thisLine.faded) then - Details.FadeHandler.Fader (thisLine, "out") + Details.FadeHandler.Fader(thisLine, "out") end - - return self:RefreshBarra (thisLine, instance) + + return self:RefreshBarra(thisLine, instance) else return end else if (thisLine.hidden or thisLine.fading_in or thisLine.faded) then - --> setando o valor mesmo com anima��es pq o barra esta hidada com o value do �ltimo actor que ela mostrou - if (use_animations) then - thisLine.animacao_fim = esta_porcentagem - thisLine:SetValue (esta_porcentagem) + --setando o valor mesmo com anima��es pq o barra esta hidada com o value do �ltimo actor que ela mostrou + if (useAnimations) then + thisLine.animacao_fim = percent + thisLine:SetValue(percent) else - thisLine:SetValue (esta_porcentagem) + thisLine:SetValue(percent) thisLine.animacao_ignorar = true end - - Details.FadeHandler.Fader (thisLine, "out") - return self:RefreshBarra (thisLine, instance) + Details.FadeHandler.Fader(thisLine, "out") + + return self:RefreshBarra(thisLine, instance) else - --> agora esta comparando se a tabela da barra � diferente da tabela na atualiza��o anterior - if (not previousData or previousData ~= thisLine.minha_tabela or forcar) then --> aqui diz se a barra do jogador mudou de posi��o ou se ela apenas ser� atualizada - if (use_animations) then - thisLine.animacao_fim = esta_porcentagem + --agora esta comparando se a tabela da barra � diferente da tabela na atualiza��o anterior + if (not previousData or previousData ~= thisLine.minha_tabela or isForceRefresh) then --aqui diz se a barra do jogador mudou de posi��o ou se ela apenas ser� atualizada + if (useAnimations) then + thisLine.animacao_fim = percent else - thisLine:SetValue (esta_porcentagem) + thisLine:SetValue(percent) thisLine.animacao_ignorar = true end - - thisLine.last_value = esta_porcentagem --> reseta o ultimo valor da barra - - return self:RefreshBarra (thisLine, instance) - - elseif (esta_porcentagem ~= thisLine.last_value) then --> continua mostrando a mesma tabela ent�o compara a porcentagem - --> apenas atualizar - if (use_animations) then - thisLine.animacao_fim = esta_porcentagem + + thisLine.last_value = percent --reseta o ultimo valor da barra + + return self:RefreshBarra(thisLine, instance) + + elseif (percent ~= thisLine.last_value) then --continua mostrando a mesma tabela ent�o compara a porcentagem + --apenas atualizar + if (useAnimations) then + thisLine.animacao_fim = percent else - thisLine:SetValue (esta_porcentagem) + thisLine:SetValue(percent) end - thisLine.last_value = esta_porcentagem - - return self:RefreshBarra (thisLine, instance) + thisLine.last_value = percent + + return self:RefreshBarra(thisLine, instance) end end - end - end -local set_text_size = function (bar, instance) +local setLineTextSize = function(line, instance) if (instance.bars_inverted) then - bar.lineText4:SetSize (instance.cached_bar_width - bar.lineText1:GetStringWidth() - 20, 15) + line.lineText4:SetSize(instance.cached_bar_width - line.lineText1:GetStringWidth() - 20, 15) else - bar.lineText1:SetSize (instance.cached_bar_width - bar.lineText4:GetStringWidth() - 20, 15) + line.lineText1:SetSize(instance.cached_bar_width - line.lineText4:GetStringWidth() - 20, 15) end end ---> this is the in bar icon (icon inside the player bar, like faction or role icon) padding, icon has the row height as is width and height - padding -local InBarIconPadding = 6 ---[[ exported]] function Details:SetBarLeftText (bar, instance, enemy, arena_enemy, arena_ally, UsingCustomLeftText) - - local bar_number = "" +function Details:SetBarLeftText(bar, instance, enemy, arenaEnemy, arenaAlly, usingCustomLeftText) --[[ exported]] + local barNumber = "" if (instance.row_info.textL_show_number) then - bar_number = bar.colocacao .. ". " + barNumber = bar.colocacao .. ". " end --translate cyrillic alphabet to western alphabet by Vardex (https://github.com/Vardex May 22, 2019) @@ -2918,79 +2917,78 @@ local InBarIconPadding = 6 end if (enemy) then - if (arena_enemy) then + if (arenaEnemy) then if (instance.row_info.show_arena_role_icon) then - --> show arena role icon + --show arena role icon local sizeOffset = instance.row_info.arena_role_icon_size_offset - local leftText = bar_number .. "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. (instance.row_info.height + sizeOffset)..":"..(instance.row_info.height + sizeOffset) .. ":0:0:256:256:" .. Details.role_texcoord [self.role or "NONE"] .. "|t " .. self.displayName - if (UsingCustomLeftText) then - bar.lineText1:SetText (_string_replace (instance.row_info.textL_custom_text, bar.colocacao, self.displayName, "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. (instance.row_info.height + sizeOffset)..":"..(instance.row_info.height + sizeOffset) .. ":0:0:256:256:" .. Details.role_texcoord [self.role or "NONE"] .. "|t ", self, instance.showing, instance, leftText)) + local leftText = barNumber .. "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. (instance.row_info.height + sizeOffset)..":"..(instance.row_info.height + sizeOffset) .. ":0:0:256:256:" .. Details.role_texcoord [self.role or "NONE"] .. "|t " .. self.displayName + if (usingCustomLeftText) then + bar.lineText1:SetText(stringReplace(instance.row_info.textL_custom_text, bar.colocacao, self.displayName, "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. (instance.row_info.height + sizeOffset)..":"..(instance.row_info.height + sizeOffset) .. ":0:0:256:256:" .. Details.role_texcoord [self.role or "NONE"] .. "|t ", self, instance.showing, instance, leftText)) else - bar.lineText1:SetText (leftText) + bar.lineText1:SetText(leftText) end else --don't show arena role icon - local leftText = bar_number .. self.displayName - if (UsingCustomLeftText) then - bar.lineText1:SetText (_string_replace (instance.row_info.textL_custom_text, bar.colocacao, self.displayName, " ", self, instance.showing, instance, leftText)) + local leftText = barNumber .. self.displayName + if (usingCustomLeftText) then + bar.lineText1:SetText(stringReplace(instance.row_info.textL_custom_text, bar.colocacao, self.displayName, " ", self, instance.showing, instance, leftText)) else - bar.lineText1:SetText (leftText) + bar.lineText1:SetText(leftText) end end else if (instance.row_info.show_faction_icon) then local sizeOffset = instance.row_info.faction_icon_size_offset if (Details.faction_against == "Horde") then - local leftText = bar_number .. "|TInterface\\AddOns\\Details\\images\\icones_barra:" .. (instance.row_info.height + sizeOffset)..":"..(instance.row_info.height + sizeOffset) .. ":0:0:256:32:0:32:0:32|t"..self.displayName - if (UsingCustomLeftText) then - bar.lineText1:SetText (_string_replace (instance.row_info.textL_custom_text, bar.colocacao, self.displayName, "|TInterface\\AddOns\\Details\\images\\icones_barra:" .. (instance.row_info.height + sizeOffset)..":"..(instance.row_info.height + sizeOffset) .. ":0:0:256:32:0:32:0:32|t", self, instance.showing, instance, leftText)) + local leftText = barNumber .. "|TInterface\\AddOns\\Details\\images\\icones_barra:" .. (instance.row_info.height + sizeOffset)..":"..(instance.row_info.height + sizeOffset) .. ":0:0:256:32:0:32:0:32|t"..self.displayName + if (usingCustomLeftText) then + bar.lineText1:SetText(stringReplace(instance.row_info.textL_custom_text, bar.colocacao, self.displayName, "|TInterface\\AddOns\\Details\\images\\icones_barra:" .. (instance.row_info.height + sizeOffset)..":"..(instance.row_info.height + sizeOffset) .. ":0:0:256:32:0:32:0:32|t", self, instance.showing, instance, leftText)) else - bar.lineText1:SetText (leftText) --seta o texto da esqueda -- HORDA + bar.lineText1:SetText(leftText) --seta o texto da esqueda -- HORDA end else --alliance - local leftText = bar_number .. "|TInterface\\AddOns\\Details\\images\\icones_barra:" .. (instance.row_info.height + sizeOffset)..":"..(instance.row_info.height + sizeOffset) .. ":0:0:256:32:32:64:0:32|t"..self.displayName - if (UsingCustomLeftText) then - bar.lineText1:SetText (_string_replace (instance.row_info.textL_custom_text, bar.colocacao, self.displayName, "|TInterface\\AddOns\\Details\\images\\icones_barra:" .. (instance.row_info.height + sizeOffset)..":"..(instance.row_info.height + sizeOffset) .. ":0:0:256:32:32:64:0:32|t", self, instance.showing, instance, leftText)) + local leftText = barNumber .. "|TInterface\\AddOns\\Details\\images\\icones_barra:" .. (instance.row_info.height + sizeOffset)..":"..(instance.row_info.height + sizeOffset) .. ":0:0:256:32:32:64:0:32|t"..self.displayName + if (usingCustomLeftText) then + bar.lineText1:SetText(stringReplace(instance.row_info.textL_custom_text, bar.colocacao, self.displayName, "|TInterface\\AddOns\\Details\\images\\icones_barra:" .. (instance.row_info.height + sizeOffset)..":"..(instance.row_info.height + sizeOffset) .. ":0:0:256:32:32:64:0:32|t", self, instance.showing, instance, leftText)) else - bar.lineText1:SetText (leftText) --seta o texto da esqueda -- ALLY + bar.lineText1:SetText(leftText) --seta o texto da esqueda -- ALLY end end else --don't show faction icon - local leftText = bar_number .. self.displayName - if (UsingCustomLeftText) then - bar.lineText1:SetText (_string_replace (instance.row_info.textL_custom_text, bar.colocacao, self.displayName, " ", self, instance.showing, instance, leftText)) + local leftText = barNumber .. self.displayName + if (usingCustomLeftText) then + bar.lineText1:SetText(stringReplace(instance.row_info.textL_custom_text, bar.colocacao, self.displayName, " ", self, instance.showing, instance, leftText)) else - bar.lineText1:SetText (leftText) + bar.lineText1:SetText(leftText) end end end else - if (arena_ally and instance.row_info.show_arena_role_icon) then + if (arenaAlly and instance.row_info.show_arena_role_icon) then local sizeOffset = instance.row_info.arena_role_icon_size_offset - local leftText = bar_number .. "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. (instance.row_info.height + sizeOffset)..":"..(instance.row_info.height + sizeOffset) .. ":0:0:256:256:" .. Details.role_texcoord [self.role or "NONE"] .. "|t " .. self.displayName - if (UsingCustomLeftText) then - bar.lineText1:SetText (_string_replace (instance.row_info.textL_custom_text, bar.colocacao, self.displayName, "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. (instance.row_info.height + sizeOffset)..":"..(instance.row_info.height + sizeOffset) .. ":0:0:256:256:" .. Details.role_texcoord [self.role or "NONE"] .. "|t ", self, instance.showing, instance, leftText)) + local leftText = barNumber .. "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. (instance.row_info.height + sizeOffset)..":"..(instance.row_info.height + sizeOffset) .. ":0:0:256:256:" .. Details.role_texcoord [self.role or "NONE"] .. "|t " .. self.displayName + if (usingCustomLeftText) then + bar.lineText1:SetText(stringReplace(instance.row_info.textL_custom_text, bar.colocacao, self.displayName, "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. (instance.row_info.height + sizeOffset)..":"..(instance.row_info.height + sizeOffset) .. ":0:0:256:256:" .. Details.role_texcoord [self.role or "NONE"] .. "|t ", self, instance.showing, instance, leftText)) else - bar.lineText1:SetText (leftText) + bar.lineText1:SetText(leftText) end else - local leftText = bar_number .. self.displayName - if (UsingCustomLeftText) then - bar.lineText1:SetText (_string_replace (instance.row_info.textL_custom_text, bar.colocacao, self.displayName, "", self, instance.showing, instance, leftText)) + local leftText = barNumber .. self.displayName + if (usingCustomLeftText) then + bar.lineText1:SetText(stringReplace(instance.row_info.textL_custom_text, bar.colocacao, self.displayName, "", self, instance.showing, instance, leftText)) else - bar.lineText1:SetText (leftText) --seta o texto da esqueda + bar.lineText1:SetText(leftText) --seta o texto da esqueda end end end - - set_text_size (bar, instance) + + setLineTextSize (bar, instance) end --[[ exported]] function Details:SetBarColors(bar, instance, r, g, b, a) - a = a or 1 - + if (instance.row_info.texture_class_colors) then --[[ Deprecation of right_to_left_texture in favor of StatusBar:SetReverseFill 5/2/2022 - Flamanis if (instance.bars_inverted) then @@ -3000,11 +2998,11 @@ end end]] bar.textura:SetVertexColor(r, g, b, a) end - + if (instance.row_info.texture_background_class_color) then bar.background:SetVertexColor(r, g, b, a) end - + if (instance.row_info.textL_class_colors) then bar.lineText1:SetTextColor(r, g, b, a) end @@ -3020,12 +3018,10 @@ end local alpha = instance.row_info.backdrop.color[4] bar.lineBorder:SetVertexColor(r, g, b, alpha) end -end +end --@self: actor object ---[[ exported]] function Details:SetClassIcon (texture, instance, classe) --self is the actorObject - - +function Details:SetClassIcon(texture, instance, class) --[[ exported]] local customIcon if (Details.immersion_unit_special_icons) then customIcon = Details.Immersion.GetIcon(self.aID) @@ -3043,136 +3039,132 @@ end texture:SetVertexColor(1, 1, 1) elseif (self.spellicon) then - texture:SetTexture (self.spellicon) - texture:SetTexCoord (0.078125, 0.921875, 0.078125, 0.921875) - - elseif (classe == "UNKNOW") then - texture:SetTexture ([[Interface\AddOns\Details\images\classes_plus]]) - texture:SetTexCoord (0.50390625, 0.62890625, 0, 0.125) - texture:SetVertexColor (1, 1, 1) - - elseif (classe == "UNGROUPPLAYER") then + texture:SetTexture(self.spellicon) + texture:SetTexCoord(0.078125, 0.921875, 0.078125, 0.921875) + + elseif (class == "UNKNOW") then + texture:SetTexture([[Interface\AddOns\Details\images\classes_plus]]) + texture:SetTexCoord(0.50390625, 0.62890625, 0, 0.125) + texture:SetVertexColor(1, 1, 1) + + elseif (class == "UNGROUPPLAYER") then if (self.enemy) then if (Details.faction_against == "Horde") then - texture:SetTexture ("Interface\\ICONS\\Achievement_Character_Troll_Male") - texture:SetTexCoord (0.05, 0.95, 0.05, 0.95) + texture:SetTexture("Interface\\ICONS\\Achievement_Character_Troll_Male") + texture:SetTexCoord(0.05, 0.95, 0.05, 0.95) else - texture:SetTexture ("Interface\\ICONS\\Achievement_Character_Nightelf_Female") - texture:SetTexCoord (0.05, 0.95, 0.05, 0.95) + texture:SetTexture("Interface\\ICONS\\Achievement_Character_Nightelf_Female") + texture:SetTexCoord(0.05, 0.95, 0.05, 0.95) end else if (Details.faction_against == "Horde") then - texture:SetTexture ("Interface\\ICONS\\Achievement_Character_Nightelf_Female") - texture:SetTexCoord (0.05, 0.95, 0.05, 0.95) + texture:SetTexture("Interface\\ICONS\\Achievement_Character_Nightelf_Female") + texture:SetTexCoord(0.05, 0.95, 0.05, 0.95) else - texture:SetTexture ("Interface\\ICONS\\Achievement_Character_Troll_Male") - texture:SetTexCoord (0.05, 0.95, 0.05, 0.95) + texture:SetTexture("Interface\\ICONS\\Achievement_Character_Troll_Male") + texture:SetTexCoord(0.05, 0.95, 0.05, 0.95) end end - texture:SetVertexColor (1, 1, 1) - - elseif (classe == "PET") then + + texture:SetVertexColor(1, 1, 1) + + elseif (class == "PET") then texture:SetTexture(instance and instance.row_info.icon_file or [[Interface\AddOns\Details\images\classes_small]]) texture:SetTexCoord(0.25, 0.49609375, 0.75, 1) texture:SetVertexColor(actor_class_color_r, actor_class_color_g, actor_class_color_b) + else if (instance and instance.row_info.use_spec_icons) then if (self.spec and Details.class_specs_coords[self.spec]) then texture:SetTexture(instance.row_info.spec_file) - texture:SetTexCoord(_unpack (Details.class_specs_coords[self.spec])) + texture:SetTexCoord(unpack(Details.class_specs_coords[self.spec])) texture:SetVertexColor(1, 1, 1) else - --if (self.spec and not Details.class_specs_coords[self.spec]) then - -- print("|cFFFFAA00Details!|r error 0x8525, report on discord", self.spec, self.classe) - --end - texture:SetTexture(instance.row_info.icon_file or [[Interface\AddOns\Details\images\classes_small]]) - texture:SetTexCoord(_unpack (Details.class_coords[classe])) + texture:SetTexCoord(unpack(Details.class_coords[class])) texture:SetVertexColor(1, 1, 1) end else texture:SetTexture(instance and instance.row_info.icon_file or [[Interface\AddOns\Details\images\classes_small]]) - texture:SetTexCoord(_unpack (Details.class_coords[classe])) + texture:SetTexCoord(unpack(Details.class_coords[class])) texture:SetVertexColor(1, 1, 1) end end end ---endd elsefi - ---[[ exported]] function Details:RefreshBarra (thisLine, instance, from_resize) - - local class, enemy, arena_enemy, arena_ally = self.classe, self.enemy, self.arena_enemy, self.arena_ally - + + +function Details:RefreshBarra(thisLine, instance, fromResize) --[[ exported]] + local class, enemy, arenaEnemy, arenaAlly = self.classe, self.enemy, self.arena_enemy, self.arena_ally + if (not class) then - Details:Msg ("Warning, actor without a class:", self.nome, self.flag_original, self.serial) + Details:Msg("Warning, actor without a class:", self.nome, self.flag_original, self.serial) self.classe = "UNKNOW" class = "UNKNOW" end - - if (from_resize) then + + if (fromResize) then actor_class_color_r, actor_class_color_g, actor_class_color_b = self:GetBarColor() end - --> icon + --icon self:SetClassIcon(thisLine.icone_classe, instance, class) - --> texture color + + --texture color self:SetBarColors(thisLine, instance, actor_class_color_r, actor_class_color_g, actor_class_color_b) - --> left text - self:SetBarLeftText(thisLine, instance, enemy, arena_enemy, arena_ally, UsingCustomLeftText) - + + --left text + self:SetBarLeftText(thisLine, instance, enemy, arenaEnemy, arenaAlly, UsingCustomLeftText) end --------------------------------------------- // TOOLTIPS // --------------------------------------------- - - ---------> TOOLTIPS BIFURCA��O -- ~tooltip function atributo_damage:ToolTip (instance, numero, barra, keydown) --> seria possivel aqui colocar o icone da classe dele? if (instance.atributo == 5) then --> custom - return self:TooltipForCustom (barra) + return self:TooltipForCustom(barra) else if (instance.sub_atributo == 1 or instance.sub_atributo == 2) then --> damage done or Dps or enemy - return self:ToolTip_DamageDone (instance, numero, barra, keydown) + return self:ToolTip_DamageDone(instance, numero, barra, keydown) + elseif (instance.sub_atributo == 3) then --> damage taken - return self:ToolTip_DamageTaken (instance, numero, barra, keydown) + return self:ToolTip_DamageTaken(instance, numero, barra, keydown) + elseif (instance.sub_atributo == 6) then --> enemies - return self:ToolTip_Enemies (instance, numero, barra, keydown) + return self:ToolTip_Enemies(instance, numero, barra, keydown) + elseif (instance.sub_atributo == 4) then --> friendly fire - return self:ToolTip_FriendlyFire (instance, numero, barra, keydown) + return self:ToolTip_FriendlyFire(instance, numero, barra, keydown) end end end ---> tooltip locals + +--tooltip locals local r, g, b local barAlha = .6 - - ---------> DAMAGE DONE & DPS - function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) - local owner = self.owner if (owner and owner.classe) then - r, g, b = unpack (Details.class_colors [owner.classe]) + r, g, b = unpack(Details.class_colors [owner.classe]) else if (not Details.class_colors [self.classe]) then return print ("Details!: error class not found:", self.classe, "for", self.nome) end - r, g, b = unpack (Details.class_colors [self.classe]) + r, g, b = unpack(Details.class_colors [self.classe]) end --> habilidades local icon_size = Details.tooltip.icon_size local icon_border = Details.tooltip.icon_border_texcoord - + do --> TOP HABILIDADES - + --get variables --local ActorDamage = self.total_without_pet --mostrando os pets no tooltip local ActorDamage = self.total @@ -3184,7 +3176,7 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) local ActorSkillsSortTable = {} local reflectionSpells = {} - + --get time type local meu_tempo if (Details.time_type == 1 or not self.grupo) then @@ -3194,7 +3186,7 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) end --add actor spells - for _spellid, _skill in _pairs (ActorSkillsContainer) do + for _spellid, _skill in _pairs(ActorSkillsContainer) do ActorSkillsSortTable [#ActorSkillsSortTable+1] = {_spellid, _skill.total, _skill.total/meu_tempo} if (_skill.isReflection) then reflectionSpells[#reflectionSpells+1] = _skill @@ -3205,36 +3197,36 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) for petIndex, petName in _ipairs (self:Pets()) do local petActor = instancia.showing[class_type]:PegarCombatente (nil, petName) if (petActor) then - for _spellid, _skill in _pairs (petActor:GetActorSpells()) do + for _spellid, _skill in _pairs(petActor:GetActorSpells()) do ActorSkillsSortTable [#ActorSkillsSortTable+1] = {_spellid, _skill.total, _skill.total/meu_tempo, petName:gsub ((" <.*"), "")} end end end --sort - _table_sort (ActorSkillsSortTable, Details.Sort2) - + _table_sort(ActorSkillsSortTable, Details.Sort2) + --> TOP INIMIGOS --get variables local ActorTargetsSortTable = {} - + --add - for target_name, amount in _pairs (self.targets) do + for target_name, amount in _pairs(self.targets) do ActorTargetsSortTable [#ActorTargetsSortTable+1] = {target_name, amount} end --sort - _table_sort (ActorTargetsSortTable, Details.Sort2) + _table_sort(ActorTargetsSortTable, Details.Sort2) --tooltip stuff local tooltip_max_abilities = Details.tooltip.tooltip_max_abilities - + local is_maximized = false if (keydown == "shift" or TooltipMaximizedMethod == 2 or TooltipMaximizedMethod == 3) then tooltip_max_abilities = 99 is_maximized = true end - + --> MOSTRA HABILIDADES - Details:AddTooltipSpellHeaderText (Loc ["STRING_SPELLS"], headerColor, #ActorSkillsSortTable, Details.tooltip_spell_icon.file, unpack (Details.tooltip_spell_icon.coords)) + Details:AddTooltipSpellHeaderText (Loc ["STRING_SPELLS"], headerColor, #ActorSkillsSortTable, Details.tooltip_spell_icon.file, unpack(Details.tooltip_spell_icon.coords)) if (is_maximized) then --highlight shift key @@ -3244,20 +3236,20 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_shift]], 1, 2, Details.tooltip_key_size_width, Details.tooltip_key_size_height, 0, 1, 0, 0.640625, Details.tooltip_key_overlay1) Details:AddTooltipHeaderStatusbar (r, g, b, barAlha) end - + local topAbility = ActorSkillsSortTable [1] and ActorSkillsSortTable [1][2] or 0.0001 - + if (#ActorSkillsSortTable > 0) then for i = 1, _math_min (tooltip_max_abilities, #ActorSkillsSortTable) do - + local SkillTable = ActorSkillsSortTable [i] - + local spellID = SkillTable [1] local totalDamage = SkillTable [2] local totalDPS = SkillTable [3] local petName = SkillTable [4] - - local nome_magia, _, icone_magia = _GetSpellInfo (spellID) + + local nome_magia, _, icone_magia = _GetSpellInfo(spellID) if (petName) then if (not nome_magia) then spellID = spellID or "spellId?" @@ -3266,8 +3258,8 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) nome_magia = nome_magia .. " (|cFFCCBBBB" .. petName .. "|r)" end end - - local percent = _cstr("%.1f", totalDamage/ActorDamage*100) + + local percent = format("%.1f", totalDamage/ActorDamage*100) if (string.len(percent) < 4) then percent = percent .. "0" end @@ -3275,9 +3267,9 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) if (instancia.sub_atributo == 1 or instancia.sub_atributo == 6) then GameCooltip:AddLine (nome_magia, FormatTooltipNumber (_, totalDamage) .." ("..percent.."%)") else - GameCooltip:AddLine (nome_magia, FormatTooltipNumber (_, _math_floor (totalDPS)) .." ("..percent.."%)") + GameCooltip:AddLine (nome_magia, FormatTooltipNumber (_, _math_floor(totalDPS)) .." ("..percent.."%)") end - + GameCooltip:AddIcon (icone_magia, nil, nil, icon_size.W + 4, icon_size.H + 4, icon_border.L, icon_border.R, icon_border.T, icon_border.B) Details:AddTooltipBackgroundStatusbar (false, totalDamage/topAbility*100) end @@ -3299,18 +3291,18 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) local spellName, _, spellIcon = _GetSpellInfo(spellId) if (spellName) then - GameCooltip:AddLine (spellName, FormatTooltipNumber (_, damageDone) .. " (" .. _math_floor (damageDone / self.total * 100) .. "%)") + GameCooltip:AddLine (spellName, FormatTooltipNumber (_, damageDone) .. " (" .. _math_floor(damageDone / self.total * 100) .. "%)") Details:AddTooltipBackgroundStatusbar (false, damageDone / self.total * 100) GameCooltip:AddIcon (spellIcon, 1, 1, icon_size.W, icon_size.H, 0.1, 0.9, 0.1, 0.9) end end end - end + end --> MOSTRA INIMIGOS local topEnemy = ActorTargetsSortTable [1] and ActorTargetsSortTable [1][2] or 0 if (instancia.sub_atributo == 1 or instancia.sub_atributo == 6) then - + --small blank space Details:AddTooltipSpellHeaderText ("", headerColor, 1, false, 0.1, 0.9, 0.1, 0.9, true) @@ -3322,7 +3314,7 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) max_targets = 99 is_maximized = true end - + if (is_maximized) then --highlight GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_ctrl]], 1, 2, Details.tooltip_key_size_width, Details.tooltip_key_size_height, 0, 1, 0, 0.640625, Details.tooltip_key_overlay2) @@ -3334,35 +3326,35 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) for i = 1, _math_min (max_targets, #ActorTargetsSortTable) do local este_inimigo = ActorTargetsSortTable [i] - GameCooltip:AddLine (este_inimigo[1], FormatTooltipNumber (_, este_inimigo[2]) .." (".._cstr("%.1f", este_inimigo[2]/ActorDamageWithPet*100).."%)") + GameCooltip:AddLine (este_inimigo[1], FormatTooltipNumber (_, este_inimigo[2]) .." ("..format("%.1f", este_inimigo[2]/ActorDamageWithPet*100).."%)") GameCooltip:AddIcon ([[Interface\PetBattles\PetBattle-StatIcons]], nil, nil, icon_size.W, icon_size.H, 0, 0.5, 0, 0.5, {.7, .7, .7, 1}, nil, true) Details:AddTooltipBackgroundStatusbar (false, este_inimigo[2] / topEnemy * 100) end end end - + --> PETS local meus_pets = self.pets if (#meus_pets > 0) then --> teve ajudantes - + local quantidade = {} --> armazena a quantidade de pets iguais local danos = {} --> armazena as habilidades local alvos = {} --> armazena os alvos local totais = {} --> armazena o dano total de cada objeto - + --small blank space Details:AddTooltipSpellHeaderText ("", headerColor, 1, false, 0.1, 0.9, 0.1, 0.9, true) for index, nome in _ipairs (meus_pets) do if (not quantidade [nome]) then quantidade [nome] = 1 - + local my_self = instancia.showing[class_type]:PegarCombatente (nil, nome) if (my_self) then local meu_total = my_self.total_without_pet local tabela = my_self.spells._ActorTable local meus_danos = {} - + --totais [nome] = my_self.total_without_pet local meu_tempo if (Details.time_type == 1 or not self.grupo) then @@ -3371,51 +3363,51 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) meu_tempo = my_self:GetCombatTime() end totais [#totais+1] = {nome, my_self.total_without_pet, my_self.total_without_pet/meu_tempo} - - for spellid, tabela in _pairs (tabela) do - local nome, rank, icone = _GetSpellInfo (spellid) + + for spellid, tabela in _pairs(tabela) do + local nome, rank, icone = _GetSpellInfo(spellid) _table_insert (meus_danos, {spellid, tabela.total, tabela.total/meu_total*100, {nome, rank, icone}}) end - _table_sort (meus_danos, Details.Sort2) + _table_sort(meus_danos, Details.Sort2) danos [nome] = meus_danos - + local meus_inimigos = {} tabela = my_self.targets - for target_name, amount in _pairs (tabela) do + for target_name, amount in _pairs(tabela) do _table_insert (meus_inimigos, {target_name, amount, amount/meu_total*100}) end - _table_sort (meus_inimigos,Details.Sort2) + _table_sort(meus_inimigos,Details.Sort2) alvos [nome] = meus_inimigos end - + else quantidade [nome] = quantidade [nome]+1 end end - + --GameTooltip:AddLine (" ") --GameCooltip:AddLine (" ") - + local _quantidade = 0 local added_logo = false - - _table_sort (totais, Details.Sort2) - + + _table_sort(totais, Details.Sort2) + local ismaximized = false if (keydown == "alt" or TooltipMaximizedMethod == 2 or TooltipMaximizedMethod == 5) then ismaximized = true end - + local topPet = totais [1] and totais [1][2] or 0 for index, _table in _ipairs (totais) do - + if (_table [2] > 0 and (index <= Details.tooltip.tooltip_max_pets or ismaximized)) then - + if (not added_logo) then added_logo = true - + Details:AddTooltipSpellHeaderText (Loc ["STRING_PETS"], headerColor, #totais, [[Interface\COMMON\friendship-heart]], 0.21875, 0.78125, 0.09375, 0.6875) - + if (ismaximized) then GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_alt]], 1, 2, Details.tooltip_key_size_width, Details.tooltip_key_size_height, 0, 1, 0, 0.640625, Details.tooltip_key_overlay2) Details:AddTooltipHeaderStatusbar (r, g, b, 1) @@ -3425,22 +3417,22 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) end end - + local n = _table [1]:gsub (("%s%<.*"), "") if (instancia.sub_atributo == 1) then - GameCooltip:AddLine (n, FormatTooltipNumber (_, _table [2]) .. " (" .. _math_floor (_table [2]/self.total*100) .. "%)") + GameCooltip:AddLine (n, FormatTooltipNumber (_, _table [2]) .. " (" .. _math_floor(_table [2]/self.total*100) .. "%)") else - GameCooltip:AddLine (n, FormatTooltipNumber (_, _math_floor (_table [3])) .. " (" .. _math_floor (_table [2]/self.total*100) .. "%)") + GameCooltip:AddLine (n, FormatTooltipNumber (_, _math_floor(_table [3])) .. " (" .. _math_floor(_table [2]/self.total*100) .. "%)") end - + Details:AddTooltipBackgroundStatusbar (false, _table [2] / topPet * 100) - + GameCooltip:AddIcon ([[Interface\AddOns\Details\images\classes_small]], 1, 1, icon_size.W, icon_size.H, 0.25, 0.49609375, 0.75, 1) end end - + end - + --> ~Phases local segment = instancia:GetShowingCombat() if (segment and self.grupo) then @@ -3448,25 +3440,25 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) local phasesInfo = segment:GetPhases() if (bossInfo and phasesInfo) then if (#phasesInfo > 1) then - + --small blank space Details:AddTooltipSpellHeaderText ("", headerColor, 1, false, 0.1, 0.9, 0.1, 0.9, true) Details:AddTooltipSpellHeaderText ("Damage by Encounter Phase", headerColor, 1, [[Interface\Garrison\orderhall-missions-mechanic8]], 11/64, 53/64, 11/64, 53/64) --localize-me Details:AddTooltipHeaderStatusbar (r, g, b, barAlha) - + local playerPhases = {} local totalDamage = 0 - - for phase, playersTable in pairs (phasesInfo.damage) do --each phase - + + for phase, playersTable in pairs(phasesInfo.damage) do --each phase + local allPlayers = {} --all players for this phase - for playerName, amount in pairs (playersTable) do + for playerName, amount in pairs(playersTable) do tinsert (allPlayers, {playerName, amount}) totalDamage = totalDamage + amount end table.sort (allPlayers, function(a, b) return a[2] > b[2] end) - + local myRank = 0 for i = 1, #allPlayers do if (allPlayers [i] [1] == self.nome) then @@ -3474,15 +3466,15 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) break end end - + tinsert (playerPhases, {phase, playersTable [self.nome] or 0, myRank, (playersTable [self.nome] or 0) / totalDamage * 100}) end - + table.sort (playerPhases, function(a, b) return a[1] < b[1] end) - + for i = 1, #playerPhases do --[1] Phase Number [2] Amount Done [3] Rank [4] Percent - GameCooltip:AddLine ("|cFFF0F0F0Phase|r " .. playerPhases [i][1], FormatTooltipNumber (_, playerPhases [i][2]) .. " (|cFFFFFF00#" .. playerPhases [i][3] .. "|r, " .. _cstr ("%.1f", playerPhases [i][4]) .. "%)") + GameCooltip:AddLine ("|cFFF0F0F0Phase|r " .. playerPhases [i][1], FormatTooltipNumber (_, playerPhases [i][2]) .. " (|cFFFFFF00#" .. playerPhases [i][3] .. "|r, " .. format ("%.1f", playerPhases [i][4]) .. "%)") GameCooltip:AddIcon ([[Interface\Garrison\orderhall-missions-mechanic9]], 1, 1, 14, 14, 11/64, 53/64, 11/64, 53/64) Details:AddTooltipBackgroundStatusbar() end @@ -3493,18 +3485,18 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) return true end -local on_switch_show_enemies = function (instance) +local on_switch_show_enemies = function(instance) instance:TrocaTabela (instance, true, 1, 6) return true end -local on_switch_show_frags = function (instance) +local on_switch_show_frags = function(instance) instance:TrocaTabela (instance, true, 1, 5) return true end -local ENEMIES_format_name = function (player) if (player == 0) then return false end return Details:GetOnlyName (player.nome) end -local ENEMIES_format_amount = function (amount) if (amount <= 0) then return false end return Details:ToK (amount) .. " (" .. _cstr ("%.1f", amount / tooltip_temp_table.damage_total * 100) .. "%)" end +local ENEMIES_format_name = function(player) if (player == 0) then return false end return Details:GetOnlyName (player.nome) end +local ENEMIES_format_amount = function(amount) if (amount <= 0) then return false end return Details:ToK(amount) .. " (" .. format ("%.1f", amount / tooltip_temp_table.damage_total * 100) .. "%)" end function atributo_damage:ReportEnemyDamageTaken (actor, instance, ShiftKeyDown, ControlKeyDown, fromFrags) if (ShiftKeyDown) then @@ -3543,16 +3535,16 @@ function atributo_damage:ReportEnemyDamageTaken (actor, instance, ShiftKeyDown, return instance:TrocaTabela (instance.segmento, 5, #Details.custom) end - + local report_table = {"Details!: " .. actor.nome .. " - " .. Loc ["STRING_ATTRIBUTE_DAMAGE_TAKEN"]} - + Details:FormatReportLines (report_table, tooltip_temp_table, ENEMIES_format_name, ENEMIES_format_amount) return Details:Reportar (report_table, {_no_current = true, _no_inverse = true, _custom = true}) end -local FRAGS_format_name = function (player_name) return Details:GetOnlyName (player_name) end -local FRAGS_format_amount = function (amount) return Details:ToK (amount) .. " (" .. _cstr ("%.1f", amount / frags_tooltip_table.damage_total * 100) .. "%)" end +local FRAGS_format_name = function(player_name) return Details:GetOnlyName (player_name) end +local FRAGS_format_amount = function(amount) return Details:ToK(amount) .. " (" .. format ("%.1f", amount / frags_tooltip_table.damage_total * 100) .. "%)" end function atributo_damage:ReportSingleFragsLine (frag, instance, ShiftKeyDown, ControlKeyDown) @@ -3561,28 +3553,28 @@ function atributo_damage:ReportSingleFragsLine (frag, instance, ShiftKeyDown, Co end local report_table = {"Details!: " .. frag [1] .. " - " .. Loc ["STRING_ATTRIBUTE_DAMAGE_TAKEN"]} - + Details:FormatReportLines (report_table, frags_tooltip_table, FRAGS_format_name, FRAGS_format_amount) return Details:Reportar (report_table, {_no_current = true, _no_inverse = true, _custom = true}) end function atributo_damage:ToolTip_Enemies (instancia, numero, barra, keydown) - + local owner = self.owner if (owner and owner.classe) then - r, g, b = unpack (Details.class_colors [owner.classe]) + r, g, b = unpack(Details.class_colors [owner.classe]) else - r, g, b = unpack (Details.class_colors [self.classe]) + r, g, b = unpack(Details.class_colors [self.classe]) end - + local combat = instancia:GetShowingCombat() local enemy_name = self:name() - + --> enemy damage taken local i = 1 local damage_taken = 0 - for _, actor in _ipairs (combat[1]._ActorTable) do + for _, actor in _ipairs (combat[1]._ActorTable) do if (actor.grupo and actor.targets [self.nome]) then local t = tooltip_temp_table [i] if (not t) then @@ -3595,15 +3587,15 @@ function atributo_damage:ToolTip_Enemies (instancia, numero, barra, keydown) i = i + 1 end end - + for o = i, #tooltip_temp_table do local t = tooltip_temp_table [o] t[2] = 0 t[1] = 0 end - _table_sort (tooltip_temp_table, Details.Sort2) - + _table_sort(tooltip_temp_table, Details.Sort2) + -- enemy damage taken Details:AddTooltipSpellHeaderText (Loc ["STRING_DAMAGE_TAKEN_FROM"], headerColor, i-1, [[Interface\Buttons\UI-MicroStream-Red]], 0.1875, 0.8125, 0.15625, 0.78125) GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_shift]], 1, 2, Details.tooltip_key_size_width, Details.tooltip_key_size_height, 0, 1, 0, 0.640625, Details.tooltip_key_overlay2) @@ -3613,17 +3605,17 @@ function atributo_damage:ToolTip_Enemies (instancia, numero, barra, keydown) --> build the tooltip local top = (tooltip_temp_table [1] and tooltip_temp_table [1][2]) or 0 tooltip_temp_table.damage_total = damage_taken - + local lineHeight = Details.tooltip.line_height - + for o = 1, i-1 do local player = tooltip_temp_table [o][1] local total = tooltip_temp_table [o][2] local player_name = Details:GetOnlyName (player:name()) - - GameCooltip:AddLine (player_name .. " ", FormatTooltipNumber (_, total) .." (" .. _cstr ("%.1f", (total / damage_taken) * 100) .. "%)") - + + GameCooltip:AddLine (player_name .. " ", FormatTooltipNumber (_, total) .." (" .. format ("%.1f", (total / damage_taken) * 100) .. "%)") + local classe = player:class() if (not classe) then classe = "UNKNOW" @@ -3636,38 +3628,38 @@ function atributo_damage:ToolTip_Enemies (instancia, numero, barra, keydown) local texture, l, r, t, b = Details:GetSpecIcon (specID, false) GameCooltip:AddIcon (texture, 1, 1, lineHeight, lineHeight, l, r, t, b) else - GameCooltip:AddIcon (instancia.row_info.icon_file, nil, nil, lineHeight, lineHeight, _unpack (Details.class_coords [classe])) + GameCooltip:AddIcon (instancia.row_info.icon_file, nil, nil, lineHeight, lineHeight, unpack(Details.class_coords [classe])) end end - - local r, g, b = unpack (Details.class_colors [classe]) + + local r, g, b = unpack(Details.class_colors [classe]) GameCooltip:AddStatusBar (total/top*100, 1, r, g, b, 1, false, enemies_background) end - + GameCooltip:SetOption ("StatusBarTexture", "Interface\\AddOns\\Details\\images\\bar_serenity") - + --> damage done and heal GameCooltip:AddLine (" ") - GameCooltip:AddLine (Loc ["STRING_ATTRIBUTE_DAMAGE_ENEMIES_DONE"], FormatTooltipNumber (_, _math_floor (self.total))) + GameCooltip:AddLine (Loc ["STRING_ATTRIBUTE_DAMAGE_ENEMIES_DONE"], FormatTooltipNumber (_, _math_floor(self.total))) local half = 0.00048828125 GameCooltip:AddIcon (instancia:GetSkinTexture(), 1, 1, 14, 14, 0.005859375 + half, 0.025390625 - half, 0.3623046875, 0.3818359375) GameCooltip:AddStatusBar (0, 1, r, g, b, 1, false, enemies_background) - + local heal_actor = instancia.showing (2, self.nome) if (heal_actor) then - GameCooltip:AddLine (Loc ["STRING_ATTRIBUTE_HEAL_ENEMY"], FormatTooltipNumber (_, _math_floor (heal_actor.heal_enemy_amt))) + GameCooltip:AddLine (Loc ["STRING_ATTRIBUTE_HEAL_ENEMY"], FormatTooltipNumber (_, _math_floor(heal_actor.heal_enemy_amt))) else GameCooltip:AddLine (Loc ["STRING_ATTRIBUTE_HEAL_ENEMY"], 0) end GameCooltip:AddIcon (instancia:GetSkinTexture(), 1, 1, 14, 14, 0.037109375 + half, 0.056640625 - half, 0.3623046875, 0.3818359375) GameCooltip:AddStatusBar (0, 1, r, g, b, 1, false, enemies_background) - + GameCooltip:AddLine (" ") Details:AddTooltipReportLineText() - + GameCooltip:SetOption ("YSpacingMod", 0) - + return true end @@ -3676,43 +3668,43 @@ function atributo_damage:ToolTip_DamageTaken (instancia, numero, barra, keydown) local owner = self.owner if (owner and owner.classe) then - r, g, b = unpack (Details.class_colors [owner.classe]) + r, g, b = unpack(Details.class_colors [owner.classe]) else - r, g, b = unpack (Details.class_colors [self.classe]) + r, g, b = unpack(Details.class_colors [self.classe]) end local agressores = self.damage_from local damage_taken = self.damage_taken - + local tabela_do_combate = instancia.showing local showing = tabela_do_combate [class_type] --> o que esta sendo mostrado -> [1] - dano [2] - cura --> pega o container com ._NameIndexTable ._ActorTable - + local meus_agressores = {} if (instancia.sub_atributo == 6) then - for _, actor in _ipairs (showing._ActorTable) do + for _, actor in _ipairs (showing._ActorTable) do if (actor.grupo and actor.targets [self.nome]) then meus_agressores [#meus_agressores+1] = {actor.nome, actor.targets [self.nome], actor.classe, actor} end end else - + --> aggressors - for nome, _ in _pairs (agressores) do --who damaged the player + for nome, _ in _pairs(agressores) do --who damaged the player --get the aggressor local este_agressor = showing._ActorTable [showing._NameIndexTable [nome]] if (este_agressor) then --> checagem por causa do total e do garbage collector que n�o limpa os nomes que deram dano local name = nome local table_added local damage_amount = este_agressor.targets [self.nome] - + if (damage_amount) then if (este_agressor:IsPlayer() or este_agressor:IsNeutralOrEnemy()) then table_added = {name, damage_amount, este_agressor.classe, este_agressor} meus_agressores [#meus_agressores+1] = table_added end end - + --special cases - Monk stagger if (nome == self.nome and self.classe == "MONK") then local ff = este_agressor.friendlyfire [nome] @@ -3732,13 +3724,13 @@ function atributo_damage:ToolTip_DamageTaken (instancia, numero, barra, keydown) end - _table_sort (meus_agressores, Details.Sort2) - + _table_sort(meus_agressores, Details.Sort2) + local max = #meus_agressores if (max > 10) then max = 10 end - + local ismaximized = false if (keydown == "shift" or TooltipMaximizedMethod == 2 or TooltipMaximizedMethod == 3 or instancia.sub_atributo == 6 or Details.damage_taken_everything) then max = #meus_agressores @@ -3766,86 +3758,86 @@ function atributo_damage:ToolTip_DamageTaken (instancia, numero, barra, keydown) else Details:AddTooltipHeaderStatusbar (r, g, b, barAlha) end - end - + end + local icon_size = Details.tooltip.icon_size local icon_border = Details.tooltip.icon_border_texcoord - + for i = 1, max do local aggressor = meus_agressores[i][4] - + --only shows damage from enemies or from the player it self --the player it self can only be placed on the list by the iteration above --the iteration doesnt check friendly fire for all actors, only a few cases like Monk Stagger - + if (aggressor:IsNeutralOrEnemy() or aggressor.nome == self.nome) then - + local all_spells = {} - - for spellid, spell in _pairs (aggressor.spells._ActorTable) do + + for spellid, spell in _pairs(aggressor.spells._ActorTable) do local on_target = spell.targets [self.nome] if (on_target) then tinsert (all_spells, {spellid, on_target, aggressor.nome}) end end - + --friendly fire local friendlyFire = aggressor.friendlyfire [self.nome] if (friendlyFire) then - for spellid, amount in _pairs (friendlyFire.spells) do + for spellid, amount in _pairs(friendlyFire.spells) do tinsert (all_spells, {spellid, amount, aggressor.nome}) end end - + for _, spell in _ipairs (all_spells) do - local spellname, _, spellicon = _GetSpellInfo (spell [1]) - GameCooltip:AddLine (spellname .. " (|cFFFFFF00" .. spell [3] .. "|r)", FormatTooltipNumber (_, spell [2]).." (" .. _cstr ("%.1f", (spell [2] / damage_taken) * 100).."%)") + local spellname, _, spellicon = _GetSpellInfo(spell [1]) + GameCooltip:AddLine (spellname .. " (|cFFFFFF00" .. spell [3] .. "|r)", FormatTooltipNumber (_, spell [2]).." (" .. format ("%.1f", (spell [2] / damage_taken) * 100).."%)") GameCooltip:AddIcon (spellicon, 1, 1, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) Details:AddTooltipBackgroundStatusbar() end - + else local aggressorName = Details:GetOnlyName (meus_agressores[i][1]) if (ismaximized and meus_agressores[i][1]:find (Details.playername)) then - GameCooltip:AddLine (aggressorName, FormatTooltipNumber (_, meus_agressores[i][2]).." (".._cstr("%.1f", (meus_agressores[i][2]/damage_taken) * 100).."%)", nil, "yellow") + GameCooltip:AddLine (aggressorName, FormatTooltipNumber (_, meus_agressores[i][2]).." ("..format("%.1f", (meus_agressores[i][2]/damage_taken) * 100).."%)", nil, "yellow") else - GameCooltip:AddLine (aggressorName, FormatTooltipNumber (_, meus_agressores[i][2]).." (".._cstr("%.1f", (meus_agressores[i][2]/damage_taken) * 100).."%)") + GameCooltip:AddLine (aggressorName, FormatTooltipNumber (_, meus_agressores[i][2]).." ("..format("%.1f", (meus_agressores[i][2]/damage_taken) * 100).."%)") end local classe = meus_agressores[i][3] - + if (not classe) then classe = "UNKNOW" end - + if (classe == "UNKNOW") then GameCooltip:AddIcon ("Interface\\LFGFRAME\\LFGROLE_BW", nil, nil, icon_size.W, icon_size.H, .25, .5, 0, 1) else - GameCooltip:AddIcon (instancia.row_info.icon_file, nil, nil, icon_size.W, icon_size.H, _unpack (Details.class_coords [classe])) + GameCooltip:AddIcon (instancia.row_info.icon_file, nil, nil, icon_size.W, icon_size.H, unpack(Details.class_coords [classe])) end Details:AddTooltipBackgroundStatusbar() end end if (instancia.sub_atributo == 6) then - + GameCooltip:AddLine (" ") - GameCooltip:AddLine (Loc ["STRING_ATTRIBUTE_DAMAGE_DONE"], FormatTooltipNumber (_, _math_floor (self.total))) + GameCooltip:AddLine (Loc ["STRING_ATTRIBUTE_DAMAGE_DONE"], FormatTooltipNumber (_, _math_floor(self.total))) local half = 0.00048828125 GameCooltip:AddIcon (instancia:GetSkinTexture(), 1, 1, icon_size.W, icon_size.H, 0.005859375 + half, 0.025390625 - half, 0.3623046875, 0.3818359375) Details:AddTooltipBackgroundStatusbar() - + local heal_actor = instancia.showing (2, self.nome) if (heal_actor) then - GameCooltip:AddLine (Loc ["STRING_ATTRIBUTE_HEAL_DONE"], FormatTooltipNumber (_, _math_floor (heal_actor.heal_enemy_amt))) + GameCooltip:AddLine (Loc ["STRING_ATTRIBUTE_HEAL_DONE"], FormatTooltipNumber (_, _math_floor(heal_actor.heal_enemy_amt))) else GameCooltip:AddLine (Loc ["STRING_ATTRIBUTE_HEAL_DONE"], 0) end GameCooltip:AddIcon (instancia:GetSkinTexture(), 1, 1, icon_size.W, icon_size.H, 0.037109375 + half, 0.056640625 - half, 0.3623046875, 0.3818359375) Details:AddTooltipBackgroundStatusbar() - + end - + return true end @@ -3854,9 +3846,9 @@ function atributo_damage:ToolTip_FriendlyFire (instancia, numero, barra, keydown local owner = self.owner if (owner and owner.classe) then - r, g, b = unpack (Details.class_colors [owner.classe]) + r, g, b = unpack(Details.class_colors [owner.classe]) else - r, g, b = unpack (Details.class_colors [self.classe]) + r, g, b = unpack(Details.class_colors [self.classe]) end local FriendlyFire = self.friendlyfire @@ -3869,24 +3861,24 @@ function atributo_damage:ToolTip_FriendlyFire (instancia, numero, barra, keydown local icon_size = Details.tooltip.icon_size local icon_border = Details.tooltip.icon_border_texcoord local lineHeight = Details.tooltip.line_height - + local DamagedPlayers = {} local Skills = {} - for target_name, ff_table in _pairs (FriendlyFire) do + for target_name, ff_table in _pairs(FriendlyFire) do local actor = combat (1, target_name) if (actor) then DamagedPlayers [#DamagedPlayers+1] = {target_name, ff_table.total, actor.classe} - for spellid, amount in _pairs (ff_table.spells) do + for spellid, amount in _pairs(ff_table.spells) do Skills [spellid] = (Skills [spellid] or 0) + amount end end end - - _table_sort (DamagedPlayers, Details.Sort2) - Details:AddTooltipSpellHeaderText (Loc ["STRING_TARGETS"], headerColor, #DamagedPlayers, Details.tooltip_target_icon.file, unpack (Details.tooltip_target_icon.coords)) - + _table_sort(DamagedPlayers, Details.Sort2) + + Details:AddTooltipSpellHeaderText (Loc ["STRING_TARGETS"], headerColor, #DamagedPlayers, Details.tooltip_target_icon.file, unpack(Details.tooltip_target_icon.coords)) + local ismaximized = false if (keydown == "shift" or TooltipMaximizedMethod == 2 or TooltipMaximizedMethod == 3) then GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_shift]], 1, 2, Details.tooltip_key_size_width, Details.tooltip_key_size_height, 0, 1, 0, 0.640625, Details.tooltip_key_overlay2) @@ -3896,38 +3888,38 @@ function atributo_damage:ToolTip_FriendlyFire (instancia, numero, barra, keydown GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_shift]], 1, 2, Details.tooltip_key_size_width, Details.tooltip_key_size_height, 0, 1, 0, 0.640625, Details.tooltip_key_overlay1) Details:AddTooltipHeaderStatusbar (r, g, b, barAlha) end - + local max_abilities = Details.tooltip.tooltip_max_abilities if (ismaximized) then max_abilities = 99 end - + for i = 1, _math_min (max_abilities, #DamagedPlayers) do local classe = DamagedPlayers[i][3] if (not classe) then classe = "UNKNOW" end - GameCooltip:AddLine (Details:GetOnlyName (DamagedPlayers[i][1]), FormatTooltipNumber (_, DamagedPlayers[i][2]).." (".._cstr("%.1f", DamagedPlayers[i][2]/FriendlyFireTotal*100).."%)") + GameCooltip:AddLine (Details:GetOnlyName (DamagedPlayers[i][1]), FormatTooltipNumber (_, DamagedPlayers[i][2]).." ("..format("%.1f", DamagedPlayers[i][2]/FriendlyFireTotal*100).."%)") GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\espadas", nil, nil, lineHeight, lineHeight) Details:AddTooltipBackgroundStatusbar() - + if (classe == "UNKNOW") then - GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small", nil, nil, lineHeight, lineHeight, _unpack (Details.class_coords ["UNKNOW"])) + GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small", nil, nil, lineHeight, lineHeight, unpack(Details.class_coords ["UNKNOW"])) else local specID = Details:GetSpec (DamagedPlayers[i][1]) if (specID) then local texture, l, r, t, b = Details:GetSpecIcon (specID, false) GameCooltip:AddIcon (texture, 1, 1, lineHeight, lineHeight, l, r, t, b) else - GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small", nil, nil, lineHeight, lineHeight, _unpack (Details.class_coords [classe])) + GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small", nil, nil, lineHeight, lineHeight, unpack(Details.class_coords [classe])) end end - + end - - Details:AddTooltipSpellHeaderText (Loc ["STRING_SPELLS"], headerColor, 1, Details.tooltip_spell_icon.file, unpack (Details.tooltip_spell_icon.coords)) - + + Details:AddTooltipSpellHeaderText (Loc ["STRING_SPELLS"], headerColor, 1, Details.tooltip_spell_icon.file, unpack(Details.tooltip_spell_icon.coords)) + local ismaximized = false if (keydown == "ctrl" or TooltipMaximizedMethod == 2 or TooltipMaximizedMethod == 4) then GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_ctrl]], 1, 2, Details.tooltip_key_size_width, Details.tooltip_key_size_height, 0, 1, 0, 0.640625, Details.tooltip_key_overlay2) @@ -3937,26 +3929,26 @@ function atributo_damage:ToolTip_FriendlyFire (instancia, numero, barra, keydown GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_ctrl]], 1, 2, Details.tooltip_key_size_width, Details.tooltip_key_size_height, 0, 1, 0, 0.640625, Details.tooltip_key_overlay1) Details:AddTooltipHeaderStatusbar (r, g, b, barAlha) end - + local max_abilities2 = Details.tooltip.tooltip_max_abilities if (ismaximized) then max_abilities2 = 99 end - + --spells usadas no friendly fire local SpellsInOrder = {} - for spellID, amount in _pairs (Skills) do + for spellID, amount in _pairs(Skills) do SpellsInOrder [#SpellsInOrder+1] = {spellID, amount} end - _table_sort (SpellsInOrder, Details.Sort2) - + _table_sort(SpellsInOrder, Details.Sort2) + for i = 1, _math_min (max_abilities2, #SpellsInOrder) do - local nome, _, icone = _GetSpellInfo (SpellsInOrder[i][1]) - GameCooltip:AddLine (nome, FormatTooltipNumber (_, SpellsInOrder[i][2]).." (".._cstr("%.1f", SpellsInOrder[i][2]/FriendlyFireTotal*100).."%)") + local nome, _, icone = _GetSpellInfo(SpellsInOrder[i][1]) + GameCooltip:AddLine (nome, FormatTooltipNumber (_, SpellsInOrder[i][2]).." ("..format("%.1f", SpellsInOrder[i][2]/FriendlyFireTotal*100).."%)") GameCooltip:AddIcon (icone, nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) Details:AddTooltipBackgroundStatusbar() - end - + end + return true end @@ -3984,7 +3976,7 @@ function atributo_damage:MontaDetalhes (spellid, barra, instancia) elseif (info.sub_atributo == 4) then return self:MontaDetalhesFriendlyFire (spellid, barra, instancia) elseif (info.sub_atributo == 6) then - if (_bit_band (self.flag_original, 0x00000400) ~= 0) then --� um jogador + if (bitBand(self.flag_original, 0x00000400) ~= 0) then --� um jogador return self:MontaDetalhesDamageDone (spellid, barra, instancia) end return self:MontaDetalhesEnemy (spellid, barra, instancia) @@ -4001,31 +3993,31 @@ function atributo_damage:MontaInfoFriendlyFire() local barras = info.barras1 local barras2 = info.barras2 local barras3 = info.barras3 - + local FriendlyFireTotal = self.friendlyfire_total - + local DamagedPlayers = {} local Skills = {} - - for target_name, ff_table in _pairs (self.friendlyfire) do - + + for target_name, ff_table in _pairs(self.friendlyfire) do + local actor = combat (1, target_name) if (actor) then _table_insert (DamagedPlayers, {target_name, ff_table.total, ff_table.total / FriendlyFireTotal * 100, actor.classe}) - - for spellid, amount in _pairs (ff_table.spells) do + + for spellid, amount in _pairs(ff_table.spells) do Skills [spellid] = (Skills [spellid] or 0) + amount end end end - _table_sort (DamagedPlayers, Details.Sort2) - + _table_sort(DamagedPlayers, Details.Sort2) + local amt = #DamagedPlayers gump:JI_AtualizaContainerBarras (amt) - + local FirstPlaceDamage = DamagedPlayers [1] and DamagedPlayers [1][2] or 0 - + for index, tabela in _ipairs (DamagedPlayers) do local barra = barras [index] @@ -4034,7 +4026,7 @@ function atributo_damage:MontaInfoFriendlyFire() barra.textura:SetStatusBarColor (1, 1, 1, 1) barra.on_focus = false end - + if (not info.mostrando_mouse_over) then if (tabela[1] == self.detalhes) then --> tabela [1] = NOME = NOME que esta na caixa da direita if (not barra.on_focus) then --> se a barra n�o tiver no foco @@ -4052,32 +4044,32 @@ function atributo_damage:MontaInfoFriendlyFire() end end end - + if (index == 1) then - barra.textura:SetValue (100) + barra.textura:SetValue(100) else - barra.textura:SetValue (tabela[2]/FirstPlaceDamage*100) + barra.textura:SetValue(tabela[2]/FirstPlaceDamage*100) end - - barra.lineText1:SetText (index .. instancia.divisores.colocacao .. Details:GetOnlyName (tabela[1])) --seta o texto da esqueda - barra.lineText4:SetText (Details:comma_value (tabela[2]) .. " (" .. _cstr ("%.1f", tabela[3]) .."%)") --seta o texto da direita - + + barra.lineText1:SetText(index .. instancia.divisores.colocacao .. Details:GetOnlyName (tabela[1])) --seta o texto da esqueda + barra.lineText4:SetText(Details:comma_value (tabela[2]) .. " (" .. format ("%.1f", tabela[3]) .."%)") --seta o texto da direita + local classe = tabela[4] if (not classe) then classe = "MONSTER" end - - barra.icone:SetTexture (info.instancia.row_info.icon_file) - + + barra.icone:SetTexture(info.instancia.row_info.icon_file) + if (Details.class_coords [classe]) then - barra.icone:SetTexCoord (_unpack (Details.class_coords [classe])) + barra.icone:SetTexCoord(unpack(Details.class_coords [classe])) else - barra.icone:SetTexture ("") + barra.icone:SetTexture("") end local color = Details.class_colors [classe] if (color) then - barra.textura:SetStatusBarColor (_unpack (color)) + barra.textura:SetStatusBarColor (unpack(color)) else barra.textura:SetStatusBarColor (1, 1, 1) end @@ -4092,45 +4084,45 @@ function atributo_damage:MontaInfoFriendlyFire() end local SkillTable = {} - for spellid, amt in _pairs (Skills) do - local nome, _, icone = _GetSpellInfo (spellid) + for spellid, amt in _pairs(Skills) do + local nome, _, icone = _GetSpellInfo(spellid) SkillTable [#SkillTable+1] = {nome, amt, amt/FriendlyFireTotal*100, icone} end - _table_sort (SkillTable, Details.Sort2) - + _table_sort(SkillTable, Details.Sort2) + amt = #SkillTable if (amt < 1) then return end gump:JI_AtualizaContainerAlvos (amt) - + FirstPlaceDamage = SkillTable [1] and SkillTable [1][2] or 0 - + for index, tabela in _ipairs (SkillTable) do local barra = barras2 [index] - + if (not barra) then barra = gump:CriaNovaBarraInfo2 (instancia, index) barra.textura:SetStatusBarColor (1, 1, 1, 1) end - + if (index == 1) then - barra.textura:SetValue (100) + barra.textura:SetValue(100) else - barra.textura:SetValue (tabela[2]/FirstPlaceDamage*100) + barra.textura:SetValue(tabela[2]/FirstPlaceDamage*100) end - - barra.lineText1:SetText (index..instancia.divisores.colocacao..tabela[1]) --seta o texto da esqueda - barra.lineText4:SetText (Details:comma_value (tabela[2]) .." (" .._cstr("%.1f", tabela[3]) .. ")") --seta o texto da direita - barra.icone:SetTexture (tabela[4]) - + + barra.lineText1:SetText(index..instancia.divisores.colocacao..tabela[1]) --seta o texto da esqueda + barra.lineText4:SetText(Details:comma_value (tabela[2]) .." (" ..format("%.1f", tabela[3]) .. ")") --seta o texto da direita + barra.icone:SetTexture(tabela[4]) + barra.minha_tabela = nil --> desativa o tooltip - + barra:Show() end - + end ------ Damage Taken @@ -4141,11 +4133,11 @@ function atributo_damage:MontaInfoDamageTaken() local instancia = info.instancia local tabela_do_combate = instancia.showing local showing = tabela_do_combate [class_type] --> o que esta sendo mostrado -> [1] - dano [2] - cura --> pega o container com ._NameIndexTable ._ActorTable - local barras = info.barras1 + local barras = info.barras1 local meus_agressores = {} - - local este_agressor - for nome, _ in _pairs (agressores) do + + local este_agressor + for nome, _ in _pairs(agressores) do este_agressor = showing._ActorTable[showing._NameIndexTable[nome]] if (este_agressor) then local alvos = este_agressor.targets @@ -4157,14 +4149,14 @@ function atributo_damage:MontaInfoDamageTaken() end local amt = #meus_agressores - + if (amt < 1) then --> caso houve apenas friendly fire return true end - - --_table_sort (meus_agressores, function (a, b) return a[2] > b[2] end) - _table_sort (meus_agressores, Details.Sort2) - + + --_table_sort(meus_agressores, function(a, b) return a[2] > b[2] end) + _table_sort(meus_agressores, Details.Sort2) + gump:JI_AtualizaContainerBarras (amt) local max_ = meus_agressores [1] and meus_agressores [1][2] or 0 @@ -4177,75 +4169,75 @@ function atributo_damage:MontaInfoDamageTaken() end self:FocusLock (barra, tabela[1]) - + local texCoords = Details.class_coords [tabela[4]] if (not texCoords) then texCoords = Details.class_coords ["UNKNOW"] end - - local formated_value = SelectedToKFunction (_, _math_floor (tabela[2])) + + local formated_value = SelectedToKFunction(_, _math_floor(tabela[2])) self:UpdadeInfoBar (barra, index, tabela[1], tabela[1], tabela[2], formated_value, max_, tabela[3], "Interface\\AddOns\\Details\\images\\classes_small_alpha", true, texCoords, nil, tabela[4]) end - + end --[[exported]] function Details:UpdadeInfoBar (row, index, spellid, name, value, value_formated, max, percent, icon, detalhes, texCoords, spellschool, class) --> seta o tamanho da barra if (index == 1) then - row.textura:SetValue (100) + row.textura:SetValue(100) else max = math.max(max, 0.001) - row.textura:SetValue (value/max*100) + row.textura:SetValue(value/max*100) end - + if (type (index) == "number") then if (debugmode) then - row.lineText1:SetText (index .. ". " .. name .. " (" .. spellid .. ")") + row.lineText1:SetText(index .. ". " .. name .. " (" .. spellid .. ")") else - row.lineText1:SetText (index .. ". " .. name) + row.lineText1:SetText(index .. ". " .. name) end else - row.lineText1:SetText (name) + row.lineText1:SetText(name) end - + row.lineText1.text = row.lineText1:GetText() - + if (value_formated) then - row.lineText4:SetText (value_formated .. " (" .. _cstr ("%.1f", percent) .."%)") + row.lineText4:SetText(value_formated .. " (" .. format ("%.1f", percent) .."%)") end - - row.lineText1:SetSize (row:GetWidth() - row.lineText4:GetStringWidth() - 40, 15) + + row.lineText1:SetSize(row:GetWidth() - row.lineText4:GetStringWidth() - 40, 15) --> seta o icone - if (icon) then - row.icone:SetTexture (icon) + if (icon) then + row.icone:SetTexture(icon) if (icon == "Interface\\AddOns\\Details\\images\\classes_small") then - row.icone:SetTexCoord (0.25, 0.49609375, 0.75, 1) + row.icone:SetTexCoord(0.25, 0.49609375, 0.75, 1) else - row.icone:SetTexCoord (0, 1, 0, 1) + row.icone:SetTexCoord(0, 1, 0, 1) end else - row.icone:SetTexture ("") + row.icone:SetTexture("") end - + if (not row.IconUpBorder) then row.IconUpBorder = CreateFrame ("frame", nil, row,"BackdropTemplate") row.IconUpBorder:SetAllPoints (row.icone) row.IconUpBorder:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1}) row.IconUpBorder:SetBackdropBorderColor (0, 0, 0, 0.75) end - + if (texCoords) then - row.icone:SetTexCoord (unpack (texCoords)) + row.icone:SetTexCoord(unpack(texCoords)) else local icon_border = Details.tooltip.icon_border_texcoord - row.icone:SetTexCoord (icon_border.L, icon_border.R, icon_border.T, icon_border.B) + row.icone:SetTexCoord(icon_border.L, icon_border.R, icon_border.T, icon_border.B) end - + row.minha_tabela = self row.show = spellid row:Show() --> mostra a barra - + if (spellschool) then local t = Details.spells_school [spellschool] if (t and t.decimals) then @@ -4253,11 +4245,11 @@ end else row.textura:SetStatusBarColor (1, 1, 1) end - + elseif (class) then local color = Details.class_colors [class] if (color) then - row.textura:SetStatusBarColor (_unpack (color)) + row.textura:SetStatusBarColor (unpack(color)) else row.textura:SetStatusBarColor (1, 1, 1) end @@ -4268,7 +4260,7 @@ end row.textura:SetStatusBarColor (1, 1, 1) end end - + if (detalhes and self.detalhes and self.detalhes == spellid and info.showing == index) then --self:MontaDetalhes (spellid, row) --> poderia deixar isso pro final e montar uma tail call?? self:MontaDetalhes (row.show, row, info.instancia) --> poderia deixar isso pro final e montar uma tail call?? @@ -4297,15 +4289,15 @@ end ------ Damage Done & Dps function atributo_damage:MontaInfoDamageDone() - + local barras = info.barras1 local instancia = info.instancia - local total = self.total_without_pet --> total de dano aplicado por este jogador - + local total = self.total_without_pet --> total de dano aplicado por este jogador + local ActorTotalDamage = self.total local ActorSkillsSortTable = {} local ActorSkillsContainer = self.spells._ActorTable - + --get time type local meu_tempo if (Details.time_type == 1 or not self.grupo) then @@ -4313,19 +4305,19 @@ function atributo_damage:MontaInfoDamageDone() elseif (Details.time_type == 2) then meu_tempo = info.instancia.showing:GetCombatTime() end - - for _spellid, _skill in _pairs (ActorSkillsContainer) do --> da foreach em cada spellid do container - local nome, _, icone = _GetSpellInfo (_spellid) + + for _spellid, _skill in _pairs(ActorSkillsContainer) do --> da foreach em cada spellid do container + local nome, _, icone = _GetSpellInfo(_spellid) if (nome) then _table_insert (ActorSkillsSortTable, {_spellid, _skill.total, _skill.total/ActorTotalDamage*100, nome, icone, nil, _skill.spellschool}) end end - + --damage rank local combat = instancia:GetShowingCombat() local diff = combat:GetDifficulty() local attribute, subattribute = instancia:GetDisplay() - + --> check if is a raid encounter and if is heroic or mythic if (diff and (diff == 15 or diff == 16)) then local db = Details.OpenStorage() @@ -4334,7 +4326,7 @@ function atributo_damage:MontaInfoDamageDone() if (bestRank) then --> discover which are the player position in the guild rank local playerTable, onEncounter, rankPosition = Details.storage:GetPlayerGuildRank (diff, combat:GetBossInfo().id, "damage", self.nome, true) - local text1 = self.nome .. " Guild Rank on " .. (combat:GetBossInfo().name or "") .. ": |cFFFFFF00" .. (rankPosition or "x") .. "|r Best Dps: |cFFFFFF00" .. Details:ToK2 ((bestRank[1] or 0) / encounterTable.elapsed) .. "|r (" .. encounterTable.date:gsub (".*%s", "") .. ")" + local text1 = self.nome .. " Guild Rank on " .. (combat:GetBossInfo().name or "") .. ": |cFFFFFF00" .. (rankPosition or "x") .. "|r Best Dps: |cFFFFFF00" .. Details:ToK2((bestRank[1] or 0) / encounterTable.elapsed) .. "|r (" .. encounterTable.date:gsub (".*%s", "") .. ")" info:SetStatusbarText (text1, 10, "gray") else info:SetStatusbarText() @@ -4345,7 +4337,7 @@ function atributo_damage:MontaInfoDamageDone() else info:SetStatusbarText() end - + --> add pets local ActorPets = self.pets --local class_color = RAID_CLASS_COLORS [self.classe] and RAID_CLASS_COLORS [self.classe].colorStr @@ -4353,10 +4345,10 @@ function atributo_damage:MontaInfoDamageDone() --local class_color = "FFDDDD44" for _, PetName in _ipairs (ActorPets) do local PetActor = instancia.showing (class_type, PetName) - if (PetActor) then + if (PetActor) then local PetSkillsContainer = PetActor.spells._ActorTable - for _spellid, _skill in _pairs (PetSkillsContainer) do --> da foreach em cada spellid do container - local nome, _, icone = _GetSpellInfo (_spellid) + for _spellid, _skill in _pairs(PetSkillsContainer) do --> da foreach em cada spellid do container + local nome, _, icone = _GetSpellInfo(_spellid) --_table_insert (ActorSkillsSortTable, {_spellid, _skill.total, _skill.total/ActorTotalDamage*100, nome .. " |TInterface\\AddOns\\Details\\images\\classes_small_alpha:12:12:0:0:128:128:33:64:96:128|t|c" .. class_color .. PetName:gsub ((" <.*"), "") .. "|r", icone, PetActor, _skill.spellschool}) if (nome) then _table_insert (ActorSkillsSortTable, {_spellid, _skill.total, _skill.total/ActorTotalDamage*100, nome .. " (|c" .. class_color .. PetName:gsub ((" <.*"), "") .. "|r)", icone, PetActor, _skill.spellschool}) @@ -4364,15 +4356,15 @@ function atributo_damage:MontaInfoDamageDone() end end end - - _table_sort (ActorSkillsSortTable, Details.Sort2) - + + _table_sort(ActorSkillsSortTable, Details.Sort2) + gump:JI_AtualizaContainerBarras (#ActorSkillsSortTable + 1) - + local max_ = ActorSkillsSortTable[1] and ActorSkillsSortTable[1][2] or 0 --> dano que a primeiro magia vez - + local barra - + --aura bar if (false) then --> disabled for now barra = barras [1] @@ -4382,10 +4374,10 @@ function atributo_damage:MontaInfoDamageDone() self:UpdadeInfoBar (barra, "", -51, "Auras", max_, false, max_, 100, [[Interface\BUTTONS\UI-GroupLoot-DE-Up]], true, nil, nil) barra.textura:SetStatusBarColor (Details.gump:ParseColors ("purple")) end - + --spell bars for index, tabela in _ipairs (ActorSkillsSortTable) do - + --index = index + 1 --with the aura bar index = index barra = barras [index] @@ -4396,30 +4388,30 @@ function atributo_damage:MontaInfoDamageDone() barra.other_actor = tabela [6] local name = tabela[4] - + if (info.sub_atributo == 2) then - local formated_value = SelectedToKFunction (_, _math_floor (tabela[2]/meu_tempo)) + local formated_value = SelectedToKFunction(_, _math_floor(tabela[2]/meu_tempo)) self:UpdadeInfoBar (barra, index, tabela[1], name, tabela[2], formated_value, max_, tabela[3], tabela[5], true, nil, tabela [7]) else - local formated_value = SelectedToKFunction (_, _math_floor (tabela[2])) + local formated_value = SelectedToKFunction(_, _math_floor(tabela[2])) self:UpdadeInfoBar (barra, index, tabela[1], name, tabela[2], formated_value, max_, tabela[3], tabela[5], true, nil, tabela [7]) end - + self:FocusLock (barra, tabela[1]) end - + --> TOP INIMIGOS if (instancia.sub_atributo == 6) then - + local damage_taken = self.damage_taken local agressores = self.damage_from local tabela_do_combate = instancia.showing local showing = tabela_do_combate [class_type] --> o que esta sendo mostrado -> [1] - dano [2] - cura --> pega o container com ._NameIndexTable ._ActorTable local barras = info.barras2 local meus_agressores = {} - - local este_agressor - for nome, _ in _pairs (agressores) do + + local este_agressor + for nome, _ in _pairs(agressores) do este_agressor = showing._ActorTable[showing._NameIndexTable[nome]] if (este_agressor) then local este_alvo = este_agressor.targets [self.nome] @@ -4430,18 +4422,18 @@ function atributo_damage:MontaInfoDamageDone() end local amt = #meus_agressores - + if (amt < 1) then --> caso houve apenas friendly fire return true end - + gump:JI_AtualizaContainerAlvos (amt) - - --_table_sort (meus_agressores, function (a, b) return a[2] > b[2] end) - _table_sort (meus_agressores, Details.Sort2) - + + --_table_sort(meus_agressores, function(a, b) return a[2] > b[2] end) + _table_sort(meus_agressores, Details.Sort2) + local max_ = meus_agressores[1] and meus_agressores[1][2] or 0 --> dano que a primeiro magia vez - + local barra for index, tabela in _ipairs (meus_agressores) do barra = barras [index] @@ -4450,36 +4442,36 @@ function atributo_damage:MontaInfoDamageDone() barra = gump:CriaNovaBarraInfo2 (instancia, index) barra.textura:SetStatusBarColor (1, 1, 1, 1) --> isso aqui � a parte da sele��o e descele��o end - + if (index == 1) then - barra.textura:SetValue (100) + barra.textura:SetValue(100) else - barra.textura:SetValue (tabela[2]/max_*100) + barra.textura:SetValue(tabela[2]/max_*100) end - barra.lineText1:SetText (index .. ". " .. Details:GetOnlyName (tabela[1])) --seta o texto da esqueda - barra.lineText4:SetText (Details:comma_value (tabela[2]) .. " (" .. _cstr ("%.1f", tabela[3]) .. "%)") --seta o texto da direita - - barra.icone:SetTexture ([[Interface\AddOns\Details\images\classes_small_alpha]]) --CLASSE - + barra.lineText1:SetText(index .. ". " .. Details:GetOnlyName (tabela[1])) --seta o texto da esqueda + barra.lineText4:SetText(Details:comma_value (tabela[2]) .. " (" .. format ("%.1f", tabela[3]) .. "%)") --seta o texto da direita + + barra.icone:SetTexture([[Interface\AddOns\Details\images\classes_small_alpha]]) --CLASSE + local texCoords = Details.class_coords [tabela[4]] if (not texCoords) then texCoords = Details.class_coords ["UNKNOW"] end - barra.icone:SetTexCoord (_unpack (texCoords)) - + barra.icone:SetTexCoord(unpack(texCoords)) + local color = Details.class_colors [tabela[4]] if (color) then - barra.textura:SetStatusBarColor (_unpack (color)) + barra.textura:SetStatusBarColor (unpack(color)) else barra.textura:SetStatusBarColor (1, 1, 1) end - + Details:name_space_info (barra) - + if (barra.mouse_over) then --> atualizar o tooltip if (barra.isAlvo) then - GameTooltip:Hide() + GameTooltip:Hide() GameTooltip:SetOwner (barra, "ANCHOR_TOPRIGHT") if (not barra.minha_tabela:MontaTooltipDamageTaken (barra, index)) then return @@ -4487,10 +4479,10 @@ function atributo_damage:MontaInfoDamageDone() GameTooltip:Show() end end - + barra.minha_tabela = self --> grava o jogador na tabela barra.nome_inimigo = tabela [1] --> salva o nome do inimigo na barra --> isso � necess�rio? - + -- no rank do spell id colocar o que? barra.spellid = "enemies" @@ -4498,64 +4490,64 @@ function atributo_damage:MontaInfoDamageDone() end else local meus_inimigos = {} - + --> my target container conteudo = self.targets - for target_name, amount in _pairs (conteudo) do + for target_name, amount in _pairs(conteudo) do _table_insert (meus_inimigos, {target_name, amount, amount/total*100}) end - + --> sort - _table_sort (meus_inimigos, Details.Sort2) - + _table_sort(meus_inimigos, Details.Sort2) + local amt_alvos = #meus_inimigos if (amt_alvos < 1) then return end - + gump:JI_AtualizaContainerAlvos (amt_alvos) - + local max_inimigos = meus_inimigos[1] and meus_inimigos[1][2] or 0 - + local barra for index, tabela in _ipairs (meus_inimigos) do - + barra = info.barras2 [index] - + if (not barra) then barra = gump:CriaNovaBarraInfo2 (instancia, index) barra.textura:SetStatusBarColor (1, 1, 1, 1) end - + if (index == 1) then - barra.textura:SetValue (100) + barra.textura:SetValue(100) else - barra.textura:SetValue (tabela[2]/max_inimigos*100) + barra.textura:SetValue(tabela[2]/max_inimigos*100) end - + local target_actor = instancia.showing (1, tabela[1]) if (target_actor) then - target_actor:SetClassIcon (barra.icone, instancia, target_actor.classe) + target_actor:SetClassIcon(barra.icone, instancia, target_actor.classe) else - barra.icone:SetTexture ([[Interface\AddOns\Details\images\classes_small_alpha]]) --CLASSE + barra.icone:SetTexture([[Interface\AddOns\Details\images\classes_small_alpha]]) --CLASSE local texCoords = Details.class_coords ["ENEMY"] - barra.icone:SetTexCoord (_unpack (texCoords)) + barra.icone:SetTexCoord(unpack(texCoords)) end - + barra.textura:SetStatusBarColor (1, 0.8, 0.8) barra.textura:SetStatusBarColor (1, 1, 1, 1) - - barra.lineText1:SetText (index .. ". " .. Details:GetOnlyName (tabela[1])) - + + barra.lineText1:SetText(index .. ". " .. Details:GetOnlyName (tabela[1])) + if (info.sub_atributo == 2) then - barra.lineText4:SetText (Details:comma_value ( _math_floor (tabela[2]/meu_tempo)) .. " (" .. _cstr ("%.1f", tabela[3]) .. "%)") + barra.lineText4:SetText(Details:comma_value ( _math_floor(tabela[2]/meu_tempo)) .. " (" .. format ("%.1f", tabela[3]) .. "%)") else - barra.lineText4:SetText (SelectedToKFunction (_, tabela[2]) .." (" .. _cstr ("%.1f", tabela[3]) .. "%)") + barra.lineText4:SetText(SelectedToKFunction(_, tabela[2]) .." (" .. format ("%.1f", tabela[3]) .. "%)") end - + if (barra.mouse_over) then --> atualizar o tooltip if (barra.isAlvo) then - --GameTooltip:Hide() + --GameTooltip:Hide() --GameTooltip:SetOwner (barra, "ANCHOR_TOPRIGHT") if (not barra.minha_tabela:MontaTooltipAlvos (barra, index, instancia)) then return @@ -4563,10 +4555,10 @@ function atributo_damage:MontaInfoDamageDone() --GameTooltip:Show() end end - + barra.minha_tabela = self --> grava o jogador na tabela barra.nome_inimigo = tabela [1] --> salva o nome do inimigo na barra --> isso � necess�rio? - + -- no rank do spell id colocar o que? barra.spellid = tabela[5] barra:Show() @@ -4578,13 +4570,13 @@ end ------ Detalhe Info Friendly Fire function atributo_damage:MontaDetalhesFriendlyFire (nome, barra) - for _, barra in _ipairs (info.barras3) do + for _, barra in _ipairs (info.barras3) do barra:Hide() end local barras = info.barras3 local instancia = info.instancia - + local tabela_do_combate = info.instancia.showing local showing = tabela_do_combate [class_type] --> o que esta sendo mostrado -> [1] - dano [2] - cura --> pega o container com ._NameIndexTable ._ActorTable @@ -4595,18 +4587,18 @@ function atributo_damage:MontaDetalhesFriendlyFire (nome, barra) return end local total = ff_table.total - + local minhas_magias = {} - for spellid, amount in _pairs (ff_table.spells) do --> da foreach em cada spellid do container - local nome, _, icone = _GetSpellInfo (spellid) + for spellid, amount in _pairs(ff_table.spells) do --> da foreach em cada spellid do container + local nome, _, icone = _GetSpellInfo(spellid) _table_insert (minhas_magias, {spellid, amount, amount / total * 100, nome, icone}) end - _table_sort (minhas_magias, Details.Sort2) + _table_sort(minhas_magias, Details.Sort2) local max_ = minhas_magias[1] and minhas_magias[1][2] or 0 --> dano que a primeiro magia vez - + local barra for index, tabela in _ipairs (minhas_magias) do barra = barras [index] @@ -4615,44 +4607,44 @@ function atributo_damage:MontaDetalhesFriendlyFire (nome, barra) barra = gump:CriaNovaBarraInfo3 (instancia, index) barra.textura:SetStatusBarColor (1, 1, 1, 1) --> isso aqui � a parte da sele��o e descele��o end - + if (index == 1) then - barra.textura:SetValue (100) + barra.textura:SetValue(100) else - barra.textura:SetValue (tabela[2]/max_*100) --> muito mais rapido... + barra.textura:SetValue(tabela[2]/max_*100) --> muito mais rapido... end - barra.lineText1:SetText (index..instancia.divisores.colocacao..tabela[4]) --seta o texto da esqueda - barra.lineText4:SetText (Details:comma_value (tabela[2]) .. " " .. instancia.divisores.abre .. _cstr ("%.1f", tabela[3]) .. "%" .. instancia.divisores.fecha) --seta o texto da direita - - barra.icone:SetTexture (tabela[5]) - barra.icone:SetTexCoord (0, 1, 0, 1) - + barra.lineText1:SetText(index..instancia.divisores.colocacao..tabela[4]) --seta o texto da esqueda + barra.lineText4:SetText(Details:comma_value (tabela[2]) .. " " .. instancia.divisores.abre .. format ("%.1f", tabela[3]) .. "%" .. instancia.divisores.fecha) --seta o texto da direita + + barra.icone:SetTexture(tabela[5]) + barra.icone:SetTexCoord(0, 1, 0, 1) + barra:Show() --> mostra a barra - - if (index == 15) then + + if (index == 15) then break end end - + end -- detalhes info enemies function atributo_damage:MontaDetalhesEnemy (spellid, barra) - - for _, barra in _ipairs (info.barras3) do + + for _, barra in _ipairs (info.barras3) do barra:Hide() end local container = info.instancia.showing[1] local barras = info.barras3 local instancia = info.instancia - + local other_actor = barra.other_actor if (other_actor) then self = other_actor end - + if (barra.lineText1:IsTruncated()) then Details:CooltipPreset (2) GameCooltip:SetOption ("FixedWidth", nil) @@ -4660,13 +4652,13 @@ function atributo_damage:MontaDetalhesEnemy (spellid, barra) GameCooltip:SetOwner (barra, "bottomleft", "topleft", 5, -10) GameCooltip:ShowCooltip() end - + local spell = self.spells:PegaHabilidade (spellid) - + local targets = spell.targets local target_pool = {} - - for target_name, amount in _pairs (targets) do + + for target_name, amount in _pairs(targets) do local classe local this_actor = info.instancia.showing (1, target_name) if (this_actor) then @@ -4677,11 +4669,11 @@ function atributo_damage:MontaDetalhesEnemy (spellid, barra) target_pool [#target_pool+1] = {target_name, amount, classe} end - - _table_sort (target_pool, Details.Sort2) - + + _table_sort(target_pool, Details.Sort2) + local max_ = target_pool [1] and target_pool [1][2] or 0 - + local barra for index, tabela in _ipairs (target_pool) do barra = barras [index] @@ -4690,88 +4682,88 @@ function atributo_damage:MontaDetalhesEnemy (spellid, barra) barra = gump:CriaNovaBarraInfo3 (instancia, index) barra.textura:SetStatusBarColor (1, 1, 1, 1) --> isso aqui � a parte da sele��o e descele��o end - + if (index == 1) then - barra.textura:SetValue (100) + barra.textura:SetValue(100) else - barra.textura:SetValue (tabela[2]/max_*100) --> muito mais rapido... + barra.textura:SetValue(tabela[2]/max_*100) --> muito mais rapido... end - barra.lineText1:SetText (index .. ". " .. Details:GetOnlyName (tabela [1])) --seta o texto da esqueda + barra.lineText1:SetText(index .. ". " .. Details:GetOnlyName (tabela [1])) --seta o texto da esqueda Details:name_space_info (barra) - + if (spell.total > 0) then - barra.lineText4:SetText (Details:comma_value (tabela[2]) .." (".. _cstr("%.1f", tabela[2] / spell.total * 100) .."%)") --seta o texto da direita + barra.lineText4:SetText(Details:comma_value (tabela[2]) .." (".. format("%.1f", tabela[2] / spell.total * 100) .."%)") --seta o texto da direita else - barra.lineText4:SetText (tabela[2] .." (0%)") --seta o texto da direita + barra.lineText4:SetText(tabela[2] .." (0%)") --seta o texto da direita end - + local texCoords = Details.class_coords [tabela[3]] if (not texCoords) then texCoords = Details.class_coords ["UNKNOW"] end - + local color = Details.class_colors [tabela[3]] if (color) then - barra.textura:SetStatusBarColor (_unpack (color)) + barra.textura:SetStatusBarColor (unpack(color)) else barra.textura:SetStatusBarColor (1, 1, 1, 1) end - - barra.icone:SetTexture ("Interface\\AddOns\\Details\\images\\classes_small_alpha") - barra.icone:SetTexCoord (unpack (texCoords)) + + barra.icone:SetTexture("Interface\\AddOns\\Details\\images\\classes_small_alpha") + barra.icone:SetTexCoord(unpack(texCoords)) barra:Show() --> mostra a barra - - if (index == 15) then + + if (index == 15) then break end end - + end ------ Detalhe Info Damage Taken function atributo_damage:MontaDetalhesDamageTaken (nome, barra) - for _, barra in _ipairs (info.barras3) do + for _, barra in _ipairs (info.barras3) do barra:Hide() end local barras = info.barras3 local instancia = info.instancia - + local tabela_do_combate = info.instancia.showing local showing = tabela_do_combate [class_type] --> o que esta sendo mostrado -> [1] - dano [2] - cura --> pega o container com ._NameIndexTable ._ActorTable local este_agressor = showing._ActorTable[showing._NameIndexTable[nome]] - - if (not este_agressor ) then + + if (not este_agressor ) then return end - + local conteudo = este_agressor.spells._ActorTable --> _pairs[] com os IDs das magias - + local actor = info.jogador.nome - + local total = este_agressor.targets [actor] or 0 local minhas_magias = {} - for spellid, tabela in _pairs (conteudo) do --> da foreach em cada spellid do container + for spellid, tabela in _pairs(conteudo) do --> da foreach em cada spellid do container local este_alvo = tabela.targets [actor] if (este_alvo) then --> esta magia deu dano no actor - local spell_nome, rank, icone = _GetSpellInfo (spellid) + local spell_nome, rank, icone = _GetSpellInfo(spellid) _table_insert (minhas_magias, {spellid, este_alvo, este_alvo/total*100, spell_nome, icone}) end end - _table_sort (minhas_magias, Details.Sort2) + _table_sort(minhas_magias, Details.Sort2) --local amt = #minhas_magias --gump:JI_AtualizaContainerBarras (amt) local max_ = minhas_magias[1] and minhas_magias[1][2] or 0 --> dano que a primeiro magia vez - + local barra for index, tabela in _ipairs (minhas_magias) do barra = barras [index] @@ -4780,28 +4772,28 @@ function atributo_damage:MontaDetalhesDamageTaken (nome, barra) barra = gump:CriaNovaBarraInfo3 (instancia, index) barra.textura:SetStatusBarColor (1, 1, 1, 1) --> isso aqui � a parte da sele��o e descele��o end - + if (index == 1) then - barra.textura:SetValue (100) + barra.textura:SetValue(100) else - barra.textura:SetValue (tabela[2]/max_*100) + barra.textura:SetValue(tabela[2]/max_*100) end - barra.lineText1:SetText (index .. "." .. tabela[4]) --seta o texto da esqueda + barra.lineText1:SetText(index .. "." .. tabela[4]) --seta o texto da esqueda Details:name_space_info (barra) - - barra.lineText4:SetText (Details:comma_value (tabela[2]) .." ".. instancia.divisores.abre .._cstr("%.1f", tabela[3]) .."%".. instancia.divisores.fecha) --seta o texto da direita - - barra.icone:SetTexture (tabela[5]) - barra.icone:SetTexCoord (0, 1, 0, 1) + + barra.lineText4:SetText(Details:comma_value (tabela[2]) .." ".. instancia.divisores.abre ..format("%.1f", tabela[3]) .."%".. instancia.divisores.fecha) --seta o texto da direita + + barra.icone:SetTexture(tabela[5]) + barra.icone:SetTexCoord(0, 1, 0, 1) barra:Show() --> mostra a barra - - if (index == 15) then + + if (index == 15) then break end end - + end ------ Detalhe Info Damage Done e Dps @@ -4818,16 +4810,16 @@ local t1, t2, t3, t4 = {}, {}, {}, {} local function FormatSpellString(str) return (string.gsub(str, "%d+", function(spellID) - local name, _, icon = GetSpellInfo (spellID); + local name, _, icon = GetSpellInfo(spellID); return string.format("|T%s:16|t", icon); end)); end -local MontaDetalhesBuffProcs = function (actor, row, instance) - +local MontaDetalhesBuffProcs = function(actor, row, instance) + instance = instance or info.instancia - + local spec = actor.spec if (spec) then local mainAuras = Details.important_auras [spec] @@ -4840,25 +4832,25 @@ local MontaDetalhesBuffProcs = function (actor, row, instance) local spellID = mainAuras [i] local spellObject = miscActor.buff_uptime_spells._ActorTable [spellID] if (spellObject) then - local spellName, spellIcon = GetSpellInfo (spellID) + local spellName, spellIcon = GetSpellInfo(spellID) local spellUptime = spellObject.uptime local spellApplies = spellObject.appliedamt local spellRefreshes = spellObject.refreshamt - + gump:SetaDetalheInfoTexto (i, 100, FormatSpellString ("" .. spellID .. " " .. spellName), "Activations: " .. spellApplies, " ", "Refreshes: " .. spellRefreshes, " ", "Uptime: " .. spellUptime .. "s") added = added + 1 end end - + for i = added + 1, 5 do gump:HidaDetalheInfo (i) end - + return end end end - + for i = 1, 5 do gump:HidaDetalheInfo (i) end @@ -4878,25 +4870,25 @@ function atributo_damage:MontaDetalhesDamageDone (spellid, barra, instancia) if (spellid == -51) then return MontaDetalhesBuffProcs (self, barra, instancia) end - + if (not esta_magia) then return end - - --> icone direito superior - local _, _, icone = _GetSpellInfo (spellid) - Details.playerDetailWindow.spell_icone:SetTexture (icone) + --> icone direito superior + local _, _, icone = _GetSpellInfo(spellid) + + Details.playerDetailWindow.spell_icone:SetTexture(icone) local total = self.total - + local meu_tempo if (Details.time_type == 1 or not self.grupo) then meu_tempo = self:Tempo() elseif (Details.time_type == 2) then meu_tempo = info.instancia.showing:GetCombatTime() end - + local total_hits = esta_magia.counter local index = 1 local data = data_table @@ -4912,7 +4904,7 @@ function atributo_damage:MontaDetalhesDamageDone (spellid, barra, instancia) if (total_hits > 0) then media = esta_magia.total/total_hits end - + local this_dps = nil if (esta_magia.counter > esta_magia.c_amt) then this_dps = Loc ["STRING_DPS"] .. ": " .. Details:comma_value (esta_magia.total/meu_tempo) @@ -4927,30 +4919,30 @@ function atributo_damage:MontaDetalhesDamageDone (spellid, barra, instancia) schooltext = t.formated end end - + local hits_string = "" .. total_hits local cast_string = Loc ["STRING_CAST"] .. ": " - + local misc_actor = info.instancia.showing (4, self:name()) if (misc_actor) then - + local uptime_spellid = esta_magia.id --if (uptime_spellid == 233490) then -- uptime_spellid = 233496 -- uptime_spellid = 233490 --end - + local debuff_uptime = misc_actor.debuff_uptime_spells and misc_actor.debuff_uptime_spells._ActorTable [uptime_spellid] and misc_actor.debuff_uptime_spells._ActorTable [uptime_spellid].uptime if (debuff_uptime) then - hits_string = hits_string .. " |cFFDDDD44(" .. _math_floor (debuff_uptime / info.instancia.showing:GetCombatTime() * 100) .. "% uptime)|r" + hits_string = hits_string .. " |cFFDDDD44(" .. _math_floor(debuff_uptime / info.instancia.showing:GetCombatTime() * 100) .. "% uptime)|r" end - + local spell_cast = misc_actor.spell_cast and misc_actor.spell_cast [spellid] - + if (not spell_cast and misc_actor.spell_cast) then - local spellname = GetSpellInfo (spellid) - for casted_spellid, amount in _pairs (misc_actor.spell_cast) do - local casted_spellname = GetSpellInfo (casted_spellid) + local spellname = GetSpellInfo(spellid) + for casted_spellid, amount in _pairs(misc_actor.spell_cast) do + local casted_spellname = GetSpellInfo(casted_spellid) if (casted_spellname == spellname) then spell_cast = amount .. " (|cFFFFFF00?|r)" end @@ -4961,15 +4953,15 @@ function atributo_damage:MontaDetalhesDamageDone (spellid, barra, instancia) end cast_string = cast_string .. spell_cast end - + gump:SetaDetalheInfoTexto ( index, 100, cast_string, - Loc ["STRING_DAMAGE"]..": "..Details:ToK (esta_magia.total), + Loc ["STRING_DAMAGE"]..": "..Details:ToK(esta_magia.total), schooltext, --offhand, - Loc ["STRING_AVERAGE"] .. ": " .. Details:comma_value (media), + Loc ["STRING_AVERAGE"] .. ": " .. Details:comma_value (media), this_dps, Loc ["STRING_HITS"]..": " .. hits_string) - + --> NORMAL local normal_hits = esta_magia.n_amt if (normal_hits > 0) then @@ -4982,7 +4974,7 @@ function atributo_damage:MontaDetalhesDamageDone (spellid, barra, instancia) normal_table.p = normal_hits/total_hits*100 data[#data+1] = t1 - + t1[1] = esta_magia.n_amt t1[2] = normal_table t1[3] = Loc ["STRING_NORMAL_HITS"] @@ -4990,12 +4982,12 @@ function atributo_damage:MontaDetalhesDamageDone (spellid, barra, instancia) t1[5] = Loc ["STRING_MAXIMUM_SHORT"] .. ": " .. Details:comma_value (esta_magia.n_max) t1[6] = Loc ["STRING_AVERAGE"] .. ": " .. Details:comma_value (media_normal) t1[7] = Loc ["STRING_DPS"] .. ": " .. Details:comma_value (normal_dmg/T) - t1[8] = normal_hits .. " [|cFFC0C0C0" .. _cstr ("%.1f", normal_hits/max(total_hits, 0.0001)*100) .. "%|r]" - + t1[8] = normal_hits .. " [|cFFC0C0C0" .. format ("%.1f", normal_hits/max(total_hits, 0.0001)*100) .. "%|r]" + end --> CRITICO - if (esta_magia.c_amt > 0) then + if (esta_magia.c_amt > 0) then local media_critico = esta_magia.c_dmg/esta_magia.c_amt local T = (meu_tempo*esta_magia.c_dmg)/esta_magia.total local P = media/max(media_critico, 0.0001)*100 @@ -5004,11 +4996,11 @@ function atributo_damage:MontaDetalhesDamageDone (spellid, barra, instancia) if (not crit_dps) then crit_dps = 0 end - + critical_table.p = esta_magia.c_amt/total_hits*100 - + data[#data+1] = t2 - + t2[1] = esta_magia.c_amt t2[2] = critical_table t2[3] = Loc ["STRING_CRITICAL_HITS"] @@ -5016,10 +5008,10 @@ function atributo_damage:MontaDetalhesDamageDone (spellid, barra, instancia) t2[5] = Loc ["STRING_MAXIMUM_SHORT"] .. ": " .. Details:comma_value (esta_magia.c_max) t2[6] = Loc ["STRING_AVERAGE"] .. ": " .. Details:comma_value (media_critico) t2[7] = Loc ["STRING_DPS"] .. ": " .. Details:comma_value (crit_dps) - t2[8] = esta_magia.c_amt .. " [|cFFC0C0C0" .. _cstr ("%.1f", esta_magia.c_amt/total_hits*100) .. "%|r]" + t2[8] = esta_magia.c_amt .. " [|cFFC0C0C0" .. format ("%.1f", esta_magia.c_amt/total_hits*100) .. "%|r]" end - + --> Outros erros: GLACING, resisted, blocked, absorbed local outros_desvios = esta_magia.g_amt + esta_magia.b_amt local parry = esta_magia ["PARRY"] or 0 @@ -5027,78 +5019,78 @@ function atributo_damage:MontaDetalhesDamageDone (spellid, barra, instancia) local erros = parry + dodge if (outros_desvios > 0 or erros > 0) then - + local porcentagem_defesas = (outros_desvios+erros) / total_hits * 100 data[#data+1] = t3 defenses_table.p = porcentagem_defesas - + t3[1] = outros_desvios+erros t3[2] = defenses_table t3[3] = Loc ["STRING_DEFENSES"] - t3[4] = Loc ["STRING_GLANCING"] .. ": " .. _math_floor (esta_magia.g_amt/esta_magia.counter*100) .. "%" + t3[4] = Loc ["STRING_GLANCING"] .. ": " .. _math_floor(esta_magia.g_amt/esta_magia.counter*100) .. "%" t3[5] = Loc ["STRING_PARRY"] .. ": " .. parry t3[6] = Loc ["STRING_DODGE"] .. ": " .. dodge - t3[7] = Loc ["STRING_BLOCKED"] .. ": " .. _math_floor (esta_magia.b_amt/esta_magia.counter*100) - t3[8] = (outros_desvios+erros) .. " / " .. _cstr ("%.1f", porcentagem_defesas) .. "%" + t3[7] = Loc ["STRING_BLOCKED"] .. ": " .. _math_floor(esta_magia.b_amt/esta_magia.counter*100) + t3[8] = (outros_desvios+erros) .. " / " .. format ("%.1f", porcentagem_defesas) .. "%" end --Details:BuildPlayerDetailsSpellChart() --DetailsPlayerDetailSmallChart.ShowChart (Details.playerDetailWindow.grupos_detalhes [5].bg, info.instancia.showing, info.instancia.showing.cleu_events, self.nome, false, spellid, 1, 2, 3, 4, 5, 6, 7, 8, 15) - + --> spell damage chart --events: 1 2 3 4 5 6 7 8 15 - - _table_sort (data, Details.Sort1) - + + _table_sort(data, Details.Sort1) + for index, tabela in _ipairs (data) do gump:SetaDetalheInfoTexto (index+1, tabela[2], tabela[3], tabela[4], tabela[5], tabela[6], tabela[7], tabela[8]) end - + for i = #data+2, 5 do gump:HidaDetalheInfo (i) end - + end function Details:BuildPlayerDetailsSpellChart() local playerDetailSmallChart = DetailsPlayerDetailSmallChart - + if (not playerDetailSmallChart) then - + playerDetailSmallChart = CreateFrame ("frame", "DetailsPlayerDetailSmallChart", info,"BackdropTemplate") DetailsFramework:ApplyStandardBackdrop (playerDetailSmallChart) playerDetailSmallChart.Lines = {} - + for i = 1, 200 do local texture = playerDetailSmallChart:CreateTexture (nil, "artwork") texture:SetColorTexture (1, 1, 1, 1) tinsert (playerDetailSmallChart.Lines, texture) end - + --Details.playerDetailWindow.grupos_detalhes [index] function playerDetailSmallChart.ShowChart (parent, combatObject, cleuData, playerName, targetName, spellId, ...) local tokenIdList = {} local eventList = {} - + --build the list of tokens for i = 1, select ("#", ... ) do local tokenId = select (i, ...) tokenIdList [tokenId] = true end - + --check which lines can be added local index = 1 local peakValue = 0 - + for i = 1, cleuData.n -1 do local event = cleuData [i] if (event [2]) then --index 2 = token local playerNameFilter = playerName and playerName == event [3] local targetNameFilter = targetName and targetName == event [4] local spellIdFilter = spellId and spellId == event [5] - + if (playerNameFilter or targetNameFilter or spellIdFilter) then eventList [index] = cleuData [i] if (peakValue < cleuData [i] [6]) then @@ -5112,22 +5104,22 @@ function Details:BuildPlayerDetailsSpellChart() --200 lines, adjust the mini chart playerDetailSmallChart:SetPoint ("topleft", parent, "topleft") playerDetailSmallChart:SetPoint ("bottomright", parent, "bottomright") - + --update lines local width = playerDetailSmallChart:GetWidth() local combatTime = combatObject:GetCombatTime() local secondsPerBar = combatTime / 200 local barWidth = width / 200 local barHeight = playerDetailSmallChart:GetHeight() - + local currentTime = eventList [1][1] local currentIndex = 1 local eventAmount = #eventList - + for i = 1, #playerDetailSmallChart.Lines do playerDetailSmallChart.Lines [i]:SetWidth (width / 200) playerDetailSmallChart.Lines [i]:SetHeight (1) - + for o = currentIndex, eventAmount do if (eventList [o][1] <= currentTime + secondsPerBar or eventList [o][1] >= currentTime) then playerDetailSmallChart.Lines [i]:SetPoint ("bottomleft", playerDetailSmallChart, "bottomleft", barWidth * (i - 1), 0) @@ -5138,7 +5130,7 @@ function Details:BuildPlayerDetailsSpellChart() break end end - + currentTime = currentTime + secondsPerBar end end @@ -5146,15 +5138,15 @@ function Details:BuildPlayerDetailsSpellChart() end function atributo_damage:MontaTooltipDamageTaken (thisLine, index) - + local aggressor = info.instancia.showing [1]:PegarCombatente (_, thisLine.nome_inimigo) local container = aggressor.spells._ActorTable local habilidades = {} local total = 0 - - for spellid, spell in _pairs (container) do - for target_name, amount in _pairs (spell.targets) do + + for spellid, spell in _pairs(container) do + for target_name, amount in _pairs(spell.targets) do if (target_name == self.nome) then total = total + amount habilidades [#habilidades+1] = {spellid, amount} @@ -5162,59 +5154,59 @@ function atributo_damage:MontaTooltipDamageTaken (thisLine, index) end end - _table_sort (habilidades, Details.Sort2) + _table_sort(habilidades, Details.Sort2) GameTooltip:AddLine (index..". "..thisLine.nome_inimigo) GameTooltip:AddLine (Loc ["STRING_DAMAGE_TAKEN_FROM2"]..":") GameTooltip:AddLine (" ") - + for index, tabela in _ipairs (habilidades) do - local nome, _, icone = _GetSpellInfo (tabela[1]) + local nome, _, icone = _GetSpellInfo(tabela[1]) if (index < 8) then - GameTooltip:AddDoubleLine (index..". |T"..icone..":0|t "..nome, Details:comma_value (tabela[2]).." (".._cstr("%.1f", tabela[2]/total*100).."%)", 1, 1, 1, 1, 1, 1) + GameTooltip:AddDoubleLine (index..". |T"..icone..":0|t "..nome, Details:comma_value (tabela[2]).." ("..format("%.1f", tabela[2]/total*100).."%)", 1, 1, 1, 1, 1, 1) else - GameTooltip:AddDoubleLine (index..". "..nome, Details:comma_value (tabela[2]).." (".._cstr("%.1f", tabela[2]/total*100).."%)", .65, .65, .65, .65, .65, .65) + GameTooltip:AddDoubleLine (index..". "..nome, Details:comma_value (tabela[2]).." ("..format("%.1f", tabela[2]/total*100).."%)", .65, .65, .65, .65, .65, .65) end end - + return true --GameTooltip:AddDoubleLine (meus_danos[i][4][1]..": ", meus_danos[i][2].." (".._cstr("%.1f", meus_danos[i][3]).."%)", 1, 1, 1, 1, 1, 1) - + end function atributo_damage:MontaTooltipAlvos (thisLine, index, instancia) - + local inimigo = thisLine.nome_inimigo local habilidades = {} local total = self.total local i = 1 - + Details:FormatCooltipForSpells() GameCooltip:SetOwner(thisLine, "bottom", "top", 4, -2) GameCooltip:SetOption ("MinWidth", _math_max (230, thisLine:GetWidth()*0.98)) - for spellid, spell in _pairs (self.spells._ActorTable) do + for spellid, spell in _pairs(self.spells._ActorTable) do if (spell.isReflection) then - for target_name, amount in _pairs (spell.targets) do + for target_name, amount in _pairs(spell.targets) do if (target_name == inimigo) then - for reflectedSpellId, amount in _pairs (spell.extra) do + for reflectedSpellId, amount in _pairs(spell.extra) do local spellName, _, spellIcon = _GetSpellInfo(reflectedSpellId) local t = habilidades [i] if (not t) then habilidades [i] = {} t = habilidades [i] end - + t[1], t[2], t[3] = spellName .. " (|cFFCCBBBBreflected|r)", amount, spellIcon i = i + 1 end end end - else - for target_name, amount in _pairs (spell.targets) do + else + for target_name, amount in _pairs(spell.targets) do if (target_name == inimigo) then - local nome, _, icone = _GetSpellInfo (spellid) - + local nome, _, icone = _GetSpellInfo(spellid) + local t = habilidades [i] if (not t) then habilidades [i] = {} @@ -5231,23 +5223,23 @@ function atributo_damage:MontaTooltipAlvos (thisLine, index, instancia) --> add pets for _, PetName in _ipairs (self.pets) do local PetActor = instancia.showing (class_type, PetName) - if (PetActor) then + if (PetActor) then local PetSkillsContainer = PetActor.spells._ActorTable - for _spellid, _skill in _pairs (PetSkillsContainer) do - + for _spellid, _skill in _pairs(PetSkillsContainer) do + local alvos = _skill.targets - for target_name, amount in _pairs (alvos) do + for target_name, amount in _pairs(alvos) do if (target_name == inimigo) then - + local t = habilidades [i] if (not t) then habilidades [i] = {} t = habilidades [i] end - - local nome, _, icone = _GetSpellInfo (_spellid) + + local nome, _, icone = _GetSpellInfo(_spellid) t[1], t[2], t[3] = nome .. " (" .. PetName:gsub ((" <.*"), "") .. ")", amount, icone - + i = i + 1 end end @@ -5255,7 +5247,7 @@ function atributo_damage:MontaTooltipAlvos (thisLine, index, instancia) end end - _table_sort (habilidades, Details.Sort2) + _table_sort(habilidades, Details.Sort2) --get time type local meu_tempo @@ -5264,15 +5256,15 @@ function atributo_damage:MontaTooltipAlvos (thisLine, index, instancia) elseif (Details.time_type == 2) then meu_tempo = info.instancia.showing:GetCombatTime() end - + local is_dps = info.instancia.sub_atributo == 2 - + if (is_dps) then - Details:AddTooltipSpellHeaderText (Loc ["STRING_DAMAGE_DPS_IN"] .. ":", {1, 0.9, 0.0, 1}, 1, Details.tooltip_spell_icon.file, unpack (Details.tooltip_spell_icon.coords)) + Details:AddTooltipSpellHeaderText (Loc ["STRING_DAMAGE_DPS_IN"] .. ":", {1, 0.9, 0.0, 1}, 1, Details.tooltip_spell_icon.file, unpack(Details.tooltip_spell_icon.coords)) Details:AddTooltipHeaderStatusbar (1, 1, 1, 1) else - Details:AddTooltipSpellHeaderText (Loc ["STRING_DAMAGE_FROM"] .. ":", {1, 0.9, 0.0, 1}, 1, Details.tooltip_spell_icon.file, unpack (Details.tooltip_spell_icon.coords)) + Details:AddTooltipSpellHeaderText (Loc ["STRING_DAMAGE_FROM"] .. ":", {1, 0.9, 0.0, 1}, 1, Details.tooltip_spell_icon.file, unpack(Details.tooltip_spell_icon.coords)) Details:AddTooltipHeaderStatusbar (1, 1, 1, 1) end @@ -5288,11 +5280,11 @@ function atributo_damage:MontaTooltipAlvos (thisLine, index, instancia) end if (is_dps) then - --GameCooltip:AddDoubleLine (index..". |T"..tabela[3]..":0|t "..tabela[1], Details:comma_value ( _math_floor (tabela[2] / meu_tempo) ).." (".._cstr("%.1f", tabela[2]/total*100).."%)", 1, 1, 1, 1, 1, 1) - GameCooltip:AddLine (tabela[1], Details:comma_value ( _math_floor (tabela[2] / meu_tempo) ).." (".._cstr("%.1f", tabela[2]/total*100).."%)") + --GameCooltip:AddDoubleLine (index..". |T"..tabela[3]..":0|t "..tabela[1], Details:comma_value ( _math_floor(tabela[2] / meu_tempo) ).." (".._cstr("%.1f", tabela[2]/total*100).."%)", 1, 1, 1, 1, 1, 1) + GameCooltip:AddLine (tabela[1], Details:comma_value ( _math_floor(tabela[2] / meu_tempo) ).." ("..format("%.1f", tabela[2]/total*100).."%)") else - --GameCooltip:AddDoubleLine (index..". |T"..tabela[3]..":0|t " .. tabela[1], SelectedToKFunction (_, tabela[2]) .. " (".._cstr("%.1f", tabela[2]/total*100).."%)", 1, 1, 1, 1, 1, 1) - GameCooltip:AddLine (tabela[1], SelectedToKFunction (_, tabela[2]) .. " (".._cstr("%.1f", tabela[2]/total*100).."%)") + --GameCooltip:AddDoubleLine (index..". |T"..tabela[3]..":0|t " .. tabela[1], SelectedToKFunction(_, tabela[2]) .. " (".._cstr("%.1f", tabela[2]/total*100).."%)", 1, 1, 1, 1, 1, 1) + GameCooltip:AddLine (tabela[1], SelectedToKFunction(_, tabela[2]) .. " ("..format("%.1f", tabela[2]/total*100).."%)") end GameCooltip:AddIcon (tabela[3], nil, nil, icon_size.W + 4, icon_size.H + 4, icon_border.L, icon_border.R, icon_border.T, icon_border.B) @@ -5301,14 +5293,14 @@ function atributo_damage:MontaTooltipAlvos (thisLine, index, instancia) end GameCooltip:Show() - + return true - + end --> controla se o dps do jogador esta travado ou destravado function atributo_damage:Iniciar (iniciar) - if (iniciar == nil) then + if (iniciar == nil) then return self.dps_started --> retorna se o dps esta aberto ou fechado para este jogador elseif (iniciar) then self.dps_started = true @@ -5333,7 +5325,7 @@ end for i = #bs_table, 1, -1 do bs_table [i] = nil end - + if (bs_tooltip_table) then wipe (bs_tooltip_table) end @@ -5366,7 +5358,7 @@ end combat_table.totals_grupo [class_type] = combat_table.totals_grupo [class_type] + self.total end end - + --> restaura a tabela de last event function atributo_damage:r_last_events_table (actor) if (not actor) then @@ -5374,16 +5366,16 @@ end end --actor.last_events_table = Details:CreateActorLastEventTable() end - + --> restaura e liga o ator com a sua shadow durante a inicializa��o (startup function) function atributo_damage:r_onlyrefresh_shadow (actor) --> criar uma shadow desse ator se ainda n�o tiver uma local overall_dano = Details.tabela_overall [1] local shadow = overall_dano._ActorTable [overall_dano._NameIndexTable [actor.nome]] - - if (not shadow) then + + if (not shadow) then shadow = overall_dano:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true) - + shadow.classe = actor.classe shadow.spec = actor.spec shadow.grupo = actor.grupo @@ -5392,68 +5384,68 @@ end shadow.boss = actor.boss shadow.boss_fight_component = actor.boss_fight_component shadow.fight_component = actor.fight_component - + shadow.start_time = time() - 3 shadow.end_time = time() end --> restaura a meta e indexes ao ator Details.refresh:r_atributo_damage (actor, shadow) - + --> copia o container de alvos (captura de dados) - for target_name, amount in _pairs (actor.targets) do + for target_name, amount in _pairs(actor.targets) do --> cria e soma o valor do total if (not shadow.targets [target_name]) then shadow.targets [target_name] = 0 end end - + --> copia o container de habilidades (captura de dados) - for spellid, habilidade in _pairs (actor.spells._ActorTable) do + for spellid, habilidade in _pairs(actor.spells._ActorTable) do --> cria e soma o valor local habilidade_shadow = shadow.spells:PegaHabilidade (spellid, true, nil, true) --> create the target value - for target_name, amount in _pairs (habilidade.targets) do + for target_name, amount in _pairs(habilidade.targets) do if (not habilidade_shadow.targets [target_name]) then habilidade_shadow.targets [target_name] = 0 end end --> create the extra value - for spellId, amount in _pairs (habilidade.extra) do + for spellId, amount in _pairs(habilidade.extra) do if (not habilidade_shadow.extra [spellId]) then habilidade_shadow.extra [spellId] = 0 end end end - + --> copia o container de friendly fire (captura de dados) - for target_name, ff_table in _pairs (actor.friendlyfire) do + for target_name, ff_table in _pairs(actor.friendlyfire) do --> cria ou pega a shadow local friendlyFire_shadow = shadow.friendlyfire [target_name] or shadow:CreateFFTable (target_name) --> some as spells - for spellid, amount in _pairs (ff_table.spells) do + for spellid, amount in _pairs(ff_table.spells) do friendlyFire_shadow.spells [spellid] = 0 end end - + return shadow end - + function atributo_damage:r_connect_shadow (actor, no_refresh, combat_object) - + --check if there's a custom combat, if not just use the overall container local host_combat = combat_object or Details.tabela_overall - + --check if the host combat object has a shadow actor for this actor, if not, just create one new local overall_dano = host_combat [1] local shadow = overall_dano._ActorTable [overall_dano._NameIndexTable [actor.nome]] - - if (not shadow) then + + if (not shadow) then shadow = overall_dano:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true) - + shadow.classe = actor.classe shadow.spec = actor.spec shadow.isTank = actor.isTank @@ -5462,7 +5454,7 @@ end shadow.boss = actor.boss shadow.boss_fight_component = actor.boss_fight_component shadow.fight_component = actor.fight_component - + shadow.start_time = time() - 3 shadow.end_time = time() end @@ -5472,7 +5464,7 @@ end shadow.boss_fight_component = actor.boss_fight_component or shadow.boss_fight_component shadow.fight_component = actor.fight_component or shadow.fight_component shadow.grupo = actor.grupo or shadow.grupo - + --check if need to restore meta tables and indexes for this actor if (not no_refresh) then Details.refresh:r_atributo_damage (actor, shadow) @@ -5483,10 +5475,10 @@ end if (not actor.end_time) then end_time = time() end - + local tempo = end_time - actor.start_time shadow.start_time = shadow.start_time - tempo - + --> pets (add unique pet names) for _, petName in _ipairs (actor.pets) do local hasPet = false @@ -5496,14 +5488,14 @@ end break end end - + if (not hasPet) then shadow.pets [#shadow.pets+1] = petName end end - + --> total de dano (captura de dados) - shadow.total = shadow.total + actor.total + shadow.total = shadow.total + actor.total shadow.totalabsorbed = shadow.totalabsorbed + actor.totalabsorbed --> total de dano sem o pet (captura de dados) shadow.total_without_pet = shadow.total_without_pet + actor.total_without_pet @@ -5517,46 +5509,46 @@ end if (actor.grupo) then host_combat.totals_grupo[1] = host_combat.totals_grupo[1] + actor.total end - + --> copia o damage_from (captura de dados) - for nome, _ in _pairs (actor.damage_from) do + for nome, _ in _pairs(actor.damage_from) do shadow.damage_from [nome] = true end - + --> copia o container de alvos (captura de dados) - for target_name, amount in _pairs (actor.targets) do + for target_name, amount in _pairs(actor.targets) do shadow.targets [target_name] = (shadow.targets [target_name] or 0) + amount end - + --> copiar o container de raid targets - for flag, amount in _pairs (actor.raid_targets) do + for flag, amount in _pairs(actor.raid_targets) do shadow.raid_targets = shadow.raid_targets or {} --deu invalido noutro dia shadow.raid_targets [flag] = (shadow.raid_targets [flag] or 0) + amount end - + --> copia o container de habilidades (captura de dados) - for spellid, habilidade in _pairs (actor.spells._ActorTable) do + for spellid, habilidade in _pairs(actor.spells._ActorTable) do --> cria e soma o valor local habilidade_shadow = shadow.spells:PegaHabilidade (spellid, true, nil, true) --> refresh e soma os valores dos alvos - for target_name, amount in _pairs (habilidade.targets) do + for target_name, amount in _pairs(habilidade.targets) do habilidade_shadow.targets [target_name] = (habilidade_shadow.targets [target_name] or 0) + amount end --> refresh and add extra values - for spellId, amount in _pairs (habilidade.extra) do + for spellId, amount in _pairs(habilidade.extra) do habilidade_shadow.extra [spellId] = (habilidade_shadow.extra [spellId] or 0) + amount end --> soma todos os demais valores - for key, value in _pairs (habilidade) do - if (_type (value) == "number") then + for key, value in _pairs(habilidade) do + if (_type(value) == "number") then if (key ~= "id" and key ~= "spellschool") then - if (not habilidade_shadow [key]) then + if (not habilidade_shadow [key]) then habilidade_shadow [key] = 0 end - + if (key == "n_min" or key == "c_min") then if (habilidade_shadow [key] > value) then habilidade_shadow [key] = value @@ -5573,19 +5565,19 @@ end end end end - + --> copia o container de friendly fire (captura de dados) - for target_name, ff_table in _pairs (actor.friendlyfire) do + for target_name, ff_table in _pairs(actor.friendlyfire) do --> cria ou pega a shadow local friendlyFire_shadow = shadow.friendlyfire [target_name] or shadow:CreateFFTable (target_name) --> soma o total friendlyFire_shadow.total = friendlyFire_shadow.total + ff_table.total --> some as spells - for spellid, amount in _pairs (ff_table.spells) do + for spellid, amount in _pairs(ff_table.spells) do friendlyFire_shadow.spells [spellid] = (friendlyFire_shadow.spells [spellid] or 0) + amount end end - + return shadow end @@ -5681,12 +5673,12 @@ function Details.SumDamageActors(actor1, actor2, actorContainer) end -atributo_damage.__add = function (tabela1, tabela2) +atributo_damage.__add = function(tabela1, tabela2) --> tempo decorrido local tempo = (tabela2.end_time or time()) - tabela2.start_time tabela1.start_time = tabela1.start_time - tempo - + --> total de dano tabela1.total = tabela1.total + tabela2.total tabela1.totalabsorbed = tabela1.totalabsorbed + tabela2.totalabsorbed @@ -5698,10 +5690,10 @@ atributo_damage.__add = function (tabela1, tabela2) tabela1.friendlyfire_total = tabela1.friendlyfire_total + tabela2.friendlyfire_total --> soma o damage_from - for nome, _ in _pairs (tabela2.damage_from) do + for nome, _ in _pairs(tabela2.damage_from) do tabela1.damage_from [nome] = true end - + --> pets (add unique pet names) for _, petName in _ipairs (tabela2.pets) do local hasPet = false @@ -5711,45 +5703,45 @@ atributo_damage.__add = function (tabela1, tabela2) break end end - + if (not hasPet) then tabela1.pets [#tabela1.pets+1] = petName end end - + --> soma os containers de alvos - for target_name, amount in _pairs (tabela2.targets) do + for target_name, amount in _pairs(tabela2.targets) do tabela1.targets [target_name] = (tabela1.targets [target_name] or 0) + amount end - + --> soma o container de raid targets - for flag, amount in _pairs (tabela2.raid_targets) do + for flag, amount in _pairs(tabela2.raid_targets) do tabela1.raid_targets [flag] = (tabela1.raid_targets [flag] or 0) + amount end - + --> soma o container de habilidades - for spellid, habilidade in _pairs (tabela2.spells._ActorTable) do + for spellid, habilidade in _pairs(tabela2.spells._ActorTable) do --> pega a habilidade no primeiro ator local habilidade_tabela1 = tabela1.spells:PegaHabilidade (spellid, true, "SPELL_DAMAGE", false) --> soma os alvos - for target_name, amount in _pairs (habilidade.targets) do + for target_name, amount in _pairs(habilidade.targets) do habilidade_tabela1.targets[target_name] = (habilidade_tabela1.targets [target_name] or 0) + amount end --> soma os extras - for spellId, amount in _pairs (habilidade.extra) do + for spellId, amount in _pairs(habilidade.extra) do habilidade_tabela1.extra = (habilidade_tabela1.extra [spellId] or 0) + amount end --> soma os valores da habilidade - for key, value in _pairs (habilidade) do - if (_type (value) == "number") then + for key, value in _pairs(habilidade) do + if (_type(value) == "number") then if (key ~= "id" and key ~= "spellschool") then - if (not habilidade_tabela1 [key]) then + if (not habilidade_tabela1 [key]) then habilidade_tabela1 [key] = 0 end - + if (key == "n_min" or key == "c_min") then if (habilidade_tabela1 [key] > value) then habilidade_tabela1 [key] = value @@ -5761,21 +5753,21 @@ atributo_damage.__add = function (tabela1, tabela2) else habilidade_tabela1 [key] = habilidade_tabela1 [key] + value end - + end end end end - + --> soma o container de friendly fire - for target_name, ff_table in _pairs (tabela2.friendlyfire) do + for target_name, ff_table in _pairs(tabela2.friendlyfire) do --> pega o ator ff no ator principal local friendlyFire_tabela1 = tabela1.friendlyfire [target_name] or tabela1:CreateFFTable (target_name) --> soma o total friendlyFire_tabela1.total = friendlyFire_tabela1.total + ff_table.total - + --> soma as habilidades - for spellid, amount in _pairs (ff_table.spells) do + for spellid, amount in _pairs(ff_table.spells) do friendlyFire_tabela1.spells [spellid] = (friendlyFire_tabela1.spells [spellid] or 0) + amount end end @@ -5783,45 +5775,45 @@ atributo_damage.__add = function (tabela1, tabela2) return tabela1 end -atributo_damage.__sub = function (tabela1, tabela2) +atributo_damage.__sub = function(tabela1, tabela2) --> tempo decorrido local tempo = (tabela2.end_time or time()) - tabela2.start_time tabela1.start_time = tabela1.start_time + tempo - + --> total de dano tabela1.total = tabela1.total - tabela2.total tabela1.totalabsorbed = tabela1.totalabsorbed - tabela2.totalabsorbed - + --> total de dano sem o pet tabela1.total_without_pet = tabela1.total_without_pet - tabela2.total_without_pet --> total de dano que o cara levou tabela1.damage_taken = tabela1.damage_taken - tabela2.damage_taken --> total do friendly fire causado tabela1.friendlyfire_total = tabela1.friendlyfire_total - tabela2.friendlyfire_total - + --> reduz os containers de alvos - for target_name, amount in _pairs (tabela2.targets) do + for target_name, amount in _pairs(tabela2.targets) do local alvo_tabela1 = tabela1.targets [target_name] if (alvo_tabela1) then tabela1.targets [target_name] = tabela1.targets [target_name] - amount end end - + --> reduz o container de raid targets - for flag, amount in _pairs (tabela2.raid_targets) do + for flag, amount in _pairs(tabela2.raid_targets) do if (tabela1.raid_targets [flag]) then tabela1.raid_targets [flag] = _math_max (tabela1.raid_targets [flag] - amount, 0) end end - + --> reduz o container de habilidades - for spellid, habilidade in _pairs (tabela2.spells._ActorTable) do + for spellid, habilidade in _pairs(tabela2.spells._ActorTable) do --> get the spell from the first actor local habilidade_tabela1 = tabela1.spells:PegaHabilidade (spellid, true, "SPELL_DAMAGE", false) --> subtract targets - for target_name, amount in _pairs (habilidade.targets) do + for target_name, amount in _pairs(habilidade.targets) do local alvo_tabela1 = habilidade_tabela1.targets [target_name] if (alvo_tabela1) then habilidade_tabela1.targets [target_name] = habilidade_tabela1.targets [target_name] - amount @@ -5829,7 +5821,7 @@ atributo_damage.__sub = function (tabela1, tabela2) end --> subtract extra table - for spellId, amount in _pairs (habilidade.extra) do + for spellId, amount in _pairs(habilidade.extra) do local extra_tabela1 = habilidade_tabela1.extra [spellId] if (extra_tabela1) then habilidade_tabela1.extra [spellId] = habilidade_tabela1.extra [spellId] - amount @@ -5837,10 +5829,10 @@ atributo_damage.__sub = function (tabela1, tabela2) end --> subtrai os valores da habilidade - for key, value in _pairs (habilidade) do - if (_type (value) == "number") then + for key, value in _pairs(habilidade) do + if (_type(value) == "number") then if (key ~= "id" and key ~= "spellschool") then - if (not habilidade_tabela1 [key]) then + if (not habilidade_tabela1 [key]) then habilidade_tabela1 [key] = 0 end if (key == "n_min" or key == "c_min") then @@ -5858,21 +5850,21 @@ atributo_damage.__sub = function (tabela1, tabela2) end end end - + --> reduz o container de friendly fire - for target_name, ff_table in _pairs (tabela2.friendlyfire) do + for target_name, ff_table in _pairs(tabela2.friendlyfire) do --> pega o ator ff no ator principal local friendlyFire_tabela1 = tabela1.friendlyfire [target_name] if (friendlyFire_tabela1) then friendlyFire_tabela1.total = friendlyFire_tabela1.total - ff_table.total - for spellid, amount in _pairs (ff_table.spells) do + for spellid, amount in _pairs(ff_table.spells) do if (friendlyFire_tabela1.spells [spellid]) then friendlyFire_tabela1.spells [spellid] = friendlyFire_tabela1.spells [spellid] - amount end end end end - + return tabela1 end @@ -5899,11 +5891,11 @@ end i = 1 local enemy = combat (1, enemy_name) if (enemy) then - + local damage_done = 0 - + --> get targets - for target_name, amount in _pairs (enemy.targets) do + for target_name, amount in _pairs(enemy.targets) do local player = combat (1, target_name) if (player and player.grupo) then local t = tooltip_temp_table [i] @@ -5917,7 +5909,7 @@ end i = i + 1 end end - + --> first clenup for o = i, #tooltip_temp_table do local t = tooltip_temp_table [o] @@ -5925,27 +5917,27 @@ end t[1] = 0 end - _table_sort (tooltip_temp_table, Details.Sort2) - + _table_sort(tooltip_temp_table, Details.Sort2) + --> enemy damage taken Details:AddTooltipSpellHeaderText (Loc ["STRING_ATTRIBUTE_DAMAGE"], headerColor, i-1, true) GameCooltip:AddIcon ([=[Interface\Buttons\UI-MicroStream-Green]=], 2, 1, 14, 14, 0.1875, 0.8125, 0.15625, 0.78125) GameCooltip:AddIcon ([=[Interface\AddOns\Details\images\key_shift]=], 2, 2, Details.tooltip_key_size_width, Details.tooltip_key_size_height, 0, 1, 0, 0.640625, Details.tooltip_key_overlay2) GameCooltip:AddStatusBar (100, 2, 0.7, g, b, 1) - + --> build the tooltip for o = 1, i-1 do local player = tooltip_temp_table [o][1] local total = tooltip_temp_table [o][2] local player_name = player:name() - + if (player_name:find (Details.playername)) then GameCooltip:AddLine (player_name .. ": ", FormatTooltipNumber (_, total) .. " (" .. _cstr ("%.1f", (total / damage_done) * 100) .. "%)", 2, "yellow") else GameCooltip:AddLine (player_name .. ": ", FormatTooltipNumber (_, total) .." (" .. _cstr ("%.1f", (total / damage_done) * 100) .. "%)", 2) end - + local classe = player:class() if (not classe) then classe = "UNKNOW" @@ -5953,14 +5945,14 @@ end if (classe == "UNKNOW") then GameCooltip:AddIcon ("Interface\\LFGFRAME\\LFGROLE_BW", 2, nil, 14, 14, .25, .5, 0, 1) else - GameCooltip:AddIcon (instancia.row_info.icon_file, 2, nil, 14, 14, _unpack (Details.class_coords [classe])) + GameCooltip:AddIcon (instancia.row_info.icon_file, 2, nil, 14, 14, _unpack(Details.class_coords [classe])) end Details:AddTooltipBackgroundStatusbar (2) end - + end - + --> clean up for o = 1, #tooltip_temp_table do local t = tooltip_temp_table [o] diff --git a/classes/class_error.lua b/classes/class_error.lua index 0161a614..b6a408a0 100644 --- a/classes/class_error.lua +++ b/classes/class_error.lua @@ -13,7 +13,7 @@ do _error.__tostring = function() return _error.errortext end - _error.__call = function (_this) + _error.__call = function(_this) print (_this.errortext) end diff --git a/classes/class_heal.lua b/classes/class_heal.lua index ea9f0b4d..c2ab82a6 100644 --- a/classes/class_heal.lua +++ b/classes/class_heal.lua @@ -70,7 +70,7 @@ local keyName function atributo_heal:NovaTabela (serial, nome, link) - local alphabetical = _detalhes:GetOrderNumber (nome) + local alphabetical = _detalhes:GetOrderNumber(nome) --> constructor local _new_healActor = { @@ -978,7 +978,7 @@ function _detalhes:CloseShields (combat) for spellid, owner_table in _pairs (spellid_table) do - local spellname = GetSpellInfo (spellid) + local spellname = GetSpellInfo(spellid) for owner, amount in _pairs (owner_table) do if (amount > 0) then @@ -1095,7 +1095,7 @@ function atributo_heal:ToolTip_HealingDenied (instancia, numero, barra, keydown) break end - local spellName, _, spellIcon = _GetSpellInfo (spellObject.id) + local spellName, _, spellIcon = _GetSpellInfo(spellObject.id) GameCooltip:AddLine (spellName .. ": ", FormatTooltipNumber (_, spellTotal) .. " (" .. _cstr ("%.1f", spellTotal / totalDenied) .."%)") @@ -1175,7 +1175,7 @@ function atributo_heal:ToolTip_HealingDenied (instancia, numero, barra, keydown) break end - local spellName, _, spellIcon = _GetSpellInfo (spellID) + local spellName, _, spellIcon = _GetSpellInfo(spellID) GameCooltip:AddLine (spellName .. ": ", FormatTooltipNumber (_, spellTotal) .. " (" .. _cstr ("%.1f", spellTotal / totalDenied) .."%)") @@ -1261,7 +1261,7 @@ function atributo_heal:ToolTip_HealingTaken (instancia, numero, barra, keydown) _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) end - _table_sort (meus_curadores, function (a, b) return a[2] > b[2] end) + _table_sort (meus_curadores, function(a, b) return a[2] > b[2] end) local max = #meus_curadores if (max > 9) then max = 9 @@ -1339,7 +1339,7 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown) --add actor spells for _spellid, _skill in _pairs (ActorSkillsContainer) do - local SkillName, _, SkillIcon = _GetSpellInfo (_spellid) + local SkillName, _, SkillIcon = _GetSpellInfo(_spellid) if (_skill [skill_key] > 0 or _skill.anti_heal) then _table_insert (ActorHealingTable, { _spellid, @@ -1360,7 +1360,7 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown) if (petActor) then for _spellid, _skill in _pairs (petActor:GetActorSpells()) do if (_skill [skill_key] > 0) then - local SkillName, _, SkillIcon = _GetSpellInfo (_spellid) + local SkillName, _, SkillIcon = _GetSpellInfo(_spellid) local petName = petName:gsub ((" <.*"), "") ActorHealingTable [#ActorHealingTable+1] = { _spellid, @@ -1739,7 +1739,7 @@ function atributo_heal:MontaInfoOverHealing() local barras = info.barras1 for spellid, tabela in _pairs (tabela) do - local nome, _, icone = _GetSpellInfo (spellid) + local nome, _, icone = _GetSpellInfo(spellid) _table_insert (minhas_curas, {spellid, tabela.overheal, tabela.overheal/total*100, nome, icone}) end @@ -1751,7 +1751,7 @@ function atributo_heal:MontaInfoOverHealing() if (PetActor) then local PetSkillsContainer = PetActor.spells._ActorTable for _spellid, _skill in _pairs (PetSkillsContainer) do --> da foreach em cada spellid do container - local nome, _, icone = _GetSpellInfo (_spellid) + local nome, _, icone = _GetSpellInfo(_spellid) _table_insert (minhas_curas, {_spellid, _skill.overheal, _skill.overheal/total*100, nome .. " (|c" .. class_color .. PetName:gsub ((" <.*"), "") .. "|r)", icone, PetActor}) end end @@ -1888,7 +1888,7 @@ function atributo_heal:MontaInfoHealingDone() end for spellid, tabela in _pairs (tabela) do - local nome, rank, icone = _GetSpellInfo (spellid) + local nome, rank, icone = _GetSpellInfo(spellid) _table_insert (minhas_curas, { spellid, tabela.total, @@ -1911,7 +1911,7 @@ function atributo_heal:MontaInfoHealingDone() if (PetActor) then local PetSkillsContainer = PetActor.spells._ActorTable for _spellid, _skill in _pairs (PetSkillsContainer) do --> da foreach em cada spellid do container - local nome, _, icone = _GetSpellInfo (_spellid) + local nome, _, icone = _GetSpellInfo(_spellid) _table_insert (minhas_curas, { _spellid, _skill.total, @@ -2049,7 +2049,7 @@ function atributo_heal:MontaTooltipAlvos (thisLine, index, instancia) for spellid, tabela in _pairs (container) do for target_name, amount in _pairs (tabela ["targets" .. targets_key]) do if (target_name == inimigo) then - local nome, _, icone = _GetSpellInfo (spellid) + local nome, _, icone = _GetSpellInfo(spellid) habilidades [#habilidades+1] = {nome, amount, icone} end end @@ -2065,7 +2065,7 @@ function atributo_heal:MontaTooltipAlvos (thisLine, index, instancia) for target_name, amount in _pairs (_skill ["targets" .. targets_key]) do if (target_name == inimigo) then - local nome, _, icone = _GetSpellInfo (_spellid) + local nome, _, icone = _GetSpellInfo(_spellid) habilidades [#habilidades+1] = {nome, amount, icone} end end @@ -2161,7 +2161,7 @@ function atributo_heal:MontaDetalhesHealingTaken (nome, barra) for spellid, tabela in _pairs (conteudo) do --> da foreach em cada spellid do container if (tabela.targets [actor]) then - local spell_nome, _, icone = _GetSpellInfo (spellid) + local spell_nome, _, icone = _GetSpellInfo(spellid) _table_insert (minhas_magias, {spellid, tabela.targets [actor], tabela.targets [actor] / total*100, spell_nome, icone}) end end @@ -2221,7 +2221,7 @@ function atributo_heal:MontaDetalhesHealingDone (spellid, barra) end --> icone direito superior - local _, _, icone = _GetSpellInfo (spellid) + local _, _, icone = _GetSpellInfo(spellid) info.spell_icone:SetTexture (icone) local total = self.total @@ -2278,9 +2278,9 @@ function atributo_heal:MontaDetalhesHealingDone (spellid, barra) local spell_cast = misc_actor.spell_cast and misc_actor.spell_cast [spellid] if (not spell_cast and misc_actor.spell_cast) then - local spellname = GetSpellInfo (spellid) + local spellname = GetSpellInfo(spellid) for casted_spellid, amount in _pairs (misc_actor.spell_cast) do - local casted_spellname = GetSpellInfo (casted_spellid) + local casted_spellname = GetSpellInfo(casted_spellid) if (casted_spellname == spellname) then spell_cast = amount .. " (|cFFFFFF00?|r)" end @@ -2702,7 +2702,7 @@ function atributo_heal:ColetarLixo (lastevent) return _detalhes:ColetarLixo (class_type, lastevent) end -atributo_heal.__add = function (tabela1, tabela2) +atributo_heal.__add = function(tabela1, tabela2) --> tempo decorrido local tempo = (tabela2.end_time or time()) - tabela2.start_time @@ -2805,7 +2805,7 @@ atributo_heal.__add = function (tabela1, tabela2) return tabela1 end -atributo_heal.__sub = function (tabela1, tabela2) +atributo_heal.__sub = function(tabela1, tabela2) --> tempo decorrido local tempo = (tabela2.end_time or time()) - tabela2.start_time diff --git a/classes/class_instance.lua b/classes/class_instance.lua index 6f472901..a5e02d9a 100644 --- a/classes/class_instance.lua +++ b/classes/class_instance.lua @@ -40,21 +40,21 @@ local segmentos = _detalhes.segmentos function _detalhes:RestartInstances() return _detalhes:ReativarInstancias() end - + function _detalhes:ReativarInstancias() - + _detalhes.opened_windows = 0 - + --> set metatables - for index = 1, #_detalhes.tabela_instancias do + for index = 1, #_detalhes.tabela_instancias do local instancia = _detalhes.tabela_instancias [index] if (not _getmetatable (instancia)) then _setmetatable (_detalhes.tabela_instancias[index], _detalhes) end end - + --> create frames - for index = 1, #_detalhes.tabela_instancias do + for index = 1, #_detalhes.tabela_instancias do local instancia = _detalhes.tabela_instancias [index] if (instancia:IsEnabled()) then _detalhes.opened_windows = _detalhes.opened_windows + 1 @@ -63,9 +63,9 @@ local segmentos = _detalhes.segmentos instancia.iniciada = false end end - + --> load - for index = 1, #_detalhes.tabela_instancias do + for index = 1, #_detalhes.tabela_instancias do local instancia = _detalhes.tabela_instancias [index] if (instancia:IsEnabled()) then instancia.iniciada = true @@ -73,9 +73,9 @@ local segmentos = _detalhes.segmentos instancia:ChangeSkin() end end - + --> send open event - for index = 1, #_detalhes.tabela_instancias do + for index = 1, #_detalhes.tabela_instancias do local instancia = _detalhes.tabela_instancias [index] if (instancia:IsEnabled()) then if (not _detalhes.initializing) then @@ -84,7 +84,7 @@ local segmentos = _detalhes.segmentos end end end - + ------------------------------------------------------------------------------------------------------------------------ --> API: call a function to all enabled instances @@ -248,7 +248,7 @@ function _detalhes:GetCustomObject (object_name) end function _detalhes:ResetAttribute() - if (self.iniciada) then + if (self.iniciada) then self:TrocaTabela (nil, 1, 1, true) else self.atributo = 1 @@ -356,7 +356,7 @@ function Details:GetActorByRank(attributeId, rankIndex) for i = 1, #actorTable do local actor = actorTable[rankIndex] return actor - end + end --]=] end @@ -384,11 +384,11 @@ end function _detalhes:LoadLocalInstanceConfig() local config = _detalhes.local_instances_config [self.meu_id] if (config) then - + if (not _detalhes.profile_save_pos) then self.posicao = Details.CopyTable (config.pos) end - + if (_type (config.attribute) ~= "number") then config.attribute = 1 end @@ -398,7 +398,7 @@ end if (_type (config.segment) ~= "number") then config.segment = 1 end - + self.ativa = config.is_open self.atributo = config.attribute self.sub_atributo = config.sub_attribute @@ -431,17 +431,17 @@ end function _detalhes:Shutdown(all) return self:DesativarInstancia(all) end - + function _detalhes:GetNumWindows() - + end --> desativando a inst�ncia ela fica em stand by e apenas hida a janela ~shutdown ~close ~fechar function _detalhes:DesativarInstancia(all) - + self.ativa = false _detalhes.opened_windows = _detalhes.opened_windows-1 - + if (not self.baseframe) then --> windown isn't initialized yet if (_detalhes.debug) then @@ -449,43 +449,43 @@ end end return end - + local lower = _detalhes:GetLowerInstanceNumber() _detalhes:GetLowerInstanceNumber() - + if (lower == self.meu_id) then --> os icones dos plugins estao hostiados nessa instancia. _detalhes.ToolBar:ReorganizeIcons (true) --n�o precisa recarregar toda a skin end - + if (_detalhes.switch.current_instancia and _detalhes.switch.current_instancia == self) then _detalhes.switch:CloseMe() end - + self:ResetaGump() - + Details.FadeHandler.Fader (self.baseframe.cabecalho.ball, 1) Details.FadeHandler.Fader (self.baseframe, 1) Details.FadeHandler.Fader (self.rowframe, 1) Details.FadeHandler.Fader (self.windowSwitchButton, 1) - + if (not all) then self:Desagrupar (-1) end if (self.modo == modo_raid) then _detalhes.RaidTables:DisableRaidMode (self) - + elseif (self.modo == modo_alone) then _detalhes.SoloTables:switch() self.atualizando = false _detalhes.solo = nil end - + if (not _detalhes.initializing) then _detalhes:SendEvent ("DETAILS_INSTANCE_CLOSE", nil, self) end - + end ------------------------------------------------------------------------------------------------------------------------ @@ -502,7 +502,7 @@ end function _detalhes:ToggleWindow (index) local window = _detalhes:GetInstance (index) - + if (window and _getmetatable (window)) then if (window:IsEnabled()) then window:ShutDown() @@ -515,33 +515,33 @@ end _detalhes.move_janela_func (instance2.baseframe, true, instance2, true) _detalhes.move_janela_func (instance2.baseframe, false, instance2, true) end - + elseif (window.meu_id == 2) then _detalhes.move_janela_func (window.baseframe, true, window, true) _detalhes.move_janela_func (window.baseframe, false, window, true) end - + end end end - + function _detalhes:CheckCoupleWindows (instance1, instance2) instance1 = instance1 or _detalhes:GetInstance (1) instance2 = instance2 or _detalhes:GetInstance (2) - + if (instance1 and instance2 and not instance1.ignore_mass_showhide and not instance1.ignore_mass_showhide) then - + instance1.baseframe:ClearAllPoints() instance2.baseframe:ClearAllPoints() - + instance1:RestoreMainWindowPosition() instance2:RestoreMainWindowPosition() - + instance1:AtualizaPontos() instance2:AtualizaPontos() - + local _R, _T, _L, _B = _detalhes.VPL (instance2, instance1), _detalhes.VPB (instance2, instance1), _detalhes.VPR (instance2, instance1), _detalhes.VPT (instance2, instance1) - + if (_R) then instance2:MakeInstanceGroup ({false, false, 1, false}) elseif (_T) then @@ -552,13 +552,13 @@ end instance2:MakeInstanceGroup ({false, 1, false, false}) end end - + end - + function _detalhes:ToggleWindows() - + local instance - + for i = 1, #_detalhes.tabela_instancias do local this_instance = _detalhes:GetInstance (i) if (this_instance and not this_instance.ignore_mass_showhide) then @@ -566,16 +566,16 @@ end break end end - + if (instance) then if (instance:IsEnabled()) then _detalhes:ShutDownAllInstances() else _detalhes:ReabrirTodasInstancias() - + local instance1 = _detalhes:GetInstance(1) local instance2 = _detalhes:GetInstance(2) - + if (instance1 and instance2) then if (not Details.disable_window_groups) then if (not instance1.ignore_mass_showhide and not instance2.ignore_mass_showhide) then @@ -586,23 +586,23 @@ end end end end - + -- reabre todas as instancias function _detalhes:ReabrirTodasInstancias (temp) - for index = math.min (#_detalhes.tabela_instancias, _detalhes.instances_amount), 1, -1 do + for index = math.min (#_detalhes.tabela_instancias, _detalhes.instances_amount), 1, -1 do local instancia = _detalhes:GetInstance (index) if (instancia and not instancia.ignore_mass_showhide) then instancia:AtivarInstancia (temp, true) end end end - + function _detalhes:LockInstance (flag) - + if (type (flag) == "boolean") then self.isLocked = not flag end - + if (self.isLocked) then self.isLocked = false if (self.baseframe) then @@ -627,15 +627,15 @@ end end end end - + function _detalhes:TravasInstancias() - for index, instancia in ipairs (_detalhes.tabela_instancias) do + for index, instancia in ipairs (_detalhes.tabela_instancias) do instancia:LockInstance (true) end end - + function _detalhes:DestravarInstancias() - for index, instancia in ipairs (_detalhes.tabela_instancias) do + for index, instancia in ipairs (_detalhes.tabela_instancias) do instancia:LockInstance (false) end end @@ -647,20 +647,20 @@ end function _detalhes:EnableInstance (temp, all) return self:AtivarInstancia (temp, all) end - + function _detalhes:AtivarInstancia (temp, all) self.ativa = true self.cached_bar_width = self.cached_bar_width or 0 self.modo = self.modo or 2 - + local lower = _detalhes:GetLowerInstanceNumber() - + if (lower == self.meu_id) then --> os icones dos plugins precisam ser hostiados nessa instancia. _detalhes.ToolBar:ReorganizeIcons (true) --> n�o precisa recarregar toda a skin end - + if (not self.iniciada) then self:RestauraJanela (self.meu_id, nil, true) --parece que esta chamando o ativar instance denovo... passei true no load_only vamos ver o resultado --tiny threat parou de funcionar depois de /reload depois dessa mudança, talvez tenha algo para carregar ainda @@ -677,12 +677,12 @@ end else Details.FadeHandler.Fader (self.baseframe.cabecalho.atributo_icon, 0) end - + Details.FadeHandler.Fader (self.baseframe.cabecalho.ball, 0) Details.FadeHandler.Fader (self.baseframe, 0) Details.FadeHandler.Fader (self.rowframe, 0) Details.FadeHandler.Fader (self.windowSwitchButton, 0) - + self:SetMenuAlpha() self.baseframe.cabecalho.fechar:Enable() self:ChangeIcon() @@ -690,12 +690,12 @@ end if (not temp) then if (self.modo == modo_raid) then _detalhes.RaidTables:EnableRaidMode(self) - + elseif (self.modo == modo_alone) then self:SoloMode (true) end end - + if (_detalhes.LastShowCommand and _detalhes.LastShowCommand+10 > GetTime()) then self:ToolbarMenuButtons() self:ToolbarSide() @@ -709,16 +709,16 @@ end if (not all) then self:Desagrupar (-1) end - + self:CheckFor_EnabledTrashSuppression() - + if (not temp and not _detalhes.initializing) then _detalhes:SendEvent ("DETAILS_INSTANCE_OPEN", nil, self) end if (self.modo == modo_raid) then _detalhes.RaidTables:EnableRaidMode(self) - + elseif (self.modo == modo_alone) then self:SoloMode (true) end @@ -744,7 +744,7 @@ end function _detalhes:DeleteInstance (id) local instance = _detalhes:GetInstance (id) - + if (not instance) then return false end @@ -766,7 +766,7 @@ end end end end - + --> re align snaps for higher instances for i = id+1, #_detalhes.tabela_instancias do local this_instance = _detalhes:GetInstance (i) @@ -781,7 +781,7 @@ end end end end - + table.remove (_detalhes.tabela_instancias, id) end @@ -796,14 +796,14 @@ end function _detalhes:CriarInstancia (_, id) if (id and _type (id) == "boolean") then - + if (#_detalhes.tabela_instancias >= _detalhes.instances_amount) then _detalhes:Msg (Loc ["STRING_INSTANCE_LIMIT"]) return false end - + local next_id = #_detalhes.tabela_instancias+1 - + if (_detalhes.unused_instances [next_id]) then local new_instance = _detalhes.unused_instances [next_id] _detalhes.tabela_instancias [next_id] = new_instance @@ -811,9 +811,9 @@ end new_instance:AtivarInstancia() return new_instance end - + local new_instance = _detalhes:NovaInstancia (next_id) - + if (_detalhes.standard_skin) then for key, value in pairs (_detalhes.standard_skin) do if (type (value) == "table") then @@ -823,7 +823,7 @@ end end end new_instance:ChangeSkin() - + else --> se n�o tiver um padr�o, criar de outra inst�ncia j� aberta. local copy_from @@ -834,9 +834,9 @@ end break end end - + if (copy_from) then - for key, value in pairs (copy_from) do + for key, value in pairs (copy_from) do if (_detalhes.instance_defaults [key] ~= nil) then if (type (value) == "table") then new_instance [key] = Details.CopyTable (value) @@ -848,9 +848,9 @@ end new_instance:ChangeSkin() end end - + return new_instance - + elseif (id) then local instancia = _detalhes.tabela_instancias [id] if (instancia and not instancia:IsAtiva()) then @@ -859,7 +859,7 @@ end return instancia end end - + --> antes de criar uma nova, ver se n�o h� alguma para reativar for index, instancia in _ipairs (_detalhes.tabela_instancias) do if (not instancia:IsAtiva()) then @@ -867,34 +867,34 @@ end return instancia end end - + if (#_detalhes.tabela_instancias >= _detalhes.instances_amount) then return _detalhes:Msg (Loc ["STRING_INSTANCE_LIMIT"]) end - + --> verifica se n�o tem uma janela na pool de janelas fechadas local next_id = #_detalhes.tabela_instancias+1 - + if (_detalhes.unused_instances [next_id]) then local new_instance = _detalhes.unused_instances [next_id] _detalhes.tabela_instancias [next_id] = new_instance _detalhes.unused_instances [next_id] = nil new_instance:AtivarInstancia() - + _detalhes:GetLowerInstanceNumber() - + return new_instance end - + --> cria uma nova janela local new_instance = _detalhes:NovaInstancia (#_detalhes.tabela_instancias+1) - + if (not _detalhes.initializing) then _detalhes:SendEvent ("DETAILS_INSTANCE_OPEN", nil, new_instance) end - + _detalhes:GetLowerInstanceNumber() - + return new_instance end ------------------------------------------------------------------------------------------------------------------------ @@ -902,7 +902,7 @@ end --> self � a inst�ncia que esta sendo movida.. instancia � a que esta parada function _detalhes:EstaAgrupada (esta_instancia, lado) --> lado //// 1 = encostou na esquerda // 2 = escostou emaixo // 3 = encostou na direita // 4 = encostou em cima --local meu_snap = self.snap --> pegou a tabela com {side, side, side, side} - + if (esta_instancia.snap [lado]) then return true --> ha possui uma janela grudapa neste lado elseif (lado == 1) then @@ -940,7 +940,7 @@ function _detalhes:BaseFrameSnap() for _, instance in _ipairs (group) do instance:SetWindowScale (scale) end - + local my_baseframe = self.baseframe for lado, snap_to in _pairs (self.snap) do local instancia_alvo = _detalhes.tabela_instancias [snap_to] @@ -949,17 +949,17 @@ function _detalhes:BaseFrameSnap() if (instancia_alvo.ativa and instancia_alvo.baseframe) then if (lado == 1) then --> a esquerda instancia_alvo.baseframe:SetPoint ("TOPRIGHT", my_baseframe, "TOPLEFT") - + elseif (lado == 2) then --> em baixo local statusbar_y_mod = 0 if (not self.show_statusbar) then statusbar_y_mod = 14 end instancia_alvo.baseframe:SetPoint ("TOPLEFT", my_baseframe, "BOTTOMLEFT", 0, -34 + statusbar_y_mod) - + elseif (lado == 3) then --> a direita instancia_alvo.baseframe:SetPoint ("BOTTOMLEFT", my_baseframe, "BOTTOMRIGHT") - + elseif (lado == 4) then --> em cima local statusbar_y_mod = 0 if (not instancia_alvo.show_statusbar) then @@ -974,7 +974,7 @@ function _detalhes:BaseFrameSnap() --[ --> aqui precisa de um efeito reverso - local reverso = self.meu_id - 2 --> se existir + local reverso = self.meu_id - 2 --> se existir if (reverso > 0) then --> se tiver uma inst�ncia l� tr�s --> aqui faz o efeito reverso: local inicio_retro = self.meu_id - 1 @@ -982,7 +982,7 @@ function _detalhes:BaseFrameSnap() local instancia = _detalhes.tabela_instancias [meu_id] for lado, snap_to in _pairs (instancia.snap) do if (snap_to < instancia.meu_id and snap_to ~= self.meu_id) then --> se o lado que esta grudado for menor que o meu id... EX instnacia #2 grudada na #1 - + --> ent�o tenho que pegar a inst�ncia do snap local instancia_alvo = _detalhes.tabela_instancias [snap_to] @@ -999,31 +999,31 @@ function _detalhes:BaseFrameSnap() --> fazer os setpoints if (instancia_alvo.ativa and instancia_alvo.baseframe) then - + if (lado_reverso == 1) then --> a esquerda instancia_alvo.baseframe:SetPoint ("BOTTOMLEFT", instancia.baseframe, "BOTTOMRIGHT") - + elseif (lado_reverso == 2) then --> em baixo - + local statusbar_y_mod = 0 if (not instancia_alvo.show_statusbar) then statusbar_y_mod = -14 end - + instancia_alvo.baseframe:SetPoint ("BOTTOMLEFT", instancia.baseframe, "TOPLEFT", 0, 34 + statusbar_y_mod) -- + (statusbar_y_mod*-1) - + elseif (lado_reverso == 3) then --> a direita instancia_alvo.baseframe:SetPoint ("TOPRIGHT", instancia.baseframe, "TOPLEFT") - + elseif (lado_reverso == 4) then --> em cima - + local statusbar_y_mod = 0 if (not instancia.show_statusbar) then statusbar_y_mod = 14 end - + instancia_alvo.baseframe:SetPoint ("TOPLEFT", instancia.baseframe, "BOTTOMLEFT", 0, -34 + statusbar_y_mod) - + end end end @@ -1031,36 +1031,36 @@ function _detalhes:BaseFrameSnap() end end --]] - + for meu_id, instancia in _ipairs (_detalhes.tabela_instancias) do if (meu_id > self.meu_id) then for lado, snap_to in _pairs (instancia.snap) do if (snap_to > instancia.meu_id and snap_to ~= self.meu_id) then local instancia_alvo = _detalhes.tabela_instancias [snap_to] - + if (instancia_alvo.ativa and instancia_alvo.baseframe) then if (lado == 1) then --> a esquerda instancia_alvo.baseframe:SetPoint ("TOPRIGHT", instancia.baseframe, "TOPLEFT") - + elseif (lado == 2) then --> em baixo local statusbar_y_mod = 0 if (not instancia.show_statusbar) then statusbar_y_mod = 14 end instancia_alvo.baseframe:SetPoint ("TOPLEFT", instancia.baseframe, "BOTTOMLEFT", 0, -34 + statusbar_y_mod) - + elseif (lado == 3) then --> a direita instancia_alvo.baseframe:SetPoint ("BOTTOMLEFT", instancia.baseframe, "BOTTOMRIGHT") - + elseif (lado == 4) then --> em cima - + local statusbar_y_mod = 0 if (not instancia_alvo.show_statusbar) then statusbar_y_mod = -14 end - + instancia_alvo.baseframe:SetPoint ("BOTTOMLEFT", instancia.baseframe, "TOPLEFT", 0, 34 + statusbar_y_mod) - + end end end @@ -1072,104 +1072,104 @@ end function _detalhes:agrupar_janelas (lados) local instancia = self - + for lado, esta_instancia in _pairs (lados) do if (esta_instancia) then instancia.baseframe:ClearAllPoints() esta_instancia = _detalhes.tabela_instancias [esta_instancia] - + instancia:SetWindowScale (esta_instancia.window_scale) - + if (lado == 3) then --> direita --> mover frame instancia.baseframe:SetPoint ("TOPRIGHT", esta_instancia.baseframe, "TOPLEFT") instancia.baseframe:SetPoint ("RIGHT", esta_instancia.baseframe, "LEFT") instancia.baseframe:SetPoint ("BOTTOMRIGHT", esta_instancia.baseframe, "BOTTOMLEFT") - + local _, height = esta_instancia:GetSize() instancia:SetSize (nil, height) - + --> salva o snap self.snap [3] = esta_instancia.meu_id esta_instancia.snap [1] = self.meu_id - + elseif (lado == 4) then --> cima --> mover frame - + local statusbar_y_mod = 0 if (not esta_instancia.show_statusbar) then statusbar_y_mod = 14 end - + instancia.baseframe:SetPoint ("TOPLEFT", esta_instancia.baseframe, "BOTTOMLEFT", 0, -34 + statusbar_y_mod) instancia.baseframe:SetPoint ("TOP", esta_instancia.baseframe, "BOTTOM", 0, -34 + statusbar_y_mod) instancia.baseframe:SetPoint ("TOPRIGHT", esta_instancia.baseframe, "BOTTOMRIGHT", 0, -34 + statusbar_y_mod) - + local _, height = esta_instancia:GetSize() instancia:SetSize (nil, height) - + --> salva o snap self.snap [4] = esta_instancia.meu_id esta_instancia.snap [2] = self.meu_id elseif (lado == 1) then --> esquerda --> mover frame - + instancia.baseframe:SetPoint ("TOPLEFT", esta_instancia.baseframe, "TOPRIGHT") instancia.baseframe:SetPoint ("LEFT", esta_instancia.baseframe, "RIGHT") instancia.baseframe:SetPoint ("BOTTOMLEFT", esta_instancia.baseframe, "BOTTOMRIGHT") - + local _, height = esta_instancia:GetSize() instancia:SetSize (nil, height) - + --> salva o snap self.snap [1] = esta_instancia.meu_id esta_instancia.snap [3] = self.meu_id - + elseif (lado == 2) then --> baixo --> mover frame - + local statusbar_y_mod = 0 if (not instancia.show_statusbar) then statusbar_y_mod = -14 end - + instancia.baseframe:SetPoint ("BOTTOMLEFT", esta_instancia.baseframe, "TOPLEFT", 0, 34 + statusbar_y_mod) instancia.baseframe:SetPoint ("BOTTOM", esta_instancia.baseframe, "TOP", 0, 34 + statusbar_y_mod) instancia.baseframe:SetPoint ("BOTTOMRIGHT", esta_instancia.baseframe, "TOPRIGHT", 0, 34 + statusbar_y_mod) - + local _, height = esta_instancia:GetSize() instancia:SetSize (nil, height) - + --> salva o snap self.snap [2] = esta_instancia.meu_id esta_instancia.snap [4] = self.meu_id end - + if (not esta_instancia.ativa) then esta_instancia:AtivarInstancia() end - + end end - + if (not _detalhes.disable_lock_ungroup_buttons) then instancia.break_snap_button:SetAlpha (1) end - + if (_detalhes.tutorial.unlock_button < 4) then - + _detalhes.temp_table1.IconSize = 32 _detalhes.temp_table1.TextHeightMod = -6 _detalhes.popup:ShowMe (instancia.break_snap_button, "tooltip", "Interface\\Buttons\\LockButton-Unlocked-Up", Loc ["STRING_UNLOCK"], 150, _detalhes.temp_table1) - + --UIFrameFlash (instancia.break_snap_button, .5, .5, 5, false, 0, 0) _detalhes.tutorial.unlock_button = _detalhes.tutorial.unlock_button + 1 end - + _detalhes:DelayOptionsRefresh() - + end _detalhes.MakeInstanceGroup = _detalhes.agrupar_janelas @@ -1189,26 +1189,26 @@ function _detalhes:Desagrupar (instancia, lado, lado2) lado = instancia instancia = self end - + if (_type (instancia) == "number") then --> significa que passou o n�mero da inst�ncia instancia = _detalhes.tabela_instancias [instancia] end - + _detalhes:DelayOptionsRefresh (nil, true) - + if (not lado) then return end - + if (lado < 0) then --> clicou no bot�o para desagrupar tudo local ID = instancia.meu_id - - for id, esta_instancia in _ipairs (_detalhes.tabela_instancias) do + + for id, esta_instancia in _ipairs (_detalhes.tabela_instancias) do for index, iid in _pairs (esta_instancia.snap) do -- index = 1 left , 3 right, 2 bottom, 4 top if (iid and (iid == ID or id == ID)) then -- iid = instancia.meu_id - + esta_instancia.snap [index] = nil - + if (instancia.verticalSnap or esta_instancia.verticalSnap) then if (not esta_instancia.snap [2] and not esta_instancia.snap [4]) then esta_instancia.verticalSnap = false @@ -1220,33 +1220,33 @@ function _detalhes:Desagrupar (instancia, lado, lado2) esta_instancia.verticalSnap = false end end - + if (index == 2) then -- index � o codigo do snap --esta_instancia.baseframe.rodape.StatusBarLeftAnchor:SetPoint ("left", esta_instancia.baseframe.rodape.top_bg, "left", 5, 58) --esta_instancia.baseframe.rodape.StatusBarCenterAnchor:SetPoint ("center", esta_instancia.baseframe.rodape.top_bg, "center", 0, 58) --esta_instancia.baseframe.rodape.esquerdo:SetTexture ("Interface\\AddOns\\Details\\images\\bar_down_left") --esta_instancia.baseframe.rodape.esquerdo.have_snap = nil end - + end end end - + instancia.break_snap_button:SetAlpha (0) - + instancia.verticalSnap = false instancia.horizontalSnap = false return end - + local esta_instancia = _detalhes.tabela_instancias [instancia.snap[lado]] - + if (not esta_instancia) then return end - + instancia.snap [lado] = nil - + if (lado == 1) then esta_instancia.snap [3] = nil elseif (lado == 2) then @@ -1258,21 +1258,21 @@ function _detalhes:Desagrupar (instancia, lado, lado2) end instancia.break_snap_button:SetAlpha (0) - - + + if (instancia.iniciada) then instancia:SaveMainWindowPosition() instancia:RestoreMainWindowPosition() end - + if (esta_instancia.iniciada) then esta_instancia:SaveMainWindowPosition() - esta_instancia:RestoreMainWindowPosition() + esta_instancia:RestoreMainWindowPosition() end end function _detalhes:SnapTextures (remove) - for id, esta_instancia in _ipairs (_detalhes.tabela_instancias) do + for id, esta_instancia in _ipairs (_detalhes.tabela_instancias) do if (esta_instancia:IsAtiva()) then if (esta_instancia.baseframe.rodape.esquerdo.have_snap) then if (remove) then @@ -1288,7 +1288,7 @@ end --> cria uma janela para uma nova inst�ncia --> search key: ~new ~nova function _detalhes:CreateDisabledInstance (ID, skin_table) - + --> first check if we can recycle a old instance if (_detalhes.unused_instances [ID]) then local new_instance = _detalhes.unused_instances [ID] @@ -1296,16 +1296,16 @@ end _detalhes.unused_instances [ID] = nil --> replace the values on recycled instance new_instance:ResetInstanceConfig() - + --> copy values from a previous skin saved if (skin_table) then --> copy from skin_table to new_instance _detalhes.table.copy (new_instance, skin_table) end - + return new_instance end - + --> must create a new one local new_instance = { --> instance id @@ -1316,8 +1316,8 @@ end rolagem = false, --barra de rolagem n�o esta sendo mostrada largura_scroll = 26, bar_mod = 0, - bgdisplay_loc = 0, - + bgdisplay_loc = 0, + --> displaying row info rows_created = 0, rows_showing = 0, @@ -1328,21 +1328,21 @@ end ["normal"] = {x = 1, y = 2, w = 300, h = 200}, ["solo"] = {x = 1, y = 2, w = 300, h = 200} }, - + --> save information about window snaps snap = {}, - + --> current state starts as normal mostrando = "normal", --> menu consolidated consolidate = false, --deprecated icons = {true, true, true, true}, - + --> status bar stuff StatusBar = {options = {}}, --> more stuff - atributo = 1, --> dano + atributo = 1, --> dano sub_atributo = 1, --> damage done sub_atributo_last = {1, 1, 1, 1, 1}, segmento = 0, --> combate atual @@ -1350,35 +1350,35 @@ end last_modo = modo_grupo, LastModo = modo_grupo, } - + _setmetatable (new_instance, _detalhes) _detalhes.tabela_instancias [#_detalhes.tabela_instancias+1] = new_instance --> fill the empty instance with default values new_instance:ResetInstanceConfig() - + --> copy values from a previous skin saved if (skin_table) then --> copy from skin_table to new_instance _detalhes.table.copy (new_instance, skin_table) end - + --> setup default wallpaper new_instance.wallpaper.texture = "Interface\\AddOns\\Details\\images\\background" - + --> finish return new_instance end - + function _detalhes:NovaInstancia (ID) local new_instance = {} _setmetatable (new_instance, _detalhes) _detalhes.tabela_instancias [#_detalhes.tabela_instancias+1] = new_instance - + --> instance number new_instance.meu_id = ID - + --> setup all config new_instance:ResetInstanceConfig() --> setup default wallpaper @@ -1392,21 +1392,21 @@ end new_instance.bar_mod = 0 new_instance.bgdisplay_loc = 0 new_instance.cached_bar_width = 0 - + --> displaying row info new_instance.rows_created = 0 new_instance.rows_showing = 0 new_instance.rows_max = 50 new_instance.rows_fit_in_window = nil - + --> saved pos for normal mode and lone wolf mode new_instance.posicao = { ["normal"] = {x = 1, y = 2, w = 300, h = 200}, ["solo"] = {x = 1, y = 2, w = 300, h = 200} - } + } --> save information about window snaps new_instance.snap = {} - + --> current state starts as normal new_instance.mostrando = "normal" --> menu consolidated @@ -1414,7 +1414,7 @@ end new_instance.icons = {true, true, true, true} --> create window frames - + local _baseframe, _bgframe, _bgframe_display, _scrollframe = gump:CriaJanelaPrincipal (ID, new_instance, true) new_instance.baseframe = _baseframe new_instance.bgframe = _bgframe @@ -1430,44 +1430,44 @@ end local clock = _detalhes.StatusBar:CreateStatusBarChildForInstance (new_instance, "DETAILS_STATUSBAR_PLUGIN_CLOCK") _detalhes.StatusBar:SetCenterPlugin (new_instance, clock) - + local segment = _detalhes.StatusBar:CreateStatusBarChildForInstance (new_instance, "DETAILS_STATUSBAR_PLUGIN_PSEGMENT") _detalhes.StatusBar:SetLeftPlugin (new_instance, segment) - + local dps = _detalhes.StatusBar:CreateStatusBarChildForInstance (new_instance, "DETAILS_STATUSBAR_PLUGIN_PDPS") _detalhes.StatusBar:SetRightPlugin (new_instance, dps) --> internal stuff new_instance.alturaAntiga = _baseframe:GetHeight() - new_instance.atributo = 1 --> dano + new_instance.atributo = 1 --> dano new_instance.sub_atributo = 1 --> damage done new_instance.sub_atributo_last = {1, 1, 1, 1, 1} new_instance.segmento = -1 --> combate atual new_instance.modo = modo_grupo new_instance.last_modo = modo_grupo new_instance.LastModo = modo_grupo - + --> change the attribute _detalhes:TrocaTabela (new_instance, 0, 1, 1) - + --> internal stuff new_instance.row_height = new_instance.row_info.height + new_instance.row_info.space.between - + new_instance.oldwith = new_instance.baseframe:GetWidth() new_instance.iniciada = true new_instance:SaveMainWindowPosition() new_instance:ReajustaGump() - + new_instance.rows_fit_in_window = _math_floor (new_instance.posicao[new_instance.mostrando].h / new_instance.row_height) - + --> all done new_instance:AtivarInstancia() - + new_instance:ShowSideBars() new_instance.skin = "no skin" new_instance:ChangeSkin (_detalhes.default_skin_to_use) - + --> apply standard skin if have one saved --[[ if (_detalhes.standard_skin) then @@ -1475,10 +1475,10 @@ end local style = _detalhes.standard_skin local instance = new_instance local skin = style.skin - + instance.skin = "" instance:ChangeSkin (skin) - + --> overwrite all instance parameters with saved ones for key, value in pairs (style) do if (key ~= "skin") then @@ -1492,10 +1492,10 @@ end end --]] - + --> apply all changed attributes --new_instance:ChangeSkin() - + return new_instance end ------------------------------------------------------------------------------------------------------------------------ @@ -1504,8 +1504,8 @@ end --print ("fixing...", instance.meu_id) --instance:ToolbarMenuButtons() end - - + + --> ao reiniciar o addon esta fun��o � rodada para recriar a janela da inst�ncia --> search key: ~restaura ~inicio ~start @@ -1538,22 +1538,22 @@ function _detalhes:RestauraJanela(index, temp, load_only) self.cached_bar_width = self.cached_bar_width or 0 self.row_height = self.row_info.height + self.row_info.space.between self.rows_fit_in_window = _math_floor (self.posicao[self.mostrando].h / self.row_height) - + --> create frames local isLocked = self.isLocked local _baseframe, _bgframe, _bgframe_display, _scrollframe = gump:CriaJanelaPrincipal (self.meu_id, self) self.baseframe = _baseframe self.bgframe = _bgframe self.bgdisplay = _bgframe_display - self.scroll = _scrollframe + self.scroll = _scrollframe _baseframe:EnableMouseWheel (false) self.alturaAntiga = _baseframe:GetHeight() - + --self.isLocked = isLocked --window isn't locked when just created it --> change the attribute _detalhes:TrocaTabela (self, self.segmento, self.atributo, self.sub_atributo, true) --> passando true no 5� valor para a fun��o ignorar a checagem de valores iguais - + --> set wallpaper if (self.wallpaper.enabled) then self:InstanceWallpaper (true) @@ -1561,7 +1561,7 @@ function _detalhes:RestauraJanela(index, temp, load_only) --> set the color of this instance window self:InstanceColor (self.color) - + --> scrollbar self:EsconderScrollBar (true) @@ -1630,35 +1630,35 @@ function _detalhes:RestauraJanela(index, temp, load_only) self:RestoreMainWindowPosition() self:ReajustaGump() --self:SaveMainWindowPosition() - + if (not load_only) then self.iniciada = true self:AtivarInstancia (temp) self:ChangeSkin() end - + --> all done return end function _detalhes:SwitchBack() local prev_switch = self.auto_switch_to_old - + if (prev_switch) then if (self.modo ~= prev_switch [1]) then _detalhes:AlteraModo (self, prev_switch [1]) end - + if (self.modo == _detalhes._detalhes_props["MODO_RAID"]) then _detalhes.RaidTables:switch (nil, prev_switch [5], self) - + elseif (self.modo == _detalhes._detalhes_props["MODO_ALONE"]) then _detalhes.SoloTables:switch (nil, prev_switch [6]) - + else _detalhes:TrocaTabela (self, prev_switch [4], prev_switch [2], prev_switch [3]) end - + self.auto_switch_to_old = nil end end @@ -1672,7 +1672,7 @@ function _detalhes:SwitchTo (switch_table, nosave) local plugin_global_name, can_switch = switch_table[2], true --plugin global name - for _, instance in ipairs (_detalhes.tabela_instancias) do + for _, instance in ipairs (_detalhes.tabela_instancias) do if (instance ~= self and instance:IsEnabled() and instance.baseframe and instance.modo == modo_raid) then if (instance.current_raid_plugin == plugin_global_name) then can_switch = false @@ -1680,7 +1680,7 @@ function _detalhes:SwitchTo (switch_table, nosave) end end end - + if (can_switch) then _detalhes.RaidTables:EnableRaidMode (self, switch_table [2]) else @@ -1702,29 +1702,29 @@ function _detalhes:CheckSwitchOnCombatEnd (nowipe, warning) local old_attribute, old_sub_atribute = self:GetDisplay() self:SwitchBack() - + local role = _UnitGroupRolesAssigned ("player") - + local got_switch = false - + if (role == "DAMAGER" and self.switch_damager) then self:SwitchTo (self.switch_damager) got_switch = true - + elseif (role == "HEALER" and self.switch_healer) then self:SwitchTo (self.switch_healer) got_switch = true - + elseif (role == "TANK" and self.switch_tank) then self:SwitchTo (self.switch_tank, true) got_switch = true - + elseif (role == "NONE" and _detalhes.last_assigned_role ~= "NONE") then self:SwitchBack() got_switch = true - + end - + if (warning and got_switch) then local current_attribute, current_sub_atribute = self:GetDisplay() if (current_attribute ~= old_attribute or current_sub_atribute ~= old_sub_atribute) then @@ -1732,18 +1732,18 @@ function _detalhes:CheckSwitchOnCombatEnd (nowipe, warning) self:InstanceAlert (string.format (Loc ["STRING_SWITCH_WARNING"], attribute_name), {[[Interface\CHARACTERFRAME\UI-StateIcon]], 18, 18, false, 0.5, 1, 0, 0.5}, 4) end end - + if (self.switch_all_roles_after_wipe and not nowipe) then if (_detalhes.tabela_vigente.is_boss and _detalhes.tabela_vigente.instance_type == "raid" and not _detalhes.tabela_vigente.is_boss.killed and _detalhes.tabela_vigente.is_boss.name) then self:SwitchBack() self:SwitchTo (self.switch_all_roles_after_wipe) end end - + end function _detalhes:CheckSwitchOnLogon (warning) - for index, instancia in ipairs (_detalhes.tabela_instancias) do + for index, instancia in ipairs (_detalhes.tabela_instancias) do if (instancia.ativa) then instancia:CheckSwitchOnCombatEnd (true, warning) end @@ -1751,7 +1751,7 @@ function _detalhes:CheckSwitchOnLogon (warning) end function _detalhes:CheckSegmentForSwitchOnCombatStart() - + end function _detalhes:CheckSwitchOnCombatStart (check_segment) @@ -1759,34 +1759,34 @@ function _detalhes:CheckSwitchOnCombatStart (check_segment) self:SwitchBack() local all_roles = self.switch_all_roles_in_combat - + local role = _UnitGroupRolesAssigned ("player") local got_switch = false - + if (role == "DAMAGER" and self.switch_damager_in_combat) then self:SwitchTo (self.switch_damager_in_combat) got_switch = true - + elseif (role == "HEALER" and self.switch_healer_in_combat) then self:SwitchTo (self.switch_healer_in_combat) got_switch = true - + elseif (role == "TANK" and self.switch_tank_in_combat) then self:SwitchTo (self.switch_tank_in_combat) got_switch = true - + elseif (self.switch_all_roles_in_combat) then self:SwitchTo (self.switch_all_roles_in_combat) got_switch = true - + end - + if (check_segment and got_switch) then if (self:GetSegment() ~= 0) then self:TrocaTabela (0) end end - + end local createStatusbarOptions = function(optionsTable) @@ -1873,7 +1873,7 @@ function _detalhes:ApplySavedSkin (style) if (not style.version or _detalhes.preset_version > style.version) then return _detalhes:Msg (Loc ["STRING_OPTIONS_PRESETTOOLD"]) end - + --> set skin preset local skin = style.skin self.skin = "" @@ -1889,11 +1889,11 @@ function _detalhes:ApplySavedSkin (style) end end end - + --> check for new keys inside tables - for key, value in pairs (_detalhes.instance_defaults) do + for key, value in pairs (_detalhes.instance_defaults) do if (type (value) == "table") then - for key2, value2 in pairs (value) do + for key2, value2 in pairs (value) do if (self [key] [key2] == nil) then if (type (value2) == "table") then self [key] [key2] = Details.CopyTable (_detalhes.instance_defaults [key] [key2]) @@ -1903,15 +1903,15 @@ function _detalhes:ApplySavedSkin (style) end end end - end - + end + self.StatusBarSaved = style.StatusBarSaved and Details.CopyTable (style.StatusBarSaved) or {options = {}} self.StatusBar.options = self.StatusBarSaved.options _detalhes.StatusBar:UpdateChilds (self) - + --> apply all changed attributes self:ChangeSkin() - + --export size and positioning if (_detalhes.profile_save_pos) then self.posicao = style.posicao @@ -1919,7 +1919,7 @@ function _detalhes:ApplySavedSkin (style) else self.posicao = Details.CopyTable (self.posicao) end - + end ------------------------------------------------------------------------------------------------------------------------ @@ -1966,7 +1966,7 @@ function _detalhes:SetBackgroundAlpha (alpha) if (not alpha) then alpha = self.bg_alpha end - + self.bgdisplay:SetBackdropColor (self.bg_r, self.bg_g, self.bg_b, alpha) self.baseframe:SetBackdropColor (self.bg_r, self.bg_g, self.bg_b, alpha) self.bg_alpha = alpha @@ -1985,7 +1985,7 @@ function _detalhes:GetPositionOnScreen() if (not xOfs) then return end - -- credits to ckknight (http://www.curseforge.com/profiles/ckknight/) + -- credits to ckknight (http://www.curseforge.com/profiles/ckknight/) local _scale = self.baseframe:GetEffectiveScale() local _UIscale = UIParent:GetScale() xOfs = xOfs*_scale - GetScreenWidth()*_UIscale/2 @@ -2002,13 +2002,13 @@ function _detalhes:Resize (w, h) if (w) then self.baseframe:SetWidth (w) end - + if (h) then self.baseframe:SetHeight (h) end - + self:SaveMainWindowPosition() - + return true end @@ -2022,7 +2022,7 @@ function _detalhes:ToggleMaxSize() self.original_width, self.original_height = original_width, original_height self.is_in_max_size = true self:SetSize (original_width, 450) - + end end @@ -2084,15 +2084,15 @@ function Details:Freeze (instancia) instancia:ResetaGump() Details.FadeHandler.Fader (instancia, "in", nil, "barras") end - + instancia:InstanceMsg (Loc ["STRING_FREEZE"], [[Interface\CHARACTERFRAME\Disconnect-Icon]], "silver") - + --instancia.freeze_icon:Show() --instancia.freeze_texto:Show() - + local width = instancia:GetSize() instancia.freeze_texto:SetWidth (width-64) - + instancia.freezed = true end @@ -2103,11 +2103,11 @@ function _detalhes:UnFreeze (instancia) end self:InstanceMsg (false) - + --instancia.freeze_icon:Hide() --instancia.freeze_texto:Hide() instancia.freezed = false - + if (not _detalhes.initializing) then --instancia:RestoreMainWindowPosition() instancia:ReajustaGump() @@ -2149,11 +2149,11 @@ function _detalhes:AtualizaSegmentos_AfterCombat (instancia, historico) instancia:ResetaGump() instancia:RefreshMainWindow (true) _detalhes:AtualizarJanela (instancia) - + elseif (segmento < _detalhes.segments_amount and segmento > 0) then instancia.showing = historico.tabelas [segmento] --print ("==> Changing the Segment now! - classe_instancia.lua 1952") - + Details.FadeHandler.Fader (instancia, _fadeType, _fadeSpeed, "barras") --"in", nil instancia.showing[instancia.atributo].need_refresh = true instancia.v_barras = true @@ -2161,7 +2161,7 @@ function _detalhes:AtualizaSegmentos_AfterCombat (instancia, historico) instancia:RefreshMainWindow (true) _detalhes:AtualizarJanela (instancia) end - + end local function ValidateAttribute (atributo, sub_atributo) @@ -2187,7 +2187,7 @@ local function ValidateAttribute (atributo, sub_atributo) else return false end - + return true end @@ -2262,23 +2262,23 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini local current_segmento = instancia.segmento local current_atributo = instancia.atributo local current_sub_atributo = instancia.sub_atributo - + local atributo_changed = false - + --> verifica se os valores passados s�o v�lidos - + if (not segmento) then segmento = instancia.segmento elseif (_type (segmento) ~= "number") then segmento = instancia.segmento end - + if (not atributo) then atributo = instancia.atributo elseif (_type (atributo) ~= "number") then atributo = instancia.atributo end - + if (not sub_atributo) then if (atributo == current_atributo) then sub_atributo = instancia.sub_atributo @@ -2288,7 +2288,7 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini elseif (_type (sub_atributo) ~= "number") then sub_atributo = instancia.sub_atributo end - + --> j� esta mostrando isso que esta pedindo if (not iniciando_instancia and segmento == current_segmento and atributo == current_atributo and sub_atributo == current_sub_atributo and not _detalhes.initializing) then return @@ -2299,7 +2299,7 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini atributo = 1 _detalhes:Msg ("invalid attribute, switching to damage done.") end - + --> Muda o segmento caso necess�rio if (segmento ~= current_segmento or _detalhes.initializing or iniciando_instancia) then @@ -2311,9 +2311,9 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini instancia.freezed = false end end - + instancia.segmento = segmento - + if (segmento == -1) then --> overall instancia.showing = _detalhes.tabela_overall elseif (segmento == 0) then --> combate atual @@ -2322,17 +2322,17 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini else --> alguma tabela do hist�rico instancia.showing = _detalhes.tabela_historico.tabelas [segmento] end - + if (update_coolTip) then _detalhes.popup:Select (1, segmento+2) end - + if (instancia.showing and instancia.showing.contra) then --print ("DEBUG: contra", instancia.showing.contra) end _detalhes:SendEvent ("DETAILS_INSTANCE_CHANGESEGMENT", nil, instancia, segmento) - + if (_detalhes.instances_segments_locked and not iniciando_instancia) then for _, instance in ipairs (_detalhes.tabela_instancias) do if (instance.meu_id ~= instancia.meu_id and instance.ativa and not instance._postponing_switch and not instance._postponing_current) then @@ -2346,9 +2346,9 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini instance.freezed = false end end - + instance.segmento = segmento - + if (segmento == -1) then --> overall instance.showing = _detalhes.tabela_overall elseif (segmento == 0) then --> combate atual @@ -2356,41 +2356,41 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini else --> alguma tabela do hist�rico instance.showing = _detalhes.tabela_historico.tabelas [segmento] end - + if (not instance.showing) then if (not iniciando_instancia) then instance:Freeze() end return end - + instance.v_barras = true instance.showing [atributo].need_refresh = true - + if (not _detalhes.initializing and not iniciando_instancia) then instance:ResetaGump() instance:RefreshMainWindow (true) end - + _detalhes:SendEvent ("DETAILS_INSTANCE_CHANGESEGMENT", nil, instance, segmento) end end end end end - + end --> Muda o atributo caso necess�rio if (atributo == 5) then - if (#_detalhes.custom < 1) then + if (#_detalhes.custom < 1) then atributo = 1 sub_atributo = 1 end end - + if (atributo ~= current_atributo or _detalhes.initializing or iniciando_instancia or (instancia.modo == modo_alone or instancia.modo == modo_raid)) then - + if (instancia.modo == modo_alone and not (_detalhes.initializing or iniciando_instancia)) then if (_detalhes.SoloTables.Mode == #_detalhes.SoloTables.Plugins) then _detalhes.popup:Select (1, 1) @@ -2400,32 +2400,32 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini end end return _detalhes.SoloTables.switch (nil, nil, -1) - + elseif ( (instancia.modo == modo_raid) and not (_detalhes.initializing or iniciando_instancia) ) then --> raid return --nao faz nada quando clicar no bot�o end - + atributo_changed = true instancia.atributo = atributo instancia.sub_atributo = instancia.sub_atributo_last [atributo] --> troca icone instancia:ChangeIcon() - + if (update_coolTip) then _detalhes.popup:Select (1, atributo) _detalhes.popup:Select (2, instancia.sub_atributo, atributo) end - + if (_detalhes.cloud_process) then - + if (_detalhes.debug) then _detalhes:Msg ("(debug) instancia #"..instancia.meu_id.." found cloud process.") end - + local atributo = instancia.atributo local time_left = (_detalhes.last_data_requested+7) - _detalhes._tempo - + if (atributo == 1 and _detalhes.in_combat and not _detalhes:CaptureGet ("damage") and _detalhes.host_by) then if (_detalhes.debug) then _detalhes:Msg ("(debug) instancia need damage cloud.") @@ -2445,7 +2445,7 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini else time_left = nil end - + if (time_left) then if (_detalhes.debug) then _detalhes:Msg ("(debug) showing instance alert.") @@ -2453,10 +2453,10 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini instancia:InstanceAlert (Loc ["STRING_PLEASE_WAIT"], {[[Interface\COMMON\StreamCircle]], 22, 22, true}, time_left) end end - + _detalhes:InstanceCall (_detalhes.CheckPsUpdate) _detalhes:SendEvent ("DETAILS_INSTANCE_CHANGEATTRIBUTE", nil, instancia, atributo, sub_atributo) - + end if (sub_atributo ~= current_sub_atributo or _detalhes.initializing or iniciando_instancia or atributo_changed) then @@ -2513,13 +2513,13 @@ function _detalhes:GetRaidPluginName() end function _detalhes:GetInstanceAttributeText() - + if (self.modo == modo_grupo or self.modo == modo_all) then local attribute = self.atributo local sub_attribute = self.sub_atributo local name = _detalhes:GetSubAttributeName (attribute, sub_attribute) return name or "Unknown" - + elseif (self.modo == modo_raid) then local plugin_name = self.current_raid_plugin or self.last_raid_plugin if (plugin_name) then @@ -2532,7 +2532,7 @@ function _detalhes:GetInstanceAttributeText() else return "Unknown Plugin" end - + elseif (self.modo == modo_alone) then local atributo = _detalhes.SoloTables.Mode or 1 local SoloInfo = _detalhes.SoloTables.Menu [atributo] @@ -2542,7 +2542,7 @@ function _detalhes:GetInstanceAttributeText() return "Unknown Plugin" end end - + end function _detalhes:MontaRaidOption (instancia) @@ -2552,7 +2552,7 @@ function _detalhes:MontaRaidOption (instancia) if (#available_plugins == 0) then return false end - + local amount = 0 for index, ptable in _ipairs (available_plugins) do if (ptable [3].__enabled) then @@ -2564,26 +2564,26 @@ function _detalhes:MontaRaidOption (instancia) if (amount == 0) then return false end - + GameCooltip:SetOption ("NoLastSelectedBar", true) - + GameCooltip:SetWallpaper (1, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true) return true end function _detalhes:MontaSoloOption (instancia) - for index, ptable in _ipairs (_detalhes.SoloTables.Menu) do + for index, ptable in _ipairs (_detalhes.SoloTables.Menu) do if (ptable [3].__enabled) then GameCooltip:AddMenu (1, _detalhes.SoloTables.switch, index, nil, nil, ptable [1], ptable [2], true) end end - + if (_detalhes.SoloTables.Mode) then GameCooltip:SetLastSelected (1, _detalhes.SoloTables.Mode) end - + GameCooltip:SetWallpaper (1, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true) - + return true end @@ -2596,18 +2596,18 @@ local menu_icones = { "Interface\\AddOns\\Details\\images\\atributos_icones_energyze", "Interface\\AddOns\\Details\\images\\atributos_icones_misc" } - + function _detalhes:MontaAtributosOption (instancia, func) func = func or instancia.TrocaTabela local checked1 = instancia.atributo local atributo_ativo = instancia.atributo --> pega o numero - + local options if (atributo_ativo == 5) then --> custom options = {Loc ["STRING_CUSTOM_NEW"]} - for index, custom in _ipairs (_detalhes.custom) do + for index, custom in _ipairs (_detalhes.custom) do options [#options+1] = custom.name end else @@ -2616,13 +2616,13 @@ function _detalhes:MontaAtributosOption (instancia, func) local CoolTip = _G.GameCooltip local p = 0.125 --> 32/256 - + local gindex = 1 for i = 1, atributos[0] do --> [0] armazena quantos atributos existem - + CoolTip:AddMenu (1, func, nil, i, nil, atributos.lista[i], nil, true) CoolTip:AddIcon ("Interface\\AddOns\\Details\\images\\atributos_icones", 1, 1, 20, 20, p*(i-1), p*(i), 0, 1) - + if (_detalhes.tooltip.submenu_wallpaper) then if (i == 1) then CoolTip:SetWallpaper (2, [[Interface\TALENTFRAME\WarlockDestruction-TopLeft]], {1, 0.22, 0, 0.55}, wallpaper_bg_color) @@ -2637,7 +2637,7 @@ function _detalhes:MontaAtributosOption (instancia, func) --> wallpaper = main window --CoolTip:SetWallpaper (2, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true) end - + local options = sub_atributos [i].lista if (not instancia.sub_atributo_last) then @@ -2656,34 +2656,34 @@ function _detalhes:MontaAtributosOption (instancia, func) gindex = gindex + 1 end - + CoolTip:SetLastSelected (2, i, instancia.sub_atributo_last [i]) end - + --> custom - + --GameCooltip:AddLine ("$div") CoolTip:AddLine ("$div", nil, 1, -3, 1) - + CoolTip:AddMenu (1, func, nil, 5, nil, atributos.lista[5], nil, true) CoolTip:AddIcon ("Interface\\AddOns\\Details\\images\\atributos_icones", 1, 1, 20, 20, p*(5-1), p*(5), 0, 1) - + CoolTip:AddMenu (2, _detalhes.OpenCustomDisplayWindow, nil, nil, nil, Loc ["STRING_CUSTOM_NEW"], nil, true) CoolTip:AddIcon ([[Interface\CHATFRAME\UI-ChatIcon-Maximize-Up]], 2, 1, 20, 20, 3/32, 29/32, 3/32, 29/32) - + CoolTip:AddLine ("$div", nil, 2, nil, -8, -13) - - for index, custom in _ipairs (_detalhes.custom) do + + for index, custom in _ipairs (_detalhes.custom) do if (custom.temp) then CoolTip:AddLine (custom.name .. Loc ["STRING_CUSTOM_TEMPORARILY"], nil, 2) else CoolTip:AddLine (custom.name, nil, 2) end - + CoolTip:AddMenu (2, func, true, 5, index) CoolTip:AddIcon (custom.icon, 2, 1, 20, 20) end - + --> set the wallpaper on custom if (_detalhes.tooltip.submenu_wallpaper) then CoolTip:SetWallpaper (2, [[Interface\TALENTFRAME\WarriorArm-TopLeft]], menu_wallpaper_custom_color, wallpaper_bg_color) @@ -2704,26 +2704,26 @@ function _detalhes:MontaAtributosOption (instancia, func) CoolTip:SetOption ("StatusBarTexture", [[Interface\AddOns\Details\images\bar4_vidro]]) CoolTip:SetOption ("ButtonsYMod", -7) CoolTip:SetOption ("HeighMod", 7) - + CoolTip:SetOption ("ButtonsYModSub", -7) CoolTip:SetOption ("HeighModSub", 7) - + CoolTip:SetOption ("SelectedTopAnchorMod", -2) CoolTip:SetOption ("SelectedBottomAnchorMod", 2) - + CoolTip:SetOption ("TextFont", _detalhes.font_faces.menus) - + _detalhes:SetTooltipMinWidth() - + local last_selected = atributo_ativo if (atributo_ativo == 5) then last_selected = 6 end CoolTip:SetLastSelected (1, last_selected) - + --removed the menu backdrop --CoolTip:SetWallpaper (1, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true) - + return menu_principal, sub_menus end @@ -2776,12 +2776,12 @@ function _detalhes:ChangeIcon(icon) local icon = _detalhes.custom [self.sub_atributo].icon self.baseframe.cabecalho.atributo_icon:SetTexture (icon) self.baseframe.cabecalho.atributo_icon:SetTexCoord (5/64, 60/64, 3/64, 62/64) - + local icon_size = skin.icon_plugins_size self.baseframe.cabecalho.atributo_icon:SetWidth (icon_size[1]) self.baseframe.cabecalho.atributo_icon:SetHeight (icon_size[2]) local icon_anchor = skin.icon_anchor_plugins - + self.baseframe.cabecalho.atributo_icon:ClearAllPoints() self.baseframe.cabecalho.atributo_icon:SetPoint ("TOPRIGHT", self.baseframe.cabecalho.ball_point, "TOPRIGHT", icon_anchor[1], icon_anchor[2]) end @@ -2798,18 +2798,18 @@ function _detalhes:ChangeIcon(icon) local p = 0.125 --> 32/256 self.baseframe.cabecalho.atributo_icon:SetTexCoord (p * (self.sub_atributo-1), p * (self.sub_atributo), 0, 1) self.baseframe.cabecalho.atributo_icon:SetSize (16, 16) - + self.baseframe.cabecalho.atributo_icon:ClearAllPoints() if (self.menu_attribute_string) then local yOffset = getFineTunedIconCoords(self.atributo, self.sub_atributo) self.baseframe.cabecalho.atributo_icon:SetPoint ("right", self.menu_attribute_string.widget, "left", -4, 1 + yOffset) end - + if (skin.attribute_icon_anchor) then self.baseframe.cabecalho.atributo_icon:ClearAllPoints() self.baseframe.cabecalho.atributo_icon:SetPoint ("topleft", self.baseframe.cabecalho.ball_point, "topleft", skin.attribute_icon_anchor[1], skin.attribute_icon_anchor[2]) end - + if (skin.attribute_icon_size) then self.baseframe.cabecalho.atributo_icon:SetSize (unpack (skin.attribute_icon_size)) end @@ -2831,12 +2831,12 @@ function _detalhes:AlteraModo (instancia, qual, from_mode_menu) qual = instancia instancia = self end - + local update_coolTip = false - + if (qual == -2) then --clicou para mudar local update_coolTip = true - + if (instancia.modo == 1) then qual = 2 elseif (instancia.modo == 2) then @@ -2861,26 +2861,26 @@ function _detalhes:AlteraModo (instancia, qual, from_mode_menu) end if (qual == modo_alone) then - + instancia.LastModo = instancia.modo - + if (instancia:IsRaidMode()) then _detalhes.RaidTables:DisableRaidMode (instancia) end --> verifica se ja tem alguma instancia desativada em solo e remove o solo dela _detalhes:InstanciaCallFunctionOffline (_detalhes.InstanciaCheckForDisabledSolo) - + instancia.modo = modo_alone instancia:ChangeIcon() - + instancia:SoloMode (true) _detalhes:SendEvent ("DETAILS_INSTANCE_CHANGEMODE", nil, instancia, modo_alone) - + elseif (qual == modo_raid) then - + instancia.LastModo = instancia.modo - + if (instancia:IsSoloMode()) then instancia:SoloMode (false) end @@ -2889,37 +2889,37 @@ function _detalhes:AlteraModo (instancia, qual, from_mode_menu) instancia.modo = modo_raid instancia:ChangeIcon() - + _detalhes.RaidTables:EnableRaidMode (instancia) - + _detalhes:SendEvent ("DETAILS_INSTANCE_CHANGEMODE", nil, instancia, modo_raid) - + elseif (qual == modo_grupo) then - + instancia.LastModo = instancia.modo - + if (instancia:IsSoloMode()) then --instancia.modo = modo_grupo instancia:SoloMode (false) elseif (instancia:IsRaidMode()) then _detalhes.RaidTables:DisableRaidMode (instancia) end - + _detalhes:ResetaGump (instancia) --Details.FadeHandler.Fader (instancia, 1, nil, "barras") - + instancia.modo = modo_grupo instancia:ChangeIcon() - + instancia:RefreshMainWindow (true) instancia.last_modo = modo_grupo _detalhes:SendEvent ("DETAILS_INSTANCE_CHANGEMODE", nil, instancia, modo_grupo) _detalhes:SendEvent ("DETAILS_INSTANCE_CHANGEATTRIBUTE", nil, instancia, instancia.atributo, instancia.sub_atributo) elseif (qual == modo_all) then - + instancia.LastModo = instancia.modo - + if (instancia:IsSoloMode()) then instancia.modo = modo_all instancia:SoloMode (false) @@ -2927,10 +2927,10 @@ function _detalhes:AlteraModo (instancia, qual, from_mode_menu) elseif (instancia:IsRaidMode()) then _detalhes.RaidTables:DisableRaidMode (instancia) end - + instancia.modo = modo_all instancia:ChangeIcon() - + instancia:RefreshMainWindow (true) instancia.last_modo = modo_all _detalhes:SendEvent ("DETAILS_INSTANCE_CHANGEMODE", nil, instancia, modo_all) @@ -2946,21 +2946,21 @@ function _detalhes:AlteraModo (instancia, qual, from_mode_menu) checked = 2 elseif (instancia.modo == 4) then checked = 3 - end + end _detalhes.popup:Select (1, checked) - + if (from_mode_menu) then instancia.baseframe.cabecalho.modo_selecao:GetScript ("OnEnter")(instancia.baseframe.cabecalho.modo_selecao, _, true) - + --> running OnEnter does also trigger an instance enter event, so we need to manually leave the instance: _detalhes.OnLeaveMainWindow (instancia, instancia.baseframe.cabecalho.modo_selecao) - + if (instancia.desaturated_menu) then instancia.baseframe.cabecalho.modo_selecao:GetNormalTexture():SetDesaturated (true) end end - + end local function GetDpsHps (_thisActor, key) @@ -2971,7 +2971,7 @@ local function GetDpsHps (_thisActor, key) elseif (key == "hps") then keyname = "last_hps" end - + if (_thisActor [keyname]) then return _thisActor [keyname] else @@ -3001,18 +3001,18 @@ end -- report_table = a table header: {"report results for:"} -- data = table with {{value1 (string), value2 ( the value)} , {value1 (string), value2 ( the value)}} -local default_format_value1 = function (v) return v end -local default_format_value2 = function (v) return v end -local default_format_value3 = function (i, v1, v2) +local default_format_value1 = function(v) return v end +local default_format_value2 = function(v) return v end +local default_format_value3 = function(i, v1, v2) return "" .. i .. ". " .. v1 .. " " .. v2 end function _detalhes:FormatReportLines (report_table, data, f1, f2, f3) - + f1 = f1 or default_format_value1 f2 = f2 or default_format_value2 f3 = f3 or default_format_value3 - + if (not _detalhes.fontstring_len) then _detalhes.fontstring_len = _detalhes.listener:CreateFontString (nil, "background", "GameFontNormal") end @@ -3023,8 +3023,8 @@ function _detalhes:FormatReportLines (report_table, data, f1, f2, f3) local fonte, _, flags = _detalhes.fontstring_len:GetFont() _detalhes.fontstring_len:SetFont (fonte, fontSize, flags) _detalhes.fontstring_len:SetText ("DEFAULT NAME") - local biggest_len = _detalhes.fontstring_len:GetStringWidth() - + local biggest_len = _detalhes.fontstring_len:GetStringWidth() + for index, t in ipairs (data) do local v1 = f1 (t[1]) _detalhes.fontstring_len:SetText (v1) @@ -3033,33 +3033,33 @@ function _detalhes:FormatReportLines (report_table, data, f1, f2, f3) biggest_len = len end end - + if (biggest_len > 130) then biggest_len = 130 end - + for index, t in ipairs (data) do local v1, v2 = f1 (t[1]), f2 (t[2]) if (v1 and v2 and type (v1) == "string" and type (v2) == "string") then v1 = v1 .. " " _detalhes.fontstring_len:SetText (v1) local len = _detalhes.fontstring_len:GetStringWidth() - - while (len < biggest_len) do + + while (len < biggest_len) do v1 = v1 .. "." _detalhes.fontstring_len:SetText (v1) len = _detalhes.fontstring_len:GetStringWidth() - end - + end + report_table [#report_table+1] = f3 (index, v1, v2) end end - + end -local report_name_function = function (name) +local report_name_function = function(name) local name, index = unpack (name) - + if (_detalhes.remove_realm_from_name and name:find ("-")) then return index .. ". " .. name:gsub (("%-.*"), "") else @@ -3067,9 +3067,9 @@ local report_name_function = function (name) end end -local report_amount_function = function (t) +local report_amount_function = function(t) local amount, dps, percent, is_string, index = unpack (t) - + if (not is_string) then if (dps) then if (_detalhes.report_schema == 1) then @@ -3091,20 +3091,20 @@ local report_amount_function = function (t) end end -local report_build_line = function (i, v1, v2) +local report_build_line = function(i, v1, v2) return v1 .. " " .. v2 end --> Reportar o que esta na janela da inst�ncia function _detalhes:monta_relatorio (este_relatorio, custom) - + if (custom) then --> shrink local report_lines = {} for i = 1, _detalhes.report_lines+1, 1 do --#este_relatorio -- o +1 � pq ele conta o cabe�alho como uma linha report_lines [#report_lines+1] = este_relatorio[i] end - + return self:envia_relatorio (report_lines, true) end @@ -3126,7 +3126,7 @@ function _detalhes:monta_relatorio (este_relatorio, custom) report_lines [#report_lines+1] = "Details!: " .. _detalhes.sub_atributos [self.atributo].lista [self.sub_atributo] end end - + if (self.meu_id and self.atributo and self.sub_atributo and _detalhes.report_where ~= "WHISPER" and _detalhes.report_where ~= "WHISPER2") then local already_exists for index, reported in ipairs (_detalhes.latest_report_table) do @@ -3135,7 +3135,7 @@ function _detalhes:monta_relatorio (este_relatorio, custom) break end end - + if (already_exists) then --push it to front local t = tremove (_detalhes.latest_report_table, already_exists) @@ -3149,53 +3149,53 @@ function _detalhes:monta_relatorio (este_relatorio, custom) tinsert (_detalhes.latest_report_table, 1, {self.meu_id, self.atributo, self.sub_atributo, amt, _detalhes.report_where}) end end - + tremove (_detalhes.latest_report_table, 11) end - + local barras = self.barras local esta_barra local is_current = _G ["Details_Report_CB_1"]:GetChecked() local is_reverse = _G ["Details_Report_CB_2"]:GetChecked() local name_member = "nome" - + if (not is_current) then - + local total, keyName, keyNameSec, first local container_amount = 0 local atributo = self.atributo local container = self.showing [atributo]._ActorTable - + if (atributo == 1) then --> damage if (self.sub_atributo == 5) then --> frags local frags = self.showing.frags local reportarFrags = {} - for name, amount in pairs (frags) do + for name, amount in pairs (frags) do --> string para imprimir direto sem calculos - reportarFrags [#reportarFrags+1] = {frag = tostring (amount), nome = name} + reportarFrags [#reportarFrags+1] = {frag = tostring (amount), nome = name} end container = reportarFrags container_amount = #reportarFrags keyName = "frag" - + elseif (self.sub_atributo == 7) then --> auras e voidzones - + total, keyName, first, container_amount, container, name_member = _detalhes.atributo_damage:RefreshWindow (self, self.showing, true, true) - + elseif (self.sub_atributo == 8) then --> damage taken by spell - + total, keyName, first, container_amount, container = _detalhes.atributo_damage:RefreshWindow (self, self.showing, true, true) - + for _, t in ipairs (container) do - t.nome = _detalhes:GetSpellLink (t.spellid) + t.nome = _detalhes:GetSpellLink(t.spellid) end - + else total, keyName, first, container_amount = _detalhes.atributo_damage:RefreshWindow (self, self.showing, true, true) if (self.sub_atributo == 1) then keyNameSec = "dps" elseif (self.sub_atributo == 2) then - + end end elseif (atributo == 2) then --> heal @@ -3211,7 +3211,7 @@ function _detalhes:monta_relatorio (este_relatorio, custom) local mortes = self.showing.last_events_tables local reportarMortes = {} - for index, morte in ipairs (mortes) do + for index, morte in ipairs (mortes) do reportarMortes [#reportarMortes+1] = {dead = morte [6], nome = morte [3]:gsub (("%-.*"), "")} end container = reportarMortes @@ -3235,15 +3235,15 @@ function _detalhes:monta_relatorio (este_relatorio, custom) container = self.showing [atributo]._ActorTable end end - + amt = math.min (amt, container_amount or 0) local raw_data_to_report = {} - for i = 1, container_amount do + for i = 1, container_amount do local actor = container [i] - - if (actor) then - + + if (actor) then + -- get the total local amount, is_string if (type (actor [keyName]) == "number") then @@ -3252,10 +3252,10 @@ function _detalhes:monta_relatorio (este_relatorio, custom) amount = actor [keyName] is_string = true end - + -- get the name local name = actor [name_member] or "" - + if (not is_string) then -- get the percent local percent @@ -3264,18 +3264,18 @@ function _detalhes:monta_relatorio (este_relatorio, custom) elseif (not is_string) then percent = _cstr ("%.1f", amount / max(total, 0.00001) * 100) end - + -- get the dps local dps = false if (keyNameSec) then dps = GetDpsHps (actor, keyNameSec) end - + raw_data_to_report [#raw_data_to_report+1] = {{name, i}, {amount, dps, percent, false}} else raw_data_to_report [#raw_data_to_report+1] = {{name, i}, {amount, false, false, true}} end - + else break end @@ -3298,9 +3298,9 @@ function _detalhes:monta_relatorio (este_relatorio, custom) end else - + local raw_data_to_report = {} - + for i = 1, amt do local window_bar = self.barras [i] if (window_bar) then @@ -3313,13 +3313,13 @@ function _detalhes:monta_relatorio (este_relatorio, custom) break end end - + _detalhes:FormatReportLines (report_lines, raw_data_to_report, nil, nil, report_build_line) - + end return self:envia_relatorio (report_lines) - + end function _detalhes:envia_relatorio (linhas, custom) @@ -3327,9 +3327,9 @@ function _detalhes:envia_relatorio (linhas, custom) local segmento = self.segmento local luta = nil local combatObject - + if (not custom) then - + if (not linhas[1]) then return _detalhes:Msg (Loc ["STRING_ACTORFRAME_NOTHING"]) end @@ -3338,28 +3338,28 @@ function _detalhes:envia_relatorio (linhas, custom) --luta = Loc ["STRING_REPORT_LAST"] .. " " .. #_detalhes.tabela_historico.tabelas .. " " .. Loc ["STRING_REPORT_FIGHTS"] luta = _detalhes.tabela_overall.overall_enemy_name combatObject = _detalhes.tabela_overall - + elseif (segmento == 0) then --current - + if (_detalhes.tabela_vigente.is_boss) then local encounterName = _detalhes.tabela_vigente.is_boss.name if (encounterName) then luta = encounterName end - + elseif (_detalhes.tabela_vigente.is_pvp) then local battleground_name = _detalhes.tabela_vigente.is_pvp.name if (battleground_name) then luta = battleground_name end end - + local isMythicDungeon = _detalhes.tabela_vigente:IsMythicDungeon() if (isMythicDungeon) then local mythicDungeonInfo = _detalhes.tabela_vigente:GetMythicDungeonInfo() if (mythicDungeonInfo) then local isMythicOverallSegment, segmentID, mythicLevel, EJID, mapID, zoneName, encounterID, encounterName, startedAt, endedAt, runID = _detalhes:UnpackMythicDungeonInfo (mythicDungeonInfo) - + if (isMythicOverallSegment) then luta = zoneName .. " +" .. mythicLevel .. " (" .. Loc ["STRING_SEGMENTS_LIST_OVERALL"] .. ")" else @@ -3373,42 +3373,42 @@ function _detalhes:envia_relatorio (linhas, custom) luta = Loc ["STRING_SEGMENTS_LIST_TRASH"] end end - + if (not luta) then if (_detalhes.tabela_vigente.enemy) then luta = _detalhes.tabela_vigente.enemy end end - + if (not luta) then luta = _detalhes.segmentos.current end - + combatObject = _detalhes.tabela_vigente - + else if (segmento == 1) then - + if (_detalhes.tabela_historico.tabelas[1].is_boss) then local encounterName = _detalhes.tabela_historico.tabelas[1].is_boss.name if (encounterName) then luta = encounterName .. " (" .. Loc ["STRING_REPORT_LASTFIGHT"] .. ")" end - + elseif (_detalhes.tabela_historico.tabelas[1].is_pvp) then local battleground_name = _detalhes.tabela_historico.tabelas[1].is_pvp.name if (battleground_name) then luta = battleground_name .. " (" .. Loc ["STRING_REPORT_LASTFIGHT"] .. ")" end end - + local thisSegment = _detalhes.tabela_historico.tabelas[1] local isMythicDungeon = thisSegment:IsMythicDungeon() if (isMythicDungeon) then local mythicDungeonInfo = thisSegment:GetMythicDungeonInfo() if (mythicDungeonInfo) then local isMythicOverallSegment, segmentID, mythicLevel, EJID, mapID, zoneName, encounterID, encounterName, startedAt, endedAt, runID = _detalhes:UnpackMythicDungeonInfo (mythicDungeonInfo) - + if (isMythicOverallSegment) then luta = zoneName .. " +" .. mythicLevel .. " (" .. Loc ["STRING_SEGMENTS_LIST_OVERALL"] .. ")" else @@ -3422,41 +3422,41 @@ function _detalhes:envia_relatorio (linhas, custom) luta = Loc ["STRING_SEGMENTS_LIST_TRASH"] end end - + if (not luta) then if (_detalhes.tabela_historico.tabelas[1].enemy) then luta = _detalhes.tabela_historico.tabelas[1].enemy .. " (" .. Loc ["STRING_REPORT_LASTFIGHT"] .. ")" end end - + if (not luta) then luta = Loc ["STRING_REPORT_LASTFIGHT"] end - + combatObject = _detalhes.tabela_historico.tabelas[1] - + else - + if (_detalhes.tabela_historico.tabelas[segmento].is_boss) then local encounterName = _detalhes.tabela_historico.tabelas[segmento].is_boss.name if (encounterName) then luta = encounterName .. " (" .. segmento .. " " .. Loc ["STRING_REPORT_PREVIOUSFIGHTS"] .. ")" end - + elseif (_detalhes.tabela_historico.tabelas[segmento].is_pvp) then local battleground_name = _detalhes.tabela_historico.tabelas[segmento].is_pvp.name if (battleground_name) then luta = battleground_name .. " (" .. Loc ["STRING_REPORT_LASTFIGHT"] .. ")" end end - + local thisSegment = _detalhes.tabela_historico.tabelas [segmento] local isMythicDungeon = thisSegment:IsMythicDungeon() if (isMythicDungeon) then local mythicDungeonInfo = thisSegment:GetMythicDungeonInfo() if (mythicDungeonInfo) then local isMythicOverallSegment, segmentID, mythicLevel, EJID, mapID, zoneName, encounterID, encounterName, startedAt, endedAt, runID = _detalhes:UnpackMythicDungeonInfo (mythicDungeonInfo) - + if (isMythicOverallSegment) then luta = zoneName .. " +" .. mythicLevel .. " (" .. Loc ["STRING_SEGMENTS_LIST_OVERALL"] .. ")" else @@ -3470,40 +3470,40 @@ function _detalhes:envia_relatorio (linhas, custom) luta = Loc ["STRING_SEGMENTS_LIST_TRASH"] end end - + if (not luta) then if (_detalhes.tabela_historico.tabelas[segmento].enemy) then luta = _detalhes.tabela_historico.tabelas[segmento].enemy .. " (" .. segmento .. " " .. Loc ["STRING_REPORT_PREVIOUSFIGHTS"] .. ")" end end - + if (not luta) then luta = " (" .. segmento .. " " .. Loc ["STRING_REPORT_PREVIOUSFIGHTS"] .. ")" end - + combatObject = _detalhes.tabela_historico.tabelas[segmento] end end - + linhas[1] = linhas[1] .. " " .. Loc ["STRING_REPORT"] .. " " .. luta end - + --adicionar o tempo de luta local segmentTime = "" if (combatObject) then local time = combatObject:GetCombatTime() segmentTime = _detalhes.gump:IntegerToTimer (time or 0) end - + --effective ou active time if (_detalhes.time_type == 2) then linhas[1] = linhas[1] .. " [" .. segmentTime .. " EF]" else linhas[1] = linhas[1] .. " [" .. segmentTime .. " AC]" end - - + + local editbox = _detalhes.janela_report.editbox if (editbox.focus) then --> n�o precionou enter antes de clicar no okey local texto = _detalhes:trim (editbox:GetText()) @@ -3514,42 +3514,42 @@ function _detalhes:envia_relatorio (linhas, custom) else _detalhes.report_to_who = "" editbox:SetText ("") - end + end editbox.perdeu_foco = true --> isso aqui pra quando estiver editando e clicar em outra caixa editbox:ClearFocus() end _detalhes:DelayUpdateReportWindowRecentlyReported() - + if (_detalhes.report_where == "COPY") then _detalhes:SendReportTextWindow (linhas) return end - + local to_who = _detalhes.report_where - + local channel = to_who:find ("CHANNEL") local is_btag = to_who:find ("REALID") - - local send_report_channel = function (timerObject) + + local send_report_channel = function(timerObject) _SendChatMessage (timerObject.Arg1, timerObject.Arg2, timerObject.Arg3, timerObject.Arg4) end - - local sendReportBnet = function (timerObject) + + local sendReportBnet = function(timerObject) BNSendWhisper(timerObject.Arg1, timerObject.Arg2) end - + local delay = 200 - + if (channel) then - + channel = to_who:gsub ((".*|"), "") - for i = 1, #linhas do + for i = 1, #linhas do if (channel == "Trade") then channel = "Trade - City" end - + local channelName = GetChannelName (channel) local timer = C_Timer.NewTimer (i * delay / 1000, send_report_channel) timer.Arg1 = linhas[i] @@ -3557,31 +3557,31 @@ function _detalhes:envia_relatorio (linhas, custom) timer.Arg3 = nil timer.Arg4 = channelName end - + return - + elseif (is_btag) then local bnetAccountID = to_who:gsub ((".*|"), "") bnetAccountID = tonumber(bnetAccountID) - + for i = 1, #linhas do local timer = C_Timer.NewTimer (i * delay / 1000, sendReportBnet) timer.Arg1 = bnetAccountID timer.Arg2 = linhas[i] end - + return elseif (to_who == "WHISPER") then --> whisper - + local alvo = _detalhes.report_to_who - + if (not alvo or alvo == "") then _detalhes:Msg (Loc ["STRING_REPORT_INVALIDTARGET"]) return end - - for i = 1, #linhas do + + for i = 1, #linhas do local timer = C_Timer.NewTimer (i * delay / 1000, send_report_channel) timer.Arg1 = linhas[i] timer.Arg2 = to_who @@ -3589,10 +3589,10 @@ function _detalhes:envia_relatorio (linhas, custom) timer.Arg4 = alvo end return - + elseif (to_who == "WHISPER2") then --> whisper target to_who = "WHISPER" - + local alvo if (_UnitExists ("target")) then if (_UnitIsPlayer ("target")) then @@ -3609,8 +3609,8 @@ function _detalhes:envia_relatorio (linhas, custom) _detalhes:Msg (Loc ["STRING_REPORT_INVALIDTARGET"]) return end - - for i = 1, #linhas do + + for i = 1, #linhas do local timer = C_Timer.NewTimer (i * delay / 1000, send_report_channel) timer.Arg1 = linhas[i] timer.Arg2 = to_who @@ -3620,22 +3620,22 @@ function _detalhes:envia_relatorio (linhas, custom) return end - + if (to_who == "RAID" or to_who == "PARTY") then if (GetNumGroupMembers (LE_PARTY_CATEGORY_INSTANCE) > 0) then to_who = "INSTANCE_CHAT" end end - - for i = 1, #linhas do + + for i = 1, #linhas do local timer = C_Timer.NewTimer (i * delay / 1000, send_report_channel) timer.Arg1 = linhas[i] timer.Arg2 = to_who timer.Arg3 = nil timer.Arg4 = nil - + end - + end -- enda elsef diff --git a/classes/class_resources.lua b/classes/class_resources.lua index 803e4977..76d250b0 100644 --- a/classes/class_resources.lua +++ b/classes/class_resources.lua @@ -66,7 +66,7 @@ function atributo_energy:NovaTabela (serial, nome, link) --> constructor - local alphabetical = _detalhes:GetOrderNumber (nome) + local alphabetical = _detalhes:GetOrderNumber(nome) local _new_energyActor = { @@ -137,7 +137,7 @@ end local power_table = {0, 1, 3, 6} local power_type -local sort_energy = function (t1, t2) +local sort_energy = function(t1, t2) if (t1.powertype == power_type and t2.powertype == power_type) then return t1.received > t2.received elseif (t1.powertype == power_type) then @@ -149,11 +149,11 @@ local sort_energy = function (t1, t2) end end -local sort_energyalternate = function (t1, t2) +local sort_energyalternate = function(t1, t2) return t1.alternatepower > t2.alternatepower end -local sort_energy_group = function (t1, t2) +local sort_energy_group = function(t1, t2) if (t1.grupo and t2.grupo) then if (t1.powertype == power_type and t2.powertype == power_type) then return t1.received > t2.received @@ -175,7 +175,7 @@ local sort_energy_group = function (t1, t2) end end -local sort_alternateenergy_group = function (t1, t2) +local sort_alternateenergy_group = function(t1, t2) if (t1.grupo and t2.grupo) then return t1.alternatepower > t2.alternatepower else @@ -924,7 +924,7 @@ function atributo_energy:ToolTipRegenRecebido (instancia, numero, barra, keydown break end - local nome_magia, _, icone_magia = _GetSpellInfo (spell [1]) + local nome_magia, _, icone_magia = _GetSpellInfo(spell [1]) GameCooltip:AddLine (nome_magia, FormatTooltipNumber (_, spell [2]).." (".._cstr("%.1f", (spell [2]/total_regenerado) * 100).."%)") GameCooltip:AddIcon (icone_magia, nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) _detalhes:AddTooltipBackgroundStatusbar (false, spell [2] / energy_tooltips_table [1][2] * 100) @@ -1013,7 +1013,7 @@ function atributo_energy:ToolTipRegenRecebido (instancia, numero, barra, keydown for i = 1, #allGeneratorSpells do local thisGenerator = allGeneratorSpells [i] - local spellName, _, spellIcon = GetSpellInfo (thisGenerator[1].id) + local spellName, _, spellIcon = GetSpellInfo(thisGenerator[1].id) GameCooltip:AddLine (spellName, FormatTooltipNumber (_, thisGenerator[2]) .. " (|cFFFF5555overflow: " .. FormatTooltipNumber (_, thisGenerator[3]) .. "|r | " .. _cstr ("%.1f", (thisGenerator[2] / allGenerated) * 100).."%)") GameCooltip:AddIcon (spellIcon, nil, nil, icon_size.W, icon_size.H, .1, .9, .1, .9) _detalhes:AddTooltipBackgroundStatusbar() @@ -1122,7 +1122,7 @@ function atributo_energy:MontaInfoRegenRecebido() self:FocusLock (barra, tabela[1]) - local spellname, _, spellicon = _GetSpellInfo (tabela [1]) + local spellname, _, spellicon = _GetSpellInfo(tabela [1]) local percent = tabela [2] / total_regenerado * 100 self:UpdadeInfoBar (barra, index, tabela[1], spellname, tabela[2], _detalhes:comma_value (tabela[2]), max_, percent, spellicon, true) @@ -1343,7 +1343,7 @@ function atributo_energy:MontaTooltipAlvos (esta_barra, index) break end - local spellname, _, spellicon = _GetSpellInfo (spell [1]) + local spellname, _, spellicon = _GetSpellInfo(spell [1]) GameTooltip:AddDoubleLine(spellname .. ": ", _detalhes:comma_value (spell [2]) .. " (" .. _cstr ("%.1f", (spell [2] / total_regenerado) * 100).."%)", 1, 1, 1, 1, 1, 1) GameTooltip:AddTexture(spellicon) end @@ -1542,7 +1542,7 @@ function _detalhes.clear:c_atributo_energy (este_jogador) _detalhes.clear:c_container_habilidades (este_jogador.spells) end -atributo_energy.__add = function (tabela1, tabela2) +atributo_energy.__add = function(tabela1, tabela2) if (not tabela1.powertype) then tabela1.powertype = tabela2.powertype @@ -1580,7 +1580,7 @@ atributo_energy.__add = function (tabela1, tabela2) return tabela1 end -atributo_energy.__sub = function (tabela1, tabela2) +atributo_energy.__sub = function(tabela1, tabela2) if (not tabela1.powertype) then tabela1.powertype = tabela2.powertype diff --git a/classes/class_spellutility.lua b/classes/class_spellutility.lua index 8f85065a..840f0a26 100644 --- a/classes/class_spellutility.lua +++ b/classes/class_spellutility.lua @@ -52,7 +52,7 @@ function habilidade_misc:Add (serial, nome, flag, who_nome, token, spellID, spellName) - --print (self.id, GetSpellInfo (self.id)) + --print (self.id, GetSpellInfo(self.id)) if (spellID == "BUFF_OR_DEBUFF") then diff --git a/classes/class_utility.lua b/classes/class_utility.lua index a4e60ff1..748bae7c 100644 --- a/classes/class_utility.lua +++ b/classes/class_utility.lua @@ -159,9 +159,9 @@ end --try to find a spell with the same name and get the amount of casts of that spell object if (not spell_cast and misc_actor.spell_cast) then - local spellname = GetSpellInfo (spellId) + local spellname = GetSpellInfo(spellId) for casted_spellid, amount in pairs (misc_actor.spell_cast) do - local casted_spellname = GetSpellInfo (casted_spellid) + local casted_spellname = GetSpellInfo(casted_spellid) if (casted_spellname == spellname) then return amount, true end @@ -379,7 +379,7 @@ end --[1] true damage/ false heal [2] spellid [3] amount [4] time [5] current health [6] source local report_table = {} -local ReportSingleDeathFunc = function (IsCurrent, IsReverse, AmtLines) +local ReportSingleDeathFunc = function(IsCurrent, IsReverse, AmtLines) AmtLines = AmtLines + 1 @@ -426,13 +426,13 @@ function atributo_misc:ReportSingleDeadLine (morte, instancia) if (evento [1] and type (evento [1]) == "boolean") then --> damage if (evento [3]) then local elapsed = _cstr ("%.1f", evento [4] - time_of_death) .."s" - local spellname, _, spellicon = _GetSpellInfo (evento [2]) + local spellname, _, spellicon = _GetSpellInfo(evento [2]) local spelllink if (evento [2] == 1) then - spelllink = GetSpellLink (6603) + spelllink = GetSpellLink(6603) elseif (evento [2] > 10) then - spelllink = GetSpellLink (evento [2]) + spelllink = GetSpellLink(evento [2]) else spelllink = spellname end @@ -453,9 +453,9 @@ function atributo_misc:ReportSingleDeadLine (morte, instancia) if (amount > _detalhes.deathlog_healingdone_min) then local elapsed = _cstr ("%.1f", evento [4] - time_of_death) .."s" - local spelllink = GetSpellLink (evento [2]) + local spelllink = GetSpellLink(evento [2]) local source = _detalhes:GetOnlyName (evento [6]) - local spellname, _, spellicon = _GetSpellInfo (evento [2]) + local spellname, _, spellicon = _GetSpellInfo(evento [2]) local hp = _math_floor (evento [5] / max_health * 100) if (hp > 100) then @@ -472,9 +472,9 @@ function atributo_misc:ReportSingleDeadLine (morte, instancia) elseif (type (evento [1]) == "number" and evento [1] == 4) then --> debuff local elapsed = _cstr ("%.1f", evento [4] - time_of_death) .."s" - local spelllink = GetSpellLink (evento [2]) + local spelllink = GetSpellLink(evento [2]) local source = _detalhes:GetOnlyName (evento [6]) - local spellname, _, spellicon = _GetSpellInfo (evento [2]) + local spellname, _, spellicon = _GetSpellInfo(evento [2]) local stacks = evento [3] local hp = _math_floor (evento [5] / max_health * 100) if (hp > 100) then @@ -509,7 +509,7 @@ function atributo_misc:ReportSingleCooldownLine (misc_actor, instancia) for i, spell in ipairs (cooldowns_used) do - local spelllink = GetSpellLink (spell [1]) + local spelllink = GetSpellLink(spell [1]) reportar [#reportar+1] = spelllink .. ": " .. spell [2] for target_name, amount in pairs (spell[3].targets) do @@ -523,18 +523,18 @@ function atributo_misc:ReportSingleCooldownLine (misc_actor, instancia) return _detalhes:Reportar (reportar, {_no_current = true, _no_inverse = true, _custom = true}) end -local buff_format_name = function (spellid) +local buff_format_name = function(spellid) if (_type (spellid) == "string") then return spellid end - return _detalhes:GetSpellLink (spellid) + return _detalhes:GetSpellLink(spellid) end -local buff_format_amount = function (t) +local buff_format_amount = function(t) local total, percent = unpack (t) local m, s = _math_floor (total / 60), _math_floor (total % 60) return _cstr ("%.1f", percent) .. "% (" .. m .. "m " .. s .. "s)" end -local sort_buff_report = function (t1, t2) +local sort_buff_report = function(t1, t2) return t1[2][1] > t2[2][1] end @@ -1096,7 +1096,7 @@ function atributo_misc:ToolTipCC (instancia, numero, barra) for _spellid, _tabela in pairs (habilidades) do --> quantidade - local nome_magia, _, icone_magia = _GetSpellInfo (_spellid) + local nome_magia, _, icone_magia = _GetSpellInfo(_spellid) GameCooltip:AddLine (nome_magia, _tabela.cc_break .. " (" .. _cstr ("%.1f", _tabela.cc_break / meu_total * 100) .. "%)") GameCooltip:AddIcon (icone_magia, nil, nil, lineHeight, lineHeight, icon_border.L, icon_border.R, icon_border.T, icon_border.B) _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) @@ -1104,7 +1104,7 @@ function atributo_misc:ToolTipCC (instancia, numero, barra) --> o que quebrou local quebrou_oque = _tabela.cc_break_oque for spellid_quebrada, amt_quebrada in pairs (_tabela.cc_break_oque) do - local nome_magia, _, icone_magia = _GetSpellInfo (spellid_quebrada) + local nome_magia, _, icone_magia = _GetSpellInfo(spellid_quebrada) GameCooltip:AddLine (nome_magia, amt_quebrada .. " ") GameCooltip:AddIcon ([[Interface\Buttons\UI-GroupLoot-Pass-Down]], nil, 1, 14, 14) GameCooltip:AddIcon (icone_magia, nil, 2, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) @@ -1163,7 +1163,7 @@ function atributo_misc:ToolTipDispell (instancia, numero, barra) if (#meus_dispells > 0) then for i = 1, min (25, #meus_dispells) do local esta_habilidade = meus_dispells[i] - local nome_magia, _, icone_magia = _GetSpellInfo (esta_habilidade[1]) + local nome_magia, _, icone_magia = _GetSpellInfo(esta_habilidade[1]) GameCooltip:AddLine (nome_magia, esta_habilidade[2].." (".._cstr("%.1f", esta_habilidade[2]/meu_total*100).."%)") GameCooltip:AddIcon (icone_magia, nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) _detalhes:AddTooltipBackgroundStatusbar() @@ -1185,7 +1185,7 @@ function atributo_misc:ToolTipDispell (instancia, numero, barra) if (#buffs_dispelados > 0) then for i = 1, min (25, #buffs_dispelados) do local esta_habilidade = buffs_dispelados[i] - local nome_magia, _, icone_magia = _GetSpellInfo (esta_habilidade[1]) + local nome_magia, _, icone_magia = _GetSpellInfo(esta_habilidade[1]) GameCooltip:AddLine (nome_magia, esta_habilidade[2].." (".._cstr("%.1f", esta_habilidade[2]/meu_total*100).."%)") GameCooltip:AddIcon (icone_magia, nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) _detalhes:AddTooltipBackgroundStatusbar() @@ -1482,7 +1482,7 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) local string_output = "pre-potion: " --> localize-me for playername, potspellid in pairs (pot_usage) do - local name, _, icon = _GetSpellInfo (potspellid) + local name, _, icon = _GetSpellInfo(potspellid) local _, class = UnitClass (playername) local class_color = "" if (class and RAID_CLASS_COLORS [class]) then @@ -1554,7 +1554,7 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) local string_output = "pre-potion: " for playername, potspellid in pairs (pot_usage) do - local name, _, icon = _GetSpellInfo (potspellid) + local name, _, icon = _GetSpellInfo(potspellid) local _, class = UnitClass (playername) local class_color = "" if (class and RAID_CLASS_COLORS [class]) then @@ -1595,7 +1595,7 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) if (in_or_out == "BUFF_UPTIME_IN") then local string_output = "pre-potion: " for playername, potspellid in pairs (pot_usage) do - local name, _, icon = _GetSpellInfo (potspellid) + local name, _, icon = _GetSpellInfo(potspellid) local _, class = UnitClass (playername) local class_color = "" if (class and RAID_CLASS_COLORS [class]) then @@ -1614,7 +1614,7 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) end end -local Sort2Reverse = function (a, b) +local Sort2Reverse = function(a, b) return a[2] < b[2] end @@ -1651,7 +1651,7 @@ function atributo_misc:ToolTipDebuffUptime (instancia, numero, barra) local esta_habilidade = debuffs_usados[i] if (esta_habilidade[2] > 0) then - local nome_magia, _, icone_magia = _GetSpellInfo (esta_habilidade[1]) + local nome_magia, _, icone_magia = _GetSpellInfo(esta_habilidade[1]) local minutos, segundos = _math_floor (esta_habilidade[2]/60), _math_floor (esta_habilidade[2]%60) if (esta_habilidade[2] >= _combat_time) then @@ -1762,7 +1762,7 @@ function atributo_misc:ToolTipDefensiveCooldowns (instancia, numero, barra) if (#cooldowns_usados > 0) then for i = 1, min (25, #cooldowns_usados) do local esta_habilidade = cooldowns_usados[i] - local nome_magia, _, icone_magia = _GetSpellInfo (esta_habilidade[1]) + local nome_magia, _, icone_magia = _GetSpellInfo(esta_habilidade[1]) GameCooltip:AddLine (nome_magia, esta_habilidade[2].." (".._cstr("%.1f", esta_habilidade[2]/meu_total*100).."%)") GameCooltip:AddIcon (icone_magia, nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) _detalhes:AddTooltipBackgroundStatusbar() @@ -1844,7 +1844,7 @@ function atributo_misc:ToolTipRess (instancia, numero, barra) if (#meus_ress > 0) then for i = 1, min (3, #meus_ress) do local esta_habilidade = meus_ress[i] - local nome_magia, _, icone_magia = _GetSpellInfo (esta_habilidade[1]) + local nome_magia, _, icone_magia = _GetSpellInfo(esta_habilidade[1]) GameCooltip:AddLine (nome_magia, esta_habilidade[2] .. " (" .. _cstr ("%.1f", floor (esta_habilidade[2]) / floor (meu_total) * 100).."%)") GameCooltip:AddIcon (icone_magia, nil, nil, lineHeight, lineHeight, icon_border.L, icon_border.R, icon_border.T, icon_border.B) _detalhes:AddTooltipBackgroundStatusbar() @@ -1926,7 +1926,7 @@ function atributo_misc:ToolTipInterrupt (instancia, numero, barra) if (#meus_interrupts > 0) then for i = 1, min (25, #meus_interrupts) do local esta_habilidade = meus_interrupts[i] - local nome_magia, _, icone_magia = _GetSpellInfo (esta_habilidade[1]) + local nome_magia, _, icone_magia = _GetSpellInfo(esta_habilidade[1]) GameCooltip:AddLine (nome_magia, esta_habilidade[2].." (".._cstr("%.1f", floor (esta_habilidade[2])/floor (meu_total)*100).."%)") GameCooltip:AddIcon (icone_magia, nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) _detalhes:AddTooltipBackgroundStatusbar() @@ -1949,7 +1949,7 @@ function atributo_misc:ToolTipInterrupt (instancia, numero, barra) if (#habilidades_interrompidas > 0) then for i = 1, min (25, #habilidades_interrompidas) do local esta_habilidade = habilidades_interrompidas[i] - local nome_magia, _, icone_magia = _GetSpellInfo (esta_habilidade[1]) + local nome_magia, _, icone_magia = _GetSpellInfo(esta_habilidade[1]) GameCooltip:AddLine (nome_magia, esta_habilidade[2].." (".._cstr("%.1f", floor (esta_habilidade[2])/floor (meu_total)*100).."%)") GameCooltip:AddIcon (icone_magia, nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) _detalhes:AddTooltipBackgroundStatusbar() @@ -2047,7 +2047,7 @@ function atributo_misc:MontaInfoInterrupt() --player for _spellid, _tabela in pairs (minha_tabela) do --> da foreach em cada spellid do container - local nome, _, icone = _GetSpellInfo (_spellid) + local nome, _, icone = _GetSpellInfo(_spellid) _table_insert (meus_interrupts, {_spellid, _tabela.counter, _tabela.counter/meu_total*100, nome, icone}) end --pet @@ -2058,7 +2058,7 @@ function atributo_misc:MontaInfoInterrupt() if (PetActor and PetActor.interrupt and PetActor.interrupt > 0) then local PetSkillsContainer = PetActor.interrupt_spells._ActorTable for _spellid, _skill in pairs (PetSkillsContainer) do --> da foreach em cada spellid do container - local nome, _, icone = _GetSpellInfo (_spellid) + local nome, _, icone = _GetSpellInfo(_spellid) _table_insert (meus_interrupts, {_spellid, _skill.counter, _skill.counter/meu_total*100, nome .. " (|c" .. class_color .. PetName:gsub ((" <.*"), "") .. "|r)", icone, PetActor}) end end @@ -2190,7 +2190,7 @@ function atributo_misc:MontaDetalhesInterrupt (spellid, barra) end --> icone direito superior - local nome, _, icone = _GetSpellInfo (spellid) + local nome, _, icone = _GetSpellInfo(spellid) local infospell = {nome, nil, icone} _detalhes.playerDetailWindow.spell_icone:SetTexture (infospell[3]) @@ -2227,7 +2227,7 @@ function atributo_misc:MontaDetalhesInterrupt (spellid, barra) barra.textura:SetValue (tabela[2]/max_*100) --> muito mais rapido... end - local nome, _, icone = _GetSpellInfo (tabela[1]) + local nome, _, icone = _GetSpellInfo(tabela[1]) barra.lineText1:SetText (index..instancia.divisores.colocacao..nome) --seta o texto da esqueda barra.lineText4:SetText (tabela[2] .." ".. instancia.divisores.abre .._cstr("%.1f", tabela[2]/total*100) .."%".. instancia.divisores.fecha) --seta o texto da direita @@ -2274,7 +2274,7 @@ function atributo_misc:MontaTooltipAlvos (esta_barra, index) GameTooltip:AddLine (" ") for index, tabela in ipairs (habilidades) do - local nome, rank, icone = _GetSpellInfo (tabela[1]) + local nome, rank, icone = _GetSpellInfo(tabela[1]) if (index < 8) then GameTooltip:AddDoubleLine (index..". |T"..icone..":0|t "..nome, tabela[2].." (".._cstr("%.1f", tabela[2]/total*100).."%)", 1, 1, 1, 1, 1, 1) else @@ -2327,12 +2327,12 @@ end end end -local refresh_alvos = function (container1, container2) +local refresh_alvos = function(container1, container2) for target_name, amount in pairs (container2) do container1 [target_name] = container1 [target_name] or 0 end end -local refresh_habilidades = function (container1, container2) +local refresh_habilidades = function(container1, container2) for spellid, habilidade in pairs (container2._ActorTable) do local habilidade_shadow = container1:PegaHabilidade (spellid, true, nil, true) refresh_alvos (habilidade_shadow.targets , habilidade.targets) @@ -2443,7 +2443,7 @@ function atributo_misc:r_onlyrefresh_shadow (actor) end -local somar_keys = function (habilidade, habilidade_tabela1) +local somar_keys = function(habilidade, habilidade_tabela1) for key, value in pairs (habilidade) do if (_type (value) == "number") then if (key ~= "id" and key ~= "spellschool") then @@ -2452,12 +2452,12 @@ local somar_keys = function (habilidade, habilidade_tabela1) end end end -local somar_alvos = function (container1, container2) +local somar_alvos = function(container1, container2) for target_name, amount in pairs (container2) do container1 [target_name] = (container1 [target_name] or 0) + amount end end -local somar_habilidades = function (container1, container2) +local somar_habilidades = function(container1, container2) for spellid, habilidade in pairs (container2._ActorTable) do local habilidade_tabela1 = container1:PegaHabilidade (spellid, true, nil, false) somar_alvos (habilidade_tabela1.targets, habilidade.targets) @@ -2526,7 +2526,7 @@ function atributo_misc:r_connect_shadow (actor, no_refresh, combat_object) if (actor.cooldowns_defensive) then if (not shadow.cooldowns_defensive_targets) then - shadow.cooldowns_defensive = _detalhes:GetOrderNumber (actor.nome) + shadow.cooldowns_defensive = _detalhes:GetOrderNumber(actor.nome) shadow.cooldowns_defensive_targets = {} shadow.cooldowns_defensive_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) end @@ -2854,7 +2854,7 @@ function _detalhes.clear:c_atributo_misc (este_jogador) end -atributo_misc.__add = function (tabela1, tabela2) +atributo_misc.__add = function(tabela1, tabela2) if (tabela2.spell_cast) then for spellid, amount in pairs (tabela2.spell_cast) do @@ -3110,7 +3110,7 @@ atributo_misc.__add = function (tabela1, tabela2) return tabela1 end -local subtrair_keys = function (habilidade, habilidade_tabela1) +local subtrair_keys = function(habilidade, habilidade_tabela1) for key, value in pairs (habilidade) do if (_type (value) == "number") then if (key ~= "id" and key ~= "spellschool") then @@ -3120,7 +3120,7 @@ local subtrair_keys = function (habilidade, habilidade_tabela1) end end -atributo_misc.__sub = function (tabela1, tabela2) +atributo_misc.__sub = function(tabela1, tabela2) if (tabela2.spell_cast) then for spellid, amount in pairs (tabela2.spell_cast) do diff --git a/classes/container_actors.lua b/classes/container_actors.lua index aef04199..5cda0e6d 100644 --- a/classes/container_actors.lua +++ b/classes/container_actors.lua @@ -436,7 +436,7 @@ local pet_text_object = _G ["DetailsPetOwnerFinderTextLeft2"] --not in use local follower_text_object = _G ["DetailsPetOwnerFinderTextLeft3"] --not in use - local find_pet_found_owner = function (ownerName, serial, nome, flag, self) + local find_pet_found_owner = function(ownerName, serial, nome, flag, self) local ownerGuid = _UnitGUID (ownerName) if (ownerGuid) then _detalhes.tabela_pets:Adicionar (serial, nome, flag, ownerGuid, ownerName, 0x00000417) @@ -453,7 +453,7 @@ end --> check pet owner name with correct declension for ruRU locale (from user 'denis-kam' on github) - local find_name_declension = function (petTooltip, playerName) + local find_name_declension = function(petTooltip, playerName) --> 2 - male, 3 - female for gender = 3, 2, -1 do for declensionSet = 1, GetNumDeclensionSets(playerName, gender) do @@ -469,7 +469,7 @@ return false end - local find_pet_owner = function (serial, nome, flag, self) + local find_pet_owner = function(serial, nome, flag, self) if (not _detalhes.tabela_vigente) then return end @@ -851,7 +851,7 @@ end local bykey - local sort = function (t1, t2) + local sort = function(t1, t2) return (t1 [bykey] or 0) > (t2 [bykey] or 0) end diff --git a/classes/custom_damagedone.lua b/classes/custom_damagedone.lua index 6f72f78c..4d419738 100644 --- a/classes/custom_damagedone.lua +++ b/classes/custom_damagedone.lua @@ -57,7 +57,7 @@ end local temp_table = {} -local target_func = function (main_table) +local target_func = function(main_table) local i = 1 for name, amount in _pairs (main_table) do local t = temp_table [i] @@ -73,7 +73,7 @@ local target_func = function (main_table) end end -local spells_used_func = function (main_table, target) +local spells_used_func = function(main_table, target) local i = 1 for spellid, spell_table in _pairs (main_table) do local target_amount = spell_table.targets [target] @@ -134,7 +134,7 @@ function atributo_custom:damagedoneTooltip (actor, target, spellid, combat, inst return else - local name, _, icon = _GetSpellInfo (spellid) + local name, _, icon = _GetSpellInfo(spellid) GameCooltip:AddLine (name) GameCooltip:AddIcon (icon, 1, 1, 14, 14) @@ -193,7 +193,7 @@ function atributo_custom:damagedoneTooltip (actor, target, spellid, combat, inst break end - local name, _, icon = _GetSpellInfo (t[1]) + local name, _, icon = _GetSpellInfo(t[1]) GameCooltip:AddLine (name, FormatTooltipNumber (_, t[2])) _detalhes:AddTooltipBackgroundStatusbar() GameCooltip:AddIcon (icon, 1, 1, 14, 14) diff --git a/classes/custom_healingdone.lua b/classes/custom_healingdone.lua index d6010d67..94b0bba0 100644 --- a/classes/custom_healingdone.lua +++ b/classes/custom_healingdone.lua @@ -50,7 +50,7 @@ local temp_table = {} - local target_func = function (main_table) + local target_func = function(main_table) local i = 1 for name, amount in _pairs (main_table) do local t = temp_table [i] @@ -66,7 +66,7 @@ end end - local spells_used_func = function (main_table, target) + local spells_used_func = function(main_table, target) local i = 1 for spellid, spell_table in _pairs (main_table) do local target_amount = spell_table.targets [target] @@ -127,7 +127,7 @@ return else - local name, _, icon = _GetSpellInfo (spellid) + local name, _, icon = _GetSpellInfo(spellid) GameCooltip:AddLine (name) GameCooltip:AddIcon (icon, 1, 1, 14, 14) @@ -186,7 +186,7 @@ break end - local name, _, icon = _GetSpellInfo (t[1]) + local name, _, icon = _GetSpellInfo(t[1]) GameCooltip:AddLine (name, FormatTooltipNumber (_, t[2])) GameCooltip:AddIcon (icon, 1, 1, 14, 14) end diff --git a/core/control.lua b/core/control.lua index 1051b031..7966711b 100644 --- a/core/control.lua +++ b/core/control.lua @@ -94,7 +94,7 @@ -- try get the current encounter name during the encounter - local boss_found_not_registered = function (t, ZoneName, ZoneMapID, DifficultyID) + local boss_found_not_registered = function(t, ZoneName, ZoneMapID, DifficultyID) local boss_table = { index = 0, @@ -112,7 +112,7 @@ Details.tabela_vigente.is_boss = boss_table end - local boss_found = function (index, name, zone, mapid, diff, encounterid) + local boss_found = function(index, name, zone, mapid, diff, encounterid) local mapID = C_Map.GetBestMapForUnit ("player") local ejid @@ -1408,7 +1408,7 @@ end end - local fight_component = function (energy_container, misc_container, name) + local fight_component = function(energy_container, misc_container, name) local on_energy = energy_container._ActorTable [energy_container._NameIndexTable [name]] if (on_energy) then on_energy.fight_component = true @@ -1876,7 +1876,7 @@ DetailsFramework:ApplyStandardBackdrop(panel) - panel:SetScript("OnMouseDown", function (self, button) + panel:SetScript("OnMouseDown", function(self, button) if (button == "RightButton") then panel:Hide() end diff --git a/core/gears.lua b/core/gears.lua index ede5d2a6..36fd77ac 100644 --- a/core/gears.lua +++ b/core/gears.lua @@ -32,7 +32,7 @@ end _detalhes.chat_embed = _detalhes:CreateEventListener() _detalhes.chat_embed.startup = true - _detalhes.chat_embed.hook_settabname = function (frame, name, doNotSave) + _detalhes.chat_embed.hook_settabname = function(frame, name, doNotSave) if (not doNotSave) then if (_detalhes.chat_tab_embed.enabled and _detalhes.chat_tab_embed.tab_name ~= "") then if (_detalhes.chat_tab_embed_onframe == frame) then @@ -42,7 +42,7 @@ end end end end - _detalhes.chat_embed.hook_closetab = function (frame, fallback) + _detalhes.chat_embed.hook_closetab = function(frame, fallback) if (_detalhes.chat_tab_embed.enabled and _detalhes.chat_tab_embed.tab_name ~= "") then if (_detalhes.chat_tab_embed_onframe == frame) then _detalhes.chat_tab_embed.enabled = false @@ -967,7 +967,7 @@ function _detalhes.storage:DBGuildSync() end local OnlyFromCurrentRaidTier = true -local encounter_is_current_tier = function (encounterID) +local encounter_is_current_tier = function(encounterID) if (OnlyFromCurrentRaidTier) then local mapID = _detalhes:GetInstanceIdFromEncounterId (encounterID) if (mapID) then @@ -982,7 +982,7 @@ local encounter_is_current_tier = function (encounterID) return true end -local have_encounter = function (db, ID) +local have_encounter = function(db, ID) local minTime = ID - 120 local maxTime = ID + 120 @@ -1006,7 +1006,7 @@ local have_encounter = function (db, ID) return false end -local have_recent_requested_encounter = function (ID) +local have_recent_requested_encounter = function(ID) local minTime = ID - 120 local maxTime = ID + 120 @@ -1992,7 +1992,7 @@ function ilvl_core:CalcItemLevel (unitid, guid, shout) end _detalhes.ilevel.CalcItemLevel = ilvl_core.CalcItemLevel -inspect_frame:SetScript ("OnEvent", function (self, event, ...) +inspect_frame:SetScript ("OnEvent", function(self, event, ...) local guid = select (1, ...) if (inspecting [guid]) then @@ -2068,7 +2068,7 @@ function ilvl_core:GetItemLevel (unitid, guid, is_forced, try_number) --NotifyInspect (unitid) end -local NotifyInspectHook = function (unitid) +local NotifyInspectHook = function(unitid) local unit = unitid:gsub ("%d+", "") if ((IsInRaid() or IsInGroup()) and (_detalhes:GetZoneType() == "raid" or _detalhes:GetZoneType() == "party")) then @@ -2441,7 +2441,7 @@ if (DetailsFramework.IsWotLKWow()) then local MIN_SPECS = 4 --put the spec with more talent point to the top - table.sort (pointsPerSpec, function (t1, t2) return t1[2] > t2[2] end) + table.sort (pointsPerSpec, function(t1, t2) return t1[2] > t2[2] end) --get the spec with more points spent local spec = pointsPerSpec[1] diff --git a/core/parser.lua b/core/parser.lua index bdd7412d..d28461bc 100755 --- a/core/parser.lua +++ b/core/parser.lua @@ -567,7 +567,7 @@ -- /run local f=CreateFrame("frame");f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");f:SetScript("OnEvent",function(self, ...) local a = select(6, ...);if (a=="")then print (...) end end) -- /run local f=CreateFrame("frame");f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");f:SetScript("OnEvent",function(self, ...) local a = select(3, ...);print (a);if (a=="SPELL_CAST_SUCCESS")then print (...) end end) - local who_aggro = function (self) + local who_aggro = function(self) if ((_detalhes.LastPullMsg or 0) + 30 > time()) then _detalhes.WhoAggroTimer = nil return @@ -594,7 +594,7 @@ local lastRecordFound = {id = 0, diff = 0, combatTime = 0} - _detalhes.PrintEncounterRecord = function (self) + _detalhes.PrintEncounterRecord = function(self) --> this block won't execute if the storage isn't loaded --> self is a timer reference from C_Timer @@ -1005,7 +1005,7 @@ else if (who_name:find ("%[")) then damage_cache [who_name] = este_jogador - local _, _, icon = _GetSpellInfo (spellid or 1) + local _, _, icon = _GetSpellInfo(spellid or 1) este_jogador.spellicon = icon else --_detalhes:Msg ("Unknown actor with unknown serial ", spellname, who_name) @@ -1434,7 +1434,7 @@ else if (who_name:find ("%[")) then damage_cache [who_name] = este_jogador - local _, _, icon = _GetSpellInfo (spellid or 1) + local _, _, icon = _GetSpellInfo(spellid or 1) este_jogador.spellicon = icon end end @@ -1639,7 +1639,7 @@ else if (who_name:find ("%[")) then damage_cache [who_name] = este_jogador - local _, _, icon = _GetSpellInfo (spellid or 1) + local _, _, icon = _GetSpellInfo(spellid or 1) este_jogador.spellicon = icon else --_detalhes:Msg ("Unknown actor with unknown serial ", spellname, who_name) @@ -3501,7 +3501,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --AlternatePowerEnableFrame:RegisterEvent ("PLAYER_REGEN_ENABLED") AlternatePowerEnableFrame.IsRunning = false - AlternatePowerEnableFrame:SetScript ("OnEvent", function (self, event) + AlternatePowerEnableFrame:SetScript ("OnEvent", function(self, event) if (event == "UNIT_POWER_BAR_SHOW") then AlternatePowerMonitorFrame:RegisterEvent ("UNIT_POWER_UPDATE") --> 8.0 AlternatePowerEnableFrame.IsRunning = true @@ -3511,7 +3511,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end) - AlternatePowerMonitorFrame:SetScript ("OnEvent", function (self, event, unitID, powerType) + AlternatePowerMonitorFrame:SetScript ("OnEvent", function(self, event, unitID, powerType) if (powerType == "ALTERNATE") then local actorName = _detalhes:GetCLName (unitID) if (actorName) then @@ -3706,7 +3706,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 ------------------------------------------------------------------------------------------------ --> build containers on the fly if (not este_jogador.cooldowns_defensive) then - este_jogador.cooldowns_defensive = _detalhes:GetOrderNumber (who_name) + este_jogador.cooldowns_defensive = _detalhes:GetOrderNumber(who_name) este_jogador.cooldowns_defensive_targets = {} este_jogador.cooldowns_defensive_spells = container_habilidades:NovoContainer (container_misc) --> cria o container das habilidades end @@ -3825,7 +3825,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --> build containers on the fly if (not este_jogador.interrupt) then - este_jogador.interrupt = _detalhes:GetOrderNumber (who_name) + este_jogador.interrupt = _detalhes:GetOrderNumber(who_name) este_jogador.interrupt_targets = {} este_jogador.interrupt_spells = container_habilidades:NovoContainer (container_misc) este_jogador.interrompeu_oque = {} @@ -3864,7 +3864,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if (meu_dono) then if (not meu_dono.interrupt) then - meu_dono.interrupt = _detalhes:GetOrderNumber (who_name) + meu_dono.interrupt = _detalhes:GetOrderNumber(who_name) meu_dono.interrupt_targets = {} meu_dono.interrupt_spells = container_habilidades:NovoContainer (container_misc) meu_dono.interrompeu_oque = {} @@ -4033,7 +4033,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if (not este_jogador.dispell) then --> constr�i aqui a tabela dele - este_jogador.dispell = _detalhes:GetOrderNumber (who_name) + este_jogador.dispell = _detalhes:GetOrderNumber(who_name) este_jogador.dispell_targets = {} este_jogador.dispell_spells = container_habilidades:NovoContainer (container_misc) este_jogador.dispell_oque = {} @@ -4089,7 +4089,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --> verifica se tem dono e adiciona o interrupt para o dono if (meu_dono) then if (not meu_dono.dispell) then - meu_dono.dispell = _detalhes:GetOrderNumber (who_name) + meu_dono.dispell = _detalhes:GetOrderNumber(who_name) meu_dono.dispell_targets = {} meu_dono.dispell_spells = container_habilidades:NovoContainer (container_misc) meu_dono.dispell_oque = {} @@ -4140,7 +4140,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --> build containers on the fly if (not este_jogador.ress) then - este_jogador.ress = _detalhes:GetOrderNumber (who_name) + este_jogador.ress = _detalhes:GetOrderNumber(who_name) este_jogador.ress_targets = {} este_jogador.ress_spells = container_habilidades:NovoContainer (container_misc) --> cria o container das habilidades usadas para interromper end @@ -4255,7 +4255,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if (not este_jogador.cc_break) then --> constr�i aqui a tabela dele - este_jogador.cc_break = _detalhes:GetOrderNumber (who_name) + este_jogador.cc_break = _detalhes:GetOrderNumber(who_name) este_jogador.cc_break_targets = {} este_jogador.cc_break_spells = container_habilidades:NovoContainer (container_misc) este_jogador.cc_break_oque = {} @@ -5831,7 +5831,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 local saver = CreateFrame ("frame", nil, UIParent) saver:RegisterEvent ("PLAYER_LOGOUT") - saver:SetScript ("OnEvent", function (...) + saver:SetScript ("OnEvent", function(...) --save the time played on this class, run protected pcall(function() local className = select(2, UnitClass("player")) @@ -6348,7 +6348,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> battleground parser - _detalhes.pvp_parser_frame:SetScript ("OnEvent", function (self, event) + _detalhes.pvp_parser_frame:SetScript ("OnEvent", function(self, event) self:ReadPvPData() end) diff --git a/core/plugins.lua b/core/plugins.lua index 9ffdd7a3..ba36b273 100644 --- a/core/plugins.lua +++ b/core/plugins.lua @@ -237,7 +237,7 @@ ["STATUSBAR"] = 0 } - local OnEnableFunction = function (self) + local OnEnableFunction = function(self) self.__parent.Enabled = true --self = frame __parent = plugin object local instance = _detalhes:GetInstance (self.__parent.instance_id) @@ -247,14 +247,14 @@ _detalhes:SendEvent ("SHOW", self.__parent) end - local OnDisableFunction = function (self) + local OnDisableFunction = function(self) _detalhes:SendEvent ("HIDE", self.__parent) if (bit.band (self.__parent.__options, DETAILSPLUGIN_ALWAYSENABLED) == 0) then self.__parent.Enabled = false end end - local BuildDefaultStatusBarMembers = function (self) + local BuildDefaultStatusBarMembers = function(self) self.childs = {} self.__index = self function self:Setup() @@ -272,10 +272,10 @@ print ("Thank You Sir!===================") end - local register_event_func = function (self, event) + local register_event_func = function(self, event) self.Frame:RegisterEvent (event) end - local unregister_event_func = function (self, event) + local unregister_event_func = function(self, event) self.Frame:UnregisterEvent (event) end @@ -544,7 +544,7 @@ end) - f:SetScript ("OnMouseDown", function (self, button) + f:SetScript ("OnMouseDown", function(self, button) if (button == "RightButton") then f.ClosePlugin() end @@ -588,7 +588,7 @@ --> re set the point of the frame within the main plugin window f.RefreshFrame (pluginObject.__var_Frame) - C_Timer.After (0.016, function () + C_Timer.After (0.016, function() f.RefreshFrame (pluginObject.__var_Frame) end) @@ -637,7 +637,7 @@ return newButton end - local on_hide = function (self) + local on_hide = function(self) DetailsPluginContainerWindow.ClosePlugin() end diff --git a/core/plugins_raid.lua b/core/plugins_raid.lua index ba4ce154..bdd04fb4 100644 --- a/core/plugins_raid.lua +++ b/core/plugins_raid.lua @@ -300,9 +300,9 @@ local spellname if (spellid > 10) then - spellname = GetSpellLink (extraSpellID) + spellname = GetSpellLink(extraSpellID) else - spellname = _GetSpellInfo (extraSpellID) + spellname = _GetSpellInfo(extraSpellID) end if (channel == "RAID") then @@ -342,9 +342,9 @@ local spellname if (spellid > 10) then - spellname = GetSpellLink (extraSpellID) + spellname = GetSpellLink(extraSpellID) else - spellname = _GetSpellInfo (extraSpellID) + spellname = _GetSpellInfo(extraSpellID) end if (custom ~= "") then @@ -416,9 +416,9 @@ local spellname if (spellid > 10) then - spellname = GetSpellLink (spellid) + spellname = GetSpellLink(spellid) else - spellname = _GetSpellInfo (spellid) + spellname = _GetSpellInfo(spellid) end local custom = _detalhes.announce_cooldowns.custom @@ -478,9 +478,9 @@ local spellname if (spellid > 10) then - spellname = GetSpellLink (spellid) + spellname = GetSpellLink(spellid) else - spellname = _GetSpellInfo (spellid) + spellname = _GetSpellInfo(spellid) end if (second < 10) then @@ -578,9 +578,9 @@ if (type (this_death[1]) == "boolean" and this_death[1] and this_death[4]+5 > time) then local spelllink if (this_death [2] > 10) then - spelllink = GetSpellLink (this_death [2]) + spelllink = GetSpellLink(this_death [2]) else - spelllink = "[" .. _GetSpellInfo (this_death [2]) .. "]" + spelllink = "[" .. _GetSpellInfo(this_death [2]) .. "]" end spells = spelllink .. ": " .. _detalhes:ToK2 (_math_floor (this_death [3])) .. " " .. spells last = o-1 diff --git a/core/plugins_statusbar.lua b/core/plugins_statusbar.lua index 327ee45f..92a38d40 100644 --- a/core/plugins_statusbar.lua +++ b/core/plugins_statusbar.lua @@ -204,7 +204,7 @@ --> select a new plugin in for an instance anchor - local ChoosePlugin = function (_, _, index, current_child, anchor) + local ChoosePlugin = function(_, _, index, current_child, anchor) GameCooltip:Close() @@ -294,7 +294,7 @@ local on_enter_backdrop = {bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16} - local OnEnter = function (frame) + local OnEnter = function(frame) --|TTexturePath: size X: size Y: point offset Y X : texture size : coordx1 L : coordx2 R : coordy1 T : coordy2 B |t -- left click: 0.0019531:0.1484375:0.4257813:0.6210938 right click: 0.0019531:0.1484375:0.6269531:0.8222656 @@ -322,7 +322,7 @@ end --> on leave - local OnLeave = function (frame) + local OnLeave = function(frame) frame:SetBackdrop (nil) @@ -333,7 +333,7 @@ return true end - local OnMouseUp = function (frame, mouse) + local OnMouseUp = function(frame, mouse) if (mouse == "LeftButton") then if (not frame.child.Setup) then @@ -814,7 +814,7 @@ do _detalhes.gump:NewLabel (window, nil, "$parentSegmentOptionLabel", "segmentOptionLabel", Loc ["STRING_PLUGIN_SEGMENTTYPE"]) window.segmentOptionLabel:SetPoint (10, -15) - local onSelectSegmentType = function (_, child, thistype) + local onSelectSegmentType = function(_, child, thistype) child.options.segmentType = thistype PSegment:Change() end @@ -1003,7 +1003,7 @@ do _detalhes.gump:NewLabel (window, nil, "$parentClockTypeLabel", "ClockTypeLabel", Loc ["STRING_PLUGIN_CLOCKTYPE"]) window.ClockTypeLabel:SetPoint (10, -15) - local onSelectClockType = function (_, child, thistype) + local onSelectClockType = function(_, child, thistype) child.options.timeType = thistype _detalhes:ClockPluginTick() end @@ -1358,7 +1358,7 @@ do myframe.widget:RegisterEvent ("PLAYER_MONEY") myframe.widget:RegisterEvent ("PLAYER_ENTERING_WORLD") - myframe.widget:SetScript ("OnEvent", function (event) + myframe.widget:SetScript ("OnEvent", function(event) if (event == "PLAYER_ENTERING_WORLD") then return PGold:ScheduleTimer ("GoldPluginTick", 10) end @@ -1417,7 +1417,7 @@ do _detalhes.gump:NewLabel (window, _, "$parentTimeTypeLabel", "TimeTypeLabel", Loc ["STRING_PLUGIN_CLOCKTYPE"]) window.TimeTypeLabel:SetPoint (10, -15) - local onSelectClockType = function (_, child, thistype) + local onSelectClockType = function(_, child, thistype) child.options.timeType = thistype child:UpdateClock() end @@ -1492,7 +1492,7 @@ end) _detalhes.gump:NewLabel (window, _, "$parentTextStyleLabel", "textstyle", Loc ["STRING_PLUGINOPTIONS_TEXTSTYLE"]) window.textstyle:SetPoint (10, -15) - local onSelectTextStyle = function (_, child, style) + local onSelectTextStyle = function(_, child, style) window.instance.StatusBar.left.options.textStyle = style window.instance.StatusBar.center.options.textStyle = style @@ -1564,7 +1564,7 @@ end) window.fonsizeSlider:SetPoint ("left", window.fonsizeLabel, "right", 2) window.fonsizeSlider:SetThumbSize (50) --window.fonsizeSlider.useDecimals = true - window.fonsizeSlider:SetHook ("OnValueChange", function (self, child, amount) + window.fonsizeSlider:SetHook ("OnValueChange", function(self, child, amount) --_detalhes.StatusBar:ApplyOptions (child, "textsize", amount) _detalhes.StatusBar:ApplyOptions (window.instance.StatusBar.left, "textsize", amount) _detalhes.StatusBar:ApplyOptions (window.instance.StatusBar.center, "textsize", amount) @@ -1572,7 +1572,7 @@ end) end) --> text font - local onSelectFont = function (_, child, fontName) + local onSelectFont = function(_, child, fontName) --_detalhes.StatusBar:ApplyOptions (child, "textface", fontName) _detalhes.StatusBar:ApplyOptions (window.instance.StatusBar.left, "textface", fontName) @@ -1605,7 +1605,7 @@ end) _detalhes.gump:NewSlider (window, _, "$parentSliderAlignX", "alignXSlider", 160, 20, -20, 20, 1, 0) window.alignXSlider:SetPoint ("left", window.alignXLabel, "right", 2) window.alignXSlider:SetThumbSize (40) - window.alignXSlider:SetHook ("OnValueChange", function (self, child, amount) + window.alignXSlider:SetHook ("OnValueChange", function(self, child, amount) _detalhes.StatusBar:ApplyOptions (child, "textxmod", amount) end) @@ -1616,7 +1616,7 @@ end) _detalhes.gump:NewSlider (window, _, "$parentSliderAlignY", "alignYSlider", 160, 20, -10, 10, 1, 0) window.alignYSlider:SetPoint ("left", window.alignYLabel, "right", 2) window.alignYSlider:SetThumbSize (40) - window.alignYSlider:SetHook ("OnValueChange", function (self, child, amount) + window.alignYSlider:SetHook ("OnValueChange", function(self, child, amount) _detalhes.StatusBar:ApplyOptions (child, "textymod", amount) end) diff --git a/core/plugins_toolbar.lua b/core/plugins_toolbar.lua index b0a18b86..2fef2465 100644 --- a/core/plugins_toolbar.lua +++ b/core/plugins_toolbar.lua @@ -171,7 +171,7 @@ end local next_check = 0.8 --check if the mouse is still interacting with the menu or with the button - button:SetScript ("OnUpdate", function (self, elapsed) + button:SetScript ("OnUpdate", function(self, elapsed) next_check = next_check - elapsed if (next_check < 0) then diff --git a/core/timemachine.lua b/core/timemachine.lua index 32d0a0ad..4c82e548 100644 --- a/core/timemachine.lua +++ b/core/timemachine.lua @@ -26,7 +26,7 @@ timeMachine.ligada = false - local calc_for_pvp = function (self) + local calc_for_pvp = function(self) for tipo, tabela in _pairs (self.tabelas) do for nome, jogador in _ipairs (tabela) do if (jogador) then @@ -45,7 +45,7 @@ end end - local calc_for_pve = function (self) + local calc_for_pve = function(self) for tipo, tabela in _pairs (self.tabelas) do for nome, jogador in _ipairs (tabela) do if (jogador) then diff --git a/core/util.lua b/core/util.lua index b6d8e4e7..7c4c6ad7 100644 --- a/core/util.lua +++ b/core/util.lua @@ -336,7 +336,7 @@ end --> get the fractional number representing the alphabetical letter - function _detalhes:GetOrderNumber (who_name) + function _detalhes:GetOrderNumber(who_name) --local name = upper (who_name .. "zz") --local byte1 = _math_abs (_string_byte (name, 2)-91)/1000000 --return byte1 + _math_abs (_string_byte (name, 1)-91)/10000 @@ -727,10 +727,10 @@ local arguments_cache = {} local parameters_cache = {} - local replace_arg = function (i) + local replace_arg = function(i) return arguments_cache [tonumber(i)] end - local run_function = function (str) + local run_function = function(str) --> cache functions local func, errortext = function_cache [str] if (not func) then @@ -1330,7 +1330,7 @@ end end --> work around to solve the UI Frame Flashes - local onFinish = function (self) + local onFinish = function(self) if (self.showWhenDone) then self.frame:SetAlpha (1) else @@ -1343,12 +1343,12 @@ end end end - local stop = function (self) + local stop = function(self) local FlashAnimation = self.FlashAnimation FlashAnimation:Stop() end - local flash = function (self, fadeInTime, fadeOutTime, flashDuration, showWhenDone, flashInHoldTime, flashOutHoldTime, loopType) + local flash = function(self, fadeInTime, fadeOutTime, flashDuration, showWhenDone, flashInHoldTime, flashOutHoldTime, loopType) local FlashAnimation = self.FlashAnimation @@ -1407,7 +1407,7 @@ end - local fade_OUT_finished_func = function (frame) + local fade_OUT_finished_func = function(frame) if (frame:IsShown() and frame.fading_out) then frame.hidden = false frame.faded = false @@ -1417,17 +1417,17 @@ end end end - local just_fade_func = function (frame) + local just_fade_func = function(frame) frame.hidden = false frame.faded = true frame.fading_in = false end - local anim_OUT_alpha_func = function (frame) + local anim_OUT_alpha_func = function(frame) frame.fading_out = false end - local anim_IN_alpha_func = function (frame) + local anim_IN_alpha_func = function(frame) frame.fading_in = false end diff --git a/core/windows.lua b/core/windows.lua index 36207ba8..e273e5b4 100644 --- a/core/windows.lua +++ b/core/windows.lua @@ -153,7 +153,7 @@ end --> simple left and right animations by delta time - local animation_left_simple = function (self, deltaTime) + local animation_left_simple = function(self, deltaTime) self.inicio = self.inicio - (animation_speed * deltaTime) self:SetValue (self.inicio) if (self.inicio-1 <= self.fim) then @@ -162,7 +162,7 @@ end end - local animation_right_simple = function (self, deltaTime) + local animation_right_simple = function(self, deltaTime) self.inicio = self.inicio + (animation_speed * deltaTime) self:SetValue (self.inicio) if (self.inicio+0.1 >= self.fim) then @@ -172,7 +172,7 @@ end --> animation with acceleration - local animation_left_with_accel = function (self, deltaTime) + local animation_left_with_accel = function(self, deltaTime) local distance = self.inicio - self.fim -- DefaultSpeed * max of ( min of (Distance / TriggerSpeed , MaxSpeed) , LowSpeed ) @@ -186,7 +186,7 @@ end end - local animation_right_with_accel = function (self, deltaTime) + local animation_right_with_accel = function(self, deltaTime) local distance = self.fim - self.inicio local calcAnimationSpeed = animation_speed * _math_max (_math_min (distance/animation_speed_hightravel_trigger, animation_speed_hightravel_maxspeed), animation_speed_lowtravel_minspeed) @@ -1165,14 +1165,14 @@ mmoc_title:SetPoint ("topleft", mmoc, "topright", 5, 0) mmoc_desc:SetPoint ("topleft", mmoc_title, "bottomleft", 0, -1) - local on_enter = function (self, capsule) + local on_enter = function(self, capsule) capsule.image:SetDesaturated (false) end - local on_leave = function (self, capsule) + local on_leave = function(self, capsule) capsule.image:SetDesaturated (true) end - local on_click = function (_, _, website) + local on_click = function(_, _, website) if (website == 1) then _detalhes:CopyPaste ([[http://www.wowinterface.com/downloads/addcomment.php?action=addcomment&fileid=23056]]) @@ -1229,7 +1229,7 @@ f.options_button:SetPoint ("topleft", f, "topleft", 10, -100) f.options_button:SetHeight (170) f.options_button:SetWidth (170) - f.options_button:SetScript ("OnClick", function (self) + f.options_button:SetScript ("OnClick", function(self) local lower_instance = _detalhes:GetLowerInstanceNumber() if (not lower_instance) then --> no window opened? @@ -1253,7 +1253,7 @@ f.new_window_button:SetText (Loc ["STRING_MINIMAPMENU_NEWWINDOW"]) f.new_window_button:SetPoint ("topleft", f, "topleft", 10, -125) f.new_window_button:SetWidth (170) - f.new_window_button:SetScript ("OnClick", function (self) + f.new_window_button:SetScript ("OnClick", function(self) _detalhes:CriarInstancia (_, true) end) @@ -1304,7 +1304,7 @@ updatewindow_frame.close:SetPoint ("bottomleft", updatewindow_frame, "bottomleft", 8, 4) updatewindow_frame.close:SetText ("Close") - updatewindow_frame.close:SetScript ("OnClick", function (self) + updatewindow_frame.close:SetScript ("OnClick", function(self) DetailsUpdateDialog:Hide() editbox:ClearFocus() end) @@ -1339,7 +1339,7 @@ HotCornerIgnore = true, - OnClick = function (self, button) + OnClick = function(self, button) if (button == "LeftButton") then if (IsControlKeyDown()) then @@ -1452,7 +1452,7 @@ end end, - OnTooltipShow = function (tooltip) + OnTooltipShow = function(tooltip) tooltip:AddLine ("Details!", 1, 1, 1) if (_detalhes.minimap.onclick_what_todo == 1) then tooltip:AddLine (Loc ["STRING_MINIMAP_TOOLTIP1"]) @@ -1477,7 +1477,7 @@ function _detalhes:DoRegisterHotCorner() --register lib-hotcorners - local on_click_on_hotcorner_button = function (frame, button) + local on_click_on_hotcorner_button = function(frame, button) if (_detalhes.hotcorner_topleft.onclick_what_todo == 1) then local lower_instance = _detalhes:GetLowerInstanceNumber() if (not lower_instance) then @@ -1493,11 +1493,11 @@ end end - local quickclick_func1 = function (frame, button) + local quickclick_func1 = function(frame, button) _detalhes.tabela_historico:resetar() end - local quickclick_func2 = function (frame, button) + local quickclick_func2 = function(frame, button) local lower_instance = _detalhes:GetLowerInstanceNumber() if (not lower_instance) then local instance = _detalhes:GetInstance (1) diff --git a/frames/fw_mods.lua b/frames/fw_mods.lua index f2a64979..680fbf54 100644 --- a/frames/fw_mods.lua +++ b/frames/fw_mods.lua @@ -140,7 +140,7 @@ function gump:NewDetailsButton (parent, container, instancia, func, param1, para end end) - new_button:SetScript ("OnMouseUp", function (self, button) + new_button:SetScript ("OnMouseUp", function(self, button) if (not self:IsEnabled()) then return end @@ -324,7 +324,7 @@ function gump:NewTextBox (parent, container, member, func, param1, param2, w, h, end end - local EnterPress = function (byScript) + local EnterPress = function(byScript) if (editbox.EnterHook) then editbox.EnterHook() @@ -444,13 +444,13 @@ function gump:NewTextBox (parent, container, member, func, param1, param2, w, h, end end) - editbox:SetScript ("OnChar", function (self, text) + editbox:SetScript ("OnChar", function(self, text) if (editbox.InputHook) then editbox:InputHook (text) end end) - editbox:SetScript ("OnTextChanged", function (self, userChanged) + editbox:SetScript ("OnTextChanged", function(self, userChanged) if (editbox.TextChangeedHook and userChanged) then editbox:TextChangeedHook (userChanged) end @@ -463,13 +463,13 @@ function gump:NewTextBox (parent, container, member, func, param1, param2, w, h, end end) - editbox.SetNext = function (_, NextBox) + editbox.SetNext = function(_, NextBox) if (NextBox) then editbox.next = NextBox end end - editbox.SetLabel = function (_, Label) + editbox.SetLabel = function(_, Label) if (Label) then editbox.label = Label editbox.label:SetTextColor (.8, .8, .8, 1) @@ -608,14 +608,14 @@ function gump:NewScrollBar2 (master, slave, x, y) self:SetScript ("OnUpdate", nil) end) --> isso aqui pra quando o slider ativar, o scroll fica na posi��o zero - botao_cima:SetScript ("OnEnable", function (self) + botao_cima:SetScript ("OnEnable", function(self) local current = slider_gump:GetValue() if (current == 0) then botao_cima:Disable() end end) - slider_gump:SetScript ("OnValueChanged", function (self) + slider_gump:SetScript ("OnValueChanged", function(self) local current = self:GetValue() master:SetVerticalScroll (current) @@ -635,22 +635,22 @@ function gump:NewScrollBar2 (master, slave, x, y) end) - slider_gump:SetScript ("OnShow", function (self) + slider_gump:SetScript ("OnShow", function(self) botao_cima:Show() botao_baixo:Show() end) - slider_gump:SetScript ("OnDisable", function (self) + slider_gump:SetScript ("OnDisable", function(self) botao_cima:Disable() botao_baixo:Disable() end) - slider_gump:SetScript ("OnEnable", function (self) + slider_gump:SetScript ("OnEnable", function(self) botao_cima:Enable() botao_baixo:Enable() end) - master:SetScript ("OnMouseWheel", function (self, delta) + master:SetScript ("OnMouseWheel", function(self, delta) if (not slider_gump:IsEnabled()) then return end diff --git a/frames/window_api.lua b/frames/window_api.lua index e9f4147c..e9a766bf 100644 --- a/frames/window_api.lua +++ b/frames/window_api.lua @@ -40,7 +40,7 @@ function Details:CreateAPI2Frame() local api = Details.API_Description.namespaces[1].api --on select api on the menu - local onSelectAPI = function (self) + local onSelectAPI = function(self) local apiName = apiFunctionNames [self.index] if (not apiName) then Details:Msg ("API name not found:", apiName) @@ -124,7 +124,7 @@ function Details:CreateAPI2Frame() end --menu scroll - local apiMenuScrollRefresh = function (self, data, offset, total_lines) + local apiMenuScrollRefresh = function(self, data, offset, total_lines) for i = 1, total_lines do local index = i + offset local apiName = data [index] @@ -147,11 +147,11 @@ function Details:CreateAPI2Frame() end local api2ScrollMenu = DetailsFramework:CreateScrollBox (Api2Frame, "$parentApi2MenuScroll", apiMenuScrollRefresh, apiFunctionNames, scrollWidth, scrollHeight, lineAmount, lineHeight) - DetailsFramework:ReskinSlider (api2ScrollMenu) + DetailsFramework:ReskinSlider(api2ScrollMenu) api2ScrollMenu:SetPoint ("topleft", Api2Frame, "topleft", 10, yStart) Api2Frame.scrollMenu = api2ScrollMenu - local lineOnEnter = function (self) + local lineOnEnter = function(self) self:SetBackdropColor (unpack (backdropColorOnEnter)) local apiName = apiFunctionNames [self.index] @@ -171,7 +171,7 @@ function Details:CreateAPI2Frame() GameCooltip2:ShowCooltip() end - local lineOnLeave = function (self) + local lineOnLeave = function(self) if (currentSelected == self.index) then self:SetBackdropColor (unpack (backdropColorSelected)) else @@ -183,7 +183,7 @@ function Details:CreateAPI2Frame() --create lines for i = 1, lineAmount do - api2ScrollMenu:CreateLine (function (self, index) + api2ScrollMenu:CreateLine (function(self, index) local line = CreateFrame ("button", "$parentLine" .. index, self, "BackdropTemplate") line:SetPoint ("topleft", self, "topleft", 1, -((index-1)*(lineHeight+1)) - 1) line:SetSize (scrollWidth - 2, lineHeight) @@ -245,7 +245,7 @@ function Details:CreateAPI2Frame() parametersHeader.required:SetPoint ("left", parametersHeader, "left", space2, 0) parametersHeader.default:SetPoint ("left", parametersHeader, "left", space3, 0) - local parameterOnEnter = function (self) + local parameterOnEnter = function(self) GameCooltip2:Preset(2) GameCooltip2:SetOwner (self) @@ -259,7 +259,7 @@ function Details:CreateAPI2Frame() self:SetBackdropColor (unpack (backdropColorOnEnter)) end - local parameterOnLeave = function (self) + local parameterOnLeave = function(self) GameCooltip2:Hide() self:SetBackdropColor (unpack (backdropColor)) end @@ -307,10 +307,10 @@ function Details:CreateAPI2Frame() returnHeader.name:SetPoint ("left", returnHeader, "left", 2, 0) returnHeader.typeData:SetPoint ("left", returnHeader, "left", space1, 0) - local returnOnEnter = function (self) + local returnOnEnter = function(self) self:SetBackdropColor (unpack (backdropColorOnEnter)) end - local returnOnLeave = function (self) + local returnOnLeave = function(self) self:SetBackdropColor (unpack (backdropColor)) end diff --git a/frames/window_benchmark.lua b/frames/window_benchmark.lua index f381f889..13dc23b5 100644 --- a/frames/window_benchmark.lua +++ b/frames/window_benchmark.lua @@ -96,7 +96,7 @@ local libwindow = LibStub("LibWindow-1.1") f:RegisterEvent ("PLAYER_REGEN_DISABLED") f:RegisterEvent ("PLAYER_REGEN_ENABLED") - f:SetScript ("OnEvent", function (self, event, ...) + f:SetScript ("OnEvent", function(self, event, ...) if (event == "PLAYER_REGEN_DISABLED") then f.StartNewBenchmark() diff --git a/frames/window_bookmark.lua b/frames/window_bookmark.lua index 25173318..f083a8c3 100644 --- a/frames/window_bookmark.lua +++ b/frames/window_bookmark.lua @@ -14,7 +14,7 @@ function Details:OpenBookmarkConfig() panel:SetBackdropColor(.1, .1, .1, .9) panel.blocks = {} - local clear_func = function (self, button, id) + local clear_func = function(self, button, id) if (Details.switch.table [id]) then Details.switch.table [id].atributo = nil Details.switch.table [id].sub_atributo = nil @@ -23,7 +23,7 @@ function Details:OpenBookmarkConfig() end end - local select_attribute = function (_, _, _, attribute, sub_atribute) + local select_attribute = function(_, _, _, attribute, sub_atribute) if (not sub_atribute) then return end @@ -34,7 +34,7 @@ function Details:OpenBookmarkConfig() end local cooltip_color = {.1, .1, .1, .3} - local set_att = function (self, button, id) + local set_att = function(self, button, id) panel.selecting_slot = id GameCooltip:Reset() GameCooltip:SetType (3) @@ -52,11 +52,11 @@ function Details:OpenBookmarkConfig() local button_backdrop = {bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 64, insets = {left=0, right=0, top=0, bottom=0}} - local set_onenter = function (self, capsule) + local set_onenter = function(self, capsule) self:SetBackdropColor (1, 1, 1, 0.9) capsule.icon:SetBlendMode ("ADD") end - local set_onleave = function (self, capsule) + local set_onleave = function(self, capsule) self:SetBackdropColor (0, 0, 0, 0.5) capsule.icon:SetBlendMode ("BLEND") end diff --git a/frames/window_brokertexteditor.lua b/frames/window_brokertexteditor.lua index 5b896bf5..fae48876 100644 --- a/frames/window_brokertexteditor.lua +++ b/frames/window_brokertexteditor.lua @@ -34,7 +34,7 @@ function Details:OpenBrokerTextEditor() end) local option_selected = 1 - local onclick= function (_, _, value) + local onclick= function(_, _, value) option_selected = value end local AddOptions = { @@ -172,7 +172,7 @@ function Details:OpenBrokerTextEditor() self:HighlightText( Start, #ColorCode + ( #Replacement - #Selection ) + #COLOR_END + End ); end - local color_func = function (_, r, g, b, a) + local color_func = function(_, r, g, b, a) local hex = Details:hex (a*255)..Details:hex (r*255)..Details:hex (g*255)..Details:hex (b*255) ColorSelection ( textentry.editbox, "|c" .. hex) end diff --git a/frames/window_cdtracker.lua b/frames/window_cdtracker.lua index be62e0ab..63e00477 100644 --- a/frames/window_cdtracker.lua +++ b/frames/window_cdtracker.lua @@ -379,7 +379,7 @@ end {--enable ocd type = "toggle", get = function() return Details.ocd_tracker.enabled end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) if (value) then Details.CooldownTracking.EnableTracker() else @@ -393,7 +393,7 @@ end {--show only in group type = "toggle", get = function() return Details.ocd_tracker.show_conditions.only_in_group end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.ocd_tracker.show_conditions.only_in_group = value Details.CooldownTracking.RefreshCooldownFrames() end, @@ -404,7 +404,7 @@ end {--show only inside instances type = "toggle", get = function() return Details.ocd_tracker.show_conditions.only_inside_instance end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.ocd_tracker.show_conditions.only_inside_instance = value Details.CooldownTracking.RefreshCooldownFrames() end, @@ -414,7 +414,7 @@ end {--lock frame type = "toggle", get = function() return Details.ocd_tracker.framme_locked end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.ocd_tracker.framme_locked = value Details.CooldownTracking.RefreshCooldownFrames() end, @@ -427,7 +427,7 @@ end {--filter: show raid wide defensive cooldowns type = "toggle", get = function() return Details.ocd_tracker.filters["defensive-raid"] end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.ocd_tracker.filters["defensive-raid"] = value Details.CooldownTracking.RefreshCooldownFrames() end, @@ -438,7 +438,7 @@ end {--filter: show target defensive cooldowns type = "toggle", get = function() return Details.ocd_tracker.filters["defensive-target"] end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.ocd_tracker.filters["defensive-target"] = value Details.CooldownTracking.RefreshCooldownFrames() end, @@ -449,7 +449,7 @@ end {--filter: show personal defensive cooldowns type = "toggle", get = function() return Details.ocd_tracker.filters["defensive-personal"] end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.ocd_tracker.filters["defensive-personal"] = value Details.CooldownTracking.RefreshCooldownFrames() end, @@ -460,7 +460,7 @@ end {--filter: show ofensive cooldowns type = "toggle", get = function() return Details.ocd_tracker.filters["ofensive"] end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.ocd_tracker.filters["ofensive"] = value Details.CooldownTracking.RefreshCooldownFrames() end, @@ -471,7 +471,7 @@ end {--filter: show utility cooldowns type = "toggle", get = function() return Details.ocd_tracker.filters["utility"] end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.ocd_tracker.filters["utility"] = value Details.CooldownTracking.RefreshCooldownFrames() end, @@ -482,7 +482,7 @@ end {--filter: show interrupt cooldowns type = "toggle", get = function() return Details.ocd_tracker.filters["interrupt"] end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.ocd_tracker.filters["interrupt"] = value Details.CooldownTracking.RefreshCooldownFrames() end, @@ -495,7 +495,7 @@ end {--bar width type = "range", get = function() return Details.ocd_tracker.width end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.ocd_tracker.width = value Details.CooldownTracking.RefreshCooldownFrames() end, @@ -509,7 +509,7 @@ end {--bar height type = "range", get = function() return Details.ocd_tracker.height end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.ocd_tracker.height = value Details.CooldownTracking.RefreshCooldownFrames() end, @@ -523,7 +523,7 @@ end {--bar height type = "range", get = function() return Details.ocd_tracker.lines_per_column end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.ocd_tracker.lines_per_column = floor(value) Details.CooldownTracking.RefreshCooldownFrames() end, diff --git a/frames/window_classcolor.lua b/frames/window_classcolor.lua index 3d98f3a8..c2263544 100644 --- a/frames/window_classcolor.lua +++ b/frames/window_classcolor.lua @@ -19,7 +19,7 @@ function Details:OpenClassColorsConfig() local y = -50 - local callback = function (button, r, g, b, a, self) + local callback = function(button, r, g, b, a, self) self.MyObject.my_texture:SetVertexColor (r, g, b) Details.class_colors [self.MyObject.my_class][1] = r Details.class_colors [self.MyObject.my_class][2] = g @@ -27,13 +27,13 @@ function Details:OpenClassColorsConfig() Details:RefreshMainWindow (-1, true) end - local set_color = function (self, button, class, index) + local set_color = function(self, button, class, index) local current_class_color = Details.class_colors [class] local r, g, b = unpack (current_class_color) DF:ColorPick (self, r, g, b, 1, callback) end - local reset_color = function (self, button, class, index) + local reset_color = function(self, button, class, index) local color_table = RAID_CLASS_COLORS [class] local r, g, b = color_table.r, color_table.g, color_table.b self.MyObject.my_texture:SetVertexColor (r, g, b) @@ -43,12 +43,12 @@ function Details:OpenClassColorsConfig() Details:RefreshMainWindow (-1, true) end - local on_enter = function (self, capsule) + local on_enter = function(self, capsule) --Details:CooltipPreset (1) --GameCooltip:AddLine ("right click to reset") --GameCooltip:Show (self) end - local on_leave = function (self, capsule) + local on_leave = function(self, capsule) --GameCooltip:Hide() end diff --git a/frames/window_currentdps.lua b/frames/window_currentdps.lua index ca93cffc..2eacc8d9 100644 --- a/frames/window_currentdps.lua +++ b/frames/window_currentdps.lua @@ -52,7 +52,7 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel) local testUsing = "arena" --mythicdungeon --> frame strata options - local set_frame_strata = function (_, _, strata) + local set_frame_strata = function(_, _, strata) Details.realtime_dps_meter.frame_settings.strata = strata Details:UpdateTheRealCurrentDPSFrame(testUsing) end @@ -64,7 +64,7 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel) strataTable [5] = {value = "DIALOG", label = "DIALOG", onclick = set_frame_strata} --> font options - local set_font_shadow= function (_, _, shadow) + local set_font_shadow= function(_, _, shadow) Details.realtime_dps_meter.font_shadow = shadow Details:UpdateTheRealCurrentDPSFrame(testUsing) end @@ -73,7 +73,7 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel) fontShadowTable [2] = {value = "OUTLINE", label = "Outline", onclick = set_font_shadow} fontShadowTable [3] = {value = "THICKOUTLINE", label = "Thick Outline", onclick = set_font_shadow} - local on_select_text_font = function (self, fixed_value, value) + local on_select_text_font = function(self, fixed_value, value) Details.realtime_dps_meter.font_face = value Details:UpdateTheRealCurrentDPSFrame(testUsing) end @@ -99,7 +99,7 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel) { type = "toggle", get = function() return Details.realtime_dps_meter.enabled end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.realtime_dps_meter.enabled = not Details.realtime_dps_meter.enabled Details:LoadFramesForBroadcastTools() end, @@ -111,7 +111,7 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel) { type = "toggle", get = function() return Details.realtime_dps_meter.frame_settings.locked end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.realtime_dps_meter.frame_settings.locked = not Details.realtime_dps_meter.frame_settings.locked Details:UpdateTheRealCurrentDPSFrame(testUsing) lockCallback() @@ -124,7 +124,7 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel) { type = "toggle", get = function() return Details.realtime_dps_meter.frame_settings.show_title end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.realtime_dps_meter.frame_settings.show_title = not Details.realtime_dps_meter.frame_settings.show_title Details:UpdateTheRealCurrentDPSFrame(testUsing) end, @@ -138,7 +138,7 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel) get = function() return {Details.realtime_dps_meter.frame_settings.backdrop_color[1], Details.realtime_dps_meter.frame_settings.backdrop_color[2], Details.realtime_dps_meter.frame_settings.backdrop_color[3], Details.realtime_dps_meter.frame_settings.backdrop_color[4]} end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) local color = Details.realtime_dps_meter.frame_settings.backdrop_color color[1], color[2], color[3], color[4] = r, g, b, a Details:UpdateTheRealCurrentDPSFrame(testUsing) @@ -158,7 +158,7 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel) { type = "range", get = function() return Details.realtime_dps_meter.sample_size end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.realtime_dps_meter.sample_size = value Details:UpdateTheRealCurrentDPSFrame(testUsing) end, @@ -173,7 +173,7 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel) { type = "range", get = function() return Details.realtime_dps_meter.frame_settings.width end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.realtime_dps_meter.frame_settings.width = value Details:UpdateTheRealCurrentDPSFrame(testUsing) end, @@ -187,7 +187,7 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel) { type = "range", get = function() return Details.realtime_dps_meter.frame_settings.height end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.realtime_dps_meter.frame_settings.height = value Details:UpdateTheRealCurrentDPSFrame(testUsing) end, @@ -205,7 +205,7 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel) { type = "toggle", get = function() return Details.realtime_dps_meter.arena_enabled end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.realtime_dps_meter.arena_enabled = not Details.realtime_dps_meter.arena_enabled Details:LoadFramesForBroadcastTools() end, @@ -216,7 +216,7 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel) { type = "toggle", get = function() return Details.realtime_dps_meter.mythic_dungeon_enabled end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.realtime_dps_meter.mythic_dungeon_enabled = not Details.realtime_dps_meter.mythic_dungeon_enabled Details:LoadFramesForBroadcastTools() end, @@ -231,7 +231,7 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel) { type = "range", get = function() return Details.realtime_dps_meter.font_size end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.realtime_dps_meter.font_size = value Details:UpdateTheRealCurrentDPSFrame(testUsing) end, @@ -247,7 +247,7 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel) get = function() return {Details.realtime_dps_meter.font_color[1], Details.realtime_dps_meter.font_color[2], Details.realtime_dps_meter.font_color[3], Details.realtime_dps_meter.font_color[4]} end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) local color = Details.realtime_dps_meter.font_color color[1], color[2], color[3], color[4] = r, g, b, a Details:UpdateTheRealCurrentDPSFrame(testUsing) @@ -275,7 +275,7 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel) { type = "range", get = function() return _detalhes.realtime_dps_meter.text_offset end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.realtime_dps_meter.text_offset = value Details:UpdateTheRealCurrentDPSFrame(testUsing) end, @@ -673,7 +673,7 @@ function Details:CreateCurrentDpsFrame(parent, name) _detalhes:UpdateTheRealCurrentDPSFrame() - local on_tick = function (self, deltaTime) + local on_tick = function(self, deltaTime) self.NextUpdate = self.NextUpdate - deltaTime if (self.NextUpdate <= 0) then diff --git a/frames/window_custom.lua b/frames/window_custom.lua index 0cf41d11..ec55bdd4 100644 --- a/frames/window_custom.lua +++ b/frames/window_custom.lua @@ -171,7 +171,7 @@ custom_window:SetSize (850, 500) custom_window:EnableMouse (true) custom_window:SetMovable (true) - custom_window:SetScript ("OnMouseDown", function (self, button) + custom_window:SetScript ("OnMouseDown", function(self, button) if (button == "LeftButton") then if (not self.moving) then self.moving = true @@ -183,7 +183,7 @@ end end end) - custom_window:SetScript ("OnMouseUp", function (self) + custom_window:SetScript ("OnMouseUp", function(self) if (self.moving) then self.moving = false self:StopMovingOrSizing() @@ -742,10 +742,10 @@ local menu_up_frame = _CreateFrame ("frame", nil, custom_window) menu_up_frame:SetFrameLevel (custom_window:GetFrameLevel()+2) - local onenter = function (self) + local onenter = function(self) --self.icontexture:SetVertexColor (1, 1, 1, 1) end - local onleave = function (self) + local onleave = function(self) --self.icontexture:SetVertexColor (.9, .9, .9, 1) end @@ -768,7 +768,7 @@ custom_window.menu [index] = {circle = circle, icon = texture, button = button} end - local build_menu = function (self, button, func, param2) + local build_menu = function(self, button, func, param2) GameCooltip:Reset() for index, custom_object in _ipairs (_detalhes.custom) do @@ -792,21 +792,21 @@ end --> edit button - local start_edit = function (_, _, custom_object, index) + local start_edit = function(_, _, custom_object, index) GameCooltip:Hide() DetailsCustomPanel:StartEdit (custom_object) end custom_window:CreateMenuButton (Loc ["STRING_CUSTOM_EDIT"], "Interface\\ICONS\\INV_Inscription_RunescrollOfFortitude_Red", build_menu, start_edit, nil, nil, "Edit", {0.07, 0.93, 0.07, 0.93}) --> remove button - local remove_display = function (_, _, custom_object, index) + local remove_display = function(_, _, custom_object, index) GameCooltip:Hide() DetailsCustomPanel:RemoveDisplay (custom_object, index) end custom_window:CreateMenuButton (Loc ["STRING_CUSTOM_REMOVE"], "Interface\\ICONS\\Spell_BrokenHeart", build_menu, remove_display, nil, nil, "Remove", {1, 0, 0, 1}) --> export button - local export_display = function (_, _, custom_object, index) + local export_display = function(_, _, custom_object, index) GameCooltip:Hide() local export_object = {} @@ -863,7 +863,7 @@ custom_window:CreateMenuButton (Loc ["STRING_CUSTOM_EXPORT"], "Interface\\ICONS\\INV_Misc_Gift_01", build_menu, export_display, nil, nil, "Export", {0.00, 0.9, 0.07, 0.93}) --> localize --> import buttonRaceChange - local import_display = function (_, _, custom_object, index) + local import_display = function(_, _, custom_object, index) GameCooltip:Hide() if (not custom_window.ImportBox) then @@ -951,11 +951,11 @@ attribute_box:SetSize (180, 260) attribute_box:Hide() - local button_onenter = function (self) + local button_onenter = function(self) self:SetBackdropColor (.3, .3, .3, .3) self.icon:SetBlendMode ("ADD") end - local button_onleave = function (self) + local button_onleave = function(self) self:SetBackdropColor (0, 0, 0, .2) self.icon:SetBlendMode ("BLEND") end @@ -1064,7 +1064,7 @@ local icon_label = gump:NewLabel (box0, box0, "$parenIconLabel", "icon", Loc ["STRING_CUSTOM_ICON"], "GameFontHighlightLeft") --> localize-me icon_label:SetPoint ("topleft", desc_label, "bottomleft", 0, -12) - local pickicon_callback = function (texture) + local pickicon_callback = function(texture) box0.icontexture:SetTexture (texture) end @@ -1166,7 +1166,7 @@ modelFrameBackground:Hide() modelFrameBackgroundIcon:Hide() - local selectedEncounterActor = function (actorName, model) + local selectedEncounterActor = function(actorName, model) source_field:SetText (actorName) source_dropdown:Select (4, true) box1.sourceentry:Enable() @@ -1176,7 +1176,7 @@ local actorsFrameButtons = {} - local buttonMouseOver = function (button) + local buttonMouseOver = function(button) button.MyObject.image:SetBlendMode ("ADD") button.MyObject.line:SetBlendMode ("ADD") button.MyObject.label:SetTextColor (1, 1, 1, 1) @@ -1192,7 +1192,7 @@ modelFrame:SetDisplayInfo (button.MyObject.model) end - local buttonMouseOut = function (button) + local buttonMouseOut = function(button) button.MyObject.image:SetBlendMode ("BLEND") button.MyObject.line:SetBlendMode ("BLEND") button.MyObject.label:SetTextColor (.8, .8, .8, .8) @@ -1200,7 +1200,7 @@ modelFrame:Hide() end - local EncounterSelect = function (_, _, instanceId, bossIndex, ej_id) + local EncounterSelect = function(_, _, instanceId, bossIndex, ej_id) DetailsCustomSpellsFrame:Hide() DetailsCustomActorsFrame:Hide() @@ -1374,7 +1374,7 @@ local modelFrameTexture = modelFrame:CreateTexture (nil, "background") modelFrameTexture:SetAllPoints() - local selectedEncounterActor = function (actorName) + local selectedEncounterActor = function(actorName) target_field:SetText (actorName) target_dropdown:Select (4, true) box1.targetentry:Enable() @@ -1384,7 +1384,7 @@ local actorsFrameButtons = {} - local buttonMouseOver = function (button) + local buttonMouseOver = function(button) button.MyObject.image:SetBlendMode ("ADD") button.MyObject.line:SetBlendMode ("ADD") button.MyObject.label:SetTextColor (1, 1, 1, 1) @@ -1400,7 +1400,7 @@ modelFrame:SetDisplayInfo (button.MyObject.model) end - local buttonMouseOut = function (button) + local buttonMouseOut = function(button) button.MyObject.image:SetBlendMode ("BLEND") button.MyObject.line:SetBlendMode ("BLEND") button.MyObject.label:SetTextColor (.8, .8, .8, .8) @@ -1409,7 +1409,7 @@ modelFrame:Hide() end - local EncounterSelect = function (_, _, instanceId, bossIndex, ej_id) + local EncounterSelect = function(_, _, instanceId, bossIndex, ej_id) DetailsCustomSpellsFrame:Hide() DetailsCustomActorsFrame:Show() @@ -1549,8 +1549,8 @@ spellsFrame:SetPoint ("topleft", custom_window, "topright", 5, 0) spellsFrame:Hide() - local selectedEncounterSpell = function (spellId) - local _, _, icon = _GetSpellInfo (spellId) + local selectedEncounterSpell = function(spellId) + local _, _, icon = _GetSpellInfo(spellId) spellid_entry:SetText (spellId) box0.icontexture:SetTexture (icon) spellsFrame:Hide() @@ -1559,7 +1559,7 @@ local spellsFrameButtons = {} - local buttonMouseOver = function (button) + local buttonMouseOver = function(button) button.MyObject.image:SetBlendMode ("ADD") button.MyObject.line:SetBlendMode ("ADD") button.MyObject.label:SetTextColor (1, 1, 1, 1) @@ -1568,14 +1568,14 @@ _detalhes:GameTooltipSetSpellByID (button.MyObject.spellid) GameTooltip:Show() end - local buttonMouseOut = function (button) + local buttonMouseOut = function(button) button.MyObject.image:SetBlendMode ("BLEND") button.MyObject.line:SetBlendMode ("BLEND") button.MyObject.label:SetTextColor (.8, .8, .8, .8) GameTooltip:Hide() end - local EncounterSelect = function (_, _, instanceId, bossIndex) + local EncounterSelect = function(_, _, instanceId, bossIndex) DetailsCustomSpellsFrame:Show() DetailsCustomActorsFrame:Hide() @@ -1626,7 +1626,7 @@ x = x + 100 end - local nome_magia, _, icone_magia = _GetSpellInfo (spell) + local nome_magia, _, icone_magia = _GetSpellInfo(spell) thisButton.image:SetTexture (icone_magia) thisButton.label:SetText (nome_magia) thisButton:SetClickFunction (selectedEncounterSpell, spell) @@ -1774,7 +1774,7 @@ end end - local font_change = function (_, _, increase) + local font_change = function(_, _, increase) if (increase) then local file, size, flags = code_editor.editbox:GetFont() code_editor.font_size = code_editor.font_size + 1 diff --git a/frames/window_dump.lua b/frames/window_dump.lua index c00b2f7a..c1e54743 100644 --- a/frames/window_dump.lua +++ b/frames/window_dump.lua @@ -30,7 +30,7 @@ function Details:Dump (...) text_editor.editbox:SetBackdrop (nil) text_editor:SetBackdrop (nil) - DetailsFramework:ReskinSlider (text_editor.scroll) + DetailsFramework:ReskinSlider(text_editor.scroll) if (not text_editor.__background) then text_editor.__background = text_editor:CreateTexture (nil, "background") @@ -95,7 +95,7 @@ function _detalhes:ShowImportWindow (defaultText, confirmFunc, titleText) importTextEditor.editbox:SetBackdrop (nil) importTextEditor:SetBackdrop (nil) - DetailsFramework:ReskinSlider (importTextEditor.scroll) + DetailsFramework:ReskinSlider(importTextEditor.scroll) if (not importTextEditor.__background) then importTextEditor.__background = importTextEditor:CreateTexture (nil, "background") diff --git a/frames/window_eventtracker.lua b/frames/window_eventtracker.lua index fb413252..97f23341 100644 --- a/frames/window_eventtracker.lua +++ b/frames/window_eventtracker.lua @@ -26,7 +26,7 @@ function Details:OpenEventTrackerOptions (from_options_panel) local options_button_template = DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE") --> frame strata options - local set_frame_strata = function (_, _, strata) + local set_frame_strata = function(_, _, strata) Details.event_tracker.frame.strata = strata Details:UpdateEventTrackerFrame() end @@ -38,7 +38,7 @@ function Details:OpenEventTrackerOptions (from_options_panel) strataTable [5] = {value = "DIALOG", label = "DIALOG", onclick = set_frame_strata} --> font options - local set_font_shadow= function (_, _, shadow) + local set_font_shadow= function(_, _, shadow) Details.event_tracker.font_shadow = shadow Details:UpdateEventTrackerFrame() end @@ -47,13 +47,13 @@ function Details:OpenEventTrackerOptions (from_options_panel) fontShadowTable [2] = {value = "OUTLINE", label = "Outline", onclick = set_font_shadow} fontShadowTable [3] = {value = "THICKOUTLINE", label = "Thick Outline", onclick = set_font_shadow} - local on_select_text_font = function (self, fixed_value, value) + local on_select_text_font = function(self, fixed_value, value) Details.event_tracker.font_face = value Details:UpdateEventTrackerFrame() end --> texture options - local set_bar_texture = function (_, _, value) + local set_bar_texture = function(_, _, value) Details.event_tracker.line_texture = value Details:UpdateEventTrackerFrame() end @@ -64,7 +64,7 @@ function Details:OpenEventTrackerOptions (from_options_panel) for name, texturePath in pairs (textures) do texTable [#texTable + 1] = {value = name, label = name, statusbar = texturePath, onclick = set_bar_texture} end - table.sort (texTable, function (t1, t2) return t1.label < t2.label end) + table.sort (texTable, function(t1, t2) return t1.label < t2.label end) --> options table local options = { @@ -74,7 +74,7 @@ function Details:OpenEventTrackerOptions (from_options_panel) { type = "toggle", get = function() return Details.event_tracker.enabled end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.event_tracker.enabled = not Details.event_tracker.enabled Details:LoadFramesForBroadcastTools() end, @@ -86,7 +86,7 @@ function Details:OpenEventTrackerOptions (from_options_panel) { type = "toggle", get = function() return Details.event_tracker.frame.locked end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.event_tracker.frame.locked = not Details.event_tracker.frame.locked Details:UpdateEventTrackerFrame() end, @@ -98,7 +98,7 @@ function Details:OpenEventTrackerOptions (from_options_panel) { type = "toggle", get = function() return Details.event_tracker.frame.show_title end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.event_tracker.frame.show_title = not Details.event_tracker.frame.show_title Details:UpdateEventTrackerFrame() end, @@ -112,7 +112,7 @@ function Details:OpenEventTrackerOptions (from_options_panel) get = function() return {Details.event_tracker.frame.backdrop_color[1], Details.event_tracker.frame.backdrop_color[2], Details.event_tracker.frame.backdrop_color[3], Details.event_tracker.frame.backdrop_color[4]} end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) local color = Details.event_tracker.frame.backdrop_color color[1], color[2], color[3], color[4] = r, g, b, a Details:UpdateEventTrackerFrame() @@ -134,7 +134,7 @@ function Details:OpenEventTrackerOptions (from_options_panel) { type = "range", get = function() return Details.event_tracker.line_height end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.event_tracker.line_height = value Details:UpdateEventTrackerFrame() end, @@ -157,7 +157,7 @@ function Details:OpenEventTrackerOptions (from_options_panel) get = function() return {Details.event_tracker.line_color[1], Details.event_tracker.line_color[2], Details.event_tracker.line_color[3], Details.event_tracker.line_color[4]} end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) local color = Details.event_tracker.line_color color[1], color[2], color[3], color[4] = r, g, b, a Details:UpdateEventTrackerFrame() @@ -170,7 +170,7 @@ function Details:OpenEventTrackerOptions (from_options_panel) { type = "range", get = function() return Details.event_tracker.font_size end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.event_tracker.font_size = value Details:UpdateEventTrackerFrame() end, @@ -186,7 +186,7 @@ function Details:OpenEventTrackerOptions (from_options_panel) get = function() return {Details.event_tracker.font_color[1], Details.event_tracker.font_color[2], Details.event_tracker.font_color[3], Details.event_tracker.font_color[4]} end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) local color = Details.event_tracker.font_color color[1], color[2], color[3], color[4] = r, g, b, a Details:UpdateEventTrackerFrame() @@ -264,13 +264,13 @@ function Details:CreateEventTrackerFrame(parent, name) local left_resize, right_resize = DF:CreateResizeGrips (f) - left_resize:SetScript ("OnMouseDown", function (self) + left_resize:SetScript ("OnMouseDown", function(self) if (not f.resizing and not _detalhes.event_tracker.frame.locked) then f.resizing = true f:StartSizing ("bottomleft") end end) - left_resize:SetScript ("OnMouseUp", function (self) + left_resize:SetScript ("OnMouseUp", function(self) if (f.resizing) then f.resizing = false f:StopMovingOrSizing() @@ -278,13 +278,13 @@ function Details:CreateEventTrackerFrame(parent, name) _detalhes.event_tracker.frame.height = f:GetHeight() end end) - right_resize:SetScript ("OnMouseDown", function (self) + right_resize:SetScript ("OnMouseDown", function(self) if (not f.resizing and not _detalhes.event_tracker.frame.locked) then f.resizing = true f:StartSizing ("bottomright") end end) - right_resize:SetScript ("OnMouseUp", function (self) + right_resize:SetScript ("OnMouseUp", function(self) if (f.resizing) then f.resizing = false f:StopMovingOrSizing() @@ -293,7 +293,7 @@ function Details:CreateEventTrackerFrame(parent, name) end end) - f:SetScript ("OnSizeChanged", function (self) + f:SetScript ("OnSizeChanged", function(self) end) @@ -306,7 +306,7 @@ function Details:CreateEventTrackerFrame(parent, name) local header_size = 20 --> on tick script - local lineOnTick = function (self, deltaTime) + local lineOnTick = function(self, deltaTime) --> when this event occured on combat log local gameTime = self.GameTime @@ -331,7 +331,7 @@ function Details:CreateEventTrackerFrame(parent, name) end --> create a line on the scroll frame - local scroll_createline = function (self, index) + local scroll_createline = function(self, index) local line = CreateFrame ("frame", "$parentLine" .. index, self,"BackdropTemplate") line:EnableMouse (false) @@ -412,7 +412,7 @@ function Details:CreateEventTrackerFrame(parent, name) local ABILITYTABLE_ISENEMY = 9 local ABILITYTABLE_TARGETSERIAL = 10 - local get_spec_or_class = function (serial, name) + local get_spec_or_class = function(serial, name) local class local spec = _detalhes.cached_specs [serial] if (not spec) then @@ -430,7 +430,7 @@ function Details:CreateEventTrackerFrame(parent, name) return spec, class end - local get_player_icon = function (spec, class) + local get_player_icon = function(spec, class) if (spec) then return [[Interface\AddOns\Details\images\spec_icons_normal]], unpack (_detalhes.class_specs_coords [spec]) elseif (class) then @@ -440,7 +440,7 @@ function Details:CreateEventTrackerFrame(parent, name) end end - local add_role_and_class_color = function (player_name, player_serial) + local add_role_and_class_color = function(player_name, player_serial) --> get the actor object local actor = _detalhes.tabela_vigente[1]:GetActor (player_name) @@ -492,7 +492,7 @@ function Details:CreateEventTrackerFrame(parent, name) return availableSpace end - local shrink_string = function (fontstring, size) + local shrink_string = function(fontstring, size) local text = fontstring:GetText() local loops = 20 while (fontstring:GetStringWidth() > size and loops > 0) do @@ -505,7 +505,7 @@ function Details:CreateEventTrackerFrame(parent, name) end --refresh the scroll frame - local scroll_refresh = function (self, data, offset, total_lines) + local scroll_refresh = function(self, data, offset, total_lines) local textSize = get_text_size() @@ -529,7 +529,7 @@ function Details:CreateEventTrackerFrame(parent, name) end if (ability [ABILITYTABLE_SPELLTYPE] == SPELLTYPE_COOLDOWN) then - local spellName, _, spellIcon = GetSpellInfo (ability [ABILITYTABLE_SPELLID]) + local spellName, _, spellIcon = GetSpellInfo(ability [ABILITYTABLE_SPELLID]) line.RightIcon:SetTexture (spellIcon) line.RightIcon:SetTexCoord (.06, .94, .06, .94) @@ -545,7 +545,7 @@ function Details:CreateEventTrackerFrame(parent, name) line.ActionIcon:SetTexCoord (0, 0.125, 0, 1) elseif (ability [ABILITYTABLE_SPELLTYPE] == SPELLTYPE_OFFENSIVE) then - local spellName, _, spellIcon = GetSpellInfo (ability [ABILITYTABLE_SPELLID]) + local spellName, _, spellIcon = GetSpellInfo(ability [ABILITYTABLE_SPELLID]) line.RightIcon:SetTexture (spellIcon) line.RightIcon:SetTexCoord (.06, .94, .06, .94) line.RightText:SetText (spellName) @@ -554,7 +554,7 @@ function Details:CreateEventTrackerFrame(parent, name) line.ActionIcon:SetTexCoord (0.127, 0.25, 0, 1) elseif (ability [ABILITYTABLE_SPELLTYPE] == SPELLTYPE_INTERRUPT) then - local spellNameInterrupted, _, spellIconInterrupted = GetSpellInfo (ability [ABILITYTABLE_EXTRASPELLID]) + local spellNameInterrupted, _, spellIconInterrupted = GetSpellInfo(ability [ABILITYTABLE_EXTRASPELLID]) line.RightIcon:SetTexture (spellIconInterrupted) line.RightIcon:SetTexCoord (.06, .94, .06, .94) line.RightText:SetText (spellNameInterrupted) @@ -563,7 +563,7 @@ function Details:CreateEventTrackerFrame(parent, name) line.ActionIcon:SetTexCoord (0.251, 0.375, 0, 1) elseif (ability [ABILITYTABLE_SPELLTYPE] == SPELLTYPE_CROWDCONTROL) then - local spellName, _, spellIcon = GetSpellInfo (ability [ABILITYTABLE_SPELLID]) + local spellName, _, spellIcon = GetSpellInfo(ability [ABILITYTABLE_SPELLID]) line.RightIcon:SetTexture (spellIcon) line.RightIcon:SetTexCoord (.06, .94, .06, .94) @@ -612,7 +612,7 @@ function Details:CreateEventTrackerFrame(parent, name) scrollframe:SetPoint ("bottomright", f, "bottomright", 0, 0) --> update line - used by 'UpdateWorldTrackerLines' function - local update_line = function (line) + local update_line = function(line) --> get the line index local index = line.Index @@ -730,20 +730,20 @@ function Details:CreateEventTrackerFrame(parent, name) local OBJECT_TYPE_ENEMY = 0x00000040 --> combat parser - local is_player = function (flag) + local is_player = function(flag) if (not flag) then return false end return bit.band (flag, OBJECT_TYPE_PLAYER) ~= 0 end - local is_enemy = function (flag) + local is_enemy = function(flag) if (not flag) then return false end return bit.band (flag, OBJECT_TYPE_ENEMY) ~= 0 end - combatLog:SetScript ("OnEvent", function (self, event) + combatLog:SetScript ("OnEvent", function(self, event) local time, token, hidding, caster_serial, caster_name, caster_flags, caster_flags2, target_serial, target_name, target_flags, target_flags2, spellid, spellname, spelltype, extraSpellID, extraSpellName, extraSchool = CombatLogGetCurrentEventInfo() local added = false diff --git a/frames/window_forge.lua b/frames/window_forge.lua index 3b9d5c19..649c3061 100644 --- a/frames/window_forge.lua +++ b/frames/window_forge.lua @@ -200,8 +200,8 @@ function Details:OpenForge() {name = L["STRING_FORGE_HEADER_FLAG"], width = 100, type = "entry", func = no_func}, }, fill_panel = false, - fill_gettotal = function (self) return #self.module.data end, - fill_fillrows = function (index, self) + fill_gettotal = function(self) return #self.module.data end, + fill_fillrows = function(index, self) local data = self.module.data [index] if (data) then return { @@ -283,8 +283,8 @@ function Details:OpenForge() {name = L["STRING_FORGE_HEADER_FLAG"], width = 100, type = "entry", func = no_func}, }, fill_panel = false, - fill_gettotal = function (self) return #self.module.data end, - fill_fillrows = function (index, self) + fill_gettotal = function(self) return #self.module.data end, + fill_fillrows = function(index, self) local data = self.module.data [index] if (data) then return { @@ -351,8 +351,8 @@ function Details:OpenForge() {name = L["STRING_FORGE_HEADER_FLAG"], width = 100, type = "entry", func = no_func}, }, fill_panel = false, - fill_gettotal = function (self) return #self.module.data end, - fill_fillrows = function (index, self) + fill_gettotal = function(self) return #self.module.data end, + fill_fillrows = function(index, self) local data = self.module.data [index] if (data) then return { @@ -382,21 +382,21 @@ function Details:OpenForge() end end - local spell_open_aura_creator = function (row) + local spell_open_aura_creator = function(row) local data = all_modules [1].data [row] local spellid = data[1] - local spellname, _, spellicon = GetSpellInfo (spellid) + local spellname, _, spellicon = GetSpellInfo(spellid) Details:OpenAuraPanel (spellid, spellname, spellicon, data[3]) end - local spell_encounter_open_aura_creator = function (row) + local spell_encounter_open_aura_creator = function(row) local data = all_modules [2].data [row] local spellID = data[1] local encounterID = data [2] local enemyName = data [3] local encounterName = data [4] - local spellname, _, spellicon = GetSpellInfo (spellID) + local spellname, _, spellicon = GetSpellInfo(spellID) Details:OpenAuraPanel (spellID, spellname, spellicon, encounterID) end @@ -464,7 +464,7 @@ function Details:OpenForge() if (can_add ) then if (filter_name ~= "") then - local spellName = GetSpellInfo (spellID) + local spellName = GetSpellInfo(spellID) if (spellName) then spellName = lower (spellName) if (not spellName:find (lower_FilterSpellName)) then @@ -497,8 +497,8 @@ function Details:OpenForge() ----{name = L["STRING_FORGE_HEADER_CREATEAURA"], width = 86, type = "button", func = spell_open_aura_creator, icon = [[Interface\AddOns\WeakAuras\Media\Textures\icon]], notext = true, iconalign = "center"}, }, fill_panel = false, - fill_gettotal = function (self) return #self.module.data end, - fill_fillrows = function (index, self) + fill_gettotal = function(self) return #self.module.data end, + fill_fillrows = function(index, self) local data = self.module.data [index] if (data) then local events = "" @@ -509,7 +509,7 @@ function Details:OpenForge() end events = events:sub (1, #events - 3) end - local spellName, _, spellIcon = GetSpellInfo (data[1]) + local spellName, _, spellIcon = GetSpellInfo(data[1]) local classColor = RAID_CLASS_COLORS [data[2]] and RAID_CLASS_COLORS [data[2]].colorStr or "FFFFFFFF" return { index, @@ -599,7 +599,7 @@ function Details:OpenForge() if (can_add ) then if (filter_name ~= "") then - local spellName = GetSpellInfo (spellID) + local spellName = GetSpellInfo(spellID) if (spellName) then spellName = lower (spellName) if (not spellName:find (lower_FilterSpellName)) then @@ -643,8 +643,8 @@ function Details:OpenForge() }, fill_panel = false, - fill_gettotal = function (self) return #self.module.data end, - fill_fillrows = function (index, self) + fill_gettotal = function(self) return #self.module.data end, + fill_fillrows = function(index, self) local data = self.module.data [index] if (data) then @@ -745,8 +745,8 @@ function Details:OpenForge() }, fill_panel = false, - fill_gettotal = function (self) return #self.module.data end, - fill_fillrows = function (index, self) + fill_gettotal = function(self) return #self.module.data end, + fill_fillrows = function(index, self) local data = self.module.data[index] if (data) then local npcId = data[1] @@ -768,12 +768,12 @@ function Details:OpenForge() ----------------------------------------------- - local dbm_open_aura_creator = function (row) + local dbm_open_aura_creator = function(row) local data = all_modules [4].data [row] local spellname, spellicon, _ if (type (data [7]) == "number") then - spellname, _, spellicon = GetSpellInfo (data [7]) + spellname, _, spellicon = GetSpellInfo(data [7]) else if (data [7]) then local spellid = data[7]:gsub ("ej", "") @@ -862,8 +862,8 @@ function Details:OpenForge() }, fill_panel = false, - fill_gettotal = function (self) return #self.module.data end, - fill_fillrows = function (index, self) + fill_gettotal = function(self) return #self.module.data end, + fill_fillrows = function(index, self) local data = self.module.data [index] if (data) then local encounter_id = data.id @@ -874,7 +874,7 @@ function Details:OpenForge() local spellName, _, spellIcon if (abilityID) then if (abilityID > 0) then - spellName, _, spellIcon = GetSpellInfo (abilityID) + spellName, _, spellIcon = GetSpellInfo(abilityID) end end @@ -897,7 +897,7 @@ function Details:OpenForge() ----------------------------------------------- - local bw_open_aura_creator = function (row) + local bw_open_aura_creator = function(row) local data = all_modules [5].data [row] @@ -909,7 +909,7 @@ function Details:OpenForge() local title, description, depth, abilityIcon, displayInfo, siblingID, nextSectionID, filteredByDifficulty, link, startsOpen, flag1, flag2, flag3, flag4 = DetailsFramework.EncounterJournal.EJ_GetSectionInfo (abs (spellid)) spellname, spellicon = title, abilityIcon else - spellname, _, spellicon = GetSpellInfo (spellid) + spellname, _, spellicon = GetSpellInfo(spellid) end Details:OpenAuraPanel (data [2], spellname, spellicon, data.id, DETAILS_WA_TRIGGER_BW_TIMER, DETAILS_WA_AURATYPE_TEXT, {bw_timer_id = data [2], text = "Next " .. spellname .. " In", text_size = 72, icon = spellicon}) @@ -993,8 +993,8 @@ function Details:OpenForge() --{name = L["STRING_FORGE_HEADER_CREATEAURA"], width = 120, type = "button", func = bw_open_aura_creator, icon = [[Interface\AddOns\WeakAuras\Media\Textures\icon]], notext = true, iconalign = "center"}, }, fill_panel = false, - fill_gettotal = function (self) return #self.module.data end, - fill_fillrows = function (index, self) + fill_gettotal = function(self) return #self.module.data end, + fill_fillrows = function(index, self) local data = self.module.data [index] if (data) then local encounter_id = data.id @@ -1005,7 +1005,7 @@ function Details:OpenForge() local spellName, _, spellIcon if (abilityID) then if (abilityID > 0) then - spellName, _, spellIcon = GetSpellInfo (abilityID) + spellName, _, spellIcon = GetSpellInfo(abilityID) end end @@ -1029,7 +1029,7 @@ function Details:OpenForge() - local select_module = function (a, b, module_number) + local select_module = function(a, b, module_number) if (current_module ~= module_number) then local module = all_modules [current_module] diff --git a/frames/window_macros.lua b/frames/window_macros.lua index e8bf1a87..e91f1346 100644 --- a/frames/window_macros.lua +++ b/frames/window_macros.lua @@ -49,29 +49,29 @@ function Details.OpenMacrosWindow() local macrosAvailable = Details.MacroList - local OnEnterMacroButton = function (self) + local OnEnterMacroButton = function(self) self:SetBackdropColor (unpack (scrollbox_line_backdrop_color_onenter)) end - local onLeaveMacroButton = function (self) + local onLeaveMacroButton = function(self) self:SetBackdropColor (unpack (scrollbox_line_backdrop_color)) end - local updateMacroLine = function (self, index, title, desc, macroText) + local updateMacroLine = function(self, index, title, desc, macroText) self.Title:SetText (title) self.Desc:SetText (desc) self.MacroTextEntry:SetText (macroText) end - local textEntryOnFocusGained = function (self) + local textEntryOnFocusGained = function(self) self:HighlightText() end - local textEntryOnFocusLost = function (self) + local textEntryOnFocusLost = function(self) self:HighlightText (0, 0) end - local refreshMacroScrollbox = function (self, data, offset, totalLines) + local refreshMacroScrollbox = function(self, data, offset, totalLines) for i = 1, totalLines do local index = i + offset local macro = macrosAvailable [index] @@ -82,7 +82,7 @@ function Details.OpenMacrosWindow() end end - local macroListCreateLine = function (self, index) + local macroListCreateLine = function(self, index) --create a new line local line = CreateFrame ("button", "$parentLine" .. index, self,"BackdropTemplate") @@ -132,7 +132,7 @@ function Details.OpenMacrosWindow() macroScrollbox:SetBackdropColor (0, 0, 0, 0) macroScrollbox:SetBackdropBorderColor (0, 0, 0, 1) f.MacroScrollbox = macroScrollbox - DF:ReskinSlider (macroScrollbox) + DF:ReskinSlider(macroScrollbox) macroScrollbox.__background:Hide() diff --git a/frames/window_main.lua b/frames/window_main.lua index 1c811ef5..172c72a1 100644 --- a/frames/window_main.lua +++ b/frames/window_main.lua @@ -163,10 +163,10 @@ local function move_barras (self, elapsed) self._move_func.instancia.bgdisplay_loc = self._move_func.instancia.bgdisplay_loc + self._move_func.inc --> inc � -1 ou 1 e ir� crescer ou diminuir a janela for index = 1, self._move_func.instancia.rows_fit_in_window do - self._move_func.instancia.barras [index]:SetWidth (self:GetWidth()+self._move_func.instancia.bgdisplay_loc-3) + self._move_func.instancia.barras [index]:SetWidth(self:GetWidth()+self._move_func.instancia.bgdisplay_loc-3) end - self._move_func.instancia.bgdisplay:SetPoint ("bottomright", self, "bottomright", self._move_func.instancia.bgdisplay_loc, 0) + self._move_func.instancia.bgdisplay:SetPoint("bottomright", self, "bottomright", self._move_func.instancia.bgdisplay_loc, 0) self._move_func.instancia.bar_mod = self._move_func.instancia.bgdisplay_loc+(-3) --> verifica o tamanho do text @@ -220,10 +220,10 @@ function Details:MostrarScrollBar (sem_animacao) else --> set size of rows for index = 1, self.rows_fit_in_window do - self.barras[index]:SetWidth (self.baseframe:GetWidth()+mover_para -3) --> -3 distance between row end and scroll start + self.barras[index]:SetWidth(self.baseframe:GetWidth()+mover_para -3) --> -3 distance between row end and scroll start end --> move the semi-background to the left (which moves the scroll) - self.bgdisplay:SetPoint ("bottomright", self.baseframe, "bottomright", mover_para, 0) + self.bgdisplay:SetPoint("bottomright", self.baseframe, "bottomright", mover_para, 0) self.bar_mod = mover_para + (-3) self.bgdisplay_loc = mover_para @@ -245,10 +245,10 @@ function Details:MostrarScrollBar (sem_animacao) self.scroll:SetValue (0) --> set value pode chamar o atualizador self.baseframe.button_down:Enable() - main.resize_direita:SetPoint ("bottomright", main, "bottomright", self.largura_scroll*-1, 0) + main.resize_direita:SetPoint("bottomright", main, "bottomright", self.largura_scroll*-1, 0) if (main.isLocked) then - main.lock_button:SetPoint ("bottomright", main, "bottomright", self.largura_scroll*-1, 0) + main.lock_button:SetPoint("bottomright", main, "bottomright", self.largura_scroll*-1, 0) end end @@ -273,9 +273,9 @@ function Details:EsconderScrollBar (sem_animacao, force) self:MoveBarrasTo (self.row_info.space.right + 3) --> else for index = 1, self.rows_fit_in_window do - self.barras [index]:SetWidth (self.baseframe:GetWidth() - 5) --> -5 space between row end and window right border + self.barras [index]:SetWidth(self.baseframe:GetWidth() - 5) --> -5 space between row end and window right border end - self.bgdisplay:SetPoint ("bottomright", self.baseframe, "bottomright", 0, 0) -- voltar o background na poci��o inicial + self.bgdisplay:SetPoint("bottomright", self.baseframe, "bottomright", 0, 0) -- voltar o background na poci��o inicial self.bar_mod = 0 -- zera o bar mod, uma vez que as barras v�o estar na pocis�o inicial self.bgdisplay_loc = -2 if (self.baseframe:GetScript ("OnUpdate") and self.baseframe:GetScript ("OnUpdate") == move_barras) then @@ -287,9 +287,9 @@ function Details:EsconderScrollBar (sem_animacao, force) self.scroll:Disable() main:EnableMouseWheel (false) - main.resize_direita:SetPoint ("bottomright", main, "bottomright", 0, 0) + main.resize_direita:SetPoint("bottomright", main, "bottomright", 0, 0) if (main.isLocked) then - main.lock_button:SetPoint ("bottomright", main, "bottomright", 0, 0) + main.lock_button:SetPoint("bottomright", main, "bottomright", 0, 0) end end @@ -304,10 +304,10 @@ local function OnLeaveMainWindow (instancia, self) --> resizes, lock and ungroup buttons if (not Details.disable_lock_ungroup_buttons) then - instancia.baseframe.resize_direita:SetAlpha (0) - instancia.baseframe.resize_esquerda:SetAlpha (0) - instancia.baseframe.lock_button:SetAlpha (0) - instancia.break_snap_button:SetAlpha (0) + instancia.baseframe.resize_direita:SetAlpha(0) + instancia.baseframe.resize_esquerda:SetAlpha(0) + instancia.baseframe.lock_button:SetAlpha(0) + instancia.break_snap_button:SetAlpha(0) end --> stretch button @@ -317,8 +317,8 @@ local function OnLeaveMainWindow (instancia, self) --> resizes, lock and ungroup buttons if (not Details.disable_lock_ungroup_buttons) then - instancia.baseframe.lock_button:SetAlpha (0) - instancia.break_snap_button:SetAlpha (0) + instancia.baseframe.lock_button:SetAlpha(0) + instancia.break_snap_button:SetAlpha(0) end Details.FadeHandler.Fader (instancia.baseframe.button_stretch, "ALPHA", 0) @@ -345,14 +345,14 @@ local function OnEnterMainWindow(instancia, self) --> resize, lock and ungroup buttons if (not Details.disable_lock_ungroup_buttons) then - instancia.baseframe.resize_direita:SetAlpha (1) - instancia.baseframe.resize_esquerda:SetAlpha (1) - instancia.baseframe.lock_button:SetAlpha (1) + instancia.baseframe.resize_direita:SetAlpha(1) + instancia.baseframe.resize_esquerda:SetAlpha(1) + instancia.baseframe.lock_button:SetAlpha(1) --> ungroup for _, instancia_id in pairs (instancia.snap) do if (instancia_id) then - instancia.break_snap_button:SetAlpha (1) + instancia.break_snap_button:SetAlpha(1) break end end @@ -366,13 +366,13 @@ local function OnEnterMainWindow(instancia, self) elseif (instancia.modo ~= Details._detalhes_props["MODO_ALONE"] and instancia.baseframe.isLocked) then if (not Details.disable_lock_ungroup_buttons) then - instancia.baseframe.lock_button:SetAlpha (1) + instancia.baseframe.lock_button:SetAlpha(1) --> ungroup for _, instancia_id in pairs (instancia.snap) do if (instancia_id) then instancia.break_snap_button:Show() - instancia.break_snap_button:SetAlpha (1) + instancia.break_snap_button:SetAlpha(1) break end end @@ -448,8 +448,8 @@ local show_instance_ids = function() --instancia. instance.baseframe.id_texture1 = instance.floatingframe:CreateTexture (nil, "overlay") instance.baseframe.id_texture2 = instance.floatingframe:CreateTexture (nil, "overlay") - instance.baseframe.id_texture1:SetTexture ([[Interface\Timer\BigTimerNumbers]]) - instance.baseframe.id_texture2:SetTexture ([[Interface\Timer\BigTimerNumbers]]) + instance.baseframe.id_texture1:SetTexture([[Interface\Timer\BigTimerNumbers]]) + instance.baseframe.id_texture2:SetTexture([[Interface\Timer\BigTimerNumbers]]) end local h = instance.baseframe:GetHeight() * 0.80 @@ -461,31 +461,31 @@ local show_instance_ids = function() local first, second = floor(id/10), floor(id%10) if (id >= 10) then - instance.baseframe.id_texture1:SetPoint ("center", instance.baseframe, "center", -h/2/2, 0) - instance.baseframe.id_texture2:SetPoint ("left", instance.baseframe.id_texture1, "right", -h/2, 0) + instance.baseframe.id_texture1:SetPoint("center", instance.baseframe, "center", -h/2/2, 0) + instance.baseframe.id_texture2:SetPoint("left", instance.baseframe.id_texture1, "right", -h/2, 0) first = first + 1 local line = ceil(first / 4) local x = ( first - ( (line-1) * 4 ) ) / 4 local l, r, t, b = x-0.25, x, 0.33 * (line-1), 0.33 * line - instance.baseframe.id_texture1:SetTexCoord (l, r, t, b) + instance.baseframe.id_texture1:SetTexCoord(l, r, t, b) second = second + 1 local line = ceil(second / 4) local x = ( second - ( (line-1) * 4 ) ) / 4 local l, r, t, b = x-0.25, x, 0.33 * (line-1), 0.33 * line - instance.baseframe.id_texture2:SetTexCoord (l, r, t, b) + instance.baseframe.id_texture2:SetTexCoord(l, r, t, b) instance.baseframe.id_texture1:Show() instance.baseframe.id_texture2:Show() else - instance.baseframe.id_texture1:SetPoint ("center", instance.baseframe, "center") + instance.baseframe.id_texture1:SetPoint("center", instance.baseframe, "center") second = second + 1 local line = ceil(second / 4) local x = ( second - ( (line-1) * 4 ) ) / 4 local l, r, t, b = x-0.25, x, 0.33 * (line-1), 0.33 * line - instance.baseframe.id_texture1:SetTexCoord (l, r, t, b) + instance.baseframe.id_texture1:SetTexCoord(l, r, t, b) instance.baseframe.id_texture1:Show() instance.baseframe.id_texture2:Hide() @@ -494,7 +494,7 @@ local show_instance_ids = function() end end -local update_line = function (self, target_frame) +local update_line = function(self, target_frame) local target_instance_PosX, target_instance_PosY = target_frame.instance:GetPositionOnScreen() local moving_instance_PosX, moving_instance_PosY = self.instance:GetPositionOnScreen() @@ -536,24 +536,24 @@ local update_line = function (self, target_frame) local ball = guide_balls [i] if (not ball) then ball = Details.overlay_frame:CreateTexture (nil, "Overlay") - ball:SetTexture ([[Interface\AddOns\Details\images\icons]]) + ball:SetTexture([[Interface\AddOns\Details\images\icons]]) ball:SetSize (16, 16) - ball:SetAlpha (0.3) - ball:SetTexCoord (410/512, 426/512, 2/512, 18/512) + ball:SetAlpha(0.3) + ball:SetTexCoord(410/512, 426/512, 2/512, 18/512) tinsert (guide_balls, ball) end ball:ClearAllPoints() ball:SetPoint("CENTER", self, "CENTER", x, y) --baseframse center ball:Show() - ball:SetVertexColor (unpack(color)) + ball:SetVertexColor(unpack(color)) end end local tempo_movendo, precisa_ativar, instancia_alvo, tempo_fades, nao_anexados, flash_bounce, start_draw_lines, instance_ids_shown, need_show_group_guide -local movement_onupdate = function (self, elapsed) +local movement_onupdate = function(self, elapsed) if (start_draw_lines and start_draw_lines > 0.95) then update_line (self, instancia_alvo.baseframe) @@ -567,8 +567,8 @@ local movement_onupdate = function (self, elapsed) if (need_show_group_guide and not DetailsFramework.IsTimewalkWoW()) then Details.MicroButtonAlert.Text:SetText (Loc["STRING_WINDOW1ATACH_DESC"]) - Details.MicroButtonAlert:SetPoint ("bottom", need_show_group_guide.baseframe, "top", 0, 30) - Details.MicroButtonAlert:SetHeight (320) + Details.MicroButtonAlert:SetPoint("bottom", need_show_group_guide.baseframe, "top", 0, 30) + Details.MicroButtonAlert:SetHeight(320) Details.MicroButtonAlert:Show() need_show_group_guide = nil @@ -604,19 +604,19 @@ local movement_onupdate = function (self, elapsed) if (instancia_alvo.toolbar_side == 1) then if (instancia_alvo.show_statusbar) then - texture:SetPoint ("topright", instancia_alvo.baseframe, "topleft", 0, 20) - texture:SetPoint ("bottomright", instancia_alvo.baseframe, "bottomleft", 0, -14) + texture:SetPoint("topright", instancia_alvo.baseframe, "topleft", 0, 20) + texture:SetPoint("bottomright", instancia_alvo.baseframe, "bottomleft", 0, -14) else - texture:SetPoint ("topright", instancia_alvo.baseframe, "topleft", 0, 20) - texture:SetPoint ("bottomright", instancia_alvo.baseframe, "bottomleft", 0, 0) + texture:SetPoint("topright", instancia_alvo.baseframe, "topleft", 0, 20) + texture:SetPoint("bottomright", instancia_alvo.baseframe, "bottomleft", 0, 0) end else if (instancia_alvo.show_statusbar) then - texture:SetPoint ("topright", instancia_alvo.baseframe, "topleft", 0, 0) - texture:SetPoint ("bottomright", instancia_alvo.baseframe, "bottomleft", 0, -34) + texture:SetPoint("topright", instancia_alvo.baseframe, "topleft", 0, 0) + texture:SetPoint("bottomright", instancia_alvo.baseframe, "bottomleft", 0, -34) else - texture:SetPoint ("topright", instancia_alvo.baseframe, "topleft", 0, 0) - texture:SetPoint ("bottomright", instancia_alvo.baseframe, "bottomleft", 0, -20) + texture:SetPoint("topright", instancia_alvo.baseframe, "topleft", 0, 0) + texture:SetPoint("bottomright", instancia_alvo.baseframe, "bottomleft", 0, -20) end end @@ -631,19 +631,19 @@ local movement_onupdate = function (self, elapsed) if (instancia_alvo.toolbar_side == 1) then if (instancia_alvo.show_statusbar) then - texture:SetPoint ("topleft", instancia_alvo.baseframe, "bottomleft", 0, -14) - texture:SetPoint ("topright", instancia_alvo.baseframe, "bottomright", 0, -14) + texture:SetPoint("topleft", instancia_alvo.baseframe, "bottomleft", 0, -14) + texture:SetPoint("topright", instancia_alvo.baseframe, "bottomright", 0, -14) else - texture:SetPoint ("topleft", instancia_alvo.baseframe, "bottomleft", 0, 0) - texture:SetPoint ("topright", instancia_alvo.baseframe, "bottomright", 0, 0) + texture:SetPoint("topleft", instancia_alvo.baseframe, "bottomleft", 0, 0) + texture:SetPoint("topright", instancia_alvo.baseframe, "bottomright", 0, 0) end else if (instancia_alvo.show_statusbar) then - texture:SetPoint ("topleft", instancia_alvo.baseframe, "bottomleft", 0, -34) - texture:SetPoint ("topright", instancia_alvo.baseframe, "bottomright", 0, -34) + texture:SetPoint("topleft", instancia_alvo.baseframe, "bottomleft", 0, -34) + texture:SetPoint("topright", instancia_alvo.baseframe, "bottomright", 0, -34) else - texture:SetPoint ("topleft", instancia_alvo.baseframe, "bottomleft", 0, -20) - texture:SetPoint ("topright", instancia_alvo.baseframe, "bottomright", 0, -20) + texture:SetPoint("topleft", instancia_alvo.baseframe, "bottomleft", 0, -20) + texture:SetPoint("topright", instancia_alvo.baseframe, "bottomright", 0, -20) end end @@ -657,19 +657,19 @@ local movement_onupdate = function (self, elapsed) if (instancia_alvo.toolbar_side == 1) then if (instancia_alvo.show_statusbar) then - texture:SetPoint ("topleft", instancia_alvo.baseframe, "topright", 0, 20) - texture:SetPoint ("bottomleft", instancia_alvo.baseframe, "bottomright", 0, -14) + texture:SetPoint("topleft", instancia_alvo.baseframe, "topright", 0, 20) + texture:SetPoint("bottomleft", instancia_alvo.baseframe, "bottomright", 0, -14) else - texture:SetPoint ("topleft", instancia_alvo.baseframe, "topright", 0, 20) - texture:SetPoint ("bottomleft", instancia_alvo.baseframe, "bottomright", 0, 0) + texture:SetPoint("topleft", instancia_alvo.baseframe, "topright", 0, 20) + texture:SetPoint("bottomleft", instancia_alvo.baseframe, "bottomright", 0, 0) end else if (instancia_alvo.show_statusbar) then - texture:SetPoint ("topleft", instancia_alvo.baseframe, "topright", 0, 0) - texture:SetPoint ("bottomleft", instancia_alvo.baseframe, "bottomright", 0, -34) + texture:SetPoint("topleft", instancia_alvo.baseframe, "topright", 0, 0) + texture:SetPoint("bottomleft", instancia_alvo.baseframe, "bottomright", 0, -34) else - texture:SetPoint ("topleft", instancia_alvo.baseframe, "topright", 0, 0) - texture:SetPoint ("bottomleft", instancia_alvo.baseframe, "bottomright", 0, -20) + texture:SetPoint("topleft", instancia_alvo.baseframe, "topright", 0, 0) + texture:SetPoint("bottomleft", instancia_alvo.baseframe, "bottomright", 0, -20) end end @@ -682,11 +682,11 @@ local movement_onupdate = function (self, elapsed) texture:ClearAllPoints() if (instancia_alvo.toolbar_side == 1) then - texture:SetPoint ("bottomleft", instancia_alvo.baseframe, "topleft", 0, 20) - texture:SetPoint ("bottomright", instancia_alvo.baseframe, "topright", 0, 20) + texture:SetPoint("bottomleft", instancia_alvo.baseframe, "topleft", 0, 20) + texture:SetPoint("bottomright", instancia_alvo.baseframe, "topright", 0, 20) else - texture:SetPoint ("bottomleft", instancia_alvo.baseframe, "topleft", 0, 0) - texture:SetPoint ("bottomright", instancia_alvo.baseframe, "topright", 0, 0) + texture:SetPoint("bottomleft", instancia_alvo.baseframe, "topleft", 0, 0) + texture:SetPoint("bottomright", instancia_alvo.baseframe, "topright", 0, 0) end instancia_alvo.h_cima:Flash (1, 1, 2.0, false, 0, 0) @@ -703,8 +703,8 @@ local movement_onupdate = function (self, elapsed) if (not DetailsFramework.IsTimewalkWoW()) then Details.MicroButtonAlert.Text:SetText (string.format (Loc["STRING_ATACH_DESC"], self.instance.meu_id, instancia_alvo.meu_id)) - Details.MicroButtonAlert:SetPoint ("bottom", instancia_alvo.baseframe.cabecalho.modo_selecao.widget, "top", 0, 18) - Details.MicroButtonAlert:SetHeight (200) + Details.MicroButtonAlert:SetPoint("bottom", instancia_alvo.baseframe.cabecalho.modo_selecao.widget, "top", 0, 18) + Details.MicroButtonAlert:SetHeight(200) Details.MicroButtonAlert:Show() end end @@ -926,7 +926,7 @@ local function move_janela (baseframe, iniciando, instancia, just_updating) group_tutorial.ArrowUP:Show() group_tutorial.ArrowGlowUP:Show() group_tutorial.Text:SetText (Loc["STRING_MINITUTORIAL_WINDOWS1"]) - group_tutorial:SetPoint ("bottom", instancia_alvo.break_snap_button, "top", 0, 24) + group_tutorial:SetPoint("bottom", instancia_alvo.break_snap_button, "top", 0, 24) group_tutorial:Show() Details.OnEnterMainWindow (instancia_alvo) @@ -988,15 +988,15 @@ local function move_janela (baseframe, iniciando, instancia, just_updating) end Details.move_janela_func = move_janela -local BGFrame_scripts_onenter = function (self) +local BGFrame_scripts_onenter = function(self) OnEnterMainWindow (self._instance, self) end -local BGFrame_scripts_onleave = function (self) +local BGFrame_scripts_onleave = function(self) OnLeaveMainWindow (self._instance, self) end -local BGFrame_scripts_onmousedown = function (self, button) +local BGFrame_scripts_onmousedown = function(self, button) -- /run Details.disable_stretch_from_toolbar = true if (self.is_toolbar and self._instance.baseframe.isLocked and button == "LeftButton" and not Details.disable_stretch_from_toolbar) then @@ -1013,7 +1013,7 @@ local BGFrame_scripts_onmousedown = function (self, button) move_janela (self._instance.baseframe, true, self._instance) if (self.is_toolbar) then if (self._instance.attribute_text.enabled and self._instance.attribute_text.side == 1 and self._instance.toolbar_side == 1) then - self._instance.menu_attribute_string:SetPoint ("bottomleft", self._instance.baseframe.cabecalho.ball, "bottomright", self._instance.attribute_text.anchor [1]+1, self._instance.attribute_text.anchor [2]-1) + self._instance.menu_attribute_string:SetPoint("bottomleft", self._instance.baseframe.cabecalho.ball, "bottomright", self._instance.attribute_text.anchor [1]+1, self._instance.attribute_text.anchor [2]-1) end end elseif (button == "RightButton") then @@ -1029,7 +1029,7 @@ local BGFrame_scripts_onmousedown = function (self, button) end end -local BGFrame_scripts_onmouseup = function (self, button) +local BGFrame_scripts_onmouseup = function(self, button) if (self.is_toolbar and self._instance.baseframe.isLocked and button == "LeftButton") then if (DetailsWindowLockPopUp1 and DetailsWindowLockPopUp1:IsShown()) then @@ -1043,7 +1043,7 @@ local BGFrame_scripts_onmouseup = function (self, button) self._instance:SaveMainWindowPosition() if (self.is_toolbar) then if (self._instance.attribute_text.enabled and self._instance.attribute_text.side == 1 and self._instance.toolbar_side == 1) then - self._instance.menu_attribute_string:SetPoint ("bottomleft", self._instance.baseframe.cabecalho.ball, "bottomright", self._instance.attribute_text.anchor [1], self._instance.attribute_text.anchor [2]) + self._instance.menu_attribute_string:SetPoint("bottomleft", self._instance.baseframe.cabecalho.ball, "bottomright", self._instance.attribute_text.anchor [1], self._instance.attribute_text.anchor [2]) end end end @@ -1059,13 +1059,13 @@ end function gump:RegisterForDetailsMove (frame, instancia) - frame:SetScript ("OnMouseDown", function (frame, button) + frame:SetScript ("OnMouseDown", function(frame, button) if (not instancia.baseframe.isLocked and button == "LeftButton") then move_janela (instancia.baseframe, true, instancia) --> novo movedor da janela end end) - frame:SetScript ("OnMouseUp", function (frame) + frame:SetScript ("OnMouseUp", function(frame) if (instancia.baseframe.isMoving) then move_janela (instancia.baseframe, false, instancia) --> novo movedor da janela instancia:SaveMainWindowPosition() @@ -1074,7 +1074,7 @@ function gump:RegisterForDetailsMove (frame, instancia) end --> scripts do base frame -local BFrame_scripts_onsizechange = function (self) +local BFrame_scripts_onsizechange = function(self) self._instance:SaveMainWindowSize() self._instance:ReajustaGump() self._instance.oldwith = self:GetWidth() @@ -1082,21 +1082,21 @@ local BFrame_scripts_onsizechange = function (self) self._instance:RefreshAttributeTextSize() end -local BFrame_scripts_onenter = function (self) +local BFrame_scripts_onenter = function(self) OnEnterMainWindow (self._instance, self) end -local BFrame_scripts_onleave = function (self) +local BFrame_scripts_onleave = function(self) OnLeaveMainWindow (self._instance, self) end -local BFrame_scripts_onmousedown = function (self, button) +local BFrame_scripts_onmousedown = function(self, button) if (not self.isLocked and button == "LeftButton") then move_janela (self, true, self._instance) end end -local BFrame_scripts_onmouseup = function (self, button) +local BFrame_scripts_onmouseup = function(self, button) if (self.isMoving) then move_janela (self, false, self._instance) --> novo movedor da janela self._instance:SaveMainWindowPosition() @@ -1113,11 +1113,11 @@ local function BFrame_scripts (baseframe, instancia) end local function backgrounddisplay_scripts (backgrounddisplay, baseframe, instancia) - backgrounddisplay:SetScript ("OnEnter", function (self) + backgrounddisplay:SetScript ("OnEnter", function(self) OnEnterMainWindow (instancia, self) end) - backgrounddisplay:SetScript ("OnLeave", function (self) + backgrounddisplay:SetScript ("OnLeave", function(self) OnLeaveMainWindow (instancia, self) end) end @@ -1127,7 +1127,7 @@ local function instancias_horizontais (instancia, largura, esquerda, direita) for lado, esta_instancia in pairs (instancia.snap) do if (lado == 1) then --> movendo para esquerda local instancia = Details.tabela_instancias [esta_instancia] - instancia.baseframe:SetWidth (largura) + instancia.baseframe:SetWidth(largura) instancia.auto_resize = true instancia:ReajustaGump() instancia.auto_resize = false @@ -1141,7 +1141,7 @@ local function instancias_horizontais (instancia, largura, esquerda, direita) for lado, esta_instancia in pairs (instancia.snap) do if (lado == 3) then --> movendo para esquerda local instancia = Details.tabela_instancias [esta_instancia] - instancia.baseframe:SetWidth (largura) + instancia.baseframe:SetWidth(largura) instancia.auto_resize = true instancia:ReajustaGump() instancia.auto_resize = false @@ -1158,7 +1158,7 @@ local function instancias_verticais (instancia, altura, esquerda, direita) if (lado == 1) then --> movendo para esquerda local instancia = Details.tabela_instancias [esta_instancia] if (instancia:IsEnabled()) then - instancia.baseframe:SetHeight (altura) + instancia.baseframe:SetHeight(altura) instancia.auto_resize = true instancia:ReajustaGump() instancia.auto_resize = false @@ -1174,7 +1174,7 @@ local function instancias_verticais (instancia, altura, esquerda, direita) if (lado == 3) then --> movendo para esquerda local instancia = Details.tabela_instancias [esta_instancia] if (instancia:IsEnabled()) then - instancia.baseframe:SetHeight (altura) + instancia.baseframe:SetHeight(altura) instancia.auto_resize = true instancia:ReajustaGump() instancia.auto_resize = false @@ -1186,7 +1186,7 @@ local function instancias_verticais (instancia, altura, esquerda, direita) end end -local check_snap_side = function (instanceid, snap, id, container) +local check_snap_side = function(instanceid, snap, id, container) local instance = Details:GetInstance (instanceid) if (instance and instance.snap [snap] and instance.snap [snap] == id) then tinsert (container, instance) @@ -1395,7 +1395,7 @@ local resizeTooltip = { --> search key: ~resizescript -local resize_scripts_onmousedown = function (self, button) +local resize_scripts_onmousedown = function(self, button) _G.GameCooltip:ShowMe (false) --> Hide Cooltip if (Details.disable_lock_ungroup_buttons) then @@ -1440,7 +1440,7 @@ local resize_scripts_onmousedown = function (self, button) self._instance.baseframe:StartSizing("bottomleft") end - self:SetPoint ("bottomleft", self._instance.baseframe, "bottomleft", -1, -1) + self:SetPoint("bottomleft", self._instance.baseframe, "bottomleft", -1, -1) self.afundado = true elseif (self._myside == ">") then @@ -1458,9 +1458,9 @@ local resize_scripts_onmousedown = function (self, button) end if (self._instance.rolagem and Details.use_scroll) then - self:SetPoint ("bottomright", self._instance.baseframe, "bottomright", (self._instance.largura_scroll*-1) + 1, -1) + self:SetPoint("bottomright", self._instance.baseframe, "bottomright", (self._instance.largura_scroll*-1) + 1, -1) else - self:SetPoint ("bottomright", self._instance.baseframe, "bottomright", 1, -1) + self:SetPoint("bottomright", self._instance.baseframe, "bottomright", 1, -1) end self.afundado = true end @@ -1475,7 +1475,7 @@ local resize_scripts_onmousedown = function (self, button) end end -local resize_scripts_onmouseup = function (self, button) +local resize_scripts_onmouseup = function(self, button) if (Details.disable_lock_ungroup_buttons) then return @@ -1485,12 +1485,12 @@ local resize_scripts_onmouseup = function (self, button) self.afundado = false if (self._myside == ">") then if (self._instance.rolagem and Details.use_scroll) then - self:SetPoint ("bottomright", self._instance.baseframe, "bottomright", self._instance.largura_scroll*-1, 0) + self:SetPoint("bottomright", self._instance.baseframe, "bottomright", self._instance.largura_scroll*-1, 0) else - self:SetPoint ("bottomright", self._instance.baseframe, "bottomright", 0, 0) + self:SetPoint("bottomright", self._instance.baseframe, "bottomright", 0, 0) end else - self:SetPoint ("bottomleft", self._instance.baseframe, "bottomleft", 0, 0) + self:SetPoint("bottomleft", self._instance.baseframe, "bottomleft", 0, 0) end end @@ -1541,8 +1541,8 @@ local resize_scripts_onmouseup = function (self, button) for _, esta_instancia in ipairs (Details.tabela_instancias) do if (esta_instancia:IsAtiva() and esta_instancia ~= self._instance and esta_instancia.modo ~= Details._detalhes_props["MODO_ALONE"]) then - esta_instancia.baseframe:SetWidth (largura) - esta_instancia.baseframe:SetHeight (altura) + esta_instancia.baseframe:SetWidth(largura) + esta_instancia.baseframe:SetHeight(altura) esta_instancia.auto_resize = true esta_instancia:RefreshBars() esta_instancia:InstanceReset() @@ -1572,14 +1572,14 @@ local resize_scripts_onmouseup = function (self, button) end end -local resize_scripts_onhide = function (self) +local resize_scripts_onhide = function(self) if (self.going_hide) then _G.GameCooltip:ShowMe (false) self.going_hide = nil end end -local resize_scripts_onenter = function (self) +local resize_scripts_onenter = function(self) if (Details.disable_lock_ungroup_buttons) then return @@ -1600,7 +1600,7 @@ local resize_scripts_onenter = function (self) end end -local resize_scripts_onleave = function (self) +local resize_scripts_onleave = function(self) if (self.mostrando) then self.going_hide = true if (not self.movendo) then @@ -1630,7 +1630,7 @@ local lockButtonTooltip = { {icon = [[Interface\PetBattles\PetBattle-LockIcon]], width = 14, height = 14, l = 0.0703125, r = 0.9453125, t = 0.0546875, b = 0.9453125, color = "orange"}, } -local lockFunctionOnEnter = function (self) +local lockFunctionOnEnter = function(self) if (Details.disable_lock_ungroup_buttons) then return @@ -1641,7 +1641,7 @@ local lockFunctionOnEnter = function (self) self.mostrando = true - self.label:SetTextColor (1, 1, 1, .6) + self.label:SetTextColor(1, 1, 1, .6) Details:CooltipPreset (2.1) GameCooltip:SetOption("FixedWidth", 180) @@ -1652,17 +1652,17 @@ local lockFunctionOnEnter = function (self) end end -local lockFunctionOnLeave = function (self) +local lockFunctionOnLeave = function(self) if (self.mostrando) then self.going_hide = true OnLeaveMainWindow (self.instancia, self) - self.label:SetTextColor (.6, .6, .6, .7) + self.label:SetTextColor(.6, .6, .6, .7) self.mostrando = false GameCooltip:ShowMe (false) end end -local lockFunctionOnHide = function (self) +local lockFunctionOnHide = function(self) if (self.going_hide) then GameCooltip:ShowMe (false) self.going_hide = nil @@ -1684,17 +1684,17 @@ function Details:RefreshLockedState() end if (self.baseframe.isLocked) then - self.baseframe.resize_direita:EnableMouse (false) - self.baseframe.resize_esquerda:EnableMouse (false) + self.baseframe.resize_direita:EnableMouse(false) + self.baseframe.resize_esquerda:EnableMouse(false) else - self.baseframe.resize_direita:EnableMouse (true) - self.baseframe.resize_esquerda:EnableMouse (true) + self.baseframe.resize_direita:EnableMouse(true) + self.baseframe.resize_esquerda:EnableMouse(true) end return true end -local lockFunctionOnClick = function (button, button_type, button2, isFromOptionsButton) +local lockFunctionOnClick = function(button, button_type, button2, isFromOptionsButton) --isFromOptionsButton is true when the call if from the button in the display section of the options panel if (Details.disable_lock_ungroup_buttons and isFromOptionsButton ~= true) then @@ -1710,15 +1710,15 @@ local lockFunctionOnClick = function (button, button_type, button2, isFromOption baseframe.isLocked = false baseframe.instance.isLocked = false button.label:SetText (Loc["STRING_LOCK_WINDOW"]) - button:SetWidth (button.label:GetStringWidth()+2) + button:SetWidth(button.label:GetStringWidth()+2) if (not Details.disable_lock_ungroup_buttons) then - baseframe.resize_direita:SetAlpha (1) - baseframe.resize_esquerda:SetAlpha (1) + baseframe.resize_direita:SetAlpha(1) + baseframe.resize_esquerda:SetAlpha(1) end button:ClearAllPoints() - button:SetPoint ("right", baseframe.resize_direita, "left", -1, 1.5) + button:SetPoint("right", baseframe.resize_direita, "left", -1, 1.5) else --> tutorial if (not Details:GetTutorialCVar ("WINDOW_LOCK_UNLOCK1") and not Details.initializing) then @@ -1728,7 +1728,7 @@ local lockFunctionOnClick = function (button, button_type, button2, isFromOption lock_tutorial.ArrowUP:Show() lock_tutorial.ArrowGlowUP:Show() lock_tutorial.Text:SetText (Loc["STRING_MINITUTORIAL_WINDOWS2"]) - lock_tutorial:SetPoint ("bottom", baseframe.UPFrame, "top", 0, 20) + lock_tutorial:SetPoint("bottom", baseframe.UPFrame, "top", 0, 20) lock_tutorial:Show() end @@ -1736,11 +1736,11 @@ local lockFunctionOnClick = function (button, button_type, button2, isFromOption baseframe.isLocked = true baseframe.instance.isLocked = true button.label:SetText (Loc["STRING_UNLOCK_WINDOW"]) - button:SetWidth (button.label:GetStringWidth()+2) + button:SetWidth(button.label:GetStringWidth()+2) button:ClearAllPoints() - button:SetPoint ("bottomright", baseframe, "bottomright", -3, 0) - baseframe.resize_direita:SetAlpha (0) - baseframe.resize_esquerda:SetAlpha (0) + button:SetPoint("bottomright", baseframe, "bottomright", -3, 0) + baseframe.resize_direita:SetAlpha(0) + baseframe.resize_esquerda:SetAlpha(0) end baseframe.instance:RefreshLockedState() @@ -1755,7 +1755,7 @@ local unSnapButtonTooltip = { {icon = [[Interface\AddOns\Details\images\icons]], width = 14, height = 14, l = 160/512, r = 179/512, t = 142/512, b = 162/512}, } -local unSnapButtonOnEnter = function (self) +local unSnapButtonOnEnter = function(self) if (Details.disable_lock_ungroup_buttons) then return @@ -1786,7 +1786,7 @@ local unSnapButtonOnEnter = function (self) end -local unSnapButtonOnLeave = function (self) +local unSnapButtonOnLeave = function(self) if (self.mostrando) then OnLeaveMainWindow (self.instancia, self) self.mostrando = false @@ -1795,7 +1795,7 @@ local unSnapButtonOnLeave = function (self) end --> this should run only when the mouse is over a instance bar -local shift_monitor = function (self) +local shift_monitor = function(self) if (not self:IsMouseOver()) then self:SetScript ("OnUpdate", shift_monitor) @@ -1858,10 +1858,10 @@ local barra_backdrop_onleave = { Details.left_anti_truncate:SetBackdrop (defaultBackdropSt) Details.left_anti_truncate:SetBackdropColor (0, 0, 0, 0.8) Details.left_anti_truncate:SetFrameStrata ("FULLSCREEN") - Details.left_anti_truncate.text = Details.left_anti_truncate:CreateFontString (nil, "overlay", "GameFontNormal") - Details.left_anti_truncate.text:SetPoint ("left", Details.left_anti_truncate, "left", 3, 0) + Details.left_anti_truncate.text = Details.left_anti_truncate:CreateFontString(nil, "overlay", "GameFontNormal") + Details.left_anti_truncate.text:SetPoint("left", Details.left_anti_truncate, "left", 3, 0) -local barra_scripts_onenter = function (self) +local lineScript_Onenter = function(self) self.mouse_over = true OnEnterMainWindow (self._instance, self) @@ -1886,11 +1886,11 @@ local barra_scripts_onenter = function (self) end - Details:SetFontSize (Details.left_anti_truncate.text, self._instance.row_info.font_size) - Details:SetFontFace (Details.left_anti_truncate.text, self._instance.row_info.font_face_file) + Details:SetFontSize(Details.left_anti_truncate.text, self._instance.row_info.font_size) + Details:SetFontFace(Details.left_anti_truncate.text, self._instance.row_info.font_face_file) Details:SetFontColor (Details.left_anti_truncate.text, lefttext:GetTextColor()) - Details.left_anti_truncate:SetPoint ("left", lefttext, "left", -3, 0) + Details.left_anti_truncate:SetPoint("left", lefttext, "left", -3, 0) Details.left_anti_truncate.text:SetText (lefttext:GetText()) Details.left_anti_truncate:SetSize (Details.left_anti_truncate.text:GetStringWidth() + 3, self._instance.row_info.height) @@ -1901,7 +1901,7 @@ local barra_scripts_onenter = function (self) self:SetScript ("OnUpdate", shift_monitor) end -local barra_scripts_onleave = function (self) +local lineScript_Onleave = function(self) self.mouse_over = false OnLeaveMainWindow (self._instance, self) @@ -1929,7 +1929,7 @@ local barra_scripts_onleave = function (self) end end -local barra_scripts_onmousedown = function (self, button) +local lineScript_Onmousedown = function(self, button) if (self.fading_in) then return end @@ -1963,7 +1963,7 @@ local barra_scripts_onmousedown = function (self, button) end end -local barra_scripts_onmouseup = function (self, button) +local lineScript_Onmouseup = function(self, button) local is_shift_down = _IsShiftKeyDown() local is_control_down = _IsControlKeyDown() @@ -2017,19 +2017,19 @@ local barra_scripts_onmouseup = function (self, button) end end -local barra_scripts_onclick = function (self, button) +local lineScript_Onclick = function(self, button) end -local barra_scripts_onshow = function (self) +local lineScript_Onshow = function(self) -- search key: ~model if (self.using_upper_3dmodels) then - self.modelbox_high:SetModel (self._instance.row_info.models.upper_model) - self.modelbox_high:SetAlpha (self._instance.row_info.models.upper_alpha) + self.modelbox_high:SetModel(self._instance.row_info.models.upper_model) + self.modelbox_high:SetAlpha(self._instance.row_info.models.upper_alpha) end if (self.using_lower_3dmodels) then - self.modelbox_low:SetModel (self._instance.row_info.models.lower_model) - self.modelbox_low:SetAlpha (self._instance.row_info.models.lower_alpha) + self.modelbox_low:SetModel(self._instance.row_info.models.lower_model) + self.modelbox_low:SetAlpha(self._instance.row_info.models.lower_alpha) end end @@ -2286,7 +2286,7 @@ local iconFrame_OnEnter = function(self) end end -local icon_frame_on_leave = function (self) +local icon_frame_on_leave = function(self) GameCooltip:Hide() if (GameTooltip and GameTooltip:IsShown()) then @@ -2377,24 +2377,24 @@ local icon_frame_create_animation = function() f.anim:SetLooping ("repeat") local t = f:CreateTexture (nil, "overlay") - t:SetTexture ([[Interface\COMMON\StreamCircle]]) - t:SetAlpha (0.7) + t:SetTexture([[Interface\COMMON\StreamCircle]]) + t:SetAlpha(0.7) t:SetAllPoints() tinsert (Details.icon_animations.load.available, f) end -local icon_frame_on_click_down = function (self) +local icon_frame_on_click_down = function(self) local instanceID = self.instance_id local instanceObject = Details:GetInstance (instanceID) - self:GetParent():GetParent().icone_classe:SetPoint ("left", self:GetParent():GetParent(), "left", instanceObject.row_info.icon_offset[1] + 1, instanceObject.row_info.icon_offset[2] + -1) + self:GetParent():GetParent().icone_classe:SetPoint("left", self:GetParent():GetParent(), "left", instanceObject.row_info.icon_offset[1] + 1, instanceObject.row_info.icon_offset[2] + -1) end -local icon_frame_on_click_up = function (self, button) +local icon_frame_on_click_up = function(self, button) local instanceID = self.instance_id local instanceObject = Details:GetInstance (instanceID) - self:GetParent():GetParent().icone_classe:SetPoint ("left", self:GetParent():GetParent(), "left", instanceObject.row_info.icon_offset[1], instanceObject.row_info.icon_offset[2]) + self:GetParent():GetParent().icone_classe:SetPoint("left", self:GetParent():GetParent(), "left", instanceObject.row_info.icon_offset[1], instanceObject.row_info.icon_offset[2]) if (button == "LeftButton") then --> open the rank panel @@ -2437,12 +2437,12 @@ local icon_frame_on_click_up = function (self, button) local f = anim if (not f.question_icon) then f.question_icon = self:GetParent():GetParent().border:CreateTexture (nil, "overlay") - f.question_icon:SetTexture ([[Interface\GossipFrame\ActiveLegendaryQuestIcon]]) + f.question_icon:SetTexture([[Interface\GossipFrame\ActiveLegendaryQuestIcon]]) f.question_icon:SetSize (16, 16) end f.question_icon:ClearAllPoints() - f.question_icon:SetPoint ("center", self, "center") + f.question_icon:SetPoint("center", self, "center") f.question_icon:Show() if (not Details.HideBarQuestionIcon) then @@ -2480,7 +2480,7 @@ local icon_frame_on_click_up = function (self, button) anim:SetParent (self) anim:ClearAllPoints() anim:SetFrameStrata ("TOOLTIP") - anim:SetPoint ("center", self, "center") + anim:SetPoint("center", self, "center") anim:SetSize (self:GetWidth()*1.7, self:GetHeight()*1.7) anim.anim:Play() @@ -2503,27 +2503,26 @@ local icon_frame_on_click_up = function (self, button) end end -local set_frame_icon_scripts = function (row) - row.icon_frame:SetScript ("OnEnter", iconFrame_OnEnter) - row.icon_frame:SetScript ("OnLeave", icon_frame_on_leave) - row.icon_frame:SetScript ("OnMouseDown", icon_frame_on_click_down) - row.icon_frame:SetScript ("OnMouseUp", icon_frame_on_click_up) +local setFrameIconScripts = function(row) + row.icon_frame:SetScript("OnEnter", iconFrame_OnEnter) + row.icon_frame:SetScript("OnLeave", icon_frame_on_leave) + row.icon_frame:SetScript("OnMouseDown", icon_frame_on_click_down) + row.icon_frame:SetScript("OnMouseUp", icon_frame_on_click_up) end -local function barra_scripts (esta_barra, instancia, i) - esta_barra._instance = instancia +local setLineScripts = function(line, instance, index) + line._instance = instance - esta_barra:SetScript ("OnEnter", barra_scripts_onenter) - esta_barra:SetScript ("OnLeave", barra_scripts_onleave) - esta_barra:SetScript ("OnMouseDown", barra_scripts_onmousedown) - esta_barra:SetScript ("OnMouseUp", barra_scripts_onmouseup) - esta_barra:SetScript ("OnClick", barra_scripts_onclick) - - esta_barra:SetScript ("OnShow", barra_scripts_onshow) - - set_frame_icon_scripts (esta_barra) - - esta_barra.SetValue = setBarValue + line:SetScript("OnEnter", lineScript_Onenter) + line:SetScript("OnLeave", lineScript_Onleave) + line:SetScript("OnMouseDown", lineScript_Onmousedown) + line:SetScript("OnMouseUp", lineScript_Onmouseup) + line:SetScript("OnClick", lineScript_Onclick) + line:SetScript("OnShow", lineScript_Onshow) + + setFrameIconScripts(line) + + line.SetValue = setBarValue end function Details:ReportSingleLine (instancia, barra) @@ -2568,13 +2567,13 @@ end local function button_stretch_scripts (baseframe, backgrounddisplay, instancia) local button = baseframe.button_stretch - button:SetScript ("OnEnter", function (self) + button:SetScript ("OnEnter", function(self) self.mouse_over = true if (not Details.disable_stretch_button) then Details.FadeHandler.Fader (self, "ALPHA", 1) end end) - button:SetScript ("OnLeave", function (self) + button:SetScript ("OnLeave", function(self) self.mouse_over = false Details.FadeHandler.Fader (self, "ALPHA", 0) end) @@ -2670,7 +2669,7 @@ local function button_stretch_scripts (baseframe, backgrounddisplay, instancia) end) - button:SetScript ("OnMouseUp", function (self, button) + button:SetScript ("OnMouseUp", function(self, button) if (button ~= "LeftButton") then return @@ -2781,7 +2780,7 @@ local function button_down_scripts (main_frame, backgrounddisplay, instancia, sc end) end) - main_frame.button_down:SetScript ("OnMouseUp", function (self) + main_frame.button_down:SetScript ("OnMouseUp", function(self) self.precionado = false self:SetScript ("OnUpdate", nil) end) @@ -2802,7 +2801,7 @@ local function button_up_scripts (main_frame, backgrounddisplay, instancia, scro self.precionado = true self.last_up = -0.3 - self:SetScript ("OnUpdate", function (self, elapsed) + self:SetScript ("OnUpdate", function(self, elapsed) self.last_up = self.last_up + elapsed if (self.last_up > 0.03) then self.last_up = 0 @@ -2816,12 +2815,12 @@ local function button_up_scripts (main_frame, backgrounddisplay, instancia, scro end) end) - main_frame.button_up:SetScript ("OnMouseUp", function (self) + main_frame.button_up:SetScript ("OnMouseUp", function(self) self.precionado = false self:SetScript ("OnUpdate", nil) end) - main_frame.button_up:SetScript ("OnEnable", function (self) + main_frame.button_up:SetScript ("OnEnable", function(self) local current = scrollbar:GetValue() if (current == 0) then main_frame.button_up:Disable() @@ -2887,7 +2886,7 @@ end local function iterate_scroll_scripts (backgrounddisplay, backgroundframe, baseframe, scrollbar, instancia) baseframe:SetScript ("OnMouseWheel", - function (self, delta) + function(self, delta) if (delta > 0) then --> rolou pra cima local A = instancia.barraS[1] if (A) then @@ -2915,7 +2914,7 @@ local function iterate_scroll_scripts (backgrounddisplay, backgroundframe, basef end) - scrollbar:SetScript ("OnValueChanged", function (self) + scrollbar:SetScript ("OnValueChanged", function(self) local ultimo = self.ultimo local meu_valor = self:GetValue() if (ultimo == meu_valor) then --> n�o mudou @@ -3044,27 +3043,27 @@ function Details:InstanceAlert (msg, icon, time, clickfunc, doflash, forceAlert) if (type (icon) == "table") then local texture, w, h, animate, left, right, top, bottom, r, g, b, a = unpack(icon) - self.alert.icon:SetTexture (texture) - self.alert.icon:SetWidth (w or 14) - self.alert.icon:SetHeight (h or 14) + self.alert.icon:SetTexture(texture) + self.alert.icon:SetWidth(w or 14) + self.alert.icon:SetHeight(h or 14) if (left and right and top and bottom) then - self.alert.icon:SetTexCoord (left, right, top, bottom) + self.alert.icon:SetTexCoord(left, right, top, bottom) end if (animate) then self.alert.rotate:Play() end if (r and g and b) then - self.alert.icon:SetVertexColor (r, g, b, a or 1) + self.alert.icon:SetVertexColor(r, g, b, a or 1) end else - self.alert.icon:SetWidth (14) - self.alert.icon:SetHeight (14) - self.alert.icon:SetTexture (icon) - self.alert.icon:SetVertexColor (1, 1, 1, 1) - self.alert.icon:SetTexCoord (0, 1, 0, 1) + self.alert.icon:SetWidth(14) + self.alert.icon:SetHeight(14) + self.alert.icon:SetTexture(icon) + self.alert.icon:SetVertexColor(1, 1, 1, 1) + self.alert.icon:SetTexCoord(0, 1, 0, 1) end else - self.alert.icon:SetTexture ("") + self.alert.icon:SetTexture("") end self.alert.button.func = nil @@ -3079,9 +3078,9 @@ function Details:InstanceAlert (msg, icon, time, clickfunc, doflash, forceAlert) self.alert_time = time Details:ScheduleTimer ("InstanceAlertTime", time, self) - self.alert:SetPoint ("bottom", self.baseframe, "bottom", 0, -12) - self.alert:SetPoint ("left", self.baseframe, "left", 3, 0) - self.alert:SetPoint ("right", self.baseframe, "right", -3, 0) + self.alert:SetPoint("bottom", self.baseframe, "bottom", 0, -12) + self.alert:SetPoint("left", self.baseframe, "left", 3, 0) + self.alert:SetPoint("right", self.baseframe, "right", -3, 0) self.alert:SetFrameStrata ("TOOLTIP") self.alert.button:SetFrameStrata ("TOOLTIP") @@ -3096,7 +3095,7 @@ function Details:InstanceAlert (msg, icon, time, clickfunc, doflash, forceAlert) end -local alert_on_click = function (self, button) +local alert_on_click = function(self, button) if (self.func) then local okey, errortext = pcall (self.func, unpack(self.func_param)) if (not okey) then @@ -3109,54 +3108,54 @@ end local function CreateAlertFrame (baseframe, instancia) local frame_upper = CreateFrame ("scrollframe", "DetailsAlertFrameScroll" .. instancia.meu_id, baseframe) - frame_upper:SetPoint ("bottom", baseframe, "bottom") - frame_upper:SetPoint ("left", baseframe, "left", 3, 0) - frame_upper:SetPoint ("right", baseframe, "right", -3, 0) - frame_upper:SetHeight (13) + frame_upper:SetPoint("bottom", baseframe, "bottom") + frame_upper:SetPoint("left", baseframe, "left", 3, 0) + frame_upper:SetPoint("right", baseframe, "right", -3, 0) + frame_upper:SetHeight(13) frame_upper:SetFrameStrata ("TOOLTIP") local frame_lower = CreateFrame ("frame", "DetailsAlertFrameScrollChild" .. instancia.meu_id, frame_upper) - frame_lower:SetHeight (25) - frame_lower:SetPoint ("left", frame_upper, "left") - frame_lower:SetPoint ("right", frame_upper, "right") + frame_lower:SetHeight(25) + frame_lower:SetPoint("left", frame_upper, "left") + frame_lower:SetPoint("right", frame_upper, "right") frame_upper:SetScrollChild (frame_lower) local alert_bg = CreateFrame ("frame", "DetailsAlertFrame" .. instancia.meu_id, frame_lower,"BackdropTemplate") - alert_bg:SetPoint ("bottom", baseframe, "bottom") - alert_bg:SetPoint ("left", baseframe, "left", 3, 0) - alert_bg:SetPoint ("right", baseframe, "right", -3, 0) - alert_bg:SetHeight (12) + alert_bg:SetPoint("bottom", baseframe, "bottom") + alert_bg:SetPoint("left", baseframe, "left", 3, 0) + alert_bg:SetPoint("right", baseframe, "right", -3, 0) + alert_bg:SetHeight(12) alert_bg:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}) alert_bg:SetBackdropColor (.1, .1, .1, 1) alert_bg:SetFrameStrata ("FULLSCREEN") - alert_bg:SetFrameLevel (baseframe:GetFrameLevel() + 6) + alert_bg:SetFrameLevel(baseframe:GetFrameLevel() + 6) alert_bg:Hide() local toptexture = alert_bg:CreateTexture (nil, "background") - toptexture:SetTexture ([[Interface\Challenges\challenges-main]]) - --toptexture:SetTexCoord (0.1921484375, 0.523671875, 0.234375, 0.160859375) - toptexture:SetTexCoord (0.231171875, 0.4846484375, 0.0703125, 0.072265625) - toptexture:SetPoint ("left", alert_bg, "left") - toptexture:SetPoint ("right", alert_bg, "right") - toptexture:SetPoint ("bottom", alert_bg, "top", 0, 0) - toptexture:SetHeight (1) + toptexture:SetTexture([[Interface\Challenges\challenges-main]]) + --toptexture:SetTexCoord(0.1921484375, 0.523671875, 0.234375, 0.160859375) + toptexture:SetTexCoord(0.231171875, 0.4846484375, 0.0703125, 0.072265625) + toptexture:SetPoint("left", alert_bg, "left") + toptexture:SetPoint("right", alert_bg, "right") + toptexture:SetPoint("bottom", alert_bg, "top", 0, 0) + toptexture:SetHeight(1) - local text = alert_bg:CreateFontString (nil, "overlay", "GameFontNormal") - text:SetPoint ("right", alert_bg, "right", -14, 0) - Details:SetFontSize (text, 10) - text:SetTextColor (1, 1, 1, 0.8) + local text = alert_bg:CreateFontString(nil, "overlay", "GameFontNormal") + text:SetPoint("right", alert_bg, "right", -14, 0) + Details:SetFontSize(text, 10) + text:SetTextColor(1, 1, 1, 0.8) local rotate_frame = CreateFrame ("frame", "DetailsAlertFrameRotate" .. instancia.meu_id, alert_bg) - rotate_frame:SetWidth (12) - rotate_frame:SetPoint ("right", alert_bg, "right", -2, 0) - rotate_frame:SetHeight (alert_bg:GetWidth()) + rotate_frame:SetWidth(12) + rotate_frame:SetPoint("right", alert_bg, "right", -2, 0) + rotate_frame:SetHeight(alert_bg:GetWidth()) rotate_frame:SetFrameStrata ("FULLSCREEN") local icon = rotate_frame:CreateTexture (nil, "overlay") - icon:SetPoint ("center", rotate_frame, "center") - icon:SetWidth (14) - icon:SetHeight (14) + icon:SetPoint("center", rotate_frame, "center") + icon:SetWidth(14) + icon:SetHeight(14) local button = CreateFrame ("button", "DetailsInstance"..instancia.meu_id.."AlertButton", alert_bg) button:SetAllPoints() @@ -3179,17 +3178,17 @@ local function CreateAlertFrame (baseframe, instancia) anime.group:SetOffset (0, 10) anime:SetScript ("OnFinished", function(self) alert_bg:Show() - alert_bg:SetPoint ("bottom", baseframe, "bottom", 0, 0) - alert_bg:SetPoint ("left", baseframe, "left", 3, 0) - alert_bg:SetPoint ("right", baseframe, "right", -3, 0) + alert_bg:SetPoint("bottom", baseframe, "bottom", 0, 0) + alert_bg:SetPoint("left", baseframe, "left", 3, 0) + alert_bg:SetPoint("right", baseframe, "right", -3, 0) end) - local on_enter_alert = function (self) - text:SetTextColor (1, 0.8, 0.3, 1) + local on_enter_alert = function(self) + text:SetTextColor(1, 0.8, 0.3, 1) icon:SetBlendMode ("ADD") end - local on_leave_alert = function (self) - text:SetTextColor (1, 1, 1, 0.8) + local on_leave_alert = function(self) + text:SetTextColor(1, 1, 1, 0.8) icon:SetBlendMode ("BLEND") end @@ -3201,8 +3200,8 @@ local function CreateAlertFrame (baseframe, instancia) end local flash_texture = button:CreateTexture (nil, "overlay") - flash_texture:SetTexCoord (53/512, 347/512, 58/256, 120/256) - flash_texture:SetTexture ([[Interface\AchievementFrame\UI-Achievement-Alert-Glow]]) + flash_texture:SetTexCoord(53/512, 347/512, 58/256, 120/256) + flash_texture:SetTexture([[Interface\AchievementFrame\UI-Achievement-Alert-Glow]]) flash_texture:SetAllPoints() flash_texture:SetBlendMode ("ADD") local animation = flash_texture:CreateAnimationGroup() @@ -3220,7 +3219,7 @@ local function CreateAlertFrame (baseframe, instancia) anim1:SetToAlpha (0) anim2:SetDuration (0.2) - animation:SetScript ("OnFinished", function (self) + animation:SetScript ("OnFinished", function(self) flash_texture:Hide() end) flash_texture:Hide() @@ -3251,29 +3250,29 @@ function Details:InstanceMsg (text, icon, textcolor, iconcoords, iconcolor) end self.freeze_texto:SetText (text) - self.freeze_icon:SetTexture (icon or [[Interface\CHARACTERFRAME\Disconnect-Icon]]) + self.freeze_icon:SetTexture(icon or [[Interface\CHARACTERFRAME\Disconnect-Icon]]) self.freeze_icon:Show() self.freeze_texto:Show() if (textcolor) then local r, g, b, a = gump:ParseColors (textcolor) - self.freeze_texto:SetTextColor (r, g, b, a) + self.freeze_texto:SetTextColor(r, g, b, a) else - self.freeze_texto:SetTextColor (1, 1, 1, 1) + self.freeze_texto:SetTextColor(1, 1, 1, 1) end if (iconcoords and type (iconcoords) == "table") then - self.freeze_icon:SetTexCoord (unpack(iconcoords)) + self.freeze_icon:SetTexCoord(unpack(iconcoords)) else - self.freeze_icon:SetTexCoord (0, 1, 0, 1) + self.freeze_icon:SetTexCoord(0, 1, 0, 1) end if (iconcolor) then local r, g, b, a = gump:ParseColors (iconcolor) - self.freeze_icon:SetVertexColor (r, g, b, a) + self.freeze_icon:SetVertexColor(r, g, b, a) else - self.freeze_icon:SetVertexColor (1, 1, 1, 1) + self.freeze_icon:SetVertexColor(1, 1, 1, 1) end end @@ -3301,9 +3300,9 @@ local function show_anti_overlap (instance, host, side) anti_menu_overlap:ClearAllPoints() if (side == "top") then - anti_menu_overlap:SetPoint ("bottom", host, "top") + anti_menu_overlap:SetPoint("bottom", host, "top") elseif (side == "bottom") then - anti_menu_overlap:SetPoint ("top", host, "bottom") + anti_menu_overlap:SetPoint("top", host, "bottom") end anti_menu_overlap:Show() end @@ -3314,8 +3313,8 @@ Details.snap_alert:SetFrameStrata ("FULLSCREEN") function Details:SnapAlert() Details.snap_alert:ClearAllPoints() - Details.snap_alert:SetPoint ("topleft", self.baseframe.cabecalho.modo_selecao.widget, "topleft", -8, 6) - Details.snap_alert:SetPoint ("bottomright", self.baseframe.cabecalho.modo_selecao.widget, "bottomright", 8, -6) + Details.snap_alert:SetPoint("topleft", self.baseframe.cabecalho.modo_selecao.widget, "topleft", -8, 6) + Details.snap_alert:SetPoint("bottomright", self.baseframe.cabecalho.modo_selecao.widget, "bottomright", 8, -6) Details.snap_alert.animOut:Stop() Details.snap_alert.animIn:Play() end @@ -3325,14 +3324,14 @@ do --search key: ~tooltip local tooltip_anchor = CreateFrame ("frame", "DetailsTooltipAnchor", UIParent,"BackdropTemplate") tooltip_anchor:SetSize (140, 20) - tooltip_anchor:SetAlpha (0) + tooltip_anchor:SetAlpha(0) tooltip_anchor:SetMovable (false) tooltip_anchor:SetClampedToScreen (true) tooltip_anchor.locked = true tooltip_anchor:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], edgeFile = [[Interface\DialogFrame\UI-DialogBox-Border]], edgeSize = 10, insets = {left = 1, right = 1, top = 2, bottom = 1}}) tooltip_anchor:SetBackdropColor (0, 0, 0, 1) - tooltip_anchor:SetScript ("OnEnter", function (self) + tooltip_anchor:SetScript ("OnEnter", function(self) tooltip_anchor.alert.animIn:Stop() tooltip_anchor.alert.animOut:Play() GameTooltip:SetOwner (self, "ANCHOR_TOPLEFT") @@ -3341,18 +3340,18 @@ do GameTooltip:Show() end) - tooltip_anchor:SetScript ("OnLeave", function (self) + tooltip_anchor:SetScript ("OnLeave", function(self) GameTooltip:Hide() end) - tooltip_anchor:SetScript ("OnMouseDown", function (self, button) + tooltip_anchor:SetScript ("OnMouseDown", function(self, button) if (not self.moving and button == "LeftButton") then self:StartMoving() self.moving = true end end) - tooltip_anchor:SetScript ("OnMouseUp", function (self, button) + tooltip_anchor:SetScript ("OnMouseUp", function(self, button) if (self.moving) then self:StopMovingOrSizing() self.moving = false @@ -3371,16 +3370,16 @@ do function tooltip_anchor:MoveAnchor() if (self.locked) then - self:SetAlpha (1) - self:EnableMouse (true) + self:SetAlpha(1) + self:EnableMouse(true) self:SetMovable (true) self:SetFrameStrata ("FULLSCREEN") self.locked = false tooltip_anchor.alert.animOut:Stop() tooltip_anchor.alert.animIn:Play() else - self:SetAlpha (0) - self:EnableMouse (false) + self:SetAlpha(0) + self:EnableMouse(false) self:SetFrameStrata ("MEDIUM") self:SetMovable (false) self.locked = true @@ -3397,25 +3396,25 @@ do y = y * UIscale / scale self:ClearAllPoints() self:SetParent (UIParent) - self:SetPoint ("center", UIParent, "center", x, y) + self:SetPoint("center", UIParent, "center", x, y) end tooltip_anchor.alert = CreateFrame ("frame", "DetailsTooltipAnchorAlert", UIParent, "ActionBarButtonSpellActivationAlert") tooltip_anchor.alert:SetFrameStrata ("FULLSCREEN") tooltip_anchor.alert:Hide() - tooltip_anchor.alert:SetPoint ("topleft", tooltip_anchor, "topleft", -60, 6) - tooltip_anchor.alert:SetPoint ("bottomright", tooltip_anchor, "bottomright", 40, -6) + tooltip_anchor.alert:SetPoint("topleft", tooltip_anchor, "topleft", -60, 6) + tooltip_anchor.alert:SetPoint("bottomright", tooltip_anchor, "bottomright", 40, -6) local icon = tooltip_anchor:CreateTexture (nil, "overlay") - icon:SetTexture ([[Interface\AddOns\Details\images\minimap]]) - icon:SetPoint ("left", tooltip_anchor, "left", 4, 0) + icon:SetTexture([[Interface\AddOns\Details\images\minimap]]) + icon:SetPoint("left", tooltip_anchor, "left", 4, 0) icon:SetSize (18, 18) - local text = tooltip_anchor:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - text:SetPoint ("left", icon, "right", 6, 0) + local text = tooltip_anchor:CreateFontString(nil, "overlay", "GameFontHighlightSmall") + text:SetPoint("left", icon, "right", 6, 0) text:SetText (Loc["STRING_OPTIONS_TOOLTIPS_ANCHOR_TEXT"]) - tooltip_anchor:EnableMouse (false) + tooltip_anchor:EnableMouse(false) end @@ -3472,17 +3471,17 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) --backgrounddisplay is a scrollschild of backgroundframe, hence its children won't show outside its canvas local backgroundframe = CreateFrame ("scrollframe", "Details_WindowFrame"..ID, baseframe) --window frame local backgrounddisplay = CreateFrame ("frame", "Details_GumpFrame"..ID, backgroundframe,"BackdropTemplate") --gump frame - backgroundframe:SetFrameLevel (3) - backgrounddisplay:SetFrameLevel (3) + backgroundframe:SetFrameLevel(3) + backgrounddisplay:SetFrameLevel(3) backgroundframe.instance = instancia backgrounddisplay.instance = instancia instancia.windowBackgroundDisplay = backgrounddisplay --> row frame is the parent of rows, it have setallpoints on baseframe local rowframe = CreateFrame ("frame", "DetailsRowFrame"..ID, _UIParent) --row frame - rowframe:SetAllPoints (baseframe) + rowframe:SetAllPoints(baseframe) rowframe:SetFrameStrata (baseframe_strata) - rowframe:SetFrameLevel (3) + rowframe:SetFrameLevel(3) rowframe:EnableMouse(false) instancia.rowframe = rowframe @@ -3493,23 +3492,23 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) --> right click bookmark local switchbutton = CreateFrame("button", "Details_SwitchButtonFrame" .. ID, UIParent) - switchbutton:SetAllPoints (baseframe) + switchbutton:SetAllPoints(baseframe) switchbutton:SetFrameStrata (baseframe_strata) - switchbutton:SetFrameLevel (4) + switchbutton:SetFrameLevel(4) instancia.windowSwitchButton = switchbutton --> avoid mouse hover over a high window when the menu is open for a lower instance. local anti_menu_overlap = CreateFrame ("frame", "Details_WindowFrameAntiMenuOverlap" .. ID, UIParent) anti_menu_overlap:SetSize (100, 13) anti_menu_overlap:SetFrameStrata ("DIALOG") - anti_menu_overlap:EnableMouse (true) + anti_menu_overlap:EnableMouse(true) anti_menu_overlap:Hide() --anti_menu_overlap:SetBackdrop (gump_fundo_backdrop) --debug baseframe.anti_menu_overlap = anti_menu_overlap --> floating frame is an anchor for widgets which should be overlaying the window local floatingframe = CreateFrame ("frame", "DetailsInstance"..ID.."BorderHolder", baseframe) - floatingframe:SetFrameLevel (baseframe:GetFrameLevel()+7) + floatingframe:SetFrameLevel(baseframe:GetFrameLevel()+7) instancia.floatingframe = floatingframe -- scroll bar ----------------------------------------------------------------------------------------------------------------------------------------------- @@ -3519,53 +3518,53 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) --> scroll image-node up baseframe.scroll_up = backgrounddisplay:CreateTexture (nil, "background") - baseframe.scroll_up:SetPoint ("topleft", backgrounddisplay, "topright", 0, 0) - baseframe.scroll_up:SetTexture (DEFAULT_SKIN) - baseframe.scroll_up:SetTexCoord (unpack(COORDS_SLIDER_TOP)) - baseframe.scroll_up:SetWidth (32) - baseframe.scroll_up:SetHeight (32) + baseframe.scroll_up:SetPoint("topleft", backgrounddisplay, "topright", 0, 0) + baseframe.scroll_up:SetTexture(DEFAULT_SKIN) + baseframe.scroll_up:SetTexCoord(unpack(COORDS_SLIDER_TOP)) + baseframe.scroll_up:SetWidth(32) + baseframe.scroll_up:SetHeight(32) --> scroll image-node down baseframe.scroll_down = backgrounddisplay:CreateTexture (nil, "background") - baseframe.scroll_down:SetPoint ("bottomleft", backgrounddisplay, "bottomright", 0, 0) - baseframe.scroll_down:SetTexture (DEFAULT_SKIN) - baseframe.scroll_down:SetTexCoord (unpack(COORDS_SLIDER_DOWN)) - baseframe.scroll_down:SetWidth (32) - baseframe.scroll_down:SetHeight (32) + baseframe.scroll_down:SetPoint("bottomleft", backgrounddisplay, "bottomright", 0, 0) + baseframe.scroll_down:SetTexture(DEFAULT_SKIN) + baseframe.scroll_down:SetTexCoord(unpack(COORDS_SLIDER_DOWN)) + baseframe.scroll_down:SetWidth(32) + baseframe.scroll_down:SetHeight(32) --> scroll image-node middle baseframe.scroll_middle = backgrounddisplay:CreateTexture (nil, "background") - baseframe.scroll_middle:SetPoint ("top", baseframe.scroll_up, "bottom", 0, 8) - baseframe.scroll_middle:SetPoint ("bottom", baseframe.scroll_down, "top", 0, -11) - baseframe.scroll_middle:SetTexture (DEFAULT_SKIN) - baseframe.scroll_middle:SetTexCoord (unpack(COORDS_SLIDER_MIDDLE)) - baseframe.scroll_middle:SetWidth (32) - baseframe.scroll_middle:SetHeight (64) + baseframe.scroll_middle:SetPoint("top", baseframe.scroll_up, "bottom", 0, 8) + baseframe.scroll_middle:SetPoint("bottom", baseframe.scroll_down, "top", 0, -11) + baseframe.scroll_middle:SetTexture(DEFAULT_SKIN) + baseframe.scroll_middle:SetTexCoord(unpack(COORDS_SLIDER_MIDDLE)) + baseframe.scroll_middle:SetWidth(32) + baseframe.scroll_middle:SetHeight(64) --> scroll widgets baseframe.button_up = CreateFrame ("button", "DetailsScrollUp" .. instancia.meu_id, backgrounddisplay) baseframe.button_down = CreateFrame ("button", "DetailsScrollDown" .. instancia.meu_id, backgrounddisplay) - baseframe.button_up:SetWidth (29) - baseframe.button_up:SetHeight (32) + baseframe.button_up:SetWidth(29) + baseframe.button_up:SetHeight(32) baseframe.button_up:SetNormalTexture ([[Interface\BUTTONS\UI-ScrollBar-ScrollUpButton-Up]]) baseframe.button_up:SetPushedTexture ([[Interface\BUTTONS\UI-ScrollBar-ScrollUpButton-Down]]) baseframe.button_up:SetDisabledTexture ([[Interface\BUTTONS\UI-ScrollBar-ScrollUpButton-Disabled]]) baseframe.button_up:Disable() - baseframe.button_down:SetWidth (29) - baseframe.button_down:SetHeight (32) + baseframe.button_down:SetWidth(29) + baseframe.button_down:SetHeight(32) baseframe.button_down:SetNormalTexture ([[Interface\BUTTONS\UI-ScrollBar-ScrollDownButton-Up]]) baseframe.button_down:SetPushedTexture ([[Interface\BUTTONS\UI-ScrollBar-ScrollDownButton-Down]]) baseframe.button_down:SetDisabledTexture ([[Interface\BUTTONS\UI-ScrollBar-ScrollDownButton-Disabled]]) baseframe.button_down:Disable() - baseframe.button_up:SetPoint ("topright", baseframe.scroll_up, "topright", -4, 3) - baseframe.button_down:SetPoint ("bottomright", baseframe.scroll_down, "bottomright", -4, -6) + baseframe.button_up:SetPoint("topright", baseframe.scroll_up, "topright", -4, 3) + baseframe.button_down:SetPoint("bottomright", baseframe.scroll_down, "bottomright", -4, -6) - scrollbar:SetPoint ("top", baseframe.button_up, "bottom", 0, 12) - scrollbar:SetPoint ("bottom", baseframe.button_down, "top", 0, -12) - scrollbar:SetPoint ("left", backgrounddisplay, "right", 3, 0) + scrollbar:SetPoint("top", baseframe.button_up, "bottom", 0, 12) + scrollbar:SetPoint("bottom", baseframe.button_down, "top", 0, -12) + scrollbar:SetPoint("left", backgrounddisplay, "right", 3, 0) scrollbar:Show() --> config set @@ -3577,7 +3576,7 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) --> thumb scrollbar.thumb = scrollbar:CreateTexture (nil, "overlay") - scrollbar.thumb:SetTexture ([[Interface\Buttons\UI-ScrollBar-Knob]]) + scrollbar.thumb:SetTexture([[Interface\Buttons\UI-ScrollBar-Knob]]) scrollbar.thumb:SetSize (29, 30) scrollbar:SetThumbTexture (scrollbar.thumb) @@ -3588,20 +3587,20 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) -- stretch button ----------------------------------------------------------------------------------------------------------------------------------------------- baseframe.button_stretch = CreateFrame ("button", "DetailsButtonStretch" .. instancia.meu_id, baseframe) - baseframe.button_stretch:SetPoint ("bottom", baseframe, "top", 0, 20) - baseframe.button_stretch:SetPoint ("right", baseframe, "right", -27, 0) - baseframe.button_stretch:SetFrameLevel (1) + baseframe.button_stretch:SetPoint("bottom", baseframe, "top", 0, 20) + baseframe.button_stretch:SetPoint("right", baseframe, "right", -27, 0) + baseframe.button_stretch:SetFrameLevel(1) local stretch_texture = baseframe.button_stretch:CreateTexture (nil, "overlay") - stretch_texture:SetTexture (DEFAULT_SKIN) - stretch_texture:SetTexCoord (unpack(COORDS_STRETCH)) - stretch_texture:SetWidth (32) - stretch_texture:SetHeight (16) - stretch_texture:SetAllPoints (baseframe.button_stretch) + stretch_texture:SetTexture(DEFAULT_SKIN) + stretch_texture:SetTexCoord(unpack(COORDS_STRETCH)) + stretch_texture:SetWidth(32) + stretch_texture:SetHeight(16) + stretch_texture:SetAllPoints(baseframe.button_stretch) baseframe.button_stretch.texture = stretch_texture - baseframe.button_stretch:SetWidth (32) - baseframe.button_stretch:SetHeight (16) + baseframe.button_stretch:SetWidth(32) + baseframe.button_stretch:SetHeight(16) baseframe.button_stretch:Show() Details.FadeHandler.Fader (baseframe.button_stretch, "ALPHA", 0) @@ -3613,9 +3612,9 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) baseframe:SetClampedToScreen (true) baseframe:SetSize (Details.new_window_size.width, Details.new_window_size.height) - baseframe:SetPoint ("center", _UIParent) + baseframe:SetPoint("center", _UIParent) baseframe:EnableMouseWheel (false) - baseframe:EnableMouse (true) + baseframe:EnableMouse(true) if (not DetailsFramework.IsDragonflight()) then baseframe:SetMinResize (150, 7) @@ -3629,43 +3628,43 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) -- background window config ------------------------------------------------------------------------------------------------------------------------------------------------- - backgroundframe:SetAllPoints (baseframe) + backgroundframe:SetAllPoints(baseframe) backgroundframe:SetScrollChild (backgrounddisplay) backgrounddisplay:SetResizable (true) - backgrounddisplay:SetPoint ("topleft", baseframe, "topleft") - backgrounddisplay:SetPoint ("bottomright", baseframe, "bottomright") + backgrounddisplay:SetPoint("topleft", baseframe, "topleft") + backgrounddisplay:SetPoint("bottomright", baseframe, "bottomright") backgrounddisplay:SetBackdrop (defaultBackdropSt) backgrounddisplay:SetBackdropColor (instancia.bg_r, instancia.bg_g, instancia.bg_b, instancia.bg_alpha) -- instance mini widgets ------------------------------------------------------------------------------------------------------------------------------------------------- --> overall data warning - instancia.overall_data_warning = backgrounddisplay:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - instancia.overall_data_warning:SetHeight (64) - instancia.overall_data_warning:SetPoint ("center", backgrounddisplay, "center") - instancia.overall_data_warning:SetTextColor (.8, .8, .8, .5) + instancia.overall_data_warning = backgrounddisplay:CreateFontString(nil, "overlay", "GameFontHighlightSmall") + instancia.overall_data_warning:SetHeight(64) + instancia.overall_data_warning:SetPoint("center", backgrounddisplay, "center") + instancia.overall_data_warning:SetTextColor(.8, .8, .8, .5) instancia.overall_data_warning:Hide() instancia.overall_data_warning:SetText (Loc["STRING_TUTORIAL_OVERALL1"]) --> freeze icon instancia.freeze_icon = backgrounddisplay:CreateTexture (nil, "overlay") - instancia.freeze_icon:SetWidth (64) - instancia.freeze_icon:SetHeight (64) - instancia.freeze_icon:SetPoint ("center", backgrounddisplay, "center") - instancia.freeze_icon:SetPoint ("left", backgrounddisplay, "left") + instancia.freeze_icon:SetWidth(64) + instancia.freeze_icon:SetHeight(64) + instancia.freeze_icon:SetPoint("center", backgrounddisplay, "center") + instancia.freeze_icon:SetPoint("left", backgrounddisplay, "left") instancia.freeze_icon:Hide() - instancia.freeze_texto = backgrounddisplay:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - instancia.freeze_texto:SetHeight (64) - instancia.freeze_texto:SetPoint ("left", instancia.freeze_icon, "right", -18, 0) - instancia.freeze_texto:SetTextColor (1, 1, 1) + instancia.freeze_texto = backgrounddisplay:CreateFontString(nil, "overlay", "GameFontHighlightSmall") + instancia.freeze_texto:SetHeight(64) + instancia.freeze_texto:SetPoint("left", instancia.freeze_icon, "right", -18, 0) + instancia.freeze_texto:SetTextColor(1, 1, 1) instancia.freeze_texto:Hide() --> details version - instancia._version = baseframe:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - --instancia._version:SetPoint ("left", backgrounddisplay, "left", 20, 0) - instancia._version:SetTextColor (1, 1, 1) + instancia._version = baseframe:CreateFontString(nil, "overlay", "GameFontHighlightSmall") + --instancia._version:SetPoint("left", backgrounddisplay, "left", 20, 0) + instancia._version:SetTextColor(1, 1, 1) instancia._version:SetText ("this is a alpha version of Details\nyou can help us sending bug reports\nuse the blue button.") if (not Details.initializing) then @@ -3686,61 +3685,61 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) baseframe.resize_direita = CreateFrame ("button", "Details_Resize_Direita"..ID, baseframe) local resize_direita_texture = baseframe.resize_direita:CreateTexture (nil, "overlay") - resize_direita_texture:SetWidth (16) - resize_direita_texture:SetHeight (16) - resize_direita_texture:SetTexture (DEFAULT_SKIN) - resize_direita_texture:SetTexCoord (unpack(COORDS_RESIZE_RIGHT)) - resize_direita_texture:SetAllPoints (baseframe.resize_direita) + resize_direita_texture:SetWidth(16) + resize_direita_texture:SetHeight(16) + resize_direita_texture:SetTexture(DEFAULT_SKIN) + resize_direita_texture:SetTexCoord(unpack(COORDS_RESIZE_RIGHT)) + resize_direita_texture:SetAllPoints(baseframe.resize_direita) baseframe.resize_direita.texture = resize_direita_texture - baseframe.resize_direita:SetWidth (16) - baseframe.resize_direita:SetHeight (16) - baseframe.resize_direita:SetPoint ("bottomright", baseframe, "bottomright", 0, 0) - baseframe.resize_direita:EnableMouse (true) + baseframe.resize_direita:SetWidth(16) + baseframe.resize_direita:SetHeight(16) + baseframe.resize_direita:SetPoint("bottomright", baseframe, "bottomright", 0, 0) + baseframe.resize_direita:EnableMouse(true) baseframe.resize_direita:SetFrameStrata ("HIGH") - baseframe.resize_direita:SetFrameLevel (baseframe:GetFrameLevel() + 6) + baseframe.resize_direita:SetFrameLevel(baseframe:GetFrameLevel() + 6) baseframe.resize_direita.side = 2 --> lock window button baseframe.lock_button = CreateFrame ("button", "Details_Lock_Button"..ID, baseframe) - baseframe.lock_button:SetPoint ("right", baseframe.resize_direita, "left", -1, 1.5) - baseframe.lock_button:SetFrameLevel (baseframe:GetFrameLevel() + 6) - baseframe.lock_button:SetWidth (40) - baseframe.lock_button:SetHeight (16) - baseframe.lock_button.label = baseframe.lock_button:CreateFontString (nil, "overlay", "GameFontNormal") - baseframe.lock_button.label:SetPoint ("right", baseframe.lock_button, "right") - baseframe.lock_button.label:SetTextColor (.6, .6, .6, .7) + baseframe.lock_button:SetPoint("right", baseframe.resize_direita, "left", -1, 1.5) + baseframe.lock_button:SetFrameLevel(baseframe:GetFrameLevel() + 6) + baseframe.lock_button:SetWidth(40) + baseframe.lock_button:SetHeight(16) + baseframe.lock_button.label = baseframe.lock_button:CreateFontString(nil, "overlay", "GameFontNormal") + baseframe.lock_button.label:SetPoint("right", baseframe.lock_button, "right") + baseframe.lock_button.label:SetTextColor(.6, .6, .6, .7) baseframe.lock_button.label:SetJustifyH ("right") baseframe.lock_button.label:SetText (Loc["STRING_LOCK_WINDOW"]) - baseframe.lock_button:SetWidth (baseframe.lock_button.label:GetStringWidth()+2) + baseframe.lock_button:SetWidth(baseframe.lock_button.label:GetStringWidth()+2) baseframe.lock_button:SetScript ("OnClick", lockFunctionOnClick) baseframe.lock_button:SetScript ("OnEnter", lockFunctionOnEnter) baseframe.lock_button:SetScript ("OnLeave", lockFunctionOnLeave) baseframe.lock_button:SetScript ("OnHide", lockFunctionOnHide) baseframe.lock_button:SetFrameStrata ("HIGH") - baseframe.lock_button:SetFrameLevel (baseframe:GetFrameLevel() + 6) + baseframe.lock_button:SetFrameLevel(baseframe:GetFrameLevel() + 6) baseframe.lock_button.instancia = instancia --> left resizer baseframe.resize_esquerda = CreateFrame ("button", "Details_Resize_Esquerda"..ID, baseframe) local resize_esquerda_texture = baseframe.resize_esquerda:CreateTexture (nil, "overlay") - resize_esquerda_texture:SetWidth (16) - resize_esquerda_texture:SetHeight (16) - resize_esquerda_texture:SetTexture (DEFAULT_SKIN) - resize_esquerda_texture:SetTexCoord (unpack(COORDS_RESIZE_LEFT)) - resize_esquerda_texture:SetAllPoints (baseframe.resize_esquerda) + resize_esquerda_texture:SetWidth(16) + resize_esquerda_texture:SetHeight(16) + resize_esquerda_texture:SetTexture(DEFAULT_SKIN) + resize_esquerda_texture:SetTexCoord(unpack(COORDS_RESIZE_LEFT)) + resize_esquerda_texture:SetAllPoints(baseframe.resize_esquerda) baseframe.resize_esquerda.texture = resize_esquerda_texture - baseframe.resize_esquerda:SetWidth (16) - baseframe.resize_esquerda:SetHeight (16) - baseframe.resize_esquerda:SetPoint ("bottomleft", baseframe, "bottomleft", 0, 0) - baseframe.resize_esquerda:EnableMouse (true) + baseframe.resize_esquerda:SetWidth(16) + baseframe.resize_esquerda:SetHeight(16) + baseframe.resize_esquerda:SetPoint("bottomleft", baseframe, "bottomleft", 0, 0) + baseframe.resize_esquerda:EnableMouse(true) baseframe.resize_esquerda:SetFrameStrata ("HIGH") - baseframe.resize_esquerda:SetFrameLevel (baseframe:GetFrameLevel() + 6) + baseframe.resize_esquerda:SetFrameLevel(baseframe:GetFrameLevel() + 6) - baseframe.resize_esquerda:SetAlpha (0) - baseframe.resize_direita:SetAlpha (0) + baseframe.resize_esquerda:SetAlpha(0) + baseframe.resize_direita:SetAlpha(0) if (instancia.isLocked) then instancia.isLocked = not instancia.isLocked @@ -3771,36 +3770,36 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) --> left baseframe.barra_esquerda = floatingframe:CreateTexture (nil, "artwork") - baseframe.barra_esquerda:SetTexture (DEFAULT_SKIN) - baseframe.barra_esquerda:SetTexCoord (unpack(COORDS_LEFT_SIDE_BAR)) - baseframe.barra_esquerda:SetWidth (64) + baseframe.barra_esquerda:SetTexture(DEFAULT_SKIN) + baseframe.barra_esquerda:SetTexCoord(unpack(COORDS_LEFT_SIDE_BAR)) + baseframe.barra_esquerda:SetWidth(64) baseframe.barra_esquerda:SetHeight (512) - baseframe.barra_esquerda:SetPoint ("topleft", baseframe, "topleft", -56, 0) - baseframe.barra_esquerda:SetPoint ("bottomleft", baseframe, "bottomleft", -56, -14) + baseframe.barra_esquerda:SetPoint("topleft", baseframe, "topleft", -56, 0) + baseframe.barra_esquerda:SetPoint("bottomleft", baseframe, "bottomleft", -56, -14) --> right baseframe.barra_direita = floatingframe:CreateTexture (nil, "artwork") - baseframe.barra_direita:SetTexture (DEFAULT_SKIN) - baseframe.barra_direita:SetTexCoord (unpack(COORDS_RIGHT_SIDE_BAR)) - baseframe.barra_direita:SetWidth (64) - baseframe.barra_direita:SetHeight (512) - baseframe.barra_direita:SetPoint ("topright", baseframe, "topright", 56, 0) - baseframe.barra_direita:SetPoint ("bottomright", baseframe, "bottomright", 56, -14) + baseframe.barra_direita:SetTexture(DEFAULT_SKIN) + baseframe.barra_direita:SetTexCoord(unpack(COORDS_RIGHT_SIDE_BAR)) + baseframe.barra_direita:SetWidth(64) + baseframe.barra_direita:SetHeight(512) + baseframe.barra_direita:SetPoint("topright", baseframe, "topright", 56, 0) + baseframe.barra_direita:SetPoint("bottomright", baseframe, "bottomright", 56, -14) --> bottom baseframe.barra_fundo = floatingframe:CreateTexture (nil, "artwork") - baseframe.barra_fundo:SetTexture (DEFAULT_SKIN) - baseframe.barra_fundo:SetTexCoord (unpack(COORDS_BOTTOM_SIDE_BAR)) - baseframe.barra_fundo:SetWidth (512) - baseframe.barra_fundo:SetHeight (64) - baseframe.barra_fundo:SetPoint ("bottomleft", baseframe, "bottomleft", 0, -56) - baseframe.barra_fundo:SetPoint ("bottomright", baseframe, "bottomright", 0, -56) + baseframe.barra_fundo:SetTexture(DEFAULT_SKIN) + baseframe.barra_fundo:SetTexCoord(unpack(COORDS_BOTTOM_SIDE_BAR)) + baseframe.barra_fundo:SetWidth(512) + baseframe.barra_fundo:SetHeight(64) + baseframe.barra_fundo:SetPoint("bottomleft", baseframe, "bottomleft", 0, -56) + baseframe.barra_fundo:SetPoint("bottomright", baseframe, "bottomright", 0, -56) -- break snap button ---------------------------------------------------------------------------------------------------------------------------------------------------------- instancia.break_snap_button = CreateFrame ("button", "DetailsBreakSnapButton" .. ID, floatingframe) - instancia.break_snap_button:SetPoint ("bottom", baseframe.resize_direita, "top", -1, 0) - instancia.break_snap_button:SetFrameLevel (baseframe:GetFrameLevel() + 5) + instancia.break_snap_button:SetPoint("bottom", baseframe.resize_direita, "top", -1, 0) + instancia.break_snap_button:SetFrameLevel(baseframe:GetFrameLevel() + 5) instancia.break_snap_button:SetSize (13, 13) - instancia.break_snap_button:SetAlpha (0) + instancia.break_snap_button:SetAlpha(0) instancia.break_snap_button.instancia = instancia @@ -3823,10 +3822,10 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) instancia.break_snap_button:SetHighlightTexture (DEFAULT_SKIN, "ADD") instancia.break_snap_button:SetPushedTexture (DEFAULT_SKIN) - instancia.break_snap_button:GetNormalTexture():SetTexCoord (unpack(COORDS_UNLOCK_BUTTON)) - instancia.break_snap_button:GetDisabledTexture():SetTexCoord (unpack(COORDS_UNLOCK_BUTTON)) - instancia.break_snap_button:GetHighlightTexture():SetTexCoord (unpack(COORDS_UNLOCK_BUTTON)) - instancia.break_snap_button:GetPushedTexture():SetTexCoord (unpack(COORDS_UNLOCK_BUTTON)) + instancia.break_snap_button:GetNormalTexture():SetTexCoord(unpack(COORDS_UNLOCK_BUTTON)) + instancia.break_snap_button:GetDisabledTexture():SetTexCoord(unpack(COORDS_UNLOCK_BUTTON)) + instancia.break_snap_button:GetHighlightTexture():SetTexCoord(unpack(COORDS_UNLOCK_BUTTON)) + instancia.break_snap_button:GetPushedTexture():SetTexCoord(unpack(COORDS_UNLOCK_BUTTON)) -- scripts ------------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -3841,11 +3840,11 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) fcima:Hide() instancia.h_cima = fcima:CreateTexture (nil, "overlay") - instancia.h_cima:SetTexture ([[Interface\AddOns\Details\images\highlight_updown]]) - instancia.h_cima:SetTexCoord (0, 1, 0.5, 1) - instancia.h_cima:SetPoint ("topleft", baseframe.cabecalho.top_bg, "bottomleft", -10, 37) - instancia.h_cima:SetPoint ("topright", baseframe.cabecalho.ball_r, "bottomright", -97, 37) - instancia.h_cima:SetDesaturated (true) + instancia.h_cima:SetTexture([[Interface\AddOns\Details\images\highlight_updown]]) + instancia.h_cima:SetTexCoord(0, 1, 0.5, 1) + instancia.h_cima:SetPoint("topleft", baseframe.cabecalho.top_bg, "bottomleft", -10, 37) + instancia.h_cima:SetPoint("topright", baseframe.cabecalho.ball_r, "bottomright", -97, 37) + instancia.h_cima:SetDesaturated(true) fcima.texture = instancia.h_cima instancia.h_cima = fcima @@ -3855,11 +3854,11 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) fbaixo:Hide() instancia.h_baixo = fbaixo:CreateTexture (nil, "overlay") - instancia.h_baixo:SetTexture ([[Interface\AddOns\Details\images\highlight_updown]]) - instancia.h_baixo:SetTexCoord (0, 1, 0, 0.5) - instancia.h_baixo:SetPoint ("topleft", baseframe.rodape.esquerdo, "bottomleft", 16, 17) - instancia.h_baixo:SetPoint ("topright", baseframe.rodape.direita, "bottomright", -16, 17) - instancia.h_baixo:SetDesaturated (true) + instancia.h_baixo:SetTexture([[Interface\AddOns\Details\images\highlight_updown]]) + instancia.h_baixo:SetTexCoord(0, 1, 0, 0.5) + instancia.h_baixo:SetPoint("topleft", baseframe.rodape.esquerdo, "bottomleft", 16, 17) + instancia.h_baixo:SetPoint("topright", baseframe.rodape.direita, "bottomright", -16, 17) + instancia.h_baixo:SetDesaturated(true) fbaixo.texture = instancia.h_baixo instancia.h_baixo = fbaixo @@ -3869,11 +3868,11 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) fesquerda:Hide() instancia.h_esquerda = fesquerda:CreateTexture (nil, "overlay") - instancia.h_esquerda:SetTexture ([[Interface\AddOns\Details\images\highlight_leftright]]) - instancia.h_esquerda:SetTexCoord (0.5, 1, 0, 1) - instancia.h_esquerda:SetPoint ("topleft", baseframe.barra_esquerda, "topleft", 40, 0) - instancia.h_esquerda:SetPoint ("bottomleft", baseframe.barra_esquerda, "bottomleft", 40, 0) - instancia.h_esquerda:SetDesaturated (true) + instancia.h_esquerda:SetTexture([[Interface\AddOns\Details\images\highlight_leftright]]) + instancia.h_esquerda:SetTexCoord(0.5, 1, 0, 1) + instancia.h_esquerda:SetPoint("topleft", baseframe.barra_esquerda, "topleft", 40, 0) + instancia.h_esquerda:SetPoint("bottomleft", baseframe.barra_esquerda, "bottomleft", 40, 0) + instancia.h_esquerda:SetDesaturated(true) fesquerda.texture = instancia.h_esquerda instancia.h_esquerda = fesquerda @@ -3883,11 +3882,11 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) fdireita:Hide() instancia.h_direita = fdireita:CreateTexture (nil, "overlay") - instancia.h_direita:SetTexture ([[Interface\AddOns\Details\images\highlight_leftright]]) - instancia.h_direita:SetTexCoord (0, 0.5, 1, 0) - instancia.h_direita:SetPoint ("topleft", baseframe.barra_direita, "topleft", 8, 18) - instancia.h_direita:SetPoint ("bottomleft", baseframe.barra_direita, "bottomleft", 8, 0) - instancia.h_direita:SetDesaturated (true) + instancia.h_direita:SetTexture([[Interface\AddOns\Details\images\highlight_leftright]]) + instancia.h_direita:SetTexCoord(0, 0.5, 1, 0) + instancia.h_direita:SetPoint("topleft", baseframe.barra_direita, "topleft", 8, 18) + instancia.h_direita:SetPoint("bottomleft", baseframe.barra_direita, "bottomleft", 8, 0) + instancia.h_direita:SetDesaturated(true) fdireita.texture = instancia.h_direita instancia.h_direita = fdireita @@ -3918,7 +3917,7 @@ end function Details:ShowOverallDataWarning (state) if (state) then self.overall_data_warning:Show() - self.overall_data_warning:SetWidth (self:GetSize() - 20) + self.overall_data_warning:SetWidth(self:GetSize() - 20) else self.overall_data_warning:Hide() end @@ -3971,10 +3970,10 @@ function Details:SetBarGrowDirection (direction) if (self.toolbar_side == 1) then --> if titlebar is attached to the top side, don't add any midifiers - row:SetPoint ("topleft", baseframe, "topleft", x, y) + row:SetPoint("topleft", baseframe, "topleft", x, y) else --> if the titlebar is on the bottom side, remove the gap between the baseframe and the titlebar - row:SetPoint ("topleft", baseframe, "topleft", x, y - 1) + row:SetPoint("topleft", baseframe, "topleft", x, y - 1) end end @@ -3984,10 +3983,10 @@ function Details:SetBarGrowDirection (direction) row:ClearAllPoints() if (self.toolbar_side == 1) then --> if the titlebar is attached to the top side, we want to align bars a little above - row:SetPoint ("bottomleft", baseframe, "bottomleft", x, y + 2) + row:SetPoint("bottomleft", baseframe, "bottomleft", x, y + 2) else --> the titlebar is on the bottom side, align bars on the bottom - row:SetPoint ("bottomleft", baseframe, "bottomleft", x, y + 0) + row:SetPoint("bottomleft", baseframe, "bottomleft", x, y + 0) end end end @@ -3995,11 +3994,11 @@ function Details:SetBarGrowDirection (direction) --> update all row width if (self.bar_mod and self.bar_mod ~= 0) then for index = 1, #bars do - bars [index]:SetWidth (baseframe:GetWidth() + self.bar_mod) + bars [index]:SetWidth(baseframe:GetWidth() + self.bar_mod) end else for index = 1, #bars do - bars [index]:SetWidth (baseframe:GetWidth() + self.row_info.space.right) + bars [index]:SetWidth(baseframe:GetWidth() + self.row_info.space.right) end end end @@ -4022,7 +4021,7 @@ function gump:CreateNewLine(instance, index) local rowframe = instance.rowframe --create the bar with rowframe as parent - local newLine = CreateFrame("button", "DetailsBarra_"..instance.meu_id.."_"..index, rowframe, "BackdropTemplate") + local newLine = CreateFrame("button", "DetailsBarra_"..instance.meu_id .. "_" .. index, rowframe, "BackdropTemplate") newLine.row_id = index newLine.instance_id = instance.meu_id @@ -4032,27 +4031,36 @@ function gump:CreateNewLine(instance, index) newLine.GetActor = getActor --set point, almost irrelevant here, it recalc this on SetBarGrowDirection() - local y = instance.row_height * (index-1) + local yOffset = instance.row_height * (index-1) if (instance.bars_grow_direction == 1) then - y = y * -1 - newLine:SetPoint("topleft", baseframe, "topleft", instance.row_info.space.left, y) + yOffset = yOffset * -1 + newLine:SetPoint("topleft", baseframe, "topleft", instance.row_info.space.left, yOffset) elseif (instance.bars_grow_direction == 2) then - newLine:SetPoint("bottomleft", baseframe, "bottomleft", instance.row_info.space.left, y + 2) + newLine:SetPoint("bottomleft", baseframe, "bottomleft", instance.row_info.space.left, yOffset + 2) end --row height - newLine:SetHeight (instance.row_info.height) - newLine:SetWidth (baseframe:GetWidth()+instance.row_info.space.right) - newLine:SetFrameLevel (baseframe:GetFrameLevel() + 4) + newLine:SetHeight(instance.row_info.height) + newLine:SetWidth(baseframe:GetWidth()+instance.row_info.space.right) + newLine:SetFrameLevel(baseframe:GetFrameLevel() + 4) newLine.last_value = 0 newLine.w_mod = 0 - newLine:EnableMouse (true) - newLine:RegisterForClicks ("LeftButtonDown", "RightButtonDown") - + newLine:EnableMouse(true) + newLine:RegisterForClicks("LeftButtonDown", "RightButtonDown") + --statusbar - newLine.statusbar = CreateFrame("StatusBar", "DetailsBarra_Statusbar_"..instance.meu_id.."_"..index, newLine) + newLine.statusbar = CreateFrame("StatusBar", "DetailsBarra_Statusbar_" .. instance.meu_id .. "_" .. index, newLine) newLine.statusbar.value = 0 + newLine.statusbar:SetStatusBarColor(0, 0, 0, 0) + newLine.statusbar:SetMinMaxValues(0, 100) + newLine.statusbar:SetValue(0) + + --create textures and icons + newLine.textura = newLine.statusbar:CreateTexture(nil, "artwork") + newLine.textura:SetHorizTile(false) + newLine.textura:SetVertTile(false) + newLine.statusbar:SetStatusBarTexture(newLine.textura) --frame for hold the backdrop border newLine.border = CreateFrame("Frame", "DetailsBarra_Border_" .. instance.meu_id .. "_" .. index, newLine.statusbar, "BackdropTemplate") @@ -4064,78 +4072,69 @@ function gump:CreateNewLine(instance, index) --low 3d bar --search key: ~model newLine.modelbox_low = CreateFrame("playermodel", "DetailsBarra_ModelBarLow_" .. instance.meu_id .. "_" .. index, newLine) - newLine.modelbox_low:SetFrameLevel (newLine.statusbar:GetFrameLevel()-1) + newLine.modelbox_low:SetFrameLevel(newLine.statusbar:GetFrameLevel()-1) newLine.modelbox_low:SetPoint("topleft", newLine, "topleft") newLine.modelbox_low:SetPoint("bottomright", newLine, "bottomright") --high 3d bar newLine.modelbox_high = CreateFrame("playermodel", "DetailsBarra_ModelBarHigh_" .. instance.meu_id .. "_" .. index, newLine) - newLine.modelbox_high:SetFrameLevel (newLine.statusbar:GetFrameLevel()+1) + newLine.modelbox_high:SetFrameLevel(newLine.statusbar:GetFrameLevel()+1) newLine.modelbox_high:SetPoint("topleft", newLine, "topleft") newLine.modelbox_high:SetPoint("bottomright", newLine, "bottomright") - --create textures and icons - newLine.textura = newLine.statusbar:CreateTexture(nil, "artwork") - newLine.textura:SetHorizTile(false) - newLine.textura:SetVertTile(false) - --row background texture newLine.background = newLine:CreateTexture(nil, "background") newLine.background:SetTexture("") - newLine.background:SetAllPoints (newLine) - - newLine.statusbar:SetStatusBarColor(0, 0, 0, 0) - newLine.statusbar:SetStatusBarTexture(newLine.textura) - newLine.statusbar:SetMinMaxValues(0, 100) - newLine.statusbar:SetValue(0) + newLine.background:SetAllPoints(newLine) + --overlay texture newLine.overlayTexture = newLine.statusbar:CreateTexture(nil, "overlay") newLine.overlayTexture:SetAllPoints() --class icon - local icone_classe = newLine.border:CreateTexture(nil, "overlay") - icone_classe:SetHeight (instance.row_info.height) - icone_classe:SetWidth (instance.row_info.height) - icone_classe:SetTexture (instance.row_info.icon_file) - icone_classe:SetTexCoord (.75, 1, .75, 1) - newLine.icone_classe = icone_classe + local classIcon = newLine.border:CreateTexture(nil, "overlay") + classIcon:SetHeight(instance.row_info.height) + classIcon:SetWidth(instance.row_info.height) + classIcon:SetTexture(instance.row_info.icon_file) + classIcon:SetTexCoord(.75, 1, .75, 1) + newLine.icone_classe = classIcon local iconFrame = CreateFrame("frame", "DetailsBarra_IconFrame_" .. instance.meu_id .. "_" .. index, newLine.statusbar) - iconFrame:SetPoint("topleft", icone_classe, "topleft") - iconFrame:SetPoint("bottomright", icone_classe, "bottomright") - iconFrame:SetFrameLevel (newLine.statusbar:GetFrameLevel()+1) + iconFrame:SetPoint("topleft", classIcon, "topleft") + iconFrame:SetPoint("bottomright", classIcon, "bottomright") + iconFrame:SetFrameLevel(newLine.statusbar:GetFrameLevel()+1) iconFrame.instance_id = instance.meu_id iconFrame.row = newLine newLine.icon_frame = iconFrame - icone_classe:SetPoint("left", newLine, "left") - newLine.statusbar:SetPoint("topleft", icone_classe, "topright") + classIcon:SetPoint("left", newLine, "left") + newLine.statusbar:SetPoint("topleft", classIcon, "topright") newLine.statusbar:SetPoint("bottomright", newLine, "bottomright") - --> left text 1 - newLine.lineText1 = newLine.border:CreateFontString (nil, "overlay", "GameFontHighlight") + --left text 1 + newLine.lineText1 = newLine.border:CreateFontString(nil, "overlay", "GameFontHighlight") newLine.lineText1:SetPoint("left", newLine.icone_classe, "right", 3, 0) newLine.lineText1:SetJustifyH ("left") newLine.lineText1:SetNonSpaceWrap (true) --create text columns for i = 2, 4 do - newLine ["lineText" .. i] = newLine.border:CreateFontString (nil, "overlay", "GameFontHighlight") + newLine["lineText" .. i] = newLine.border:CreateFontString(nil, "overlay", "GameFontHighlight") end - --> set the onclick, on enter scripts - barra_scripts (newLine, instance, index) + --set the onclick, on enter scripts + setLineScripts (newLine, instance, index) - --> hide + --hide Details.FadeHandler.Fader (newLine, 1) - --> adds the window container + --adds the window container instance.barras [index] = newLine - --> set the left text + --set the left text newLine.lineText1:SetText (Loc["STRING_NEWROW"]) - --> refresh rows + --refresh rows instance:InstanceRefreshRows() Details:SendEvent ("DETAILS_INSTANCE_NEWROW", nil, instance, newLine) @@ -4153,7 +4152,7 @@ function Details:SetBarTextSettings (size, font, fixedcolor, leftcolorbyclass, r --> font if (font) then self.row_info.font_face = font - self.row_info.font_face_file = SharedMedia:Fetch ("font", font) + self.row_info.font_face_file = SharedMedia:Fetch("font", font) end --> fixed color @@ -4454,7 +4453,7 @@ function Details:SetBarSettings (height, texture, colorclass, fixedcolor, backgr --> texture if (texture) then self.row_info.texture = texture - self.row_info.texture_file = SharedMedia:Fetch ("statusbar", texture) + self.row_info.texture_file = SharedMedia:Fetch("statusbar", texture) end if (texture_custom) then @@ -4477,7 +4476,7 @@ function Details:SetBarSettings (height, texture, colorclass, fixedcolor, backgr --> background texture if (backgroundtexture) then self.row_info.texture_background = backgroundtexture - self.row_info.texture_background_file = SharedMedia:Fetch ("statusbar", backgroundtexture) + self.row_info.texture_background_file = SharedMedia:Fetch("statusbar", backgroundtexture) end --> background color by class @@ -4556,7 +4555,7 @@ end --/script _detalhes:InstanceRefreshRows (_detalhes.tabela_instancias[1]) --onupdate function for 'Fast Updates' feature -local fast_ps_func = function (self) +local fast_ps_func = function(self) local instance = self.instance if (not instance.showing) then @@ -4676,117 +4675,105 @@ function Details:AdjustInLineTextPadding() end -- search key: ~row ~bar ~updatebar -function Details:InstanceRefreshRows (instancia) - - if (instancia) then - self = instancia +function Details:InstanceRefreshRows(instance) + if (instance) then + self = instance end if (not self.barras or not self.barras[1]) then return end - --> mirror - local is_mirror = self.bars_inverted + --mirror + local isInvertedBars = self.bars_inverted - --> texture - local texture_file = SharedMedia:Fetch ("statusbar", self.row_info.texture) - local texture_file2 = SharedMedia:Fetch ("statusbar", self.row_info.texture_background) - --> update texture files - self.row_info.texture_file = texture_file - self.row_info.texture_background_file = texture_file2 - - if (type (self.row_info.texture_custom) == "string" and self.row_info.texture_custom ~= "") then - texture_file = [[Interface\]] .. self.row_info.texture_custom - --update texture file - self.row_info.texture_custom_file = texture_file - end - - --> outline values - local left_text_outline = self.row_info.textL_outline - local right_text_outline = self.row_info.textR_outline - local textL_outline_small = self.row_info.textL_outline_small - local textL_outline_small_color = self.row_info.textL_outline_small_color - local textR_outline_small = self.row_info.textR_outline_small - local textR_outline_small_color = self.row_info.textR_outline_small_color - - --> texture color values - local texture_class_color = self.row_info.texture_class_colors - local texture_r, texture_g, texture_b - if (not texture_class_color) then - texture_r, texture_g, texture_b = unpack(self.row_info.fixed_texture_color) - end + --texture + local textureFile = SharedMedia:Fetch("statusbar", self.row_info.texture) + local textureFile2 = SharedMedia:Fetch("statusbar", self.row_info.texture_background) + + --update texture files + self.row_info.texture_file = textureFile + self.row_info.texture_background_file = textureFile2 + if (type(self.row_info.texture_custom) == "string" and self.row_info.texture_custom ~= "") then + textureFile = [[Interface\]] .. self.row_info.texture_custom + --update texture file + self.row_info.texture_custom_file = textureFile + end + + --outline values + local left_text_outline = self.row_info.textL_outline + local right_text_outline = self.row_info.textR_outline + local textL_outline_small = self.row_info.textL_outline_small + local textL_outline_small_color = self.row_info.textL_outline_small_color + local textR_outline_small = self.row_info.textR_outline_small + local textR_outline_small_color = self.row_info.textR_outline_small_color + + --texture color values + local texture_class_color = self.row_info.texture_class_colors + local texture_r, texture_g, texture_b + if (not texture_class_color) then + texture_r, texture_g, texture_b = unpack(self.row_info.fixed_texture_color) + end + --text color - local left_text_class_color = self.row_info.textL_class_colors - local right_text_class_color = self.row_info.textR_class_colors - local text_r, text_g, text_b - if (not left_text_class_color or not right_text_class_color) then - text_r, text_g, text_b = unpack(self.row_info.fixed_text_color) - end - - local height = self.row_info.height - + local left_text_class_color = self.row_info.textL_class_colors + local right_text_class_color = self.row_info.textR_class_colors + local text_r, text_g, text_b + if (not left_text_class_color or not right_text_class_color) then + text_r, text_g, text_b = unpack(self.row_info.fixed_text_color) + end + + local height = self.row_info.height + --alpha - local alpha = self.row_info.alpha - + local alpha = self.row_info.alpha + --icons - local no_icon = self.row_info.no_icon - local start_after_icon = self.row_info.start_after_icon - - --if (self.row_info.use_spec_icons) then - --local icon_texture = self.row_info.spec_file --isn't in use - --end - - local icon_force_grayscale = self.row_info.icon_grayscale - local icon_offset_x, icon_offset_y = unpack(self.row_info.icon_offset) + local no_icon = self.row_info.no_icon + local start_after_icon = self.row_info.start_after_icon + local icon_force_grayscale = self.row_info.icon_grayscale + local icon_offset_x, icon_offset_y = unpack(self.row_info.icon_offset) --line border - local lineBorderEnabled = self.row_info.backdrop.enabled - local lineBorderColor = self.row_info.backdrop.color - local lineBorderSize = self.row_info.backdrop.size - + local lineBorderEnabled = self.row_info.backdrop.enabled + local lineBorderColor = self.row_info.backdrop.color + local lineBorderSize = self.row_info.backdrop.size + --font face - self.row_info.font_face_file = SharedMedia:Fetch ("font", self.row_info.font_face) - + self.row_info.font_face_file = SharedMedia:Fetch("font", self.row_info.font_face) + --models - local upper_model_enabled = self.row_info.models.upper_enabled - local lower_model_enabled = self.row_info.models.lower_enabled - - local upper_model = self.row_info.models.upper_model - local lower_model = self.row_info.models.lower_model - - local upper_model_alpha = self.row_info.models.upper_alpha - local lower_model_alpha = self.row_info.models.lower_alpha + local upper_model_enabled = self.row_info.models.upper_enabled + local lower_model_enabled = self.row_info.models.lower_enabled + local upper_model = self.row_info.models.upper_model + local lower_model = self.row_info.models.lower_model + local upper_model_alpha = self.row_info.models.upper_alpha + local lower_model_alpha = self.row_info.models.lower_alpha - local overlayTexture = SharedMedia:Fetch("statusbar", self.row_info.overlay_texture) - local overlayColor = self.row_info.overlay_color - ---using_upper_3dmodels using_lower_3dmodels - - -- do it + local overlayTexture = SharedMedia:Fetch("statusbar", self.row_info.overlay_texture) + local overlayColor = self.row_info.overlay_color - for _, row in ipairs (self.barras) do + for _, row in ipairs(self.barras) do + --positioning and size + row:SetHeight(height) + row.icone_classe:SetHeight(height) + row.icone_classe:SetWidth(height) - --> positioning and size - row:SetHeight (height) - row.icone_classe:SetHeight (height) - row.icone_classe:SetWidth (height) - if (icon_force_grayscale) then - row.icone_classe:SetDesaturated (true) + row.icone_classe:SetDesaturated(true) else - row.icone_classe:SetDesaturated (false) + row.icone_classe:SetDesaturated(false) end - - --> icon and texture anchors - if (not is_mirror) then + + --icon and texture anchors + if (not isInvertedBars) then row.lineText1:ClearAllPoints() - + row.lineText2:ClearAllPoints() row.lineText3:ClearAllPoints() row.lineText4:ClearAllPoints() - + row.lineText1:SetJustifyH("left") row.lineText2:SetJustifyH("right") row.lineText3:SetJustifyH("right") @@ -4796,31 +4783,31 @@ function Details:InstanceRefreshRows (instancia) row.lineText2:SetText("") row.lineText3:SetText("") end - + row.lineText4:SetText("") - - row.lineText2:SetPoint ("right", row.statusbar, "right", -self.fontstrings_text2_anchor, 0) - row.lineText3:SetPoint ("right", row.statusbar, "right", -self.fontstrings_text3_anchor, 0) - row.lineText4:SetPoint ("right", row.statusbar, "right", -self.fontstrings_text4_anchor, 0) + + row.lineText2:SetPoint("right", row.statusbar, "right", -self.fontstrings_text2_anchor, 0) + row.lineText3:SetPoint("right", row.statusbar, "right", -self.fontstrings_text3_anchor, 0) + row.lineText4:SetPoint("right", row.statusbar, "right", -self.fontstrings_text4_anchor, 0) if (no_icon) then - row.statusbar:SetPoint ("topleft", row, "topleft") - row.statusbar:SetPoint ("bottomright", row, "bottomright") - row.lineText1:SetPoint ("left", row.statusbar, "left", 2, 0) + row.statusbar:SetPoint("topleft", row, "topleft") + row.statusbar:SetPoint("bottomright", row, "bottomright") + row.lineText1:SetPoint("left", row.statusbar, "left", 2, 0) row.icone_classe:Hide() else row.icone_classe:ClearAllPoints() - row.icone_classe:SetPoint ("left", row, "left", icon_offset_x, icon_offset_y) + row.icone_classe:SetPoint("left", row, "left", icon_offset_x, icon_offset_y) row.icone_classe:Show() if (start_after_icon) then - row.statusbar:SetPoint ("topleft", row.icone_classe, "topright") + row.statusbar:SetPoint("topleft", row.icone_classe, "topright") else - row.statusbar:SetPoint ("topleft", row, "topleft") + row.statusbar:SetPoint("topleft", row, "topleft") end - row.statusbar:SetPoint ("bottomright", row, "bottomright") - row.lineText1:SetPoint ("left", row.icone_classe, "right", 3, 0) + row.statusbar:SetPoint("bottomright", row, "bottomright") + row.lineText1:SetPoint("left", row.icone_classe, "right", 3, 0) end else row.lineText1:ClearAllPoints() @@ -4833,91 +4820,91 @@ function Details:InstanceRefreshRows (instancia) row.lineText2:SetJustifyH("left") row.lineText1:SetJustifyH("right") - row.lineText4:SetPoint ("left", row.statusbar, "left", self.fontstrings_text4_anchor + 1, 0) - row.lineText3:SetPoint ("left", row.statusbar, "left", self.fontstrings_text3_anchor + 1, 0) - row.lineText2:SetPoint ("left", row.statusbar, "left", self.fontstrings_text2_anchor + 1, 0) + row.lineText4:SetPoint("left", row.statusbar, "left", self.fontstrings_text4_anchor + 1, 0) + row.lineText3:SetPoint("left", row.statusbar, "left", self.fontstrings_text3_anchor + 1, 0) + row.lineText2:SetPoint("left", row.statusbar, "left", self.fontstrings_text2_anchor + 1, 0) if (no_icon) then - row.statusbar:SetPoint ("topleft", row, "topleft") - row.statusbar:SetPoint ("bottomright", row, "bottomright") - row.lineText1:SetPoint ("right", row.statusbar, "right", -2, 0) + row.statusbar:SetPoint("topleft", row, "topleft") + row.statusbar:SetPoint("bottomright", row, "bottomright") + row.lineText1:SetPoint("right", row.statusbar, "right", -2, 0) row.icone_classe:Hide() --[[ Deprecation of right_to_left_texture in favor of StatusBar:SetReverseFill 5/2/2022 - Flamanis - row.right_to_left_texture:SetPoint ("topright", row.statusbar, "topright") - row.right_to_left_texture:SetPoint ("bottomright", row.statusbar, "bottomright")]] + row.right_to_left_texture:SetPoint("topright", row.statusbar, "topright") + row.right_to_left_texture:SetPoint("bottomright", row.statusbar, "bottomright")]] + else - row.icone_classe:ClearAllPoints() - row.icone_classe:SetPoint ("right", row, "right", icon_offset_x, icon_offset_y) + row.icone_classe:SetPoint("right", row, "right", icon_offset_x, icon_offset_y) row.icone_classe:Show() if (start_after_icon) then - row.statusbar:SetPoint ("bottomright", row.icone_classe, "bottomleft") + row.statusbar:SetPoint("bottomright", row.icone_classe, "bottomleft") else - row.statusbar:SetPoint ("bottomright", row, "bottomright") + row.statusbar:SetPoint("bottomright", row, "bottomright") end - row.statusbar:SetPoint ("topleft", row, "topleft") + row.statusbar:SetPoint("topleft", row, "topleft") - row.lineText1:SetPoint ("right", row.icone_classe, "left", -2, 0) + row.lineText1:SetPoint("right", row.icone_classe, "left", -2, 0) end end - + if (not self.row_info.texture_background_class_color) then local c = self.row_info.fixed_texture_background_color - row.background:SetVertexColor (c[1], c[2], c[3], c[4]) + row.background:SetVertexColor(c[1], c[2], c[3], c[4]) else local c = self.row_info.fixed_texture_background_color local r, g, b = row.background:GetVertexColor() - row.background:SetVertexColor (r, g, b, c[4]) + row.background:SetVertexColor(r, g, b, c[4]) end - - --> outline + + --outline if (left_text_outline) then Details:SetFontOutline(row.lineText1, left_text_outline) else Details:SetFontOutline(row.lineText1, nil) end - + if (right_text_outline) then - self:SetFontOutline (row.lineText2, right_text_outline) - self:SetFontOutline (row.lineText3, right_text_outline) - self:SetFontOutline (row.lineText4, right_text_outline) + self:SetFontOutline(row.lineText2, right_text_outline) + self:SetFontOutline(row.lineText3, right_text_outline) + self:SetFontOutline(row.lineText4, right_text_outline) else - self:SetFontOutline (row.lineText2, nil) - self:SetFontOutline (row.lineText3, nil) - self:SetFontOutline (row.lineText4, nil) + self:SetFontOutline(row.lineText2, nil) + self:SetFontOutline(row.lineText3, nil) + self:SetFontOutline(row.lineText4, nil) end - - --> small outline + + --small outline if (textL_outline_small) then - local c = textL_outline_small_color - row.lineText1:SetShadowColor (c[1], c[2], c[3], c[4]) + local color = textL_outline_small_color + row.lineText1:SetShadowColor(color[1], color[2], color[3], color[4]) else - row.lineText1:SetShadowColor (0, 0, 0, 0) + row.lineText1:SetShadowColor(0, 0, 0, 0) end if (textR_outline_small) then - local c = textR_outline_small_color - row.lineText4:SetShadowColor (c[1], c[2], c[3], c[4]) - row.lineText3:SetShadowColor (c[1], c[2], c[3], c[4]) - row.lineText2:SetShadowColor (c[1], c[2], c[3], c[4]) + local color = textR_outline_small_color + row.lineText4:SetShadowColor(color[1], color[2], color[3], color[4]) + row.lineText3:SetShadowColor(color[1], color[2], color[3], color[4]) + row.lineText2:SetShadowColor(color[1], color[2], color[3], color[4]) else - row.lineText4:SetShadowColor (0, 0, 0, 0) - row.lineText3:SetShadowColor (0, 0, 0, 0) - row.lineText2:SetShadowColor (0, 0, 0, 0) + row.lineText4:SetShadowColor(0, 0, 0, 0) + row.lineText3:SetShadowColor(0, 0, 0, 0) + row.lineText2:SetShadowColor(0, 0, 0, 0) end - - --> texture: - row.textura:SetTexture (texture_file) + + --texture: + row.textura:SetTexture(textureFile) --Deprecation of right_to_left_texture in favor of StatusBar:SetReverseFill 5/2/2022 - Flamanis - --row.right_to_left_texture:SetTexture (texture_file) + --row.right_to_left_texture:SetTexture(texture_file) - row.background:SetTexture (texture_file2) + row.background:SetTexture(textureFile2) row.overlayTexture:SetTexture(overlayTexture) row.overlayTexture:SetVertexColor(unpack(overlayColor)) - if (is_mirror) then + if (isInvertedBars) then --Deprecation of right_to_left_texture in favor of StatusBar:SetReverseFill 5/2/2022 - Flamanis --row.right_to_left_texture:Show() row.statusbar:SetReverseFill(true) @@ -4926,39 +4913,39 @@ function Details:InstanceRefreshRows (instancia) --row.right_to_left_texture:Hide() end - --> texture class color: if true color changes on the fly through class refresh + --texture class color: if true color changes on the fly through class refresh if (not texture_class_color) then - row.textura:SetVertexColor (texture_r, texture_g, texture_b, alpha) + row.textura:SetVertexColor(texture_r, texture_g, texture_b, alpha) --Deprecation of right_to_left_texture in favor of StatusBar:SetReverseFill 5/2/2022 - Flamanis - --row.right_to_left_texture:SetVertexColor (texture_r, texture_g, texture_b, alpha) + --row.right_to_left_texture:SetVertexColor(texture_r, texture_g, texture_b, alpha) else --automatically color the bar by the actor class --forcing alpha 1 instead of use the alpha from the fixed color local r, g, b = row.textura:GetVertexColor() - row.textura:SetVertexColor (r, g, b, 1) --alpha + row.textura:SetVertexColor(r, g, b, 1) --alpha end - --> text class color: if true color changes on the fly through class refresh + --text class color: if true color changes on the fly through class refresh if (not left_text_class_color) then - row.lineText1:SetTextColor (text_r, text_g, text_b) + row.lineText1:SetTextColor(text_r, text_g, text_b) end if (not right_text_class_color) then - row.lineText4:SetTextColor (text_r, text_g, text_b) - row.lineText3:SetTextColor (text_r, text_g, text_b) - row.lineText2:SetTextColor (text_r, text_g, text_b) + row.lineText4:SetTextColor(text_r, text_g, text_b) + row.lineText3:SetTextColor(text_r, text_g, text_b) + row.lineText2:SetTextColor(text_r, text_g, text_b) end - --> text size - Details:SetFontSize (row.lineText1, self.row_info.font_size or height * 0.75) - Details:SetFontSize (row.lineText2, self.row_info.font_size or height * 0.75) - Details:SetFontSize (row.lineText3, self.row_info.font_size or height * 0.75) - Details:SetFontSize (row.lineText4, self.row_info.font_size or height * 0.75) + --text size + Details:SetFontSize(row.lineText1, self.row_info.font_size or height * 0.75) + Details:SetFontSize(row.lineText2, self.row_info.font_size or height * 0.75) + Details:SetFontSize(row.lineText3, self.row_info.font_size or height * 0.75) + Details:SetFontSize(row.lineText4, self.row_info.font_size or height * 0.75) - --> text font - Details:SetFontFace (row.lineText1, self.row_info.font_face_file or "GameFontHighlight") - Details:SetFontFace (row.lineText2, self.row_info.font_face_file or "GameFontHighlight") - Details:SetFontFace (row.lineText3, self.row_info.font_face_file or "GameFontHighlight") - Details:SetFontFace (row.lineText4, self.row_info.font_face_file or "GameFontHighlight") + --text font + Details:SetFontFace(row.lineText1, self.row_info.font_face_file or "GameFontHighlight") + Details:SetFontFace(row.lineText2, self.row_info.font_face_file or "GameFontHighlight") + Details:SetFontFace(row.lineText3, self.row_info.font_face_file or "GameFontHighlight") + Details:SetFontFace(row.lineText4, self.row_info.font_face_file or "GameFontHighlight") --backdrop if (lineBorderEnabled) then @@ -4970,12 +4957,12 @@ function Details:InstanceRefreshRows (instancia) row.lineBorder:Hide() end - --> models + --models if (upper_model_enabled) then row.using_upper_3dmodels = true row.modelbox_high:Show() - row.modelbox_high:SetModel (upper_model) - row.modelbox_high:SetAlpha (upper_model_alpha) + row.modelbox_high:SetModel(upper_model) + row.modelbox_high:SetAlpha(upper_model_alpha) else row.using_upper_3dmodels = false row.modelbox_high:Hide() @@ -4984,8 +4971,8 @@ function Details:InstanceRefreshRows (instancia) if (lower_model_enabled) then row.using_lower_3dmodels = true row.modelbox_low:Show() - row.modelbox_low:SetModel (lower_model) - row.modelbox_low:SetAlpha (lower_model_alpha) + row.modelbox_low:SetModel(lower_model) + row.modelbox_low:SetAlpha(lower_model_alpha) else row.using_lower_3dmodels = false row.modelbox_low:Hide() @@ -4994,10 +4981,7 @@ function Details:InstanceRefreshRows (instancia) end self:SetBarGrowDirection() - self:UpdateClickThrough() - - end function Details:SetBarOverlaySettings(overlayTexture, overlayColor) @@ -5108,30 +5092,30 @@ function Details:InstanceWallpaper (texture, anchor, alpha, texcoord, width, hei t:ClearAllPoints() if (anchor == "all") then - t:SetPoint ("topleft", self.baseframe, "topleft") - t:SetPoint ("bottomright", self.baseframe, "bottomright") + t:SetPoint("topleft", self.baseframe, "topleft") + t:SetPoint("bottomright", self.baseframe, "bottomright") elseif (anchor == "titlebar") then - t:SetPoint ("topleft", self.baseframe.titleBar, "topleft", 0, 0) - t:SetPoint ("bottomright", self.baseframe, "bottomright", 1, -1) + t:SetPoint("topleft", self.baseframe.titleBar, "topleft", 0, 0) + t:SetPoint("bottomright", self.baseframe, "bottomright", 1, -1) elseif (anchor == "center") then - t:SetPoint ("center", self.baseframe, "center", 0, 4) + t:SetPoint("center", self.baseframe, "center", 0, 4) elseif (anchor == "stretchLR") then - t:SetPoint ("center", self.baseframe, "center") - t:SetPoint ("left", self.baseframe, "left") - t:SetPoint ("right", self.baseframe, "right") + t:SetPoint("center", self.baseframe, "center") + t:SetPoint("left", self.baseframe, "left") + t:SetPoint("right", self.baseframe, "right") elseif (anchor == "stretchTB") then - t:SetPoint ("center", self.baseframe, "center") - t:SetPoint ("top", self.baseframe, "top") - t:SetPoint ("bottom", self.baseframe, "bottom") + t:SetPoint("center", self.baseframe, "center") + t:SetPoint("top", self.baseframe, "top") + t:SetPoint("bottom", self.baseframe, "bottom") else - t:SetPoint (anchor, self.baseframe, anchor) + t:SetPoint(anchor, self.baseframe, anchor) end - t:SetTexture (texture) - t:SetTexCoord (unpack(texcoord)) - t:SetWidth (width) - t:SetHeight (height) - t:SetVertexColor (unpack(overlay)) + t:SetTexture(texture) + t:SetTexCoord(unpack(texcoord)) + t:SetWidth(width) + t:SetHeight(height) + t:SetVertexColor(unpack(overlay)) wallpaper.enabled = true wallpaper.texture = texture @@ -5143,7 +5127,7 @@ function Details:InstanceWallpaper (texture, anchor, alpha, texcoord, width, hei wallpaper.overlay = overlay t:Show() - --t:SetAlpha (alpha) + --t:SetAlpha(alpha) Details.FadeHandler.Fader (t, "ALPHAANIM", alpha) end @@ -5303,12 +5287,12 @@ function Details:InstanceButtonsColors (red, green, blue, alpha, no_save, only_l local icons = {baseToolbar.modo_selecao, baseToolbar.segmento, baseToolbar.atributo, baseToolbar.report, baseToolbar.fechar, baseToolbar.reset, baseToolbar.fechar} for _, button in ipairs (icons) do - button:SetAlpha (alpha) + button:SetAlpha(alpha) end if (self:IsLowerInstance()) then for _, ThisButton in ipairs (Details.ToolBar.Shown) do - ThisButton:SetAlpha (alpha) + ThisButton:SetAlpha(alpha) end end @@ -5317,12 +5301,12 @@ function Details:InstanceButtonsColors (red, green, blue, alpha, no_save, only_l local icons = {baseToolbar.modo_selecao, baseToolbar.segmento, baseToolbar.atributo, baseToolbar.report, baseToolbar.fechar, baseToolbar.reset, baseToolbar.fechar} for _, button in ipairs (icons) do - button:SetAlpha (alpha) + button:SetAlpha(alpha) end if (self:IsLowerInstance()) then for _, ThisButton in ipairs (Details.ToolBar.Shown) do - ThisButton:SetAlpha (alpha) + ThisButton:SetAlpha(alpha) end end @@ -5330,20 +5314,20 @@ function Details:InstanceButtonsColors (red, green, blue, alpha, no_save, only_l end function Details:InstanceAlpha (alpha) - self.baseframe.cabecalho.ball_r:SetAlpha (alpha) - self.baseframe.cabecalho.ball:SetAlpha (alpha) + self.baseframe.cabecalho.ball_r:SetAlpha(alpha) + self.baseframe.cabecalho.ball:SetAlpha(alpha) local skin = Details.skins [self.skin] if (not skin.icon_ignore_alpha) then - self.baseframe.cabecalho.atributo_icon:SetAlpha (alpha) + self.baseframe.cabecalho.atributo_icon:SetAlpha(alpha) end - self.baseframe.cabecalho.emenda:SetAlpha (alpha) - self.baseframe.cabecalho.top_bg:SetAlpha (alpha) - self.baseframe.barra_esquerda:SetAlpha (alpha) - self.baseframe.barra_direita:SetAlpha (alpha) - self.baseframe.barra_fundo:SetAlpha (alpha) - self.baseframe.UPFrame:SetAlpha (alpha) + self.baseframe.cabecalho.emenda:SetAlpha(alpha) + self.baseframe.cabecalho.top_bg:SetAlpha(alpha) + self.baseframe.barra_esquerda:SetAlpha(alpha) + self.baseframe.barra_direita:SetAlpha(alpha) + self.baseframe.barra_fundo:SetAlpha(alpha) + self.baseframe.UPFrame:SetAlpha(alpha) end function Details:InstanceColor(red, green, blue, alpha, noSave, changeStatusbar) @@ -5413,22 +5397,22 @@ function Details:StatusBarAlert (text, icon, color, time) if (text) then if (type (text) == "table") then if (text.color) then - statusbar.text:SetTextColor (gump:ParseColors (text.color)) + statusbar.text:SetTextColor(gump:ParseColors (text.color)) else - statusbar.text:SetTextColor (1, 1, 1, 1) + statusbar.text:SetTextColor(1, 1, 1, 1) end statusbar.text:SetText (text.text or "") if (text.size) then - Details:SetFontSize (statusbar.text, text.size) + Details:SetFontSize(statusbar.text, text.size) else - Details:SetFontSize (statusbar.text, 9) + Details:SetFontSize(statusbar.text, 9) end else statusbar.text:SetText (text) - statusbar.text:SetTextColor (1, 1, 1, 1) - Details:SetFontSize (statusbar.text, 9) + statusbar.text:SetTextColor(1, 1, 1, 1) + Details:SetFontSize(statusbar.text, 9) end else statusbar.text:SetText ("") @@ -5437,20 +5421,20 @@ function Details:StatusBarAlert (text, icon, color, time) if (icon) then if (type (icon) == "table") then local texture, w, h, l, r, t, b = unpack(icon) - statusbar.icon:SetTexture (texture) - statusbar.icon:SetWidth (w or 14) - statusbar.icon:SetHeight (h or 14) + statusbar.icon:SetTexture(texture) + statusbar.icon:SetWidth(w or 14) + statusbar.icon:SetHeight(h or 14) if (l and r and t and b) then - statusbar.icon:SetTexCoord (l, r, t, b) + statusbar.icon:SetTexCoord(l, r, t, b) end else - statusbar.icon:SetTexture (icon) - statusbar.icon:SetWidth (14) - statusbar.icon:SetHeight (14) - statusbar.icon:SetTexCoord (0, 1, 0, 1) + statusbar.icon:SetTexture(icon) + statusbar.icon:SetWidth(14) + statusbar.icon:SetHeight(14) + statusbar.icon:SetTexCoord(0, 1, 0, 1) end else - statusbar.icon:SetTexture ("") + statusbar.icon:SetTexture("") end if (color) then @@ -5476,71 +5460,71 @@ function gump:CriaRodape (baseframe, instancia) --> esquerdo com statusbar baseframe.rodape.esquerdo = instancia.floatingframe:CreateTexture (nil, "overlay") - baseframe.rodape.esquerdo:SetPoint ("topright", baseframe, "bottomleft", 16, 0) - baseframe.rodape.esquerdo:SetTexture (DEFAULT_SKIN) - baseframe.rodape.esquerdo:SetTexCoord (unpack(COORDS_PIN_LEFT)) - baseframe.rodape.esquerdo:SetWidth (32) - baseframe.rodape.esquerdo:SetHeight (32) + baseframe.rodape.esquerdo:SetPoint("topright", baseframe, "bottomleft", 16, 0) + baseframe.rodape.esquerdo:SetTexture(DEFAULT_SKIN) + baseframe.rodape.esquerdo:SetTexCoord(unpack(COORDS_PIN_LEFT)) + baseframe.rodape.esquerdo:SetWidth(32) + baseframe.rodape.esquerdo:SetHeight(32) --> esquerdo sem statusbar baseframe.rodape.esquerdo_nostatusbar = instancia.floatingframe:CreateTexture (nil, "overlay") - baseframe.rodape.esquerdo_nostatusbar:SetPoint ("topright", baseframe, "bottomleft", 16, 14) - baseframe.rodape.esquerdo_nostatusbar:SetTexture (DEFAULT_SKIN) - baseframe.rodape.esquerdo_nostatusbar:SetTexCoord (unpack(COORDS_PIN_LEFT)) - baseframe.rodape.esquerdo_nostatusbar:SetWidth (32) - baseframe.rodape.esquerdo_nostatusbar:SetHeight (32) + baseframe.rodape.esquerdo_nostatusbar:SetPoint("topright", baseframe, "bottomleft", 16, 14) + baseframe.rodape.esquerdo_nostatusbar:SetTexture(DEFAULT_SKIN) + baseframe.rodape.esquerdo_nostatusbar:SetTexCoord(unpack(COORDS_PIN_LEFT)) + baseframe.rodape.esquerdo_nostatusbar:SetWidth(32) + baseframe.rodape.esquerdo_nostatusbar:SetHeight(32) --> direito com statusbar baseframe.rodape.direita = instancia.floatingframe:CreateTexture (nil, "overlay") - baseframe.rodape.direita:SetPoint ("topleft", baseframe, "bottomright", -16, 0) - baseframe.rodape.direita:SetTexture (DEFAULT_SKIN) - baseframe.rodape.direita:SetTexCoord (unpack(COORDS_PIN_RIGHT)) - baseframe.rodape.direita:SetWidth (32) - baseframe.rodape.direita:SetHeight (32) + baseframe.rodape.direita:SetPoint("topleft", baseframe, "bottomright", -16, 0) + baseframe.rodape.direita:SetTexture(DEFAULT_SKIN) + baseframe.rodape.direita:SetTexCoord(unpack(COORDS_PIN_RIGHT)) + baseframe.rodape.direita:SetWidth(32) + baseframe.rodape.direita:SetHeight(32) --> direito sem statusbar baseframe.rodape.direita_nostatusbar = instancia.floatingframe:CreateTexture (nil, "overlay") - baseframe.rodape.direita_nostatusbar:SetPoint ("topleft", baseframe, "bottomright", -16, 14) - baseframe.rodape.direita_nostatusbar:SetTexture (DEFAULT_SKIN) - baseframe.rodape.direita_nostatusbar:SetTexCoord (unpack(COORDS_PIN_RIGHT)) - baseframe.rodape.direita_nostatusbar:SetWidth (32) - baseframe.rodape.direita_nostatusbar:SetHeight (32) + baseframe.rodape.direita_nostatusbar:SetPoint("topleft", baseframe, "bottomright", -16, 14) + baseframe.rodape.direita_nostatusbar:SetTexture(DEFAULT_SKIN) + baseframe.rodape.direita_nostatusbar:SetTexCoord(unpack(COORDS_PIN_RIGHT)) + baseframe.rodape.direita_nostatusbar:SetWidth(32) + baseframe.rodape.direita_nostatusbar:SetHeight(32) --> barra centro baseframe.rodape.top_bg = baseframe:CreateTexture (nil, "background") - baseframe.rodape.top_bg:SetTexture (DEFAULT_SKIN) - baseframe.rodape.top_bg:SetTexCoord (unpack(COORDS_BOTTOM_BACKGROUND)) - baseframe.rodape.top_bg:SetWidth (512) - baseframe.rodape.top_bg:SetHeight (128) - baseframe.rodape.top_bg:SetPoint ("left", baseframe.rodape.esquerdo, "right", -16, -48) - baseframe.rodape.top_bg:SetPoint ("right", baseframe.rodape.direita, "left", 16, -48) + baseframe.rodape.top_bg:SetTexture(DEFAULT_SKIN) + baseframe.rodape.top_bg:SetTexCoord(unpack(COORDS_BOTTOM_BACKGROUND)) + baseframe.rodape.top_bg:SetWidth(512) + baseframe.rodape.top_bg:SetHeight(128) + baseframe.rodape.top_bg:SetPoint("left", baseframe.rodape.esquerdo, "right", -16, -48) + baseframe.rodape.top_bg:SetPoint("right", baseframe.rodape.direita, "left", 16, -48) local StatusBarLeftAnchor = CreateFrame ("frame", "DetailsStatusBarAnchorLeft" .. instancia.meu_id, baseframe) - StatusBarLeftAnchor:SetPoint ("left", baseframe.rodape.top_bg, "left", 5, 57) - StatusBarLeftAnchor:SetWidth (1) - StatusBarLeftAnchor:SetHeight (1) + StatusBarLeftAnchor:SetPoint("left", baseframe.rodape.top_bg, "left", 5, 57) + StatusBarLeftAnchor:SetWidth(1) + StatusBarLeftAnchor:SetHeight(1) baseframe.rodape.StatusBarLeftAnchor = StatusBarLeftAnchor local StatusBarCenterAnchor = CreateFrame ("frame", "DetailsStatusBarAnchorCenter" .. instancia.meu_id, baseframe) - StatusBarCenterAnchor:SetPoint ("center", baseframe.rodape.top_bg, "center", 0, 57) - StatusBarCenterAnchor:SetWidth (1) - StatusBarCenterAnchor:SetHeight (1) + StatusBarCenterAnchor:SetPoint("center", baseframe.rodape.top_bg, "center", 0, 57) + StatusBarCenterAnchor:SetWidth(1) + StatusBarCenterAnchor:SetHeight(1) baseframe.rodape.StatusBarCenterAnchor = StatusBarCenterAnchor --> display frame baseframe.statusbar = CreateFrame ("frame", "DetailsStatusBar" .. instancia.meu_id, instancia.floatingframe,"BackdropTemplate") - baseframe.statusbar:SetFrameLevel (instancia.floatingframe:GetFrameLevel()+2) - baseframe.statusbar:SetPoint ("left", baseframe.rodape.esquerdo, "right", -13, 10) - baseframe.statusbar:SetPoint ("right", baseframe.rodape.direita, "left", 13, 10) - baseframe.statusbar:SetHeight (14) + baseframe.statusbar:SetFrameLevel(instancia.floatingframe:GetFrameLevel()+2) + baseframe.statusbar:SetPoint("left", baseframe.rodape.esquerdo, "right", -13, 10) + baseframe.statusbar:SetPoint("right", baseframe.rodape.direita, "left", 13, 10) + baseframe.statusbar:SetHeight(14) local statusbar_icon = baseframe.statusbar:CreateTexture (nil, "overlay") - statusbar_icon:SetWidth (14) - statusbar_icon:SetHeight (14) - statusbar_icon:SetPoint ("left", baseframe.statusbar, "left") + statusbar_icon:SetWidth(14) + statusbar_icon:SetHeight(14) + statusbar_icon:SetPoint("left", baseframe.statusbar, "left") - local statusbar_text = baseframe.statusbar:CreateFontString (nil, "overlay", "GameFontNormal") - statusbar_text:SetPoint ("left", statusbar_icon, "right", 2, 0) + local statusbar_text = baseframe.statusbar:CreateFontString(nil, "overlay", "GameFontNormal") + statusbar_text:SetPoint("left", statusbar_icon, "right", 2, 0) baseframe.statusbar:SetBackdrop ({ bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16, @@ -5555,12 +5539,12 @@ function gump:CriaRodape (baseframe, instancia) --> frame invis�vel baseframe.DOWNFrame = CreateFrame ("frame", "DetailsDownFrame" .. instancia.meu_id, baseframe) - baseframe.DOWNFrame:SetPoint ("left", baseframe.rodape.esquerdo, "right", 0, 10) - baseframe.DOWNFrame:SetPoint ("right", baseframe.rodape.direita, "left", 0, 10) - baseframe.DOWNFrame:SetHeight (14) + baseframe.DOWNFrame:SetPoint("left", baseframe.rodape.esquerdo, "right", 0, 10) + baseframe.DOWNFrame:SetPoint("right", baseframe.rodape.direita, "left", 0, 10) + baseframe.DOWNFrame:SetHeight(14) baseframe.DOWNFrame:Show() - baseframe.DOWNFrame:EnableMouse (true) + baseframe.DOWNFrame:EnableMouse(true) baseframe.DOWNFrame:SetMovable (true) baseframe.DOWNFrame:SetResizable (true) @@ -5736,15 +5720,15 @@ function Details:ToolbarMenuSetButtons (_mode, _segment, _attributes, _report, _ if (self.menu_icons [index]) then button:ClearAllPoints() if (got_anchor) then - button:SetPoint ("left", self.lastIcon.widget or self.lastIcon, "right", space, 0) + button:SetPoint("left", self.lastIcon.widget or self.lastIcon, "right", space, 0) else - button:SetPoint (point1, anchor_frame, point2) + button:SetPoint(point1, anchor_frame, point2) got_anchor = button self.firstIcon = button end self.lastIcon = button button:SetParent (self.baseframe) - button:SetFrameLevel (self.baseframe.UPFrame:GetFrameLevel()+1) + button:SetFrameLevel(self.baseframe.UPFrame:GetFrameLevel()+1) button:Show() button:SetSize (16*size, 16*size) @@ -5766,15 +5750,15 @@ function Details:ToolbarMenuSetButtons (_mode, _segment, _attributes, _report, _ if (self.menu_icons [index]) then button:ClearAllPoints() if (got_anchor) then - button:SetPoint ("right", self.lastIcon.widget or self.lastIcon, "left", -space, 0) + button:SetPoint("right", self.lastIcon.widget or self.lastIcon, "left", -space, 0) else - button:SetPoint (point1, anchor_frame, point2) + button:SetPoint(point1, anchor_frame, point2) got_anchor = button self.firstIcon = button end self.lastIcon = button button:SetParent (self.baseframe) - button:SetFrameLevel (self.baseframe.UPFrame:GetFrameLevel()+1) + button:SetFrameLevel(self.baseframe.UPFrame:GetFrameLevel()+1) button:Show() button:SetSize (16*size, 16*size) @@ -5795,11 +5779,11 @@ function Details:ToolbarMenuSetButtons (_mode, _segment, _attributes, _report, _ local pluginFirstIcon = true if (not self.baseframe.cabecalho.PluginIconsSeparator) then self.baseframe.cabecalho.PluginIconsSeparator = self.baseframe:CreateTexture (nil, "overlay") - self.baseframe.cabecalho.PluginIconsSeparator:SetTexture ([[Interface\FriendsFrame\StatusIcon-Offline]]) + self.baseframe.cabecalho.PluginIconsSeparator:SetTexture([[Interface\FriendsFrame\StatusIcon-Offline]]) local color = 0 - self.baseframe.cabecalho.PluginIconsSeparator:SetVertexColor (color, color, color) - self.baseframe.cabecalho.PluginIconsSeparator:SetAlpha (0.2) + self.baseframe.cabecalho.PluginIconsSeparator:SetVertexColor(color, color, color) + self.baseframe.cabecalho.PluginIconsSeparator:SetAlpha(0.2) local scale = 0.4 self.baseframe.cabecalho.PluginIconsSeparator:SetSize (16 * scale, 16 * scale) @@ -5833,11 +5817,11 @@ function Details:ToolbarMenuSetButtons (_mode, _segment, _attributes, _report, _ if (pluginFirstIcon) then temp_space = temp_space / 3 - self.baseframe.cabecalho.PluginIconsSeparator:SetPoint ("left", last_plugin_icon or self.lastIcon.widget or self.lastIcon, "right", temp_space, 0) + self.baseframe.cabecalho.PluginIconsSeparator:SetPoint("left", last_plugin_icon or self.lastIcon.widget or self.lastIcon, "right", temp_space, 0) self.lastIcon = self.baseframe.cabecalho.PluginIconsSeparator end - button:SetPoint ("left", self.lastIcon.widget or self.lastIcon, "right", temp_space, 0) + button:SetPoint("left", self.lastIcon.widget or self.lastIcon, "right", temp_space, 0) elseif (self.menu_anchor.side == 2) then --right @@ -5845,11 +5829,11 @@ function Details:ToolbarMenuSetButtons (_mode, _segment, _attributes, _report, _ if (pluginFirstIcon) then temp_space = temp_space / 3 - self.baseframe.cabecalho.PluginIconsSeparator:SetPoint ("left", last_plugin_icon or self.firstIcon.widget or self.firstIcon, "right", temp_space, 0) + self.baseframe.cabecalho.PluginIconsSeparator:SetPoint("left", last_plugin_icon or self.firstIcon.widget or self.firstIcon, "right", temp_space, 0) self.lastIcon = self.baseframe.cabecalho.PluginIconsSeparator end - button:SetPoint ("left", last_plugin_icon or self.lastIcon.widget or self.firstIcon, "right", temp_space, 0) + button:SetPoint("left", last_plugin_icon or self.lastIcon.widget or self.firstIcon, "right", temp_space, 0) end @@ -5860,11 +5844,11 @@ function Details:ToolbarMenuSetButtons (_mode, _segment, _attributes, _report, _ if (pluginFirstIcon) then temp_space = temp_space / 3 - self.baseframe.cabecalho.PluginIconsSeparator:SetPoint ("right", last_plugin_icon or self.firstIcon.widget or self.firstIcon, "left", -temp_space, 0) + self.baseframe.cabecalho.PluginIconsSeparator:SetPoint("right", last_plugin_icon or self.firstIcon.widget or self.firstIcon, "left", -temp_space, 0) self.lastIcon = self.baseframe.cabecalho.PluginIconsSeparator end - button:SetPoint ("right", last_plugin_icon or self.lastIcon.widget or self.firstIcon, "left", -temp_space, 0) + button:SetPoint("right", last_plugin_icon or self.lastIcon.widget or self.firstIcon, "left", -temp_space, 0) elseif (self.menu_anchor.side == 2) then --right @@ -5872,18 +5856,18 @@ function Details:ToolbarMenuSetButtons (_mode, _segment, _attributes, _report, _ if (pluginFirstIcon) then temp_space = temp_space / 3 - self.baseframe.cabecalho.PluginIconsSeparator:SetPoint ("right", last_plugin_icon or self.lastIcon.widget or self.lastIcon, "left", -temp_space, 0) + self.baseframe.cabecalho.PluginIconsSeparator:SetPoint("right", last_plugin_icon or self.lastIcon.widget or self.lastIcon, "left", -temp_space, 0) self.lastIcon = self.baseframe.cabecalho.PluginIconsSeparator end - button:SetPoint ("right", last_plugin_icon or self.lastIcon.widget or self.firstIcon, "left", -temp_space, 0) + button:SetPoint("right", last_plugin_icon or self.lastIcon.widget or self.firstIcon, "left", -temp_space, 0) end end pluginFirstIcon = false else - button:SetPoint (point1, anchor_frame, point2) + button:SetPoint(point1, anchor_frame, point2) self.firstIcon = button got_anchor = button end @@ -5892,7 +5876,7 @@ function Details:ToolbarMenuSetButtons (_mode, _segment, _attributes, _report, _ last_plugin_icon = button button:SetParent (self.baseframe) - button:SetFrameLevel (self.baseframe.UPFrame:GetFrameLevel()+1) + button:SetFrameLevel(self.baseframe.UPFrame:GetFrameLevel()+1) button:Show() button:SetSize (16*size, 16*size) @@ -5932,7 +5916,7 @@ end local parameters_table = {} -local on_leave_menu = function (self, elapsed) +local on_leave_menu = function(self, elapsed) parameters_table[2] = parameters_table[2] + elapsed if (parameters_table[2] > 0.3) then if (not _G.GameCooltip.mouseOver and not _G.GameCooltip.buttonOver and (not _G.GameCooltip:GetOwner() or _G.GameCooltip:GetOwner() == self)) then @@ -5942,7 +5926,7 @@ local on_leave_menu = function (self, elapsed) end end -local OnClickNovoMenu = function (_, _, id, instance) +local OnClickNovoMenu = function(_, _, id, instance) local is_new if (not Details.tabela_instancias [id]) then @@ -7103,30 +7087,30 @@ function Details:ChangeSkin(skin_name) skin_file = "Interface\\" .. self.skin_custom end - self.baseframe.cabecalho.ball:SetTexture (skin_file) --> bola esquerda - self.baseframe.cabecalho.emenda:SetTexture (skin_file) --> emenda que liga a bola a textura do centro + self.baseframe.cabecalho.ball:SetTexture(skin_file) --> bola esquerda + self.baseframe.cabecalho.emenda:SetTexture(skin_file) --> emenda que liga a bola a textura do centro - self.baseframe.cabecalho.ball_r:SetTexture (skin_file) --> bola direita onde fica o bot�o de fechar - self.baseframe.cabecalho.top_bg:SetTexture (skin_file) --> top background + self.baseframe.cabecalho.ball_r:SetTexture(skin_file) --> bola direita onde fica o bot�o de fechar + self.baseframe.cabecalho.top_bg:SetTexture(skin_file) --> top background - self.baseframe.barra_esquerda:SetTexture (skin_file) --> barra lateral - self.baseframe.barra_direita:SetTexture (skin_file) --> barra lateral - self.baseframe.barra_fundo:SetTexture (skin_file) --> barra inferior + self.baseframe.barra_esquerda:SetTexture(skin_file) --> barra lateral + self.baseframe.barra_direita:SetTexture(skin_file) --> barra lateral + self.baseframe.barra_fundo:SetTexture(skin_file) --> barra inferior - self.baseframe.scroll_up:SetTexture (skin_file) --> scrollbar parte de cima - self.baseframe.scroll_down:SetTexture (skin_file) --> scrollbar parte de baixo - self.baseframe.scroll_middle:SetTexture (skin_file) --> scrollbar parte do meio + self.baseframe.scroll_up:SetTexture(skin_file) --> scrollbar parte de cima + self.baseframe.scroll_down:SetTexture(skin_file) --> scrollbar parte de baixo + self.baseframe.scroll_middle:SetTexture(skin_file) --> scrollbar parte do meio - self.baseframe.rodape.top_bg:SetTexture (skin_file) --> rodape top background - self.baseframe.rodape.esquerdo:SetTexture (skin_file) --> rodape esquerdo - self.baseframe.rodape.direita:SetTexture (skin_file) --> rodape direito - self.baseframe.rodape.esquerdo_nostatusbar:SetTexture (skin_file) --> rodape direito - self.baseframe.rodape.direita_nostatusbar:SetTexture (skin_file) --> rodape direito + self.baseframe.rodape.top_bg:SetTexture(skin_file) --> rodape top background + self.baseframe.rodape.esquerdo:SetTexture(skin_file) --> rodape esquerdo + self.baseframe.rodape.direita:SetTexture(skin_file) --> rodape direito + self.baseframe.rodape.esquerdo_nostatusbar:SetTexture(skin_file) --> rodape direito + self.baseframe.rodape.direita_nostatusbar:SetTexture(skin_file) --> rodape direito - self.baseframe.button_stretch.texture:SetTexture (skin_file) --> bot�o de esticar a janela + self.baseframe.button_stretch.texture:SetTexture(skin_file) --> bot�o de esticar a janela - self.baseframe.resize_direita.texture:SetTexture (skin_file) --> bot�o de redimencionar da direita - self.baseframe.resize_esquerda.texture:SetTexture (skin_file) --> bot�o de redimencionar da esquerda + self.baseframe.resize_direita.texture:SetTexture(skin_file) --> bot�o de redimencionar da direita + self.baseframe.resize_esquerda.texture:SetTexture(skin_file) --> bot�o de redimencionar da esquerda self.break_snap_button:SetNormalTexture (skin_file) --> cadeado self.break_snap_button:SetDisabledTexture (skin_file) @@ -7161,7 +7145,7 @@ function Details:ChangeSkin(skin_name) if (self.modo == 1 or self.modo == 4 or self.atributo == 5) then -- alone e raid local icon_anchor = this_skin.icon_anchor_plugins - self.baseframe.cabecalho.atributo_icon:SetPoint ("topright", self.baseframe.cabecalho.ball_point, "topright", icon_anchor[1], icon_anchor[2]) + self.baseframe.cabecalho.atributo_icon:SetPoint("topright", self.baseframe.cabecalho.ball_point, "topright", icon_anchor[1], icon_anchor[2]) if (self.modo == 1) then if (Details.SoloTables.Plugins [1] and Details.SoloTables.Mode) then local plugin_index = Details.SoloTables.Mode @@ -7180,7 +7164,7 @@ function Details:ChangeSkin(skin_name) end else local icon_anchor = this_skin.icon_anchor_main --> ancora do icone do canto direito superior - self.baseframe.cabecalho.atributo_icon:SetPoint ("topright", self.baseframe.cabecalho.ball_point, "topright", icon_anchor[1], icon_anchor[2]) + self.baseframe.cabecalho.atributo_icon:SetPoint("topright", self.baseframe.cabecalho.ball_point, "topright", icon_anchor[1], icon_anchor[2]) self:ChangeIcon() end @@ -7334,7 +7318,7 @@ end --update the window click through state local updateClickThroughListener = Details:CreateEventListener() function updateClickThroughListener:EnterCombat() - Details:InstanceCall (function (instance) + Details:InstanceCall (function(instance) C_Timer.After (1.5, function() instance:UpdateClickThrough() end) @@ -7342,7 +7326,7 @@ function updateClickThroughListener:EnterCombat() end function updateClickThroughListener:LeaveCombat() - Details:InstanceCall (function (instance) + Details:InstanceCall (function(instance) C_Timer.After (1.5, function() instance:UpdateClickThrough() end) @@ -7806,8 +7790,8 @@ function Details:RefreshAttributeTextSize() local window_width = self:GetSize() if (self.auto_hide_menu.left and not self.is_interacting) then - self.menu_attribute_string:SetWidth (window_width) - self.menu_attribute_string:SetHeight (self.attribute_text.text_size + 2) + self.menu_attribute_string:SetWidth(window_width) + self.menu_attribute_string:SetHeight(self.attribute_text.text_size + 2) return end @@ -7817,8 +7801,8 @@ function Details:RefreshAttributeTextSize() local width_by_buttons = (buttons_shown * buttons_width) + (buttons_spacement * (buttons_shown - 1)) local text_size = window_width - width_by_buttons - 6 - self.menu_attribute_string:SetWidth (text_size) - self.menu_attribute_string:SetHeight (self.attribute_text.text_size + 2) + self.menu_attribute_string:SetWidth(text_size) + self.menu_attribute_string:SetHeight(self.attribute_text.text_size + 2) end end @@ -7860,7 +7844,7 @@ function Details:CheckForTextTimeCounter(combatStart) --called from combat start end end -local formatTime = function (t) +local formatTime = function(t) local m, s = floor(t/60), floor(t%60) if (m < 1) then m = "00" @@ -8084,31 +8068,31 @@ function Details:AttributeMenu (enabled, pos_x, pos_y, font, size, color, side, if (side == 1) then --> a string esta no lado de cima if (self.toolbar_side == 1) then -- a toolbar esta em cima self.menu_attribute_string:ClearAllPoints() - self.menu_attribute_string:SetPoint ("bottomleft", self.baseframe.cabecalho.ball, "bottomright", self.attribute_text.anchor [1], self.attribute_text.anchor [2]) + self.menu_attribute_string:SetPoint("bottomleft", self.baseframe.cabecalho.ball, "bottomright", self.attribute_text.anchor [1], self.attribute_text.anchor [2]) elseif (self.toolbar_side == 2) then --a toolbar esta em baixo self.menu_attribute_string:ClearAllPoints() - self.menu_attribute_string:SetPoint ("bottomleft", self.baseframe, "topleft", self.attribute_text.anchor [1] + 21, self.attribute_text.anchor [2]) + self.menu_attribute_string:SetPoint("bottomleft", self.baseframe, "topleft", self.attribute_text.anchor [1] + 21, self.attribute_text.anchor [2]) end elseif (side == 2) then --> a string esta no lado de baixo if (self.toolbar_side == 1) then --toolbar esta em cima self.menu_attribute_string:ClearAllPoints() - self.menu_attribute_string:SetPoint ("left", self.baseframe.rodape.StatusBarLeftAnchor, "left", self.attribute_text.anchor [1] + 16, self.attribute_text.anchor [2] - 6) + self.menu_attribute_string:SetPoint("left", self.baseframe.rodape.StatusBarLeftAnchor, "left", self.attribute_text.anchor [1] + 16, self.attribute_text.anchor [2] - 6) elseif (self.toolbar_side == 2) then --toolbar esta em baixo - self.menu_attribute_string:SetPoint ("bottomleft", self.baseframe.cabecalho.ball, "topright", self.attribute_text.anchor [1], self.attribute_text.anchor [2] - 19) + self.menu_attribute_string:SetPoint("bottomleft", self.baseframe.cabecalho.ball, "topright", self.attribute_text.anchor [1], self.attribute_text.anchor [2] - 19) end end --font face - local fontPath = SharedMedia:Fetch ("font", font) - Details:SetFontFace (self.menu_attribute_string, fontPath) + local fontPath = SharedMedia:Fetch("font", font) + Details:SetFontFace(self.menu_attribute_string, fontPath) --font size - Details:SetFontSize (self.menu_attribute_string, size) + Details:SetFontSize(self.menu_attribute_string, size) --color Details:SetFontColor (self.menu_attribute_string, color) @@ -8117,7 +8101,7 @@ function Details:AttributeMenu (enabled, pos_x, pos_y, font, size, color, side, end) --shadow - Details:SetFontOutline (self.menu_attribute_string, shadow) + Details:SetFontOutline(self.menu_attribute_string, shadow) --refresh size self:RefreshAttributeTextSize() @@ -8132,7 +8116,7 @@ function Details:SetBackdropTexture (texturename) self.backdrop_texture = texturename - local texture_path = SharedMedia:Fetch ("background", texturename) + local texture_path = SharedMedia:Fetch("background", texturename) self.baseframe:SetBackdrop ({ bgFile = texture_path, tile = true, tileSize = 128, @@ -8250,7 +8234,7 @@ function Details:SetMenuAlpha (enabled, onenter, onleave, ignorebars, interactin self.menu_alpha.ignorebars = ignorebars if (not enabled) then - self.baseframe:SetAlpha (1) + self.baseframe:SetAlpha(1) self.rowframe:SetFrameAlpha(1) self:InstanceAlpha (self.color[4]) self:SetIconAlpha (1, nil, true) @@ -8438,44 +8422,44 @@ function Details:ToolbarSide (side, only_update_anchors) local x, y = unpack(skin.icon_point_anchor) x = x + (anchor_mod) - self.baseframe.cabecalho.ball_point:SetPoint ("bottomleft", self.baseframe, "topleft", x, y) + self.baseframe.cabecalho.ball_point:SetPoint("bottomleft", self.baseframe, "topleft", x, y) --> ball if (self.hide_icon) then - self.baseframe.cabecalho.ball:SetTexCoord (unpack(COORDS_LEFT_BALL_NO_ICON)) - self.baseframe.cabecalho.emenda:SetTexCoord (unpack(COORDS_LEFT_CONNECTOR_NO_ICON)) + self.baseframe.cabecalho.ball:SetTexCoord(unpack(COORDS_LEFT_BALL_NO_ICON)) + self.baseframe.cabecalho.emenda:SetTexCoord(unpack(COORDS_LEFT_CONNECTOR_NO_ICON)) else - self.baseframe.cabecalho.ball:SetTexCoord (unpack(COORDS_LEFT_BALL)) - self.baseframe.cabecalho.emenda:SetTexCoord (unpack(COORDS_LEFT_CONNECTOR)) + self.baseframe.cabecalho.ball:SetTexCoord(unpack(COORDS_LEFT_BALL)) + self.baseframe.cabecalho.emenda:SetTexCoord(unpack(COORDS_LEFT_CONNECTOR)) end self.baseframe.cabecalho.ball:ClearAllPoints() local x, y = unpack(skin.left_corner_anchor) x = x + (anchor_mod) - self.baseframe.cabecalho.ball:SetPoint ("bottomleft", self.baseframe, "topleft", x, y) + self.baseframe.cabecalho.ball:SetPoint("bottomleft", self.baseframe, "topleft", x, y) --> ball r - self.baseframe.cabecalho.ball_r:SetTexCoord (unpack(COORDS_RIGHT_BALL)) + self.baseframe.cabecalho.ball_r:SetTexCoord(unpack(COORDS_RIGHT_BALL)) self.baseframe.cabecalho.ball_r:ClearAllPoints() local x, y = unpack(skin.right_corner_anchor) x = x + ((anchor_mod) * -1) - self.baseframe.cabecalho.ball_r:SetPoint ("bottomright", self.baseframe, "topright", x, y) + self.baseframe.cabecalho.ball_r:SetPoint("bottomright", self.baseframe, "topright", x, y) --> tex coords - self.baseframe.cabecalho.top_bg:SetTexCoord (unpack(COORDS_TOP_BACKGROUND)) + self.baseframe.cabecalho.top_bg:SetTexCoord(unpack(COORDS_TOP_BACKGROUND)) --> up frames - self.baseframe.UPFrame:SetPoint ("left", self.baseframe.cabecalho.ball, "right", 0, -53) - self.baseframe.UPFrame:SetPoint ("right", self.baseframe.cabecalho.ball_r, "left", 0, -53) + self.baseframe.UPFrame:SetPoint("left", self.baseframe.cabecalho.ball, "right", 0, -53) + self.baseframe.UPFrame:SetPoint("right", self.baseframe.cabecalho.ball_r, "left", 0, -53) self.baseframe.UPFrameConnect:ClearAllPoints() - self.baseframe.UPFrameConnect:SetPoint ("bottomleft", self.baseframe, "topleft", 0, -1) - self.baseframe.UPFrameConnect:SetPoint ("bottomright", self.baseframe, "topright", 0, -1) + self.baseframe.UPFrameConnect:SetPoint("bottomleft", self.baseframe, "topleft", 0, -1) + self.baseframe.UPFrameConnect:SetPoint("bottomright", self.baseframe, "topright", 0, -1) self.baseframe.UPFrameLeftPart:ClearAllPoints() - self.baseframe.UPFrameLeftPart:SetPoint ("bottomleft", self.baseframe, "topleft", 0, 0) + self.baseframe.UPFrameLeftPart:SetPoint("bottomleft", self.baseframe, "topleft", 0, 0) else --> bottom @@ -8492,42 +8476,42 @@ function Details:ToolbarSide (side, only_update_anchors) local _x, _y = unpack(skin.icon_point_anchor_bottom) _x = _x + (anchor_mod) - self.baseframe.cabecalho.ball_point:SetPoint ("topleft", self.baseframe, "bottomleft", _x, _y + y) + self.baseframe.cabecalho.ball_point:SetPoint("topleft", self.baseframe, "bottomleft", _x, _y + y) --> ball self.baseframe.cabecalho.ball:ClearAllPoints() local _x, _y = unpack(skin.left_corner_anchor_bottom) _x = _x + (anchor_mod) - self.baseframe.cabecalho.ball:SetPoint ("topleft", self.baseframe, "bottomleft", _x, _y + y) + self.baseframe.cabecalho.ball:SetPoint("topleft", self.baseframe, "bottomleft", _x, _y + y) local l, r, t, b = unpack(COORDS_LEFT_BALL) - self.baseframe.cabecalho.ball:SetTexCoord (l, r, b, t) + self.baseframe.cabecalho.ball:SetTexCoord(l, r, b, t) --> ball r self.baseframe.cabecalho.ball_r:ClearAllPoints() local _x, _y = unpack(skin.right_corner_anchor_bottom) _x = _x + ((anchor_mod) * -1) - self.baseframe.cabecalho.ball_r:SetPoint ("topright", self.baseframe, "bottomright", _x, _y + y) + self.baseframe.cabecalho.ball_r:SetPoint("topright", self.baseframe, "bottomright", _x, _y + y) local l, r, t, b = unpack(COORDS_RIGHT_BALL) - self.baseframe.cabecalho.ball_r:SetTexCoord (l, r, b, t) + self.baseframe.cabecalho.ball_r:SetTexCoord(l, r, b, t) --> tex coords local l, r, t, b = unpack(COORDS_LEFT_CONNECTOR) - self.baseframe.cabecalho.emenda:SetTexCoord (l, r, b, t) + self.baseframe.cabecalho.emenda:SetTexCoord(l, r, b, t) local l, r, t, b = unpack(COORDS_TOP_BACKGROUND) - self.baseframe.cabecalho.top_bg:SetTexCoord (l, r, b, t) + self.baseframe.cabecalho.top_bg:SetTexCoord(l, r, b, t) --> up frames - self.baseframe.UPFrame:SetPoint ("left", self.baseframe.cabecalho.ball, "right", 0, 53) - self.baseframe.UPFrame:SetPoint ("right", self.baseframe.cabecalho.ball_r, "left", 0, 53) + self.baseframe.UPFrame:SetPoint("left", self.baseframe.cabecalho.ball, "right", 0, 53) + self.baseframe.UPFrame:SetPoint("right", self.baseframe.cabecalho.ball_r, "left", 0, 53) self.baseframe.UPFrameConnect:ClearAllPoints() - self.baseframe.UPFrameConnect:SetPoint ("topleft", self.baseframe, "bottomleft", 0, 1) - self.baseframe.UPFrameConnect:SetPoint ("topright", self.baseframe, "bottomright", 0, 1) + self.baseframe.UPFrameConnect:SetPoint("topleft", self.baseframe, "bottomleft", 0, 1) + self.baseframe.UPFrameConnect:SetPoint("topright", self.baseframe, "bottomright", 0, 1) self.baseframe.UPFrameLeftPart:ClearAllPoints() - self.baseframe.UPFrameLeftPart:SetPoint ("topleft", self.baseframe, "bottomleft", 0, 0) + self.baseframe.UPFrameLeftPart:SetPoint("topleft", self.baseframe, "bottomleft", 0, 0) end @@ -8584,9 +8568,9 @@ function Details:StretchButtonAnchor (side) y = -20 end - self.baseframe.button_stretch:SetPoint ("bottom", self.baseframe, "top", 0, 20 + y) - self.baseframe.button_stretch:SetPoint ("right", self.baseframe, "right", -27, 0) - self.baseframe.button_stretch.texture:SetTexCoord (unpack(COORDS_STRETCH)) + self.baseframe.button_stretch:SetPoint("bottom", self.baseframe, "top", 0, 20 + y) + self.baseframe.button_stretch:SetPoint("right", self.baseframe, "right", -27, 0) + self.baseframe.button_stretch.texture:SetTexCoord(unpack(COORDS_STRETCH)) self.stretch_button_side = 1 elseif (side == 2 or string.lower (side) == "bottom") then @@ -8601,11 +8585,11 @@ function Details:StretchButtonAnchor (side) y = y -14 end - self.baseframe.button_stretch:SetPoint ("center", self.baseframe, "center") - self.baseframe.button_stretch:SetPoint ("top", self.baseframe, "bottom", 0, y) + self.baseframe.button_stretch:SetPoint("center", self.baseframe, "center") + self.baseframe.button_stretch:SetPoint("top", self.baseframe, "bottom", 0, y) local l, r, t, b = unpack(COORDS_STRETCH) - self.baseframe.button_stretch.texture:SetTexCoord (r, l, b, t) + self.baseframe.button_stretch.texture:SetTexCoord(r, l, b, t) self.stretch_button_side = 2 @@ -8642,10 +8626,10 @@ function Details:MenuAnchor (x, y) menu_points [1]:ClearAllPoints() if (self.toolbar_side == 1) then --> top - menu_points [1]:SetPoint ("bottomleft", self.baseframe.cabecalho.ball, "bottomright", x, y) -- y+2 + menu_points [1]:SetPoint("bottomleft", self.baseframe.cabecalho.ball, "bottomright", x, y) -- y+2 else --> bottom - menu_points [1]:SetPoint ("topleft", self.baseframe.cabecalho.ball, "topright", x, (y*-1) - 4) + menu_points [1]:SetPoint("topleft", self.baseframe.cabecalho.ball, "topright", x, (y*-1) - 4) end @@ -8654,10 +8638,10 @@ function Details:MenuAnchor (x, y) menu_points [2]:ClearAllPoints() if (self.toolbar_side == 1) then --> top - menu_points [2]:SetPoint ("topleft", self.baseframe.cabecalho.ball_r, "bottomleft", x, y+16) + menu_points [2]:SetPoint("topleft", self.baseframe.cabecalho.ball_r, "bottomleft", x, y+16) else --> bottom - menu_points [2]:SetPoint ("topleft", self.baseframe.cabecalho.ball_r, "topleft", x, (y*-1) - 4) + menu_points [2]:SetPoint("topleft", self.baseframe.cabecalho.ball_r, "topleft", x, (y*-1) - 4) end end @@ -8677,14 +8661,14 @@ function Details:HideMainIcon (value) Details.FadeHandler.Fader (self.baseframe.cabecalho.atributo_icon, 1) if (self.toolbar_side == 1) then - self.baseframe.cabecalho.ball:SetTexCoord (unpack(COORDS_LEFT_BALL_NO_ICON)) - self.baseframe.cabecalho.emenda:SetTexCoord (unpack(COORDS_LEFT_CONNECTOR_NO_ICON)) + self.baseframe.cabecalho.ball:SetTexCoord(unpack(COORDS_LEFT_BALL_NO_ICON)) + self.baseframe.cabecalho.emenda:SetTexCoord(unpack(COORDS_LEFT_CONNECTOR_NO_ICON)) elseif (self.toolbar_side == 2) then local l, r, t, b = unpack(COORDS_LEFT_BALL_NO_ICON) - self.baseframe.cabecalho.ball:SetTexCoord (l, r, b, t) + self.baseframe.cabecalho.ball:SetTexCoord(l, r, b, t) local l, r, t, b = unpack(COORDS_LEFT_CONNECTOR_NO_ICON) - self.baseframe.cabecalho.emenda:SetTexCoord (l, r, b, t) + self.baseframe.cabecalho.emenda:SetTexCoord(l, r, b, t) end local skin = Details.skins [self.skin] @@ -8701,15 +8685,15 @@ function Details:HideMainIcon (value) if (self.toolbar_side == 1) then - self.baseframe.cabecalho.ball:SetTexCoord (unpack(COORDS_LEFT_BALL)) - self.baseframe.cabecalho.emenda:SetTexCoord (unpack(COORDS_LEFT_CONNECTOR)) + self.baseframe.cabecalho.ball:SetTexCoord(unpack(COORDS_LEFT_BALL)) + self.baseframe.cabecalho.emenda:SetTexCoord(unpack(COORDS_LEFT_CONNECTOR)) elseif (self.toolbar_side == 2) then local l, r, t, b = unpack(COORDS_LEFT_BALL) - self.baseframe.cabecalho.ball:SetTexCoord (l, r, b, t) + self.baseframe.cabecalho.ball:SetTexCoord(l, r, b, t) local l, r, t, b = unpack(COORDS_LEFT_CONNECTOR) - self.baseframe.cabecalho.emenda:SetTexCoord (l, r, b, t) + self.baseframe.cabecalho.emenda:SetTexCoord(l, r, b, t) end end end @@ -8724,32 +8708,32 @@ function Details:DesaturateMenu (value) if (value) then self.desaturated_menu = true - self.baseframe.cabecalho.modo_selecao:GetNormalTexture():SetDesaturated (true) - self.baseframe.cabecalho.segmento:GetNormalTexture():SetDesaturated (true) - self.baseframe.cabecalho.atributo:GetNormalTexture():SetDesaturated (true) - self.baseframe.cabecalho.report:GetNormalTexture():SetDesaturated (true) - self.baseframe.cabecalho.reset:GetNormalTexture():SetDesaturated (true) - self.baseframe.cabecalho.fechar:GetNormalTexture():SetDesaturated (true) + self.baseframe.cabecalho.modo_selecao:GetNormalTexture():SetDesaturated(true) + self.baseframe.cabecalho.segmento:GetNormalTexture():SetDesaturated(true) + self.baseframe.cabecalho.atributo:GetNormalTexture():SetDesaturated(true) + self.baseframe.cabecalho.report:GetNormalTexture():SetDesaturated(true) + self.baseframe.cabecalho.reset:GetNormalTexture():SetDesaturated(true) + self.baseframe.cabecalho.fechar:GetNormalTexture():SetDesaturated(true) if (self.meu_id == Details:GetLowerInstanceNumber()) then for _, button in ipairs (Details.ToolBar.AllButtons) do - button:GetNormalTexture():SetDesaturated (true) + button:GetNormalTexture():SetDesaturated(true) end end else self.desaturated_menu = false - self.baseframe.cabecalho.modo_selecao:GetNormalTexture():SetDesaturated (false) - self.baseframe.cabecalho.segmento:GetNormalTexture():SetDesaturated (false) - self.baseframe.cabecalho.atributo:GetNormalTexture():SetDesaturated (false) - self.baseframe.cabecalho.report:GetNormalTexture():SetDesaturated (false) - self.baseframe.cabecalho.reset:GetNormalTexture():SetDesaturated (false) - self.baseframe.cabecalho.fechar:GetNormalTexture():SetDesaturated (false) + self.baseframe.cabecalho.modo_selecao:GetNormalTexture():SetDesaturated(false) + self.baseframe.cabecalho.segmento:GetNormalTexture():SetDesaturated(false) + self.baseframe.cabecalho.atributo:GetNormalTexture():SetDesaturated(false) + self.baseframe.cabecalho.report:GetNormalTexture():SetDesaturated(false) + self.baseframe.cabecalho.reset:GetNormalTexture():SetDesaturated(false) + self.baseframe.cabecalho.fechar:GetNormalTexture():SetDesaturated(false) if (self.meu_id == Details:GetLowerInstanceNumber()) then for _, button in ipairs (Details.ToolBar.AllButtons) do - button:GetNormalTexture():SetDesaturated (false) + button:GetNormalTexture():SetDesaturated(false) end end @@ -8777,36 +8761,36 @@ function Details:ShowSideBars (instancia) end if (self.show_statusbar) then - self.baseframe.barra_esquerda:SetPoint ("bottomleft", self.baseframe, "bottomleft", -56, -14) - self.baseframe.barra_direita:SetPoint ("bottomright", self.baseframe, "bottomright", 56, -14) + self.baseframe.barra_esquerda:SetPoint("bottomleft", self.baseframe, "bottomleft", -56, -14) + self.baseframe.barra_direita:SetPoint("bottomright", self.baseframe, "bottomright", 56, -14) if (self.toolbar_side == 2) then self.baseframe.barra_fundo:Show() local l, r, t, b = unpack(COORDS_BOTTOM_SIDE_BAR) - self.baseframe.barra_fundo:SetTexCoord (l, r, b, t) + self.baseframe.barra_fundo:SetTexCoord(l, r, b, t) self.baseframe.barra_fundo:ClearAllPoints() - self.baseframe.barra_fundo:SetPoint ("bottomleft", self.baseframe, "topleft", 0, -6) - self.baseframe.barra_fundo:SetPoint ("bottomright", self.baseframe, "topright", -1, -6) + self.baseframe.barra_fundo:SetPoint("bottomleft", self.baseframe, "topleft", 0, -6) + self.baseframe.barra_fundo:SetPoint("bottomright", self.baseframe, "topright", -1, -6) else self.baseframe.barra_fundo:Hide() end else - self.baseframe.barra_esquerda:SetPoint ("bottomleft", self.baseframe, "bottomleft", -56, 0) - self.baseframe.barra_direita:SetPoint ("bottomright", self.baseframe, "bottomright", 56, 0) + self.baseframe.barra_esquerda:SetPoint("bottomleft", self.baseframe, "bottomleft", -56, 0) + self.baseframe.barra_direita:SetPoint("bottomright", self.baseframe, "bottomright", 56, 0) self.baseframe.barra_fundo:Show() if (self.toolbar_side == 2) then --tooltbar on bottom local l, r, t, b = unpack(COORDS_BOTTOM_SIDE_BAR) - self.baseframe.barra_fundo:SetTexCoord (l, r, b, t) + self.baseframe.barra_fundo:SetTexCoord(l, r, b, t) self.baseframe.barra_fundo:ClearAllPoints() - self.baseframe.barra_fundo:SetPoint ("bottomleft", self.baseframe, "topleft", 0, -6) - self.baseframe.barra_fundo:SetPoint ("bottomright", self.baseframe, "topright", -1, -6) + self.baseframe.barra_fundo:SetPoint("bottomleft", self.baseframe, "topleft", 0, -6) + self.baseframe.barra_fundo:SetPoint("bottomright", self.baseframe, "topright", -1, -6) else --tooltbar on top - self.baseframe.barra_fundo:SetTexCoord (unpack(COORDS_BOTTOM_SIDE_BAR)) + self.baseframe.barra_fundo:SetTexCoord(unpack(COORDS_BOTTOM_SIDE_BAR)) self.baseframe.barra_fundo:ClearAllPoints() - self.baseframe.barra_fundo:SetPoint ("bottomleft", self.baseframe, "bottomleft", 0, -56) - self.baseframe.barra_fundo:SetPoint ("bottomright", self.baseframe, "bottomright", -1, -56) + self.baseframe.barra_fundo:SetPoint("bottomleft", self.baseframe, "bottomleft", 0, -56) + self.baseframe.barra_fundo:SetPoint("bottomright", self.baseframe, "bottomright", -1, -56) end end @@ -8899,16 +8883,16 @@ function Details:StatusBarColor (r, g, b, a, no_save) self.statusbar_info.alpha = a end - self.baseframe.rodape.esquerdo:SetVertexColor (r, g, b) - self.baseframe.rodape.esquerdo:SetAlpha (a) - self.baseframe.rodape.direita:SetVertexColor (r, g, b) - self.baseframe.rodape.direita:SetAlpha (a) - self.baseframe.rodape.direita_nostatusbar:SetVertexColor (r, g, b) - self.baseframe.rodape.esquerdo_nostatusbar:SetVertexColor (r, g, b) - self.baseframe.rodape.direita_nostatusbar:SetAlpha (a) - self.baseframe.rodape.esquerdo_nostatusbar:SetAlpha (a) - self.baseframe.rodape.top_bg:SetVertexColor (r, g, b) - self.baseframe.rodape.top_bg:SetAlpha (a) + self.baseframe.rodape.esquerdo:SetVertexColor(r, g, b) + self.baseframe.rodape.esquerdo:SetAlpha(a) + self.baseframe.rodape.direita:SetVertexColor(r, g, b) + self.baseframe.rodape.direita:SetAlpha(a) + self.baseframe.rodape.direita_nostatusbar:SetVertexColor(r, g, b) + self.baseframe.rodape.esquerdo_nostatusbar:SetVertexColor(r, g, b) + self.baseframe.rodape.direita_nostatusbar:SetAlpha(a) + self.baseframe.rodape.esquerdo_nostatusbar:SetAlpha(a) + self.baseframe.rodape.top_bg:SetVertexColor(r, g, b) + self.baseframe.rodape.top_bg:SetAlpha(a) end @@ -8959,13 +8943,13 @@ function Details:SetTooltipBackdrop (border_texture, border_size, border_color) c[1], c[2], c[3], c[4] = border_color[1], border_color[2], border_color[3], border_color[4] or 1 cc[1], cc[2], cc[3], cc[4] = border_color[1], border_color[2], border_color[3], border_color[4] or 1 - Details.tooltip_backdrop.edgeFile = SharedMedia:Fetch ("border", border_texture) + Details.tooltip_backdrop.edgeFile = SharedMedia:Fetch("border", border_texture) Details.tooltip_backdrop.edgeSize = border_size end --> reset button functions - local reset_button_onenter = function (self, _, forced, from_click) + local reset_button_onenter = function(self, _, forced, from_click) if (Details.instances_menu_click_to_open and not forced) then return @@ -8981,7 +8965,7 @@ end self.instance.baseframe.cabecalho.button_mouse_over = true if (self.instance.desaturated_menu) then - self:GetNormalTexture():SetDesaturated (false) + self:GetNormalTexture():SetDesaturated(false) end gameCooltip:Reset() @@ -9011,11 +8995,11 @@ end gameCooltip:ShowCooltip() end - local reset_button_onleave = function (self) + local reset_button_onleave = function(self) OnLeaveMainWindow (self.instance, self) if (self.instance.desaturated_menu) then - self:GetNormalTexture():SetDesaturated (true) + self:GetNormalTexture():SetDesaturated(true) end hide_anti_overlap (self.instance.baseframe.anti_menu_overlap) @@ -9034,7 +9018,7 @@ end --> close button functions - local close_button_onclick = function (self, button_type, button) + local close_button_onclick = function(self, button_type, button) if (self and not self.instancia and button and button.instancia) then self = button @@ -9058,10 +9042,10 @@ end local panel = gump:Create1PxPanel (UIParent, 600, 100, "|cFFFFFFFFDetails!, the window hit the ground, bang bang...|r", nil, nil, nil, nil) panel:SetBackdropColor (0, 0, 0, 0.9) - panel:SetPoint ("center", UIParent, "center") + panel:SetPoint("center", UIParent, "center") - local s = panel:CreateFontString (nil, "overlay", "GameFontNormal") - s:SetPoint ("center", panel, "center") + local s = panel:CreateFontString(nil, "overlay", "GameFontNormal") + s:SetPoint("center", panel, "center") s:SetText (Loc["STRING_TUTORIAL_FULLY_DELETE_WINDOW"]) panel:Show() @@ -9071,11 +9055,11 @@ end end Details.close_instancia_func = close_button_onclick - local close_button_onenter = function (self) + local close_button_onenter = function(self) OnEnterMainWindow (self.instance, self, 3) if (self.instance.desaturated_menu) then - self:GetNormalTexture():SetDesaturated (false) + self:GetNormalTexture():SetDesaturated(false) end local GameCooltip = GameCooltip @@ -9099,7 +9083,7 @@ end GameCooltip:SetOption("HeighMod", 9) - local font = SharedMedia:Fetch ("font", "Friz Quadrata TT") + local font = SharedMedia:Fetch("font", "Friz Quadrata TT") GameCooltip:AddLine(Loc["STRING_MENU_CLOSE_INSTANCE"], nil, 1, "white", nil, Details.font_sizes.menus, Details.font_faces.menus) GameCooltip:AddIcon([[Interface\Buttons\UI-Panel-MinimizeButton-Up]], 1, 1, 14, 14, 0.2, 0.8, 0.2, 0.8) GameCooltip:AddMenu(1, close_button_onclick, self) @@ -9121,11 +9105,11 @@ end GameCooltip:ShowCooltip() end - local close_button_onleave = function (self) + local close_button_onleave = function(self) OnLeaveMainWindow (self.instance, self, 3) if (self.instance.desaturated_menu) then - self:GetNormalTexture():SetDesaturated (true) + self:GetNormalTexture():SetDesaturated(true) end hide_anti_overlap (self.instance.baseframe.anti_menu_overlap) @@ -9155,7 +9139,7 @@ local menu_can_open = function() end end -local report_on_enter = function (self, motion, forced, from_click) +local report_on_enter = function(self, motion, forced, from_click) local is_cooltip_opened = menu_can_open() -- and not is_cooltip_opened if (Details.instances_menu_click_to_open and not forced) then @@ -9167,7 +9151,7 @@ local report_on_enter = function (self, motion, forced, from_click) OnEnterMainWindow (instancia, self, 3) if (instancia.desaturated_menu) then - self:GetNormalTexture():SetDesaturated (false) + self:GetNormalTexture():SetDesaturated(false) end GameCooltip.buttonOver = true @@ -9219,7 +9203,7 @@ local report_on_enter = function (self, motion, forced, from_click) GameCooltip:ShowCooltip() end -local report_on_leave = function (self, motion, forced, from_click) +local report_on_leave = function(self, motion, forced, from_click) local instancia = self._instance or self.widget._instance local baseframe = instancia.baseframe @@ -9232,7 +9216,7 @@ local report_on_leave = function (self, motion, forced, from_click) baseframe.cabecalho.button_mouse_over = false if (instancia.desaturated_menu) then - self:GetNormalTexture():SetDesaturated (true) + self:GetNormalTexture():SetDesaturated(true) end if (GameCooltip.active) then @@ -9243,7 +9227,7 @@ local report_on_leave = function (self, motion, forced, from_click) end end -local atributo_on_enter = function (self, motion, forced, from_click) +local atributo_on_enter = function(self, motion, forced, from_click) local is_cooltip_opened = menu_can_open() -- and not is_cooltip_opened if (Details.instances_menu_click_to_open and not forced) then @@ -9256,7 +9240,7 @@ local atributo_on_enter = function (self, motion, forced, from_click) OnEnterMainWindow (instancia, self, 3) if (instancia.desaturated_menu) then - self:GetNormalTexture():SetDesaturated (false) + self:GetNormalTexture():SetDesaturated(false) end GameCooltip.buttonOver = true @@ -9280,7 +9264,7 @@ local atributo_on_enter = function (self, motion, forced, from_click) GameCooltip:SetOption("TextHeightMod", 0) GameCooltip:SetOption("IgnoreButtonAutoHeight", false) - GameCooltip:AddLine("All raid plugins already\nin use or disabled.", nil, 1, "white", nil, 10, SharedMedia:Fetch ("font", "Friz Quadrata TT")) + GameCooltip:AddLine("All raid plugins already\nin use or disabled.", nil, 1, "white", nil, 10, SharedMedia:Fetch("font", "Friz Quadrata TT")) GameCooltip:AddIcon([[Interface\GROUPFRAME\UI-GROUP-ASSISTANTICON]], 1, 1) GameCooltip:SetWallpaper (1, Details.tooltip.menus_bg_texture, Details.tooltip.menus_bg_coords, Details.tooltip.menus_bg_color, true) @@ -9300,7 +9284,7 @@ local atributo_on_enter = function (self, motion, forced, from_click) GameCooltip:ShowCooltip () end -local atributo_on_leave = function (self, motion, forced, from_click) +local atributo_on_leave = function(self, motion, forced, from_click) local instancia = self._instance or self.widget._instance local baseframe = instancia.baseframe @@ -9309,7 +9293,7 @@ local atributo_on_leave = function (self, motion, forced, from_click) hide_anti_overlap (instancia.baseframe.anti_menu_overlap) if (instancia.desaturated_menu) then - self:GetNormalTexture():SetDesaturated (true) + self:GetNormalTexture():SetDesaturated(true) end GameCooltip.buttonOver = false @@ -9372,7 +9356,7 @@ local segmentButton_OnLeave = function(self, motion, forced, fromClick) end end -local modo_selecao_on_enter = function (self, motion, forced, from_click) +local modo_selecao_on_enter = function(self, motion, forced, from_click) local is_cooltip_opened = menu_can_open() -- not is_cooltip_opened if (Details.instances_menu_click_to_open and not forced) then @@ -9385,7 +9369,7 @@ local modo_selecao_on_enter = function (self, motion, forced, from_click) OnEnterMainWindow (instancia, self, 3) if (instancia.desaturated_menu) then - self:GetNormalTexture():SetDesaturated (false) + self:GetNormalTexture():SetDesaturated(false) end GameCooltip.buttonOver = true @@ -9414,7 +9398,7 @@ local modo_selecao_on_enter = function (self, motion, forced, from_click) self:SetScript ("OnUpdate", build_mode_list) end -local modo_selecao_on_leave = function (self) +local modo_selecao_on_leave = function(self) local instancia = self._instance or self.widget._instance local baseframe = instancia.baseframe @@ -9424,7 +9408,7 @@ local modo_selecao_on_leave = function (self) hide_anti_overlap (instancia.baseframe.anti_menu_overlap) if (instancia.desaturated_menu) then - self:GetNormalTexture():SetDesaturated (true) + self:GetNormalTexture():SetDesaturated(true) end GameCooltip.buttonOver = false @@ -9466,26 +9450,26 @@ function Details:CreateFakeWindow() t:SetBackdrop ({bgFile = "Interface\\AddOns\\Details\\images\\background", tile = true, tileSize = 16 }) t:SetBackdropColor (0.0941, 0.0941, 0.0941, 0.3) local tb = CreateFrame ("frame", nil, t) - tb:SetPoint ("bottomleft", t, "topleft", 0, 0) - tb:SetPoint ("bottomright", t, "topright", 0, 0) - tb:SetHeight (16) + tb:SetPoint("bottomleft", t, "topleft", 0, 0) + tb:SetPoint("bottomright", t, "topright", 0, 0) + tb:SetHeight(16) tb:SetBackdrop ({bgFile = "Interface\\AddOns\\Details\\images\\background", tile = true, tileSize = 16 }) tb:SetBackdropColor (0.7, 0.7, 0.7, 0.4) - local tt = tb:CreateFontString (nil, "overlay", "GameFontNormal") + local tt = tb:CreateFontString(nil, "overlay", "GameFontNormal") Details:SetFontColor (tt, "white") - Details:SetFontSize (tt, 10) - Details:SetFontFace (tt, LibStub:GetLibrary("LibSharedMedia-3.0"):Fetch ("font", "Accidental Presidency")) - tt:SetPoint ("bottomleft", tb, 3, 4) + Details:SetFontSize(tt, 10) + Details:SetFontFace(tt, LibStub:GetLibrary("LibSharedMedia-3.0"):Fetch("font", "Accidental Presidency")) + tt:SetPoint("bottomleft", tb, 3, 4) tt:SetText ("Damage Done") t.TitleIcons = {} for i = 1, 5 do local b = tb:CreateTexture (nil, "overlay") b:SetSize (12, 12) - b:SetPoint ("bottomright", tb, "bottomright", -((abs(i-6)-1)*11) - 1, 2) + b:SetPoint("bottomright", tb, "bottomright", -((abs(i-6)-1)*11) - 1, 2) local button_texture_texcoord = Details:GetTitleBarIconsTexture (i) - b:SetTexture (button_texture_texcoord.texture) - b:SetTexCoord (unpack(button_texture_texcoord.texcoord)) + b:SetTexture(button_texture_texcoord.texture) + b:SetTexCoord(unpack(button_texture_texcoord.texcoord)) tinsert (t.TitleIcons, b) end @@ -9553,17 +9537,17 @@ function gump:CriaCabecalho (baseframe, instancia) --> FECHAR INSTANCIA ---------------------------------------------------------------------------------------------------------------------------------------------------- baseframe.cabecalho.fechar = CreateFrame ("button", "DetailsCloseInstanceButton" .. instancia.meu_id, baseframe) --, "UIPanelCloseButton" - baseframe.cabecalho.fechar:SetWidth (18) - baseframe.cabecalho.fechar:SetHeight (18) - baseframe.cabecalho.fechar:SetFrameLevel (5) --> altura mais alta que os demais frames - baseframe.cabecalho.fechar:SetPoint ("bottomright", baseframe, "topright", 5, -6) --> seta o ponto dele fixando no base frame + baseframe.cabecalho.fechar:SetWidth(18) + baseframe.cabecalho.fechar:SetHeight(18) + baseframe.cabecalho.fechar:SetFrameLevel(5) --> altura mais alta que os demais frames + baseframe.cabecalho.fechar:SetPoint("bottomright", baseframe, "topright", 5, -6) --> seta o ponto dele fixando no base frame baseframe.cabecalho.fechar:SetNormalTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) - baseframe.cabecalho.fechar:GetNormalTexture():SetTexCoord (160/256, 192/256, 0, 1) + baseframe.cabecalho.fechar:GetNormalTexture():SetTexCoord(160/256, 192/256, 0, 1) baseframe.cabecalho.fechar:SetHighlightTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) - baseframe.cabecalho.fechar:GetHighlightTexture():SetTexCoord (160/256, 192/256, 0, 1) + baseframe.cabecalho.fechar:GetHighlightTexture():SetTexCoord(160/256, 192/256, 0, 1) baseframe.cabecalho.fechar:SetPushedTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) - baseframe.cabecalho.fechar:GetPushedTexture():SetTexCoord (160/256, 192/256, 0, 1) + baseframe.cabecalho.fechar:GetPushedTexture():SetTexCoord(160/256, 192/256, 0, 1) --baseframe.cabecalho.fechar:SetNormalTexture ([[Interface\Buttons\UI-Panel-MinimizeButton-Up]]) --baseframe.cabecalho.fechar:SetHighlightTexture ([[Interface\Buttons\UI-Panel-MinimizeButton-Highlight]]) @@ -9579,66 +9563,66 @@ function gump:CriaCabecalho (baseframe, instancia) --> bola do canto esquedo superior --> primeiro criar a arma��o para apoiar as texturas baseframe.cabecalho.ball_point = instancia.floatingframe:CreateTexture (nil, "overlay") - baseframe.cabecalho.ball_point:SetPoint ("bottomleft", baseframe, "topleft", -37, 0) - baseframe.cabecalho.ball_point:SetWidth (64) - baseframe.cabecalho.ball_point:SetHeight (32) + baseframe.cabecalho.ball_point:SetPoint("bottomleft", baseframe, "topleft", -37, 0) + baseframe.cabecalho.ball_point:SetWidth(64) + baseframe.cabecalho.ball_point:SetHeight(32) --> icone do atributo --baseframe.cabecalho.atributo_icon = _detalhes.listener:CreateTexture (nil, "artwork") baseframe.cabecalho.atributo_icon = baseframe:CreateTexture ("DetailsAttributeIcon" .. instancia.meu_id, "background") local icon_anchor = Details.skins ["WoW Interface"].icon_anchor_main - baseframe.cabecalho.atributo_icon:SetPoint ("topright", baseframe.cabecalho.ball_point, "topright", icon_anchor[1], icon_anchor[2]) - baseframe.cabecalho.atributo_icon:SetTexture (DEFAULT_SKIN) - baseframe.cabecalho.atributo_icon:SetWidth (32) - baseframe.cabecalho.atributo_icon:SetHeight (32) + baseframe.cabecalho.atributo_icon:SetPoint("topright", baseframe.cabecalho.ball_point, "topright", icon_anchor[1], icon_anchor[2]) + baseframe.cabecalho.atributo_icon:SetTexture(DEFAULT_SKIN) + baseframe.cabecalho.atributo_icon:SetWidth(32) + baseframe.cabecalho.atributo_icon:SetHeight(32) --> bola overlay --baseframe.cabecalho.ball = _detalhes.listener:CreateTexture (nil, "overlay") baseframe.cabecalho.ball = baseframe:CreateTexture (nil, "overlay") - baseframe.cabecalho.ball:SetPoint ("bottomleft", baseframe, "topleft", -107, 0) - baseframe.cabecalho.ball:SetWidth (128) - baseframe.cabecalho.ball:SetHeight (128) + baseframe.cabecalho.ball:SetPoint("bottomleft", baseframe, "topleft", -107, 0) + baseframe.cabecalho.ball:SetWidth(128) + baseframe.cabecalho.ball:SetHeight(128) - baseframe.cabecalho.ball:SetTexture (DEFAULT_SKIN) - baseframe.cabecalho.ball:SetTexCoord (unpack(COORDS_LEFT_BALL)) + baseframe.cabecalho.ball:SetTexture(DEFAULT_SKIN) + baseframe.cabecalho.ball:SetTexCoord(unpack(COORDS_LEFT_BALL)) --> emenda baseframe.cabecalho.emenda = baseframe:CreateTexture (nil, "background") - baseframe.cabecalho.emenda:SetPoint ("bottomleft", baseframe.cabecalho.ball, "bottomright") - baseframe.cabecalho.emenda:SetWidth (8) - baseframe.cabecalho.emenda:SetHeight (128) - baseframe.cabecalho.emenda:SetTexture (DEFAULT_SKIN) - baseframe.cabecalho.emenda:SetTexCoord (unpack(COORDS_LEFT_CONNECTOR)) + baseframe.cabecalho.emenda:SetPoint("bottomleft", baseframe.cabecalho.ball, "bottomright") + baseframe.cabecalho.emenda:SetWidth(8) + baseframe.cabecalho.emenda:SetHeight(128) + baseframe.cabecalho.emenda:SetTexture(DEFAULT_SKIN) + baseframe.cabecalho.emenda:SetTexCoord(unpack(COORDS_LEFT_CONNECTOR)) baseframe.cabecalho.atributo_icon:Hide() baseframe.cabecalho.ball:Hide() --> bola do canto direito superior baseframe.cabecalho.ball_r = baseframe:CreateTexture (nil, "background") - baseframe.cabecalho.ball_r:SetPoint ("bottomright", baseframe, "topright", 96, 0) - baseframe.cabecalho.ball_r:SetWidth (128) - baseframe.cabecalho.ball_r:SetHeight (128) - baseframe.cabecalho.ball_r:SetTexture (DEFAULT_SKIN) - baseframe.cabecalho.ball_r:SetTexCoord (unpack(COORDS_RIGHT_BALL)) + baseframe.cabecalho.ball_r:SetPoint("bottomright", baseframe, "topright", 96, 0) + baseframe.cabecalho.ball_r:SetWidth(128) + baseframe.cabecalho.ball_r:SetHeight(128) + baseframe.cabecalho.ball_r:SetTexture(DEFAULT_SKIN) + baseframe.cabecalho.ball_r:SetTexCoord(unpack(COORDS_RIGHT_BALL)) --> barra centro baseframe.cabecalho.top_bg = baseframe:CreateTexture (nil, "background") - baseframe.cabecalho.top_bg:SetPoint ("left", baseframe.cabecalho.emenda, "right", 0, 0) - baseframe.cabecalho.top_bg:SetPoint ("right", baseframe.cabecalho.ball_r, "left") - baseframe.cabecalho.top_bg:SetTexture (DEFAULT_SKIN) - baseframe.cabecalho.top_bg:SetTexCoord (unpack(COORDS_TOP_BACKGROUND)) - baseframe.cabecalho.top_bg:SetWidth (512) - baseframe.cabecalho.top_bg:SetHeight (128) + baseframe.cabecalho.top_bg:SetPoint("left", baseframe.cabecalho.emenda, "right", 0, 0) + baseframe.cabecalho.top_bg:SetPoint("right", baseframe.cabecalho.ball_r, "left") + baseframe.cabecalho.top_bg:SetTexture(DEFAULT_SKIN) + baseframe.cabecalho.top_bg:SetTexCoord(unpack(COORDS_TOP_BACKGROUND)) + baseframe.cabecalho.top_bg:SetWidth(512) + baseframe.cabecalho.top_bg:SetHeight(128) --> frame invis�vel baseframe.UPFrame = CreateFrame ("frame", "DetailsUpFrameInstance"..instancia.meu_id, baseframe) - baseframe.UPFrame:SetPoint ("left", baseframe.cabecalho.ball, "right", 0, -53) - baseframe.UPFrame:SetPoint ("right", baseframe.cabecalho.ball_r, "left", 0, -53) - baseframe.UPFrame:SetHeight (20) + baseframe.UPFrame:SetPoint("left", baseframe.cabecalho.ball, "right", 0, -53) + baseframe.UPFrame:SetPoint("right", baseframe.cabecalho.ball_r, "left", 0, -53) + baseframe.UPFrame:SetHeight(20) baseframe.UPFrame.is_toolbar = true baseframe.UPFrame:Show() - baseframe.UPFrame:EnableMouse (true) + baseframe.UPFrame:EnableMouse(true) baseframe.UPFrame:SetMovable (true) baseframe.UPFrame:SetResizable (true) @@ -9646,10 +9630,10 @@ function gump:CriaCabecalho (baseframe, instancia) --> corrige o v�o entre o baseframe e o upframe baseframe.UPFrameConnect = CreateFrame ("frame", "DetailsAntiGap"..instancia.meu_id, baseframe) - baseframe.UPFrameConnect:SetPoint ("bottomleft", baseframe, "topleft", 0, -1) - baseframe.UPFrameConnect:SetPoint ("bottomright", baseframe, "topright", 0, -1) - baseframe.UPFrameConnect:SetHeight (2) - baseframe.UPFrameConnect:EnableMouse (true) + baseframe.UPFrameConnect:SetPoint("bottomleft", baseframe, "topleft", 0, -1) + baseframe.UPFrameConnect:SetPoint("bottomright", baseframe, "topright", 0, -1) + baseframe.UPFrameConnect:SetHeight(2) + baseframe.UPFrameConnect:EnableMouse(true) baseframe.UPFrameConnect:SetMovable (true) baseframe.UPFrameConnect:SetResizable (true) baseframe.UPFrameConnect.is_toolbar = true @@ -9657,9 +9641,9 @@ function gump:CriaCabecalho (baseframe, instancia) BGFrame_scripts (baseframe.UPFrameConnect, baseframe, instancia) baseframe.UPFrameLeftPart = CreateFrame ("frame", "DetailsUpFrameLeftPart"..instancia.meu_id, baseframe) - baseframe.UPFrameLeftPart:SetPoint ("bottomleft", baseframe, "topleft", 0, 0) + baseframe.UPFrameLeftPart:SetPoint("bottomleft", baseframe, "topleft", 0, 0) baseframe.UPFrameLeftPart:SetSize (22, 20) - baseframe.UPFrameLeftPart:EnableMouse (true) + baseframe.UPFrameLeftPart:EnableMouse(true) baseframe.UPFrameLeftPart:SetMovable (true) baseframe.UPFrameLeftPart:SetResizable (true) baseframe.UPFrameLeftPart.is_toolbar = true @@ -9668,22 +9652,22 @@ function gump:CriaCabecalho (baseframe, instancia) --> anchors para os micro displays no lado de cima da janela local StatusBarLeftAnchor = CreateFrame ("frame", "DetailsStatusBarLeftAnchor" .. instancia.meu_id, baseframe) - StatusBarLeftAnchor:SetPoint ("bottomleft", baseframe, "topleft", 0, 9) - StatusBarLeftAnchor:SetWidth (1) - StatusBarLeftAnchor:SetHeight (1) + StatusBarLeftAnchor:SetPoint("bottomleft", baseframe, "topleft", 0, 9) + StatusBarLeftAnchor:SetWidth(1) + StatusBarLeftAnchor:SetHeight(1) baseframe.cabecalho.StatusBarLeftAnchor = StatusBarLeftAnchor local StatusBarCenterAnchor = CreateFrame ("frame", "DetailsStatusBarCenterAnchor" .. instancia.meu_id, baseframe) - StatusBarCenterAnchor:SetPoint ("center", baseframe, "center") - StatusBarCenterAnchor:SetPoint ("bottom", baseframe, "top", 0, 9) - StatusBarCenterAnchor:SetWidth (1) - StatusBarCenterAnchor:SetHeight (1) + StatusBarCenterAnchor:SetPoint("center", baseframe, "center") + StatusBarCenterAnchor:SetPoint("bottom", baseframe, "top", 0, 9) + StatusBarCenterAnchor:SetWidth(1) + StatusBarCenterAnchor:SetHeight(1) baseframe.cabecalho.StatusBarCenterAnchor = StatusBarCenterAnchor local StatusBarRightAnchor = CreateFrame ("frame", "DetailsStatusBarRightAnchor" .. instancia.meu_id, baseframe) - StatusBarRightAnchor:SetPoint ("bottomright", baseframe, "topright", 0, 9) - StatusBarRightAnchor:SetWidth (1) - StatusBarRightAnchor:SetHeight (1) + StatusBarRightAnchor:SetPoint("bottomright", baseframe, "topright", 0, 9) + StatusBarRightAnchor:SetWidth(1) + StatusBarRightAnchor:SetHeight(1) baseframe.cabecalho.StatusBarRightAnchor = StatusBarRightAnchor local MenuAnchorLeft = CreateFrame ("frame", "DetailsMenuAnchorLeft"..instancia.meu_id, baseframe) @@ -9719,8 +9703,8 @@ function gump:CriaCabecalho (baseframe, instancia) end baseframe.cabecalho.modo_selecao = gump:NewButton (baseframe, nil, "DetailsModeButton"..instancia.meu_id, nil, 16, 16, modo_selecao_button_click, nil, nil, [[Interface\AddOns\Details\images\modo_icone]]) - baseframe.cabecalho.modo_selecao:SetPoint ("bottomleft", baseframe.cabecalho.ball, "bottomright", instancia.menu_anchor [1], instancia.menu_anchor [2]) - baseframe.cabecalho.modo_selecao:SetFrameLevel (baseframe:GetFrameLevel()+5) + baseframe.cabecalho.modo_selecao:SetPoint("bottomleft", baseframe.cabecalho.ball, "bottomright", instancia.menu_anchor [1], instancia.menu_anchor [2]) + baseframe.cabecalho.modo_selecao:SetFrameLevel(baseframe:GetFrameLevel()+5) baseframe.cabecalho.modo_selecao.widget._instance = instancia baseframe.cabecalho.modo_selecao:SetScript ("OnEnter", modo_selecao_on_enter) @@ -9728,15 +9712,15 @@ function gump:CriaCabecalho (baseframe, instancia) local b = baseframe.cabecalho.modo_selecao.widget b:SetNormalTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) - b:GetNormalTexture():SetTexCoord (0/256, 32/256, 0, 1) + b:GetNormalTexture():SetTexCoord(0/256, 32/256, 0, 1) b:SetHighlightTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) - b:GetHighlightTexture():SetTexCoord (0/256, 32/256, 0, 1) + b:GetHighlightTexture():SetTexCoord(0/256, 32/256, 0, 1) b:SetPushedTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) - b:GetPushedTexture():SetTexCoord (0/256, 32/256, 0, 1) + b:GetPushedTexture():SetTexCoord(0/256, 32/256, 0, 1) --> SELECIONAR O SEGMENTO ---------------------------------------------------------------------------------------------------------------------------------------------------- - local segmento_button_click = function (self, button, param1) + local segmento_button_click = function(self, button, param1) if (Details.instances_menu_click_to_open) then if (instancia.LastMenuOpened == "segments" and GameCooltipFrame1:IsShown()) then GameCooltip:ShowMe (false) @@ -9751,9 +9735,9 @@ function gump:CriaCabecalho (baseframe, instancia) end baseframe.cabecalho.segmento = gump:NewButton (baseframe, nil, "DetailsSegmentButton"..instancia.meu_id, nil, 16, 16, segmento_button_click, nil, nil, [[Interface\AddOns\Details\images\segmentos_icone]]) - baseframe.cabecalho.segmento:SetFrameLevel (baseframe.UPFrame:GetFrameLevel()+1) + baseframe.cabecalho.segmento:SetFrameLevel(baseframe.UPFrame:GetFrameLevel()+1) baseframe.cabecalho.segmento.widget._instance = instancia - baseframe.cabecalho.segmento:SetPoint ("left", baseframe.cabecalho.modo_selecao, "right", 0, 0) + baseframe.cabecalho.segmento:SetPoint("left", baseframe.cabecalho.modo_selecao, "right", 0, 0) --> ativa bot�o do meio e direito baseframe.cabecalho.segmento:SetClickFunction (segmento_button_click, nil, nil, "rightclick") @@ -9763,11 +9747,11 @@ function gump:CriaCabecalho (baseframe, instancia) local b = baseframe.cabecalho.segmento.widget b:SetNormalTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) - b:GetNormalTexture():SetTexCoord (32/256, 64/256, 0, 1) + b:GetNormalTexture():SetTexCoord(32/256, 64/256, 0, 1) b:SetHighlightTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) - b:GetHighlightTexture():SetTexCoord (32/256, 64/256, 0, 1) + b:GetHighlightTexture():SetTexCoord(32/256, 64/256, 0, 1) b:SetPushedTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) - b:GetPushedTexture():SetTexCoord (32/256, 64/256, 0, 1) + b:GetPushedTexture():SetTexCoord(32/256, 64/256, 0, 1) --> SELECIONAR O ATRIBUTO ---------------------------------------------------------------------------------------------------------------------------------------------------- local atributo_button_click = function() @@ -9783,20 +9767,20 @@ function gump:CriaCabecalho (baseframe, instancia) end baseframe.cabecalho.atributo = gump:NewButton (baseframe, nil, "DetailsAttributeButton"..instancia.meu_id, nil, 16, 16, atributo_button_click) - baseframe.cabecalho.atributo:SetFrameLevel (baseframe.UPFrame:GetFrameLevel()+1) + baseframe.cabecalho.atributo:SetFrameLevel(baseframe.UPFrame:GetFrameLevel()+1) baseframe.cabecalho.atributo.widget._instance = instancia - baseframe.cabecalho.atributo:SetPoint ("left", baseframe.cabecalho.segmento.widget, "right", 0, 0) + baseframe.cabecalho.atributo:SetPoint("left", baseframe.cabecalho.segmento.widget, "right", 0, 0) baseframe.cabecalho.atributo:SetScript ("OnEnter", atributo_on_enter) baseframe.cabecalho.atributo:SetScript ("OnLeave", atributo_on_leave) local b = baseframe.cabecalho.atributo.widget b:SetNormalTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) - b:GetNormalTexture():SetTexCoord (66/256, 93/256, 0, 1) + b:GetNormalTexture():SetTexCoord(66/256, 93/256, 0, 1) b:SetHighlightTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) - b:GetHighlightTexture():SetTexCoord (68/256, 93/256, 0, 1) + b:GetHighlightTexture():SetTexCoord(68/256, 93/256, 0, 1) b:SetPushedTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) - b:GetPushedTexture():SetTexCoord (68/256, 93/256, 0, 1) + b:GetPushedTexture():SetTexCoord(68/256, 93/256, 0, 1) --> REPORTAR ~report ---------------------------------------------------------------------------------------------------------------------------------------------------- local report_func = function() @@ -9804,20 +9788,20 @@ function gump:CriaCabecalho (baseframe, instancia) GameCooltip2:Hide() end baseframe.cabecalho.report = gump:NewButton (baseframe, nil, "DetailsReportButton"..instancia.meu_id, nil, 8, 16, report_func) - baseframe.cabecalho.report:SetFrameLevel (baseframe.UPFrame:GetFrameLevel()+1) + baseframe.cabecalho.report:SetFrameLevel(baseframe.UPFrame:GetFrameLevel()+1) baseframe.cabecalho.report.widget._instance = instancia - baseframe.cabecalho.report:SetPoint ("left", baseframe.cabecalho.atributo, "right", -6, 0) + baseframe.cabecalho.report:SetPoint("left", baseframe.cabecalho.atributo, "right", -6, 0) baseframe.cabecalho.report:SetScript ("OnEnter", report_on_enter) baseframe.cabecalho.report:SetScript ("OnLeave", report_on_leave) local b = baseframe.cabecalho.report.widget b:SetNormalTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) - b:GetNormalTexture():SetTexCoord (96/256, 128/256, 0, 1) + b:GetNormalTexture():SetTexCoord(96/256, 128/256, 0, 1) b:SetHighlightTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) - b:GetHighlightTexture():SetTexCoord (96/256, 128/256, 0, 1) + b:GetHighlightTexture():SetTexCoord(96/256, 128/256, 0, 1) b:SetPushedTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) - b:GetPushedTexture():SetTexCoord (96/256, 128/256, 0, 1) + b:GetPushedTexture():SetTexCoord(96/256, 128/256, 0, 1) @@ -9843,9 +9827,9 @@ function gump:CriaCabecalho (baseframe, instancia) end baseframe.cabecalho.reset = CreateFrame ("button", "DetailsClearSegmentsButton" .. instancia.meu_id, baseframe) - baseframe.cabecalho.reset:SetFrameLevel (baseframe.UPFrame:GetFrameLevel()+1) + baseframe.cabecalho.reset:SetFrameLevel(baseframe.UPFrame:GetFrameLevel()+1) baseframe.cabecalho.reset:SetSize (10, 16) - baseframe.cabecalho.reset:SetPoint ("right", baseframe.cabecalho.novo, "left") + baseframe.cabecalho.reset:SetPoint("right", baseframe.cabecalho.novo, "left") baseframe.cabecalho.reset.instance = instancia baseframe.cabecalho.reset._instance = instancia @@ -9855,10 +9839,10 @@ function gump:CriaCabecalho (baseframe, instancia) local b = baseframe.cabecalho.reset b:SetNormalTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) - b:GetNormalTexture():SetTexCoord (128/256, 160/256, 0, 1) + b:GetNormalTexture():SetTexCoord(128/256, 160/256, 0, 1) b:SetHighlightTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) - b:GetHighlightTexture():SetTexCoord (128/256, 160/256, 0, 1) + b:GetHighlightTexture():SetTexCoord(128/256, 160/256, 0, 1) b:SetPushedTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) - b:GetPushedTexture():SetTexCoord (128/256, 160/256, 0, 1) + b:GetPushedTexture():SetTexCoord(128/256, 160/256, 0, 1) end diff --git a/frames/window_news.lua b/frames/window_news.lua index 841942b5..bd5519aa 100644 --- a/frames/window_news.lua +++ b/frames/window_news.lua @@ -1,11 +1,10 @@ -local Details = _G.Details -local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) -local g = Details.gump +local Details = _G.Details +local Loc = LibStub("AceLocale-3.0"):GetLocale( "Details" ) +local gump = Details.gump local _ function Details:OpenNewsWindow(textToShow, dumpValues, keeptext) - Details.latest_news_saw = Details.userversion local newsFrame = Details:CreateOrOpenNewsWindow() @@ -15,30 +14,30 @@ function Details:OpenNewsWindow(textToShow, dumpValues, keeptext) newsFrame:Show() return end - + if (textToShow and type (textToShow) == "table") then - DetailsNewsWindowLower:SetSize (450, 5000) - DetailsNewsWindowSlider:SetMinMaxValues (0, 5000) - DetailsNewsWindowText:SetHeight (5000) - - local s = "" - for _, text in ipairs (textToShow) do - if (type (text) == "string" or type (text) == "number") then - s = s .. text .. "\n" + DetailsNewsWindowLower:SetSize(450, 5000) + DetailsNewsWindowSlider:SetMinMaxValues(0, 5000) + DetailsNewsWindowText:SetHeight(5000) + + local returnString = "" + for _, text in ipairs(textToShow) do + if (type(text) == "string" or type(text) == "number") then + returnString = returnString .. text .. "\n" end end - + if (dumpValues) then - s = Details.table.dump (textToShow) + returnString = Details.table.dump(textToShow) end - + if (keeptext) then - newsFrame:Text ((DetailsNewsWindowText:GetText() or "") .. "\n\n" .. s) + newsFrame:Text((DetailsNewsWindowText:GetText() or "") .. "\n\n" .. returnString) else if (dumpValues) then - newsFrame.DumpTableFrame:SetText (s) + newsFrame.DumpTableFrame:SetText (returnString) else - newsFrame:Text (s) + newsFrame:Text (returnString) end end else @@ -62,10 +61,8 @@ end function Details:CreateOrOpenNewsWindow() local frame = _G.DetailsNewsWindow - - if (not frame) then - --build news frame + if (not frame) then frame = DetailsFramework:CreateSimplePanel(UIParent, 480, 560, "Details! Damage Meter " .. Details.version, "DetailsNewsWindow", panel_options, db) tinsert(UISpecialFrames, "DetailsNewsWindow") frame:SetPoint("left", UIParent, "left", 10, 0) @@ -83,30 +80,30 @@ function Details:CreateOrOpenNewsWindow() frame.imageFrame.texture = frame.imageFrame:CreateTexture(nil, "overlay") frame.imageFrame.texture:SetPoint("topleft", frame.imageFrame, "topleft") - local dumpFrame = g:CreateTextEntry(frame, function()end, 500, 612, "DumpTable", "$parentDumpTable") - dumpFrame.editbox:SetMultiLine (true) - + local dumpFrame = gump:CreateTextEntry(frame, function()end, 500, 612, "DumpTable", "$parentDumpTable") + dumpFrame.editbox:SetMultiLine(true) + dumpFrame:SetPoint("topleft", frame, "topleft", 8, -68) dumpFrame:SetBackdrop(nil) dumpFrame.editbox:SetBackdrop(nil) dumpFrame.editbox:SetJustifyH("left") dumpFrame.editbox:SetJustifyV("top") - - frame.DumpTableFrame = dumpFrame - - local frame_upper = CreateFrame("scrollframe", nil, frame, "BackdropTemplate") - local frame_lower = CreateFrame("frame", "DetailsNewsWindowLower", frame_upper, "BackdropTemplate") - frame_lower:SetSize (450, 2000) - frame_upper:SetPoint ("topleft", frame, "topleft", 10, -30) - frame_upper:SetWidth(445) - frame_upper:SetHeight(500) - frame_upper:SetBackdrop({ + frame.DumpTableFrame = dumpFrame + + local frameUpper = CreateFrame("scrollframe", nil, frame, "BackdropTemplate") + local frameLower = CreateFrame("frame", "DetailsNewsWindowLower", frameUpper, "BackdropTemplate") + + frameLower:SetSize (450, 2000) + frameUpper:SetPoint ("topleft", frame, "topleft", 10, -30) + frameUpper:SetWidth(445) + frameUpper:SetHeight(500) + frameUpper:SetBackdrop({ bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, insets = {left = 1, right = 1, top = 0, bottom = 1},}) - frame_upper:SetBackdropColor (.1, .1, .1, .3) - frame_upper:SetScrollChild (frame_lower) + frameUpper:SetBackdropColor (.1, .1, .1, .3) + frameUpper:SetScrollChild (frameLower) local slider = CreateFrame ("slider", "DetailsNewsWindowSlider", frame, "BackdropTemplate") slider.bg = slider:CreateTexture (nil, "background") @@ -120,15 +117,15 @@ function Details:CreateOrOpenNewsWindow() slider:SetThumbTexture (slider.thumb) slider:SetOrientation ("vertical"); slider:SetSize (16, 499) - slider:SetPoint ("topleft", frame_upper, "topright") + slider:SetPoint ("topleft", frameUpper, "topright") slider:SetMinMaxValues (0, 2000) slider:SetValue(0) - slider:SetScript("OnValueChanged", function (self) - frame_upper:SetVerticalScroll (self:GetValue()) + slider:SetScript("OnValueChanged", function(self) + frameUpper:SetVerticalScroll (self:GetValue()) end) - frame_upper:EnableMouseWheel (true) - frame_upper:SetScript("OnMouseWheel", function (self, delta) + frameUpper:EnableMouseWheel (true) + frameUpper:SetScript("OnMouseWheel", function(self, delta) local current = slider:GetValue() if (IsShiftKeyDown() and (delta > 0)) then slider:SetValue(0) @@ -142,8 +139,8 @@ function Details:CreateOrOpenNewsWindow() end) --> text box - local texto = frame_lower:CreateFontString("DetailsNewsWindowText", "overlay", "GameFontNormal") - texto:SetPoint("topleft", frame_lower, "topleft") + local texto = frameLower:CreateFontString("DetailsNewsWindowText", "overlay", "GameFontNormal") + texto:SetPoint("topleft", frameLower, "topleft") texto:SetJustifyH("left") texto:SetJustifyV("top") texto:SetTextColor(1, 1, 1) diff --git a/frames/window_options2_sections.lua b/frames/window_options2_sections.lua index 05086e4d..95315fc3 100644 --- a/frames/window_options2_sections.lua +++ b/frames/window_options2_sections.lua @@ -151,7 +151,7 @@ do local iconcolor = {1, 1, 1, .5} local iconsize = {14, 14} - local onSelectTimeAbbreviation = function (_, _, abbreviationtype) + local onSelectTimeAbbreviation = function(_, _, abbreviationtype) _detalhes.ps_abbreviation = abbreviationtype _detalhes:UpdateToKFunctions() afterUpdate() @@ -172,7 +172,7 @@ do end --> number system - local onSelectNumeralSystem = function (_, _, systemNumber) + local onSelectNumeralSystem = function(_, _, systemNumber) _detalhes:SelectNumericalSystem(systemNumber) end @@ -195,7 +195,7 @@ do end --> time measure type - local onSelectTimeType = function (_, _, timetype) + local onSelectTimeType = function(_, _, timetype) _detalhes.time_type = timetype _detalhes.time_type_original = timetype _detalhes:RefreshMainWindow(-1, true) @@ -211,7 +211,7 @@ do end --> auto erase | erase data - local onSelectEraseData = function (_, _, eraseType) + local onSelectEraseData = function(_, _, eraseType) _detalhes.segments_auto_erase = eraseType afterUpdate() end @@ -243,7 +243,7 @@ do {--segments locked type = "toggle", get = function() return Details.instances_segments_locked end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.instances_segments_locked = value end, name = Loc ["STRING_OPTIONS_LOCKSEGMENTS"], @@ -253,7 +253,7 @@ do {--animate bars type = "toggle", get = function() return _detalhes.use_row_animations end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes:SetUseAnimations(value) afterUpdate() end, @@ -264,7 +264,7 @@ do {--scroll speed type = "range", get = function() return _detalhes.scroll_speed end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.scroll_speed = value end, min = 1, @@ -276,7 +276,7 @@ do {--instances amount type = "range", get = function() return _detalhes.instances_amount end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.instances_amount = value end, min = 1, @@ -306,7 +306,7 @@ do {--update speed type = "range", get = function() return _detalhes.update_speed end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes:SetWindowUpdateSpeed(value) afterUpdate() end, @@ -342,7 +342,7 @@ do {--auto erase trash segments type = "toggle", get = function() return _detalhes.trash_auto_remove end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.trash_auto_remove = value afterUpdate() end, @@ -353,7 +353,7 @@ do {--auto erase world segments type = "toggle", get = function() return _detalhes.world_combat_is_trash end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.world_combat_is_trash = value afterUpdate() end, @@ -364,7 +364,7 @@ do {--erase chart data type = "toggle", get = function() return _detalhes.clear_graphic end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.clear_graphic = value afterUpdate() end, @@ -376,7 +376,7 @@ do {--battleground remote parser type = "toggle", get = function() return _detalhes.use_battleground_server_parser end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.use_battleground_server_parser = value end, name = Loc ["STRING_OPTIONS_BG_UNIQUE_SEGMENT"], @@ -386,7 +386,7 @@ do {--battleground show enemies type = "toggle", get = function() return _detalhes.pvp_as_group end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.pvp_as_group = value end, name = Loc ["STRING_OPTIONS_BG_ALL_ALLY"], @@ -397,7 +397,7 @@ do {--max segments type = "range", get = function() return _detalhes.segments_amount end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.segments_amount = value afterUpdate() end, @@ -411,7 +411,7 @@ do {--max segments saved type = "range", get = function() return _detalhes.segments_amount_to_save end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.segments_amount_to_save = value afterUpdate() end, @@ -427,7 +427,7 @@ do {--pvp frags type = "toggle", get = function() return _detalhes.only_pvp_frags end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.only_pvp_frags = value afterUpdate() end, @@ -439,7 +439,7 @@ do {--damage taken everything type = "toggle", get = function() return _detalhes.damage_taken_everything end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.damage_taken_everything = value afterUpdate() end, @@ -460,7 +460,7 @@ do {--death log min healing type = "range", get = function() return _detalhes.deathlog_healingdone_min end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.deathlog_healingdone_min = value afterUpdate() end, @@ -477,7 +477,7 @@ do {--erase overall data on new boss type = "toggle", get = function() return _detalhes.overall_clear_newboss end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes:SetOverallResetOptions(value) afterUpdate() end, @@ -488,7 +488,7 @@ do {--erase overall data on mythic plus type = "toggle", get = function() return _detalhes.overall_clear_newchallenge end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes:SetOverallResetOptions(nil, value) afterUpdate() end, @@ -499,7 +499,7 @@ do {--erase overall data on logout type = "toggle", get = function() return _detalhes.overall_clear_pvp end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes:SetOverallResetOptions(nil, nil, nil, value) afterUpdate() end, @@ -510,7 +510,7 @@ do {--erase overall data on logout type = "toggle", get = function() return _detalhes.overall_clear_logout end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes:SetOverallResetOptions(nil, nil, value) afterUpdate() end, @@ -589,7 +589,7 @@ do {--click through type = "toggle", get = function() return currentInstance.clickthrough_window end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details:InstanceGroupCall(currentInstance, "UpdateClickThroughSettings", nil, value, value, value) afterUpdate() end, @@ -600,7 +600,7 @@ do {--click only in combat type = "toggle", get = function() return currentInstance.clickthrough_incombatonly end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details:InstanceGroupCall(currentInstance, "UpdateClickThroughSettings", value) afterUpdate() end, @@ -615,7 +615,7 @@ do {--show pets when solo type = "toggle", get = function() return Details.immersion_pets_on_solo_play end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.immersion_pets_on_solo_play = value afterUpdate() end, @@ -627,7 +627,7 @@ do {--always show players even on stardard mode type = "toggle", get = function() return _detalhes.all_players_are_group end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.all_players_are_group = value afterUpdate() end, @@ -667,7 +667,7 @@ do {--ignore nicknames type = "toggle", get = function() return _detalhes.ignore_nicktag end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.ignore_nicktag = value afterUpdate() end, @@ -679,7 +679,7 @@ do {--remove realm name type = "toggle", get = function() return _detalhes.remove_realm_from_name end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.remove_realm_from_name = value afterUpdate() end, @@ -694,7 +694,7 @@ do {--player bar color toggle type = "toggle", get = function() return Details.use_self_color end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.use_self_color = value afterUpdate() end, @@ -709,7 +709,7 @@ do local r, g, b = unpack(Details.class_colors.SELF) return {r, g, b, 1} end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) Details.class_colors.SELF[1] = r Details.class_colors.SELF[2] = g Details.class_colors.SELF[3] = b @@ -743,7 +743,7 @@ do end --> skin selection - local onSelectSkin = function (_, _, skinName) + local onSelectSkin = function(_, _, skinName) if (isGroupEditing()) then Details:InstanceGroupCall(currentInstance, "OptionPanelOnChangeSkin", skinName) else @@ -826,7 +826,7 @@ do --> import skin string local importSaved = function() --when clicking in the okay button in the import window, it send the text in the first argument - _detalhes:ShowImportWindow("", function (skinString) + _detalhes:ShowImportWindow("", function(skinString) if (type (skinString) ~= "string" or string.len(skinString) < 2) then return end @@ -1011,7 +1011,7 @@ do {--chat tab embed enabled type = "toggle", get = function() return _detalhes.chat_tab_embed.enabled end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.chat_embed:SetTabSettings(nil, value) Details.options.SetCurrentInstanceAndRefresh(currentInstance) afterUpdate() @@ -1033,7 +1033,7 @@ do {--single window type = "toggle", get = function() return _detalhes.chat_tab_embed.single_window end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.chat_embed:SetTabSettings (nil, nil, value) Details.options.SetCurrentInstanceAndRefresh(currentInstance) afterUpdate() @@ -1045,7 +1045,7 @@ do {--chat tab width offset type = "range", get = function() return tonumber (_detalhes.chat_tab_embed.x_offset) end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.chat_tab_embed.x_offset = value if (_detalhes.chat_embed.enabled) then _detalhes.chat_embed:DoEmbed() @@ -1062,7 +1062,7 @@ do {--chat tab height offset type = "range", get = function() return tonumber (_detalhes.chat_tab_embed.y_offset) end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.chat_tab_embed.y_offset = value if (_detalhes.chat_embed.enabled) then _detalhes.chat_embed:DoEmbed() @@ -1089,7 +1089,7 @@ end do --bar grow direction - local set_bar_grow_direction = function (_, instance, value) + local set_bar_grow_direction = function(_, instance, value) editInstanceSetting(currentInstance, "SetBarGrowDirection", value) afterUpdate() end @@ -1106,7 +1106,7 @@ do end --bar orientation - local set_bar_orientation = function (_, instance, value) + local set_bar_orientation = function(_, instance, value) editInstanceSetting(currentInstance, "SetBarOrientationDirection", value) afterUpdate() end @@ -1140,7 +1140,7 @@ do local texture_icon_size = {14, 14} local texture_texcoord = {469/512, 505/512, 249/512, 284/512} - local onSelectTexture = function (_, instance, textureName) + local onSelectTexture = function(_, instance, textureName) editInstanceSetting(currentInstance, "SetBarSettings", nil, textureName) afterUpdate() end @@ -1151,12 +1151,12 @@ do for name, texturePath in pairs (textures) do texTable[#texTable+1] = {value = name, label = name, iconsize = texture_icon_size, statusbar = texturePath, onclick = onSelectTexture, icon = texture_icon, texcoord = texture_texcoord} end - table.sort (texTable, function (t1, t2) return t1.label < t2.label end) + table.sort (texTable, function(t1, t2) return t1.label < t2.label end) return texTable end --select background texture - local onSelectTextureBackground = function (_, instance, textureName) + local onSelectTextureBackground = function(_, instance, textureName) editInstanceSetting(currentInstance, "SetBarSettings", nil, nil, nil, nil, textureName) afterUpdate() end @@ -1167,17 +1167,17 @@ do for name, texturePath in pairs (textures2) do texTable2[#texTable2+1] = {value = name, label = name, iconsize = texture_icon_size, statusbar = texturePath, onclick = onSelectTextureBackground, icon = texture_icon, texcoord = texture_texcoord} end - table.sort (texTable2, function (t1, t2) return t1.label < t2.label end) + table.sort (texTable2, function(t1, t2) return t1.label < t2.label end) return texTable2 end --select icon file from dropdown - local OnSelectIconFileSpec = function (_, _, iconpath) + local OnSelectIconFileSpec = function(_, _, iconpath) editInstanceSetting(currentInstance, "SetBarSpecIconSettings", true, iconpath, true) afterUpdate() end - local OnSelectIconFile = function (_, _, iconpath) + local OnSelectIconFile = function(_, _, iconpath) editInstanceSetting(currentInstance, "SetBarSettings", nil, nil, nil, nil, nil, nil, nil, nil, iconpath) if (currentInstance.row_info.use_spec_icons) then editInstanceSetting(currentInstance, "SetBarSpecIconSettings", false) @@ -1195,7 +1195,7 @@ do for name, texturePath in pairs (textures2) do texTable2[#texTable2+1] = {value = name, label = name, iconsize = texture_icon_size, statusbar = texturePath, onclick = onSelectBarTextureOverlay, icon = texture_icon, texcoord = texture_texcoord} end - table.sort(texTable2, function (t1, t2) return t1.label < t2.label end) + table.sort(texTable2, function(t1, t2) return t1.label < t2.label end) return texTable2 end @@ -1221,7 +1221,7 @@ do {--line height type = "range", get = function() return tonumber (currentInstance.row_info.height) end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetBarSettings", value) afterUpdate() end, @@ -1235,7 +1235,7 @@ do {--padding type = "range", get = function() return tonumber (currentInstance.row_info.space.between) end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetBarSettings", nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, value) afterUpdate() end, @@ -1249,7 +1249,7 @@ do {--disable highlight type = "toggle", get = function() return _detalhes.instances_disable_bar_highlight end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.instances_disable_bar_highlight = value afterUpdate() end, @@ -1260,7 +1260,7 @@ do {--fast dps updates type = "toggle", get = function() return currentInstance.row_info.fast_ps_update end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "row_info", "fast_ps_update", value) afterUpdate() end, @@ -1271,7 +1271,7 @@ do {--always show me type = "toggle", get = function() return currentInstance.following.enabled end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "following", "enabled", value) afterUpdate() end, @@ -1352,7 +1352,7 @@ do local alpha = currentInstance.row_info.alpha return {r, g, b, a} end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) editInstanceSetting(currentInstance, "SetBarSettings", nil, nil, nil, {r, g, b}) editInstanceSetting(currentInstance, "SetBarSettings", nil, nil, nil, nil, nil, nil, nil, a) afterUpdate() @@ -1364,7 +1364,7 @@ do {--color by player class type = "toggle", get = function() return currentInstance.row_info.texture_class_colors end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetBarSettings", nil, nil, value) afterUpdate() end, @@ -1390,7 +1390,7 @@ do local r, g, b, a = unpack(currentInstance.row_info.overlay_color) return {r, g, b, a} end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) editInstanceSetting(currentInstance, "SetBarOverlaySettings", nil, {r, g, b, a}) afterUpdate() end, @@ -1418,7 +1418,7 @@ do local alpha = currentInstance.row_info.alpha return {r, g, b, a} end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) editInstanceSetting(currentInstance, "SetBarSettings", nil, nil, nil, nil, nil, nil, {r, g, b, a}) afterUpdate() end, @@ -1429,7 +1429,7 @@ do {--background uses class colors type = "toggle", get = function() return currentInstance.row_info.texture_background_class_color end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetBarSettings", nil, nil, nil, nil, nil, value) afterUpdate() end, @@ -1489,7 +1489,7 @@ do {--bar start after icon type = "toggle", get = function() return currentInstance.row_info.start_after_icon end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetBarSettings", nil, nil, nil, nil, nil, nil, nil, nil, nil, value) afterUpdate() end, @@ -1500,7 +1500,7 @@ do {--icon size offset type = "range", get = function() return tonumber (currentInstance.row_info.icon_size_offset) end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetBarSettings", nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, value) afterUpdate() end, @@ -1518,7 +1518,7 @@ do {--show faction icon type = "toggle", get = function() return currentInstance.row_info.show_faction_icon end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetBarFactionIconSettings", value) afterUpdate() end, @@ -1529,7 +1529,7 @@ do {--faction icon size offset type = "range", get = function() return tonumber (currentInstance.row_info.faction_icon_size_offset) end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetBarFactionIconSettings", nil, value) afterUpdate() end, @@ -1547,7 +1547,7 @@ do {--show role icon type = "toggle", get = function() return currentInstance.row_info.show_arena_role_icon end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetBarArenaRoleIconSettings", value) afterUpdate() end, @@ -1558,7 +1558,7 @@ do {--role icon size offset type = "range", get = function() return tonumber (currentInstance.row_info.arena_role_icon_size_offset) end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetBarArenaRoleIconSettings", nil, value) afterUpdate() end, @@ -1579,7 +1579,7 @@ do {--inline text enabled type = "toggle", get = function() return currentInstance.use_multi_fontstrings end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "use_multi_fontstrings", value) editInstanceSetting(currentInstance, "InstanceRefreshRows") _detalhes:RefreshMainWindow(-1, true) @@ -1592,7 +1592,7 @@ do {--inline auto align enabled type = "toggle", get = function() return currentInstance.use_auto_align_multi_fontstrings end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "use_auto_align_multi_fontstrings", value) editInstanceSetting(currentInstance, "InstanceRefreshRows") _detalhes:RefreshMainWindow(-1, true) @@ -1606,7 +1606,7 @@ do {--name size offset type = "range", get = function() return tonumber(currentInstance.fontstrings_text_limit_offset) end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "fontstrings_text_limit_offset", value) editInstanceSetting(currentInstance, "InstanceRefreshRows") Details.options.RefreshInstances(currentInstance) @@ -1622,7 +1622,7 @@ do {--lineText2 (left, usuali is the 'done' amount) type = "range", get = function() return tonumber (currentInstance.fontstrings_text2_anchor) end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "fontstrings_text2_anchor", value) editInstanceSetting(currentInstance, "InstanceRefreshRows") afterUpdate() @@ -1637,7 +1637,7 @@ do {--lineText3 (in the middle) type = "range", get = function() return tonumber (currentInstance.fontstrings_text3_anchor) end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "fontstrings_text3_anchor", value) editInstanceSetting(currentInstance, "InstanceRefreshRows") afterUpdate() @@ -1652,7 +1652,7 @@ do {--lineText4 (closest to the right) type = "range", get = function() return tonumber (currentInstance.fontstrings_text4_anchor) end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "fontstrings_text4_anchor", value) editInstanceSetting(currentInstance, "InstanceRefreshRows") afterUpdate() @@ -1671,7 +1671,7 @@ do {--total bar enabled type = "toggle", get = function() return currentInstance.total_bar.enabled end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "total_bar", "enabled", value) afterUpdate() Details.options.RefreshInstances(currentInstance) @@ -1682,7 +1682,7 @@ do {--only in group type = "toggle", get = function() return currentInstance.total_bar.only_in_group end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "total_bar", "only_in_group", value) afterUpdate() end, @@ -1695,7 +1695,7 @@ do local r, g, b = unpack(currentInstance.total_bar.color) return {r, g, b, 1} end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) editInstanceSetting(currentInstance, "total_bar", "color", {r, g, b, 1}) afterUpdate() end, @@ -1711,7 +1711,7 @@ do local r, g, b = unpack(Details.class_colors.ARENA_GREEN) return {r, g, b, 1} end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) Details.class_colors.ARENA_GREEN[1] = r Details.class_colors.ARENA_GREEN[2] = g Details.class_colors.ARENA_GREEN[3] = b @@ -1726,7 +1726,7 @@ do local r, g, b = unpack(Details.class_colors.ARENA_YELLOW) return {r, g, b, 1} end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) Details.class_colors.ARENA_YELLOW[1] = r Details.class_colors.ARENA_YELLOW[2] = g Details.class_colors.ARENA_YELLOW[3] = b @@ -1742,7 +1742,7 @@ do {--border enabled type = "toggle", get = function() return currentInstance.row_info.backdrop.enabled end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetBarBackdropSettings", value) afterUpdate() end, @@ -1756,7 +1756,7 @@ do local r, g, b, a = unpack(currentInstance.row_info.backdrop.color) return {r, g, b, a} end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) editInstanceSetting(currentInstance, "SetBarBackdropSettings", nil, nil, {r, g, b, a}) afterUpdate() end, @@ -1767,7 +1767,7 @@ do {--border size type = "range", get = function() return tonumber (currentInstance.row_info.backdrop.size) end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetBarBackdropSettings", nil, value) afterUpdate() end, @@ -1783,7 +1783,7 @@ do {--border uses class colors type = "toggle", get = function() return currentInstance.row_info.backdrop.use_class_colors end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetBarBackdropSettings", nil, nil, nil, value) afterUpdate() end, @@ -1804,7 +1804,7 @@ end do --> text font selection - local onSelectFont = function (_, instance, fontName) + local onSelectFont = function(_, instance, fontName) editInstanceSetting(currentInstance, "SetBarTextSettings", nil, fontName) afterUpdate() end @@ -1815,12 +1815,12 @@ do for name, fontPath in pairs (fontObjects) do fontTable[#fontTable+1] = {value = name, label = name, icon = font_select_icon, texcoord = font_select_texcoord, onclick = onSelectFont, font = fontPath, descfont = name, desc = Loc ["STRING_MUSIC_DETAILS_ROBERTOCARLOS"]} end - table.sort (fontTable, function (t1, t2) return t1.label < t2.label end) + table.sort (fontTable, function(t1, t2) return t1.label < t2.label end) return fontTable end --> percent type - local onSelectPercent = function (_, instance, percentType) + local onSelectPercent = function(_, instance, percentType) editInstanceSetting(currentInstance, "SetBarTextSettings", nil, nil, nil, nil, nil, nil, nil, nil, nil, percentType) afterUpdate() end @@ -1834,7 +1834,7 @@ do end --> brackets - local onSelectBracket = function (_, instance, value) + local onSelectBracket = function(_, instance, value) editInstanceSetting(currentInstance, "SetBarRightTextSettings", nil, nil, nil, value) afterUpdate() end @@ -1851,7 +1851,7 @@ do end --> separators - local onSelectSeparator = function (_, instance, value) + local onSelectSeparator = function(_, instance, value) editInstanceSetting(currentInstance, "SetBarRightTextSettings", nil, nil, nil, nil, value) afterUpdate() end @@ -1882,7 +1882,7 @@ do local r, g, b = unpack(currentInstance.row_info.fixed_text_color) return {r, g, b, 1} end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) editInstanceSetting(currentInstance, "SetBarTextSettings", nil, nil, {r, g, b, 1}) afterUpdate() end, @@ -1892,7 +1892,7 @@ do {--text size 2 type = "range", get = function() return currentInstance.row_info.font_size end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetBarTextSettings", value) afterUpdate() end, @@ -1929,7 +1929,7 @@ do {--use class colors 7 type = "toggle", get = function() return currentInstance.row_info.textL_class_colors end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetBarTextSettings", nil, nil, nil, value) afterUpdate() end, @@ -1939,7 +1939,7 @@ do {--outline 8 type = "toggle", get = function() return currentInstance.row_info.textL_outline end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetBarTextSettings", nil, nil, nil, nil, nil, value) afterUpdate() end, @@ -1949,7 +1949,7 @@ do {--outline small 9 type = "toggle", get = function() return currentInstance.row_info.textL_outline_small end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetBarTextSettings", nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, value) afterUpdate() end, @@ -1962,7 +1962,7 @@ do local r, g, b = unpack(currentInstance.row_info.textL_outline_small_color) return {r, g, b, a} end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) editInstanceSetting(currentInstance, "SetBarTextSettings", nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, {r, g, b, a}) afterUpdate() end, @@ -1972,7 +1972,7 @@ do {--position number 11 type = "toggle", get = function() return currentInstance.row_info.textL_show_number end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetBarTextSettings", nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, value) afterUpdate() end, @@ -1982,7 +1982,7 @@ do {--translit text 12 type = "toggle", get = function() return currentInstance.row_info.textL_translit_text end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetBarTextSettings", nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, value) afterUpdate() end, @@ -1995,7 +1995,7 @@ do {--custom left text 14 type = "toggle", get = function() return currentInstance.row_info.textL_enable_custom_text end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetBarTextSettings", nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, value) afterUpdate() end, @@ -2026,7 +2026,7 @@ do {--use class colors 18 type = "toggle", get = function() return currentInstance.row_info.textR_class_colors end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetBarTextSettings", nil, nil, nil, nil, value) afterUpdate() end, @@ -2036,7 +2036,7 @@ do {--outline 19 type = "toggle", get = function() return currentInstance.row_info.textR_outline end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetBarTextSettings", nil, nil, nil, nil, nil, nil, value) afterUpdate() end, @@ -2046,7 +2046,7 @@ do {--outline small 20 type = "toggle", get = function() return currentInstance.row_info.textR_outline_small end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetBarTextSettings", nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, value) afterUpdate() end, @@ -2059,7 +2059,7 @@ do local r, g, b = unpack(currentInstance.row_info.textR_outline_small_color) return {r, g, b, a} end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) editInstanceSetting(currentInstance, "SetBarTextSettings", nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, {r, g, b, a}) afterUpdate() end, @@ -2072,7 +2072,7 @@ do {--show total --23 type = "toggle", get = function() return currentInstance.row_info.textR_show_data[1] end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetBarRightTextSettings", value) afterUpdate() end, @@ -2082,7 +2082,7 @@ do {--show per second 24 type = "toggle", get = function() return currentInstance.row_info.textR_show_data[2] end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetBarRightTextSettings", nil, value) afterUpdate() end, @@ -2092,7 +2092,7 @@ do {--show percent 25 type = "toggle", get = function() return currentInstance.row_info.textR_show_data[3] end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetBarRightTextSettings", nil, nil, value) afterUpdate() end, @@ -2128,7 +2128,7 @@ do {--custom right text 31 type = "toggle", get = function() return currentInstance.row_info.textR_enable_custom_text end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetBarTextSettings", nil, nil, nil, nil, nil, nil, nil, value) afterUpdate() end, @@ -2182,14 +2182,14 @@ end -- ~05 - title bar do - local func = function (menu_button) + local func = function(menu_button) editInstanceSetting(currentInstance, "menu_icons", menu_button, not currentInstance.menu_icons[menu_button]) editInstanceSetting(currentInstance, "ToolbarMenuSetButtons") afterUpdate() end --> menu text face - local onSelectFont = function (_, _, fontName) + local onSelectFont = function(_, _, fontName) _detalhes.font_faces.menus = fontName end @@ -2199,12 +2199,12 @@ do for name, fontPath in pairs (fontObjects) do fontTable[#fontTable+1] = {value = name, label = name, icon = font_select_icon, texcoord = font_select_texcoord, onclick = onSelectFont, font = fontPath, descfont = name, desc = Loc ["STRING_MUSIC_DETAILS_ROBERTOCARLOS"]} end - table.sort (fontTable, function (t1, t2) return t1.label < t2.label end) + table.sort (fontTable, function(t1, t2) return t1.label < t2.label end) return fontTable end --> attribute text font - local on_select_attribute_font = function (self, instance, fontName) + local on_select_attribute_font = function(self, instance, fontName) editInstanceSetting(currentInstance, "AttributeMenu", nil, nil, nil, fontName) afterUpdate() end @@ -2214,7 +2214,7 @@ do for name, fontPath in pairs (SharedMedia:HashTable ("font")) do fonts [#fonts+1] = {value = name, label = name, icon = font_select_icon, texcoord = font_select_texcoord, onclick = on_select_attribute_font, font = fontPath, descfont = name, desc = "Our thoughts strayed constantly\nAnd without boundary\nThe ringing of the division bell had began."} end - table.sort (fonts, function (t1, t2) return t1.label < t2.label end) + table.sort (fonts, function(t1, t2) return t1.label < t2.label end) return fonts end @@ -2237,7 +2237,7 @@ do for name, texturePath in pairs (textures) do texTable[#texTable+1] = {value = name, label = name, statusbar = texturePath, onclick = onSelectCustomTitleBarTexture} end - table.sort(texTable, function (t1, t2) return t1.label < t2.label end) + table.sort(texTable, function(t1, t2) return t1.label < t2.label end) return texTable end @@ -2261,7 +2261,7 @@ do {--use custom titlebar type = "toggle", get = function() return currentInstance.titlebar_shown end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetTitleBarSettings", value) editInstanceSetting(currentInstance, "RefreshTitleBar") afterUpdate() @@ -2273,7 +2273,7 @@ do {--custom title bar height type = "range", get = function() return currentInstance.titlebar_height end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetTitleBarSettings", nil, value) editInstanceSetting(currentInstance, "RefreshTitleBar") afterUpdate() @@ -2301,7 +2301,7 @@ do local r, g, b, a = unpack(currentInstance.titlebar_texture_color) return {r, g, b, a} end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) editInstanceSetting(currentInstance, "SetTitleBarSettings", nil, nil, nil, {r, g, b, a}) editInstanceSetting(currentInstance, "RefreshTitleBar") afterUpdate() @@ -2316,7 +2316,7 @@ do {--disable all displays type = "toggle", get = function() return currentInstance.disable_alldisplays_window end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.disable_alldisplays_window = value afterUpdate() end, @@ -2434,7 +2434,7 @@ do {--title bar icons size type = "range", get = function() return currentInstance.menu_icons_size end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "ToolbarMenuButtonsSize", value) afterUpdate() end, @@ -2449,7 +2449,7 @@ do {--title bar icons spacing type = "range", get = function() return currentInstance.menu_icons.space end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "ToolbarMenuSetButtonsOptions", value) afterUpdate() end, @@ -2463,7 +2463,7 @@ do {--title bar icons position X type = "range", get = function() return currentInstance.menu_anchor[1] end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "MenuAnchor", value) afterUpdate() end, @@ -2477,7 +2477,7 @@ do {--title bar icons position Y type = "range", get = function() return currentInstance.menu_anchor[2] end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "MenuAnchor", nil, value) afterUpdate() end, @@ -2491,7 +2491,7 @@ do {--icons desaturated type = "toggle", get = function() return currentInstance.desaturated_menu end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "DesaturateMenu", value) afterUpdate() end, @@ -2502,7 +2502,7 @@ do {--hide icon main icon type = "toggle", get = function() return currentInstance.hide_icon end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "HideMainIcon", value) afterUpdate() end, @@ -2513,7 +2513,7 @@ do {--button attach to right type = "toggle", get = function() return currentInstance.menu_anchor.side == 2 and true or false end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "LeftMenuAnchorSide", value and 2 or 1) afterUpdate() end, @@ -2524,7 +2524,7 @@ do {--plugins button attach to right type = "toggle", get = function() return currentInstance.plugins_grow_direction == 2 and true or false end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "plugins_grow_direction", value and 2 or 1) editInstanceSetting(currentInstance, "ToolbarMenuSetButtons") afterUpdate() @@ -2536,7 +2536,7 @@ do {--disable reset button type = "toggle", get = function() return _detalhes.disable_reset_button end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.disable_reset_button = value afterUpdate() end, @@ -2547,7 +2547,7 @@ do {--click to open menus type = "toggle", get = function() return _detalhes.instances_menu_click_to_open end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.instances_menu_click_to_open = value afterUpdate() end, @@ -2558,7 +2558,7 @@ do {--auto hide buttons type = "toggle", get = function() return currentInstance.auto_hide_menu.left end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetAutoHideMenu", value) afterUpdate() end, @@ -2572,7 +2572,7 @@ do {--enable text type = "toggle", get = function() return currentInstance.attribute_text.enabled end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "AttributeMenu", value) afterUpdate() end, @@ -2583,7 +2583,7 @@ do {--encounter time type = "toggle", get = function() return currentInstance.attribute_text.show_timer and true or false end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "AttributeMenu", nil, nil, nil, nil, nil, nil, nil, nil, value) afterUpdate() end, @@ -2594,7 +2594,7 @@ do {--text size type = "range", get = function() return tonumber(currentInstance.attribute_text.text_size) end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "AttributeMenu", nil, nil, nil, nil, value) afterUpdate() end, @@ -2621,7 +2621,7 @@ do local r, g, b = unpack (currentInstance.attribute_text.text_color) return {r, g, b, a} end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) editInstanceSetting(currentInstance, "AttributeMenu", nil, nil, nil, nil, nil, {r, g, b, a}) afterUpdate() end, @@ -2632,7 +2632,7 @@ do {--text shadow type = "toggle", get = function() return currentInstance.attribute_text.shadow end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "AttributeMenu", nil, nil, nil, nil, nil, nil, nil, value) afterUpdate() end, @@ -2643,7 +2643,7 @@ do {--text X type = "range", get = function() return tonumber(currentInstance.attribute_text.anchor[1]) end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "AttributeMenu", nil, value) afterUpdate() end, @@ -2657,7 +2657,7 @@ do {--text Y type = "range", get = function() return tonumber(currentInstance.attribute_text.anchor[2]) end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "AttributeMenu", nil, nil, value) afterUpdate() end, @@ -2671,7 +2671,7 @@ do {--anchor to top type = "toggle", get = function() return currentInstance.attribute_text.side == 1 and true or false end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "AttributeMenu", nil, nil, nil, nil, nil, nil, value and 1 or 2) afterUpdate() end, @@ -2693,7 +2693,7 @@ do {--menu text size type = "range", get = function() return Details.font_sizes.menus end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.font_sizes.menus = value afterUpdate() end, @@ -2726,7 +2726,7 @@ do ["DIALOG"] = "Dialog" } - local onStrataSelect = function (_, instance, strataName) + local onStrataSelect = function(_, instance, strataName) editInstanceSetting(currentInstance, "SetFrameStrata", strataName) afterUpdate() end @@ -2741,7 +2741,7 @@ do local buildStrataMenu = function() return strataTable end --> backdrop texture - local onBackdropSelect = function (_, instance, backdropName) + local onBackdropSelect = function(_, instance, backdropName) editInstanceSetting(currentInstance, "SetBackdropTexture", backdropName) afterUpdate() end @@ -2823,7 +2823,7 @@ do return {r, g, b, 1} end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) editInstanceSetting(currentInstance, "InstanceColor", r, g, b, a, nil, true) afterUpdate() end, @@ -2834,7 +2834,7 @@ do {--show borders type = "toggle", get = function() return currentInstance.show_sidebars end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) if (value) then editInstanceSetting(currentInstance, "ShowSideBars") else @@ -2852,7 +2852,7 @@ do get = function() return {currentInstance.bg_r, currentInstance.bg_g, currentInstance.bg_b, currentInstance.bg_alpha} end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) editInstanceSetting(currentInstance, "SetBackgroundColor", r, g, b) editInstanceSetting(currentInstance, "SetBackgroundAlpha", a) afterUpdate() @@ -2864,7 +2864,7 @@ do {--window scale type = "range", get = function() return tonumber(currentInstance.window_scale) end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetWindowScale", value, true) afterUpdate() end, @@ -2879,7 +2879,7 @@ do {--ignore on mass hide type = "toggle", get = function() return currentInstance.ignore_mass_showhide end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "ignore_mass_showhide", value) afterUpdate() end, @@ -2912,7 +2912,7 @@ do {--disable grouping type = "toggle", get = function() return _detalhes.disable_window_groups end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.disable_window_groups = value afterUpdate() end, @@ -2923,7 +2923,7 @@ do {--disable resize buttons type = "toggle", get = function() return _detalhes.disable_lock_ungroup_buttons end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.disable_lock_ungroup_buttons = value afterUpdate() end, @@ -2934,7 +2934,7 @@ do {--disable stretch button type = "toggle", get = function() return _detalhes.disable_stretch_button end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.disable_stretch_button = value afterUpdate() end, @@ -2947,7 +2947,7 @@ do {--title bar on top side type = "toggle", get = function() return currentInstance.toolbar_side == 1 and true or false end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "ToolbarSide", value and 1 or 2) afterUpdate() end, @@ -2958,7 +2958,7 @@ do {--stretch button always on top type = "toggle", get = function() return currentInstance.grab_on_top end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "grab_on_top", value) afterUpdate() end, @@ -2969,7 +2969,7 @@ do {--stretch button on top side type = "toggle", get = function() return currentInstance.stretch_button_side == 1 and true or false end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "StretchButtonAnchor", value and 1 or 2) afterUpdate() end, @@ -3011,7 +3011,7 @@ do {--show full border ~border type = "toggle", get = function() return currentInstance.fullborder_shown end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "UpdateFullBorder", value) afterUpdate() end, @@ -3024,7 +3024,7 @@ do get = function() return {unpack(currentInstance.fullborder_color)} end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) editInstanceSetting(currentInstance, "UpdateFullBorder", nil, {r, g, b, a}) afterUpdate() end, @@ -3035,7 +3035,7 @@ do {--border size type = "range", get = function() return tonumber(currentInstance.fullborder_size) end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "UpdateFullBorder", nil, nil, value) afterUpdate() end, @@ -3053,7 +3053,7 @@ do {--show full border ~border type = "toggle", get = function() return currentInstance.rowareaborder_shown end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "UpdateRowAreaBorder", value) afterUpdate() end, @@ -3066,7 +3066,7 @@ do get = function() return {unpack(currentInstance.rowareaborder_color)} end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) editInstanceSetting(currentInstance, "UpdateRowAreaBorder", nil, {r, g, b, a}) afterUpdate() end, @@ -3077,7 +3077,7 @@ do {--border size type = "range", get = function() return tonumber(currentInstance.rowareaborder_size) end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "UpdateRowAreaBorder", nil, nil, value) afterUpdate() end, @@ -3151,7 +3151,7 @@ do {--show statusbar type = "toggle", get = function() return currentInstance.show_statusbar end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) if (value) then editInstanceSetting(currentInstance, "ShowStatusBar") else @@ -3173,7 +3173,7 @@ do local alpha = currentInstance.statusbar_info.alpha return {r, g, b, alpha} end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) editInstanceSetting(currentInstance, "StatusBarColor", r, g, b, a) afterUpdate() end, @@ -3184,7 +3184,7 @@ do {--lock micro displays type = "toggle", get = function() return currentInstance.micro_displays_locked end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "MicroDisplaysLock", value) afterUpdate() end, @@ -3195,7 +3195,7 @@ do {--anchor on top side type = "toggle", get = function() return currentInstance.micro_displays_side == 1 and true or false end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "MicroDisplaysSide", value and 1 or 2, true) afterUpdate() end, @@ -3219,7 +3219,7 @@ do DF:NewLabel (sectionFrame, _, "$parentMicroDisplayWarningLabel", "MicroDisplayWarningLabel", Loc ["STRING_OPTIONS_MICRODISPLAYS_WARNING"], "GameFontHighlightSmall", 10, "orange") --dropdown on select option - local onMicroDisplaySelect = function (_, _, micro_display) + local onMicroDisplaySelect = function(_, _, micro_display) local anchor, index = unpack (micro_display) if (index == -1) then @@ -3273,7 +3273,7 @@ do sectionFrame.MicroDisplayRightDropdown.tooltip = Loc ["STRING_OPTIONS_MICRODISPLAYS_DROPDOWN_TOOLTIP"] - local hideLeftMicroFrameButton = DF:NewButton (sectionFrame.MicroDisplayLeftDropdown, _, "$parenthideLeftMicroFrameButton", "hideLeftMicroFrameButton", 22, 22, function (self, button) + local hideLeftMicroFrameButton = DF:NewButton (sectionFrame.MicroDisplayLeftDropdown, _, "$parenthideLeftMicroFrameButton", "hideLeftMicroFrameButton", 22, 22, function(self, button) if (currentInstance.StatusBar ["left"].options.isHidden) then _detalhes.StatusBar:SetPlugin (currentInstance, currentInstance.StatusBar ["left"].real_name, "left") else @@ -3291,14 +3291,14 @@ do hideLeftMicroFrameButton:SetPushedTexture ([[Interface\Buttons\UI-GroupLoot-Pass-Up]]) hideLeftMicroFrameButton:GetNormalTexture():SetDesaturated (true) hideLeftMicroFrameButton.tooltip = Loc ["STRING_OPTIONS_MICRODISPLAYS_SHOWHIDE_TOOLTIP"] - hideLeftMicroFrameButton:SetHook ("OnEnter", function (self, capsule) + hideLeftMicroFrameButton:SetHook ("OnEnter", function(self, capsule) self:GetNormalTexture():SetBlendMode("ADD") end) - hideLeftMicroFrameButton:SetHook ("OnLeave", function (self, capsule) + hideLeftMicroFrameButton:SetHook ("OnLeave", function(self, capsule) self:GetNormalTexture():SetBlendMode("BLEND") end) - local HideCenterMicroFrameButton = DF:NewButton (sectionFrame.MicroDisplayCenterDropdown, _, "$parentHideCenterMicroFrameButton", "HideCenterMicroFrameButton", 22, 22, function (self) + local HideCenterMicroFrameButton = DF:NewButton (sectionFrame.MicroDisplayCenterDropdown, _, "$parentHideCenterMicroFrameButton", "HideCenterMicroFrameButton", 22, 22, function(self) if (currentInstance.StatusBar ["center"].options.isHidden) then _detalhes.StatusBar:SetPlugin (currentInstance, currentInstance.StatusBar ["center"].real_name, "center") else @@ -3316,14 +3316,14 @@ do HideCenterMicroFrameButton:SetPushedTexture ([[Interface\Buttons\UI-GroupLoot-Pass-Up]]) HideCenterMicroFrameButton:GetNormalTexture():SetDesaturated (true) HideCenterMicroFrameButton.tooltip = Loc ["STRING_OPTIONS_MICRODISPLAYS_SHOWHIDE_TOOLTIP"] - HideCenterMicroFrameButton:SetHook ("OnEnter", function (self, capsule) + HideCenterMicroFrameButton:SetHook ("OnEnter", function(self, capsule) self:GetNormalTexture():SetBlendMode("ADD") end) - HideCenterMicroFrameButton:SetHook ("OnLeave", function (self, capsule) + HideCenterMicroFrameButton:SetHook ("OnLeave", function(self, capsule) self:GetNormalTexture():SetBlendMode("BLEND") end) - local HideRightMicroFrameButton = DF:NewButton (sectionFrame.MicroDisplayRightDropdown, _, "$parentHideRightMicroFrameButton", "HideRightMicroFrameButton", 20, 20, function (self) + local HideRightMicroFrameButton = DF:NewButton (sectionFrame.MicroDisplayRightDropdown, _, "$parentHideRightMicroFrameButton", "HideRightMicroFrameButton", 20, 20, function(self) if (currentInstance.StatusBar ["right"].options.isHidden) then _detalhes.StatusBar:SetPlugin (currentInstance, currentInstance.StatusBar ["right"].real_name, "right") else @@ -3340,14 +3340,14 @@ do HideRightMicroFrameButton:SetPushedTexture ([[Interface\Buttons\UI-GroupLoot-Pass-Up]]) HideRightMicroFrameButton:GetNormalTexture():SetDesaturated (true) HideRightMicroFrameButton.tooltip = Loc ["STRING_OPTIONS_MICRODISPLAYS_SHOWHIDE_TOOLTIP"] - HideRightMicroFrameButton:SetHook ("OnEnter", function (self, capsule) + HideRightMicroFrameButton:SetHook ("OnEnter", function(self, capsule) self:GetNormalTexture():SetBlendMode("ADD") end) - HideRightMicroFrameButton:SetHook ("OnLeave", function (self, capsule) + HideRightMicroFrameButton:SetHook ("OnLeave", function(self, capsule) self:GetNormalTexture():SetBlendMode("BLEND") end) - local configRightMicroFrameButton = DF:NewButton (sectionFrame.MicroDisplayRightDropdown, _, "$parentconfigRightMicroFrameButton", "configRightMicroFrameButton", 18, 18, function (self) + local configRightMicroFrameButton = DF:NewButton (sectionFrame.MicroDisplayRightDropdown, _, "$parentconfigRightMicroFrameButton", "configRightMicroFrameButton", 18, 18, function(self) currentInstance.StatusBar ["right"]:Setup() currentInstance.StatusBar ["right"]:Setup() end) @@ -3356,7 +3356,7 @@ do configRightMicroFrameButton:SetHighlightTexture ([[Interface\Buttons\UI-OptionsButton]]) configRightMicroFrameButton.tooltip = Loc ["STRING_OPTIONS_MICRODISPLAYS_OPTION_TOOLTIP"] - local configCenterMicroFrameButton = DF:NewButton (sectionFrame.MicroDisplayCenterDropdown, _, "$parentconfigCenterMicroFrameButton", "configCenterMicroFrameButton", 18, 18, function (self) + local configCenterMicroFrameButton = DF:NewButton (sectionFrame.MicroDisplayCenterDropdown, _, "$parentconfigCenterMicroFrameButton", "configCenterMicroFrameButton", 18, 18, function(self) currentInstance.StatusBar ["center"]:Setup() currentInstance.StatusBar ["center"]:Setup() end) @@ -3365,7 +3365,7 @@ do configCenterMicroFrameButton:SetHighlightTexture ([[Interface\Buttons\UI-OptionsButton]]) configCenterMicroFrameButton.tooltip = Loc ["STRING_OPTIONS_MICRODISPLAYS_OPTION_TOOLTIP"] - local configLeftMicroFrameButton = DF:NewButton (sectionFrame.MicroDisplayLeftDropdown, _, "$parentconfigLeftMicroFrameButton", "configLeftMicroFrameButton", 18, 18, function (self) + local configLeftMicroFrameButton = DF:NewButton (sectionFrame.MicroDisplayLeftDropdown, _, "$parentconfigLeftMicroFrameButton", "configLeftMicroFrameButton", 18, 18, function(self) currentInstance.StatusBar ["left"]:Setup() currentInstance.StatusBar ["left"]:Setup() end) @@ -3409,7 +3409,7 @@ do anchorFrame.plugin_widgets = {} anchorFrame:SetSize(1, 1) - local on_enter = function (self) + local on_enter = function(self) self:SetBackdropColor (.5, .5, .5, .8) @@ -3441,7 +3441,7 @@ do end end - local on_leave = function (self) + local on_leave = function(self) self:SetBackdropColor (.3, .3, .3, .3) if (self ["toolbarPluginsIcon" .. self.id]) then @@ -3539,7 +3539,7 @@ do tinsert (anchorFrame.plugin_widgets, bframe ["toolbarPluginsSlider"..i]) bframe ["toolbarPluginsSlider"..i]:SetPoint ("topleft", anchorFrame, "topleft", 415, y) bframe ["toolbarPluginsSlider"..i]:SetAsCheckBox() - bframe ["toolbarPluginsSlider"..i].OnSwitch = function (self, _, value) + bframe ["toolbarPluginsSlider"..i].OnSwitch = function(self, _, value) plugin_stable.enabled = value plugin.__enabled = value if (value) then @@ -3674,7 +3674,7 @@ do bframe ["raidPluginsSlider"..i].PluginName = absName bframe ["raidPluginsSlider"..i]:SetPoint ("topleft", anchorFrame, "topleft", 415, y+1) bframe ["raidPluginsSlider"..i]:SetAsCheckBox() - bframe ["raidPluginsSlider"..i].OnSwitch = function (self, _, value) + bframe ["raidPluginsSlider"..i].OnSwitch = function(self, _, value) plugin_stable.enabled = value plugin.__enabled = value if (not value) then @@ -3812,7 +3812,7 @@ do bframe ["soloPluginsSlider"..i].PluginName = absName bframe ["soloPluginsSlider"..i]:SetPoint ("topleft", anchorFrame, "topleft", 415, y+1) bframe ["soloPluginsSlider"..i]:SetAsCheckBox() - bframe ["soloPluginsSlider"..i].OnSwitch = function (self, _, value) + bframe ["soloPluginsSlider"..i].OnSwitch = function(self, _, value) plugin_stable.enabled = value plugin.__enabled = value if (not value) then @@ -3854,7 +3854,7 @@ do local buildSection = function(sectionFrame) --build profile menu for "always use this profile" feature - local profile_selected_alwaysuse = function (_, instance, profile_name) + local profile_selected_alwaysuse = function(_, instance, profile_name) _detalhes.always_use_profile_name = profile_name local unitname = UnitName ("player") _detalhes.always_use_profile_exception [unitname] = nil @@ -3872,7 +3872,7 @@ do return menu end - local selectProfile = function (_, _, profileName) + local selectProfile = function(_, _, profileName) _detalhes:ApplyProfile(profileName) _detalhes:Msg (Loc ["STRING_OPTIONS_PROFILE_LOADED"], profileName) --Details.options.SetCurrentInstanceAndRefresh(currentInstance) @@ -3915,7 +3915,7 @@ do {--save size and positioning type = "toggle", get = function() return _detalhes.profile_save_pos end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.profile_save_pos = value _detalhes:SetProfileCProp (nil, "profile_save_pos", value) afterUpdate() @@ -4016,13 +4016,13 @@ do {--import profile type = "execute", func = function(self) - _detalhes:ShowImportWindow("", function (profileString) + _detalhes:ShowImportWindow("", function(profileString) if (type (profileString) ~= "string" or string.len (profileString) < 2) then return end --prompt text panel returns what the user inserted in the text field in the first argument - DF:ShowTextPromptPanel(Loc["STRING_OPTIONS_IMPORT_PROFILE_NAME"] .. ":", function (newProfileName) + DF:ShowTextPromptPanel(Loc["STRING_OPTIONS_IMPORT_PROFILE_NAME"] .. ":", function(newProfileName) Details:ImportProfile (profileString, newProfileName) end) end, Loc["STRING_OPTIONS_IMPORT_PROFILE_PASTE"]) @@ -4037,7 +4037,7 @@ do {--use on all characters type = "toggle", get = function() return _detalhes.always_use_profile end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.always_use_profile = value if (value) then @@ -4104,7 +4104,7 @@ do end --text face - local on_select_tooltip_font = function (self, _, fontName) + local on_select_tooltip_font = function(self, _, fontName) _detalhes.tooltip.fontface = fontName _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) end @@ -4115,7 +4115,7 @@ do fonts [#fonts+1] = {value = name, icon = font_select_icon, texcoord = font_select_texcoord, label = name, onclick = on_select_tooltip_font, font = fontPath, descfont = name, desc = "Our thoughts strayed constantly\nAnd without boundary\nThe ringing of the division bell had began."} end - table.sort (fonts, function (t1, t2) return t1.label < t2.label end) + table.sort (fonts, function(t1, t2) return t1.label < t2.label end) return fonts end @@ -4124,7 +4124,7 @@ do local iconcolor = {1, 1, 1, .5} local iconsize = {14, 14} - local onSelectTimeAbbreviation = function (_, _, abbreviationtype) + local onSelectTimeAbbreviation = function(_, _, abbreviationtype) _detalhes.tooltip.abbreviation = abbreviationtype _detalhes.atributo_damage:UpdateSelectedToKFunction() @@ -4151,7 +4151,7 @@ do end --maximize method - local onSelectMaximize = function (_, _, maximizeType) + local onSelectMaximize = function(_, _, maximizeType) _detalhes.tooltip.maximize_method = maximizeType _detalhes.atributo_damage:UpdateSelectedToKFunction() _detalhes.atributo_heal:UpdateSelectedToKFunction() @@ -4178,7 +4178,7 @@ do end --tooltip side - local onSelectAnchorPoint = function (_, _, selected_anchor) + local onSelectAnchorPoint = function(_, _, selected_anchor) _detalhes.tooltip.anchor_point = selected_anchor afterUpdate() end @@ -4199,7 +4199,7 @@ do end --tooltip relative side - local onSelectAnchorRelative = function (_, _, selected_anchor) + local onSelectAnchorRelative = function(_, _, selected_anchor) _detalhes.tooltip.anchor_relative = selected_anchor afterUpdate() end @@ -4220,7 +4220,7 @@ do end --anchor - local onSelectAnchor = function (_, _, selected_anchor) + local onSelectAnchor = function(_, _, selected_anchor) _detalhes.tooltip.anchored_to = selected_anchor refreshToggleAnchor() afterUpdate() @@ -4240,7 +4240,7 @@ do {--text shadow type = "toggle", get = function() return _detalhes.tooltip.fontshadow end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.tooltip.fontshadow = value afterUpdate() end, @@ -4256,7 +4256,7 @@ do local r, g, b, a = unpack(_detalhes.tooltip.fontcolor) return {r, g, b, a} end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) local color = _detalhes.tooltip.fontcolor color[1] = r color[2] = g @@ -4274,7 +4274,7 @@ do local r, g, b, a = unpack(_detalhes.tooltip.fontcolor_right) return {r, g, b, a} end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) local color = _detalhes.tooltip.fontcolor_right color[1] = r color[2] = g @@ -4292,7 +4292,7 @@ do local r, g, b, a = unpack(_detalhes.tooltip.header_text_color) return {r, g, b, a} end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) local color = _detalhes.tooltip.header_text_color color[1] = r color[2] = g @@ -4307,7 +4307,7 @@ do {--text size type = "range", get = function() return _detalhes.tooltip.fontsize end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.tooltip.fontsize = value afterUpdate() end, @@ -4337,7 +4337,7 @@ do local r, g, b, a = unpack(_detalhes.tooltip.background) return {r, g, b, a} end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) local color = _detalhes.tooltip.background color[1] = r color[2] = g @@ -4352,7 +4352,7 @@ do {--show amount type = "toggle", get = function() return _detalhes.tooltip.show_amount end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.tooltip.show_amount = value afterUpdate() end, @@ -4429,7 +4429,7 @@ do {--anchor offset x type = "range", get = function() return _detalhes.tooltip.anchor_offset[1] end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.tooltip.anchor_offset[1] = value afterUpdate() end, @@ -4443,7 +4443,7 @@ do {--anchor offset y type = "range", get = function() return _detalhes.tooltip.anchor_offset[2] end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.tooltip.anchor_offset[2] = value afterUpdate() end, @@ -4471,7 +4471,7 @@ end do local buildSection = function(sectionFrame) - local onSelectMinimapAction = function (_, _, option) + local onSelectMinimapAction = function(_, _, option) _detalhes.minimap.onclick_what_todo = option afterUpdate() end @@ -4484,7 +4484,7 @@ do return menu end - local onSelectTimeAbbreviation = function (_, _, abbreviationtype) + local onSelectTimeAbbreviation = function(_, _, abbreviationtype) _detalhes.tooltip.abbreviation = abbreviationtype _detalhes:BrokerTick() afterUpdate() @@ -4513,7 +4513,7 @@ do {--minimap icon enabled type = "toggle", get = function() return not _detalhes.minimap.hide end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.minimap.hide = not value local LDBIcon = LDB and LibStub("LibDBIcon-1.0", true) @@ -4583,7 +4583,7 @@ do {--item level tracker enabled type = "toggle", get = function() return _detalhes.ilevel:IsTrackerEnabled() end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.ilevel:TrackItemLevel(value) afterUpdate() end, @@ -4597,7 +4597,7 @@ do {--enabled heal spell links type = "toggle", get = function() return _detalhes.report_heal_links end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.report_heal_links = value afterUpdate() end, @@ -4620,14 +4620,14 @@ do local buildSection = function(sectionFrame) --> callback from the image editor - local callmeback = function (width, height, overlayColor, alpha, texCoords) + local callmeback = function(width, height, overlayColor, alpha, texCoords) editInstanceSetting(currentInstance, "InstanceWallpaper", nil, nil, alpha, texCoords, width, height, overlayColor) sectionFrame:UpdateWallpaperInfo() afterUpdate() end --> select wallpaper - local onSelectSecTexture = function (self, instance, texturePath) + local onSelectSecTexture = function(self, instance, texturePath) local textureOptions = sectionFrame.wallpaperOptions local selectedTextureOption = texturePath @@ -4811,7 +4811,7 @@ do end --> wallpaper alignment - local onSelectAnchor = function (_, instance, anchor) + local onSelectAnchor = function(_, instance, anchor) editInstanceSetting(currentInstance, "InstanceWallpaper", nil, anchor) afterUpdate() sectionFrame:UpdateWallpaperInfo() @@ -4941,7 +4941,7 @@ do {--enable wallpaper type = "toggle", get = function() return currentInstance.wallpaper.enabled end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) currentInstance.wallpaper.enabled = value @@ -4988,7 +4988,7 @@ do {--wallpaper level type = "range", get = function() return currentInstance.wallpaper.level end, --default 2 - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetInstanceWallpaperLevel", value) afterUpdate() end, @@ -5079,7 +5079,7 @@ do autoSwitchFrame:SetPoint("topleft", 0, 0) --damager not in combat - local onSelectAutoSwitchDamagerNoCombat = function (_, _, switchTo) + local onSelectAutoSwitchDamagerNoCombat = function(_, _, switchTo) if (switchTo == 0) then currentInstance.switch_damager = false afterUpdate() @@ -5091,7 +5091,7 @@ do end --damager in combat - local onSelectAutoSwitchDamagerInCombat = function (_, _, switchTo) + local onSelectAutoSwitchDamagerInCombat = function(_, _, switchTo) if (switchTo == 0) then currentInstance.switch_damager_in_combat = false afterUpdate() @@ -5103,7 +5103,7 @@ do end --healer not in combat - local onSelectAutoSwitchHealerNoCombat = function (_, _, switchTo) + local onSelectAutoSwitchHealerNoCombat = function(_, _, switchTo) if (switchTo == 0) then currentInstance.switch_healer = false afterUpdate() @@ -5115,7 +5115,7 @@ do end --healer in combat - local onSelectAutoSwitchHealerInCombat = function (_, _, switchTo) + local onSelectAutoSwitchHealerInCombat = function(_, _, switchTo) if (switchTo == 0) then currentInstance.switch_healer_in_combat = false afterUpdate() @@ -5127,7 +5127,7 @@ do end --tank not in combat - local onSelectAutoSwitchTankNoCombat = function (_, _, switchTo) + local onSelectAutoSwitchTankNoCombat = function(_, _, switchTo) if (switchTo == 0) then currentInstance.switch_tank = false afterUpdate() @@ -5139,7 +5139,7 @@ do end --tank in combat - local onSelectAutoSwitchTankInCombat = function (_, _, switchTo) + local onSelectAutoSwitchTankInCombat = function(_, _, switchTo) if (switchTo == 0) then currentInstance.switch_tank_in_combat = false afterUpdate() @@ -5151,7 +5151,7 @@ do end --after wipe - local onSelectAutoSwitchAfterWipe = function (_, _, switchTo) + local onSelectAutoSwitchAfterWipe = function(_, _, switchTo) if (switchTo == 0) then currentInstance.switch_all_roles_after_wipe = false afterUpdate() @@ -5279,7 +5279,7 @@ do {--auto current segment type = "toggle", get = function() return currentInstance.auto_current end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) currentInstance.auto_current = value afterUpdate() end, @@ -5290,7 +5290,7 @@ do {--trash suppression type = "range", get = function() return _detalhes.instances_suppress_trash end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes:SetTrashSuppression(value) afterUpdate() end, @@ -5307,7 +5307,7 @@ do {--enabled type = "toggle", get = function() return currentInstance.menu_alpha.enabled end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetMenuAlpha", value) afterUpdate() end, @@ -5318,7 +5318,7 @@ do {--ignore bars type = "toggle", get = function() return currentInstance.menu_alpha.ignorebars end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetMenuAlpha", nil, nil, nil, value) afterUpdate() end, @@ -5329,7 +5329,7 @@ do {--on hover over alpha type = "range", get = function() return currentInstance.menu_alpha.onenter end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetMenuAlpha", nil, value) afterUpdate() end, @@ -5344,7 +5344,7 @@ do {--no interaction type = "range", get = function() return currentInstance.menu_alpha.onleave end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) editInstanceSetting(currentInstance, "SetMenuAlpha", nil, nil, value) afterUpdate() end, @@ -5498,7 +5498,7 @@ do --raid tools local buildSection = function(sectionFrame) --on select channel for interrip announcer - local on_select_channel = function (self, _, channel) + local on_select_channel = function(self, _, channel) _detalhes.announce_interrupts.channel = channel C_Timer.After(0, function() if (channel == "WHISPER") then @@ -5521,7 +5521,7 @@ do --raid tools end --on select channel for cooldown announcer - local on_select_channel = function (self, _, channel) + local on_select_channel = function(self, _, channel) _detalhes.announce_cooldowns.channel = channel afterUpdate() end @@ -5538,7 +5538,7 @@ do --raid tools end --on select channel for report deaths - local on_select_channel = function (self, _, channel) + local on_select_channel = function(self, _, channel) _detalhes.announce_deaths.where = channel afterUpdate() end @@ -5569,7 +5569,7 @@ do --raid tools f:SetFrameStrata ("FULLSCREEN") f:EnableMouse() f:SetMovable (true) - f:SetScript ("OnMouseDown", function (self, button) + f:SetScript ("OnMouseDown", function(self, button) if (button == "RightButton") then if (f.IsMoving) then f.IsMoving = false @@ -5583,7 +5583,7 @@ do --raid tools f:StartMoving() end) - f:SetScript ("OnMouseUp", function (self, button) + f:SetScript ("OnMouseUp", function(self, button) if (f.IsMoving) then f.IsMoving = false f:StopMovingOrSizing() @@ -5591,7 +5591,7 @@ do --raid tools end) f.labels = {} - local on_switch_func = function (self, spellid, value) + local on_switch_func = function(self, spellid, value) if (spellid) then if (not value) then _detalhes.announce_cooldowns.ignored_cooldowns [spellid] = nil @@ -5601,7 +5601,7 @@ do --raid tools end end - f:SetScript ("OnHide", function (self) + f:SetScript ("OnHide", function(self) self:Clear() end) @@ -5638,7 +5638,7 @@ do --raid tools local _GetSpellInfo = _detalhes.getspellinfo --details api for index, spellid in ipairs (_detalhes:GetCooldownList()) do - local name, _, icon = _GetSpellInfo (spellid) + local name, _, icon = _GetSpellInfo(spellid) if (name) then local label = f.labels [index] or f:CreateLabel() label.icon.texture = icon @@ -5664,7 +5664,7 @@ do --raid tools {--auto current segment type = "toggle", get = function() return Details.announce_interrupts.enabled end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) if (value) then _detalhes:EnableInterruptAnnouncer() else @@ -5749,7 +5749,7 @@ do --raid tools {--enable cooldown announcer type = "toggle", get = function() return _detalhes.announce_cooldowns.enabled end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) if (value) then _detalhes:EnableCooldownAnnouncer() else @@ -5815,7 +5815,7 @@ do --raid tools {--enable death announcer type = "toggle", get = function() return _detalhes.announce_deaths.enabled end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) if (value) then _detalhes:EnableDeathAnnouncer() else @@ -5830,7 +5830,7 @@ do --raid tools {--max hits to show type = "range", get = function() return _detalhes.announce_deaths.last_hits end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.announce_deaths.last_hits = value afterUpdate() end, @@ -5844,7 +5844,7 @@ do --raid tools {--max hits to show type = "range", get = function() return _detalhes.announce_deaths.only_first end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.announce_deaths.only_first = value afterUpdate() end, @@ -5871,7 +5871,7 @@ do --raid tools {--enable death recap type = "toggle", get = function() return _detalhes.death_recap.enabled end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.death_recap.enabled = value afterUpdate() end, @@ -5882,7 +5882,7 @@ do --raid tools {--relevance time type = "range", get = function() return _detalhes.death_recap.relevance_time end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.death_recap.relevance_time = value afterUpdate() end, @@ -5896,7 +5896,7 @@ do --raid tools {--show life percent type = "toggle", get = function() return _detalhes.death_recap.show_life_percent end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.death_recap.show_life_percent = value afterUpdate() end, @@ -5907,7 +5907,7 @@ do --raid tools {--show segment list type = "toggle", get = function() return _detalhes.death_recap.show_segments end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.death_recap.show_segments = value afterUpdate() end, @@ -5921,7 +5921,7 @@ do --raid tools {--show first hit type = "toggle", get = function() return _detalhes.announce_firsthit.enabled end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.announce_firsthit.enabled = value afterUpdate() end, @@ -5932,7 +5932,7 @@ do --raid tools {--show death menu type = "toggle", get = function() return _detalhes.on_death_menu end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.on_death_menu = value afterUpdate() end, @@ -6155,7 +6155,7 @@ do {--no window alerts type = "toggle", get = function() return _detalhes.streamer_config.no_alerts end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.streamer_config.no_alerts = value afterUpdate() end, @@ -6166,7 +6166,7 @@ do {--60hz updates type = "toggle", get = function() return _detalhes.streamer_config.faster_updates end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.streamer_config.faster_updates = value _detalhes:RefreshUpdater() afterUpdate() @@ -6178,7 +6178,7 @@ do {--quick player info type = "toggle", get = function() return _detalhes.streamer_config.quick_detection end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.streamer_config.quick_detection = value afterUpdate() end, @@ -6189,7 +6189,7 @@ do {--disable M+ shenanigans type = "toggle", get = function() return _detalhes.streamer_config.disable_mythic_dungeon end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.streamer_config.disable_mythic_dungeon = value afterUpdate() end, @@ -6200,7 +6200,7 @@ do {--disable M+ charts type = "toggle", get = function() return _detalhes.mythic_plus.show_damage_graphic end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.mythic_plus.show_damage_graphic = value afterUpdate() end, @@ -6211,7 +6211,7 @@ do {--clear cache regurlary type = "toggle", get = function() return _detalhes.mythic_plus.show_damage_graphic end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) _detalhes.mythic_plus.show_damage_graphic = value afterUpdate() end, @@ -6234,16 +6234,16 @@ end do local buildSection = function(sectionFrame) - local name_entry_func = function (index, text) + local name_entry_func = function(index, text) _detalhes:UserCustomSpellUpdate (index, text) end - local icon_func = function (index, icon) + local icon_func = function(index, icon) _detalhes:UserCustomSpellUpdate (index, nil, icon) end - local remove_func = function (index) + local remove_func = function(index) _detalhes:UserCustomSpellRemove (index) end - local reset_func = function (index) + local reset_func = function(index) _detalhes:UserCustomSpellReset (index) end @@ -6260,7 +6260,7 @@ do local total_lines = function() return #_detalhes.savedCustomSpells end - local fill_row = function (index) + local fill_row = function(index) local data = _detalhes.savedCustomSpells [index] if (data) then return {index, data [2], data [3], data [1], ""} @@ -6288,8 +6288,8 @@ do local spellname_entry = DF:NewTextEntry (addframe, nil, "$parentSpellnameEntry", "spellnameEntry", 160, 20, spellname_entry_func, nil, nil, nil, nil, options_dropdown_template) spellname_entry:SetPoint ("left", spellname, "right", 2, 0) - local spellid_entry_func = function (arg1, arg2, spellid) - local spellname, _, icon = GetSpellInfo (spellid) + local spellid_entry_func = function(arg1, arg2, spellid) + local spellname, _, icon = GetSpellInfo(spellid) if (spellname) then spellname_entry:SetText (spellname) addframe.spellIconButton.icon.texture = icon @@ -6301,7 +6301,7 @@ do spellid_entry:SetTemplate (options_dropdown_template) spellid_entry:SetPoint ("left", spellid, "right", 2, 0) - local icon_button_func = function (texture) + local icon_button_func = function(texture) addframe.spellIconButton.icon.texture = texture end local icon_button = DF:NewButton (addframe, nil, "$parentSpellIconButton", "spellIconButton", 20, 20, function() DF:IconPick (icon_button_func, true) end) @@ -6371,7 +6371,7 @@ do DF:NewSwitch (sectionFrame, _, "$parentConsolidadeSpellsSwitch", "ConsolidadeSpellsSwitch", 60, 20, nil, nil, _detalhes.override_spellids, nil, nil, nil, nil, options_switch_template) sectionFrame.ConsolidadeSpellsLabel:SetPoint ("left", sectionFrame.ConsolidadeSpellsSwitch, "right", 3) sectionFrame.ConsolidadeSpellsSwitch:SetAsCheckBox() - sectionFrame.ConsolidadeSpellsSwitch.OnSwitch = function (self, instance, value) + sectionFrame.ConsolidadeSpellsSwitch.OnSwitch = function(self, instance, value) _detalhes.override_spellids = value _detalhes:UpdateParserGears() end @@ -6413,7 +6413,7 @@ do end --> panel - local edit_name = function (index, name) + local edit_name = function(index, name) _detalhes:TimeDataUpdate (index, name) sectionFrame.userTimeCaptureFillPanel:Refresh() end @@ -6422,7 +6422,7 @@ do big_code_editor:SetPoint ("topleft", sectionFrame, "topleft", startX, startY - 70) big_code_editor:SetFrameLevel (sectionFrame:GetFrameLevel()+6) big_code_editor:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1,tile = 1, tileSize = 16}) - DF:ReskinSlider (big_code_editor.scroll) + DF:ReskinSlider(big_code_editor.scroll) big_code_editor:SetBackdropColor (0.5, 0.5, 0.5, 0.95) big_code_editor:SetBackdropBorderColor (0, 0, 0, 1) big_code_editor:Hide() @@ -6451,7 +6451,7 @@ do cancel_changes:SetTemplate(options_button_template) cancel_changes:SetText(Loc ["STRING_OPTIONS_CHART_CANCEL"]) - local edit_code = function (index) + local edit_code = function(index) local data = _detalhes.savedTimeCaptures [index] if (data) then local func = data [2] @@ -6475,15 +6475,15 @@ do end end - local edit_icon = function (index, icon) + local edit_icon = function(index, icon) _detalhes:TimeDataUpdate (index, nil, nil, nil, nil, nil, icon) sectionFrame.userTimeCaptureFillPanel:Refresh() end - local edit_author = function (index, author) + local edit_author = function(index, author) _detalhes:TimeDataUpdate (index, nil, nil, nil, author) sectionFrame.userTimeCaptureFillPanel:Refresh() end - local edit_version = function (index, version) + local edit_version = function(index, version) _detalhes:TimeDataUpdate (index, nil, nil, nil, nil, version) sectionFrame.userTimeCaptureFillPanel:Refresh() end @@ -6492,7 +6492,7 @@ do big_code_editor2:SetPoint ("topleft", sectionFrame, "topleft", 7, -70) big_code_editor2:SetFrameLevel (sectionFrame:GetFrameLevel()+6) big_code_editor2:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1,tile = 1, tileSize = 16}) - DF:ReskinSlider (big_code_editor2.scroll) + DF:ReskinSlider(big_code_editor2.scroll) big_code_editor2:SetBackdropColor (0.5, 0.5, 0.5, 0.95) big_code_editor2:SetBackdropBorderColor (0, 0, 0, 1) big_code_editor2:Hide() @@ -6508,7 +6508,7 @@ do close_export:SetText (Loc ["STRING_OPTIONS_CHART_CLOSE"]) close_export:SetTemplate (options_button_template) - local export_function = function (index) + local export_function = function(index) local data = _detalhes.savedTimeCaptures [index] if (data) then local encoded = Details:CompressData (data, "print") @@ -6524,12 +6524,12 @@ do end end - local remove_capture = function (index) + local remove_capture = function(index) _detalhes:TimeDataUnregister (index) sectionFrame.userTimeCaptureFillPanel:Refresh() end - local edit_enabled = function (index, enabled, a, b) + local edit_enabled = function(index, enabled, a, b) if (enabled) then _detalhes:TimeDataUpdate (index, nil, nil, nil, nil, nil, nil, false) else @@ -6553,7 +6553,7 @@ do local total_lines = function() return #_detalhes.savedTimeCaptures end - local fill_row = function (index) + local fill_row = function(index) local data = _detalhes.savedTimeCaptures [index] if (data) then @@ -6612,11 +6612,11 @@ do capture_func_entry:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) capture_func_entry:SetBackdropBorderColor (0, 0, 0, 1) capture_func_entry:SetBackdropColor (0, 0, 0, .5) - DF:ReskinSlider (capture_func_entry.scroll) + DF:ReskinSlider(capture_func_entry.scroll) --> icon local capture_icon = DF:NewLabel (addframe, nil, "$parentIconLabel", "iconLabel", Loc ["STRING_OPTIONS_CHART_ADDICON"]) - local icon_button_func = function (texture) + local icon_button_func = function(texture) addframe.iconButton.iconTexture = texture addframe.iconButton:SetIcon(texture) end @@ -6821,7 +6821,7 @@ do {--always in combat type = "toggle", get = function() return Details.mythic_plus.always_in_combat end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.mythic_plus.always_in_combat = value end, name = "Always in Combat", @@ -6831,7 +6831,7 @@ do {--dedicated segment for bosses type = "toggle", get = function() return Details.mythic_plus.boss_dedicated_segment end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.mythic_plus.boss_dedicated_segment = value end, name = "Boss Dedicated Segment", @@ -6841,7 +6841,7 @@ do {--make overall when done type = "toggle", get = function() return Details.mythic_plus.make_overall_when_done end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.mythic_plus.make_overall_when_done = value end, name = "Make Overall Segment", @@ -6851,7 +6851,7 @@ do {--overall only with bosses type = "toggle", get = function() return Details.mythic_plus.make_overall_boss_only end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.mythic_plus.make_overall_boss_only = value end, name = "Overall Segment Boss Only", @@ -6861,7 +6861,7 @@ do {--merge trash type = "toggle", get = function() return Details.mythic_plus.merge_boss_trash end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.mythic_plus.merge_boss_trash = value end, name = "Merge Trash", @@ -6871,7 +6871,7 @@ do {--delete merged trash type = "toggle", get = function() return Details.mythic_plus.delete_trash_after_merge end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.mythic_plus.delete_trash_after_merge = value end, name = "Delete Merged Trash Segments", @@ -6881,7 +6881,7 @@ do {--show chart popup type = "toggle", get = function() return Details.mythic_plus.show_damage_graphic end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.mythic_plus.show_damage_graphic = value end, name = "Show Damage Charts", diff --git a/frames/window_plater.lua b/frames/window_plater.lua index 4870bdb4..39e22355 100644 --- a/frames/window_plater.lua +++ b/frames/window_plater.lua @@ -42,13 +42,13 @@ function Details.OpenPlaterIntegrationWindow() --> anchor text function local anchor_names = {"Top Left", "Left", "Bottom Left", "Bottom", "Bottom Right", "Right", "Top Right", "Top", "Center", "Inner Left", "Inner Right", "Inner Top", "Inner Bottom"} - local build_anchor_side_table = function (member) + local build_anchor_side_table = function(member) local t = {} for i = 1, 13 do tinsert (t, { label = anchor_names[i], value = i, - onclick = function (_, _, value) + onclick = function(_, _, value) Details.plater [member].side = value if (Plater) then Plater.UpdateAllPlates() @@ -67,7 +67,7 @@ function Details.OpenPlaterIntegrationWindow() { type = "toggle", get = function() return Details.plater.realtime_dps_enabled end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.plater.realtime_dps_enabled = value Details:RefreshPlaterIntegration() @@ -87,7 +87,7 @@ function Details.OpenPlaterIntegrationWindow() { type = "range", get = function() return Details.plater.realtime_dps_size end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.plater.realtime_dps_size = value if (Plater) then Plater.UpdateAllPlates() @@ -106,7 +106,7 @@ function Details.OpenPlaterIntegrationWindow() local color = Details.plater.realtime_dps_color return {color [1], color [2], color [3], color [4]} end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) local color = Details.plater.realtime_dps_color color[1], color[2], color[3], color[4] = r, g, b, a if (Plater) then @@ -121,7 +121,7 @@ function Details.OpenPlaterIntegrationWindow() { type = "toggle", get = function() return Details.plater.realtime_dps_shadow end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.plater.realtime_dps_shadow = value if (Plater) then Plater.UpdateAllPlates() @@ -143,7 +143,7 @@ function Details.OpenPlaterIntegrationWindow() { type = "range", get = function() return Details.plater.realtime_dps_anchor.x end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.plater.realtime_dps_anchor.x = value if (Plater) then Plater.UpdateAllPlates() @@ -159,7 +159,7 @@ function Details.OpenPlaterIntegrationWindow() { type = "range", get = function() return Details.plater.realtime_dps_anchor.y end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.plater.realtime_dps_anchor.y = value if (Plater) then Plater.UpdateAllPlates() @@ -179,7 +179,7 @@ function Details.OpenPlaterIntegrationWindow() { type = "toggle", get = function() return Details.plater.realtime_dps_player_enabled end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.plater.realtime_dps_player_enabled = value Details:RefreshPlaterIntegration() @@ -199,7 +199,7 @@ function Details.OpenPlaterIntegrationWindow() { type = "range", get = function() return Details.plater.realtime_dps_player_size end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.plater.realtime_dps_player_size = value if (Plater) then Plater.UpdateAllPlates() @@ -218,7 +218,7 @@ function Details.OpenPlaterIntegrationWindow() local color = Details.plater.realtime_dps_player_color return {color [1], color [2], color [3], color [4]} end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) local color = Details.plater.realtime_dps_player_color color[1], color[2], color[3], color[4] = r, g, b, a if (Plater) then @@ -233,7 +233,7 @@ function Details.OpenPlaterIntegrationWindow() { type = "toggle", get = function() return Details.plater.realtime_dps_player_shadow end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.plater.realtime_dps_player_shadow = value if (Plater) then Plater.UpdateAllPlates() @@ -255,7 +255,7 @@ function Details.OpenPlaterIntegrationWindow() { type = "range", get = function() return Details.plater.realtime_dps_player_anchor.x end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.plater.realtime_dps_player_anchor.x = value if (Plater) then Plater.UpdateAllPlates() @@ -271,7 +271,7 @@ function Details.OpenPlaterIntegrationWindow() { type = "range", get = function() return Details.plater.realtime_dps_player_anchor.y end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.plater.realtime_dps_player_anchor.y = value if (Plater) then Plater.UpdateAllPlates() @@ -291,7 +291,7 @@ function Details.OpenPlaterIntegrationWindow() { type = "toggle", get = function() return Details.plater.damage_taken_enabled end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.plater.damage_taken_enabled = value Details:RefreshPlaterIntegration() @@ -311,7 +311,7 @@ function Details.OpenPlaterIntegrationWindow() { type = "range", get = function() return Details.plater.damage_taken_size end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.plater.damage_taken_size = value if (Plater) then Plater.UpdateAllPlates() @@ -330,7 +330,7 @@ function Details.OpenPlaterIntegrationWindow() local color = Details.plater.damage_taken_color return {color [1], color [2], color [3], color [4]} end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) local color = Details.plater.damage_taken_color color[1], color[2], color[3], color[4] = r, g, b, a if (Plater) then @@ -345,7 +345,7 @@ function Details.OpenPlaterIntegrationWindow() { type = "toggle", get = function() return Details.plater.damage_taken_shadow end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.plater.damage_taken_shadow = value if (Plater) then Plater.UpdateAllPlates() @@ -367,7 +367,7 @@ function Details.OpenPlaterIntegrationWindow() { type = "range", get = function() return Details.plater.damage_taken_anchor.x end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.plater.damage_taken_anchor.x = value if (Plater) then Plater.UpdateAllPlates() @@ -383,7 +383,7 @@ function Details.OpenPlaterIntegrationWindow() { type = "range", get = function() return Details.plater.damage_taken_anchor.y end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Details.plater.damage_taken_anchor.y = value if (Plater) then Plater.UpdateAllPlates() diff --git a/frames/window_playerbreakdown.lua b/frames/window_playerbreakdown.lua index b1364f0e..6712c563 100644 --- a/frames/window_playerbreakdown.lua +++ b/frames/window_playerbreakdown.lua @@ -110,12 +110,13 @@ function Details:OpenPlayerBreakdown (windowObject, playerObject) end function _detalhes:AbreJanelaInfo (jogador, from_att_change, refresh, ShiftKeyDown, ControlKeyDown) - - --print (debugstack()) + --create the player list frame in the left side of the window + Details.PlayerBreakdown.CreatePlayerListFrame() if (not _detalhes.row_singleclick_overwrite [self.atributo] or not _detalhes.row_singleclick_overwrite [self.atributo][self.sub_atributo]) then _detalhes:FechaJanelaInfo() return + elseif (_type (_detalhes.row_singleclick_overwrite [self.atributo][self.sub_atributo]) == "function") then if (from_att_change) then _detalhes:FechaJanelaInfo() @@ -123,7 +124,7 @@ function _detalhes:AbreJanelaInfo (jogador, from_att_change, refresh, ShiftKeyDo end return _detalhes.row_singleclick_overwrite [self.atributo][self.sub_atributo] (_, jogador, self, ShiftKeyDown, ControlKeyDown) end - + if (self.modo == _detalhes._detalhes_props["MODO_RAID"]) then _detalhes:FechaJanelaInfo() return @@ -139,18 +140,18 @@ function _detalhes:AbreJanelaInfo (jogador, from_att_change, refresh, ShiftKeyDo end if (info.barras1) then - for index, barra in ipairs (info.barras1) do + for index, barra in ipairs (info.barras1) do barra.other_actor = nil end end - + if (info.barras2) then - for index, barra in ipairs (info.barras2) do + for index, barra in ipairs (info.barras2) do barra.icone:SetTexture ("") barra.icone:SetTexCoord (0, 1, 0, 1) end end - + --> passar os par�metros para dentro da tabela da janela. info.ativo = true --> sinaliza o addon que a janela esta aberta @@ -158,16 +159,16 @@ function _detalhes:AbreJanelaInfo (jogador, from_att_change, refresh, ShiftKeyDo info.sub_atributo = self.sub_atributo --> instancia.sub_atributo -> grava o sub atributo (damage done, dps, damage taken, etc) info.jogador = jogador --> de qual jogador (objeto classe_damage) info.instancia = self --> salva a refer�ncia da inst�ncia que pediu o info - + info.target_text = Loc ["STRING_TARGETS"] .. ":" info.target_member = "total" info.target_persecond = false - + info.mostrando = nil - + local nome = info.jogador.nome --> nome do jogador local atributo_nome = sub_atributos[info.atributo].lista [info.sub_atributo] .. " " .. Loc ["STRING_ACTORFRAME_REPORTOF"] --> // nome do atributo // precisa ser o sub atributo correto??? - + --> removendo o nome da realm do jogador if (nome:find ("-")) then nome = nome:gsub (("-.*"), "") @@ -185,11 +186,11 @@ function _detalhes:AbreJanelaInfo (jogador, from_att_change, refresh, ShiftKeyDo if (serial ~= "") then avatar = NickTag:GetNicknameTable (serial) end - + if (avatar and avatar [1]) then info.nome:SetText ((not _detalhes.ignore_nicktag and avatar [1]) or nome) end - + if (avatar and avatar [2]) then info.avatar:SetTexture (avatar [2]) @@ -200,10 +201,10 @@ function _detalhes:AbreJanelaInfo (jogador, from_att_change, refresh, ShiftKeyDo if (avatar [6]) then info.avatar_bg:SetVertexColor (unpack (avatar [6])) end - + info.avatar_nick:SetText (avatar [1] or nome) info.avatar_attribute:SetText (atributo_nome) - + info.avatar_attribute:SetPoint ("CENTER", info.avatar_nick, "CENTER", 0, 14) info.avatar:Show() info.avatar_bg:Show() @@ -212,28 +213,28 @@ function _detalhes:AbreJanelaInfo (jogador, from_att_change, refresh, ShiftKeyDo info.avatar_attribute:Show() info.nome:Hide() info.atributo_nome:Hide() - + else - + info.avatar:Hide() info.avatar_bg:Hide() info.avatar_nick:Hide() info.avatar_attribute:Hide() - + info.nome:Show() info.atributo_nome:Show() end - + info.atributo_nome:SetPoint ("CENTER", info.nome, "CENTER", 0, 14) - + info.no_targets:Hide() info.no_targets.text:Hide() gump:TrocaBackgroundInfo (info) - + gump:HidaAllBarrasInfo() gump:HidaAllBarrasAlvo() gump:HidaAllDetalheInfo() - + gump:JI_AtualizaContainerBarras (-1) local classe = jogador.classe @@ -355,26 +356,26 @@ function gump:TrocaBackgroundInfo() info.apoio_icone_esquerdo:Show() info.apoio_icone_direito:Show() - + info.report_direita:Hide() - + for i = 1, spellInfoSettings.amount do info ["right_background" .. i]:Show() end - + if (info.atributo == 1) then --> DANO - + if (info.sub_atributo == 1 or info.sub_atributo == 2) then --> damage done / dps info.bg1_sec_texture:SetTexture ("") info.tipo = 1 - + if (info.sub_atributo == 2) then info.targets:SetText (Loc ["STRING_TARGETS"] .. " " .. Loc ["STRING_ATTRIBUTE_DAMAGE_DPS"] .. ":") info.target_persecond = true else info.targets:SetText (Loc ["STRING_TARGETS"] .. ":") end - + elseif (info.sub_atributo == 3) then --> damage taken --info.bg1_sec_texture:SetTexture ([[Interface\AddOns\Details\images\info_window_damagetaken]]) @@ -386,51 +387,51 @@ function gump:TrocaBackgroundInfo() for i = 1, spellInfoSettings.amount do info ["right_background" .. i]:Hide() end - + info.targets:SetText (Loc ["STRING_TARGETS"] .. ":") info.no_targets:Show() info.no_targets.text:Show() - + info.apoio_icone_esquerdo:Hide() info.apoio_icone_direito:Hide() info.report_direita:Show() - + elseif (info.sub_atributo == 4) then --> friendly fire --info.bg1_sec_texture:SetTexture ([[Interface\AddOns\Details\images\info_window_damagetaken]]) info.bg1_sec_texture:SetColorTexture (.05, .05, .05, .4) info.bg3_sec_texture:Show() info.bg2_sec_texture:Show() info.tipo = 3 - + for i = 1, spellInfoSettings.amount do info ["right_background" .. i]:Hide() end - + info.targets:SetText (Loc ["STRING_SPELLS"] .. ":") - + info.apoio_icone_esquerdo:Hide() info.apoio_icone_direito:Hide() info.report_direita:Show() - + elseif (info.sub_atributo == 6) then --> enemies --info.bg1_sec_texture:SetTexture ([[Interface\AddOns\Details\images\info_window_damagetaken]]) info.bg1_sec_texture:SetColorTexture (.05, .05, .05, .4) info.bg3_sec_texture:Show() info.bg2_sec_texture:Show() info.tipo = 3 - + for i = 1, spellInfoSettings.amount do info ["right_background" .. i]:Hide() end - + info.targets:SetText (Loc ["STRING_DAMAGE_TAKEN_FROM"]) end - + elseif (info.atributo == 2) then --> HEALING if (info.sub_atributo == 1 or info.sub_atributo == 2 or info.sub_atributo == 3) then --> damage done / dps info.bg1_sec_texture:SetTexture ("") info.tipo = 1 - + if (info.sub_atributo == 3) then info.targets:SetText (Loc ["STRING_OVERHEALED"] .. ":") info.target_member = "overheal" @@ -441,7 +442,7 @@ function gump:TrocaBackgroundInfo() else info.targets:SetText (Loc ["STRING_TARGETS"] .. ":") end - + elseif (info.sub_atributo == 4) then --> Healing taken info.bg1_sec_texture:SetColorTexture (.05, .05, .05, .4) info.bg3_sec_texture:Show() @@ -451,21 +452,21 @@ function gump:TrocaBackgroundInfo() for i = 1, spellInfoSettings.amount do info ["right_background" .. i]:Hide() end - + info.targets:SetText (Loc ["STRING_TARGETS"] .. ":") info.no_targets:Show() info.no_targets.text:Show() - + info.apoio_icone_esquerdo:Hide() info.apoio_icone_direito:Hide() info.report_direita:Show() end - + elseif (info.atributo == 3) then --> REGEN info.bg1_sec_texture:SetTexture ("") info.tipo = 2 info.targets:SetText ("Vindo de:") - + elseif (info.atributo == 4) then --> MISC info.bg1_sec_texture:SetTexture ("") info.tipo = 2 @@ -486,17 +487,17 @@ function _detalhes:FechaJanelaInfo (fromEscape) Details.FadeHandler.Fader (info, 1) end info.ativo = false --> sinaliza o addon que a janela esta agora fechada - + --_detalhes.info_jogador.detalhes = nil info.jogador = nil info.atributo = nil info.sub_atributo = nil info.instancia = nil - + info.nome:SetText ("") info.atributo_nome:SetText ("") - - gump:JI_AtualizaContainerBarras (-1) --> reseta o frame das barras + + gump:JI_AtualizaContainerBarras (-1) --> reseta o frame das barras end end @@ -526,7 +527,7 @@ function gump:HidaAllDetalheInfo() for i = 1, spellInfoSettings.amount do gump:HidaDetalheInfo (i) end - for _, barra in _ipairs (info.barras3) do + for _, barra in _ipairs (info.barras3) do barra:Hide() end _detalhes.playerDetailWindow.spell_icone:SetTexture ("") @@ -534,7 +535,7 @@ end --> seta os scripts da janela de informa��es -local mouse_down_func = function (self, button) +local mouse_down_func = function(self, button) if (button == "LeftButton") then info:StartMoving() info.isMoving = true @@ -543,7 +544,7 @@ local mouse_down_func = function (self, button) end end -local mouse_up_func = function (self, button) +local mouse_up_func = function(self, button) if (info.isMoving) then info:StopMovingOrSizing() info.isMoving = false @@ -559,7 +560,7 @@ local function seta_scripts (este_gump) este_gump.container_barras.gump:SetScript ("OnMouseDown", mouse_down_func) este_gump.container_barras.gump:SetScript ("OnMouseUp", mouse_up_func) - + este_gump.container_detalhes:SetScript ("OnMouseDown", mouse_down_func) este_gump.container_detalhes:SetScript ("OnMouseUp", mouse_up_func) @@ -567,7 +568,7 @@ local function seta_scripts (este_gump) este_gump.container_alvos.gump:SetScript ("OnMouseUp", mouse_up_func) --> bot�o fechar - este_gump.close_button:SetScript ("OnClick", function (self) + este_gump.close_button:SetScript ("OnClick", function(self) _detalhes:FechaJanelaInfo() end) end @@ -589,54 +590,54 @@ end --> cria a barra de detalhes a direita da janela de informa��es ------------------------------------------------------------------------------------------------------------------------------ -local detalhe_infobg_onenter = function (self) - Details.FadeHandler.Fader (self.overlay, "OUT") +local detalhe_infobg_onenter = function(self) + Details.FadeHandler.Fader (self.overlay, "OUT") Details.FadeHandler.Fader (self.reportar, "OUT") end -local detalhe_infobg_onleave = function (self) +local detalhe_infobg_onleave = function(self) Details.FadeHandler.Fader (self.overlay, "IN") Details.FadeHandler.Fader (self.reportar, "IN") end -local detalhes_inforeport_onenter = function (self) +local detalhes_inforeport_onenter = function(self) Details.FadeHandler.Fader (self:GetParent().overlay, "OUT") Details.FadeHandler.Fader (self, "OUT") end -local detalhes_inforeport_onleave = function (self) +local detalhes_inforeport_onleave = function(self) Details.FadeHandler.Fader (self:GetParent().overlay, "IN") Details.FadeHandler.Fader (self, "IN") end function gump:CriaDetalheInfo (index) local info = {} - + info.bg = _CreateFrame ("StatusBar", "DetailsPlayerDetailsWindow_DetalheInfoBG" .. index, _detalhes.playerDetailWindow.container_detalhes, "BackdropTemplate") info.bg:SetStatusBarTexture ("Interface\\AddOns\\Details\\images\\bar_detalhes2") info.bg:SetStatusBarColor (1, 1, 1, .84) info.bg:SetMinMaxValues (0, 100) info.bg:SetValue (100) info.bg:SetSize (320, 47) - + info.nome = info.bg:CreateFontString (nil, "OVERLAY", "GameFontNormal") info.nome2 = info.bg:CreateFontString (nil, "OVERLAY", "GameFontHighlightSmall") info.dano = info.bg:CreateFontString (nil, "OVERLAY", "GameFontHighlightSmall") info.dano_porcento = info.bg:CreateFontString (nil, "OVERLAY", "GameFontHighlightSmall") info.dano_media = info.bg:CreateFontString (nil, "OVERLAY", "GameFontHighlightSmall") info.dano_dps = info.bg:CreateFontString (nil, "OVERLAY", "GameFontHighlightSmall") - + info.bg.overlay = info.bg:CreateTexture ("DetailsPlayerDetailsWindow_DetalheInfoBG_Overlay" .. index, "ARTWORK") info.bg.overlay:SetTexture ("Interface\\AddOns\\Details\\images\\overlay_detalhes") info.bg.overlay:SetWidth (341) info.bg.overlay:SetHeight (61) info.bg.overlay:SetPoint ("TOPLEFT", info.bg, "TOPLEFT", -7, 6) Details.FadeHandler.Fader (info.bg.overlay, 1) - + info.bg.reportar = gump:NewDetailsButton (info.bg, nil, nil, _detalhes.Reportar, _detalhes.playerDetailWindow, 10+index, 16, 16, "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", nil, "DetailsJanelaInfoReport1") info.bg.reportar:SetPoint ("BOTTOMLEFT", info.bg.overlay, "BOTTOMRIGHT", -33, 10) Details.FadeHandler.Fader (info.bg.reportar, 1) - + info.bg:SetScript ("OnEnter", detalhe_infobg_onenter) info.bg:SetScript ("OnLeave", detalhe_infobg_onleave) @@ -655,12 +656,12 @@ function info:SetDetailInfoConfigs (texture, color, x, y) if (texture) then info.grupos_detalhes [i].bg:SetStatusBarTexture (texture) end - + if (color) then local texture = info.grupos_detalhes [i].bg:GetStatusBarTexture() texture:SetVertexColor (unpack (color)) end - + if (x or y) then gump:SetaDetalheInfoAltura (i, x, y) end @@ -672,71 +673,71 @@ end function gump:SetaDetalheInfoAltura (index, xmod, ymod) local info = _detalhes.playerDetailWindow.grupos_detalhes [index] local janela = _detalhes.playerDetailWindow.container_detalhes - + local altura = {-10, -63, -118, -173, -228, -279} - + local x1 = 64 + (xmod or 0) local x2 = 00 + (ymod or 0) - + altura = altura [index] - + local background - + local y = -74 - ((index-1) * 79.5) - + if (index == 1) then _detalhes.playerDetailWindow.right_background1:SetPoint ("topleft", _detalhes.playerDetailWindow, "topleft", 357 + (xmod or 0), y) background = _detalhes.playerDetailWindow.right_background1 - + elseif (index == 2) then _detalhes.playerDetailWindow.right_background2:SetPoint ("topleft", _detalhes.playerDetailWindow, "topleft", 357 + (xmod or 0), y) background = _detalhes.playerDetailWindow.right_background2 - + elseif (index == 3) then _detalhes.playerDetailWindow.right_background3:SetPoint ("topleft", _detalhes.playerDetailWindow, "topleft", 357 + (xmod or 0), y) background = _detalhes.playerDetailWindow.right_background3 - + elseif (index == 4) then _detalhes.playerDetailWindow.right_background4:SetPoint ("topleft", _detalhes.playerDetailWindow, "topleft", 357 + (xmod or 0), y) background = _detalhes.playerDetailWindow.right_background4 - + elseif (index == 5) then _detalhes.playerDetailWindow.right_background5:SetPoint ("topleft", _detalhes.playerDetailWindow, "topleft", 357 + (xmod or 0), y) background = _detalhes.playerDetailWindow.right_background5 - + elseif (index == 6) then _detalhes.playerDetailWindow.right_background6:SetPoint ("topleft", _detalhes.playerDetailWindow, "topleft", 357 + (xmod or 0), y) background = _detalhes.playerDetailWindow.right_background6 - + end - + background:SetHeight (75) - + --3 textos da esquerda e direita local y = -3 local x = 3 local right = -1 - + info.nome:SetPoint ("TOPLEFT", background, "TOPLEFT", x, y + (-2)) info.dano:SetPoint ("TOPLEFT", background, "TOPLEFT", x, y + (-24)) info.dano_media:SetPoint ("TOPLEFT", background, "TOPLEFT", x, y + (-44)) - + info.nome2:SetPoint ("TOPRIGHT", background, "TOPRIGHT", -x + right, y + (-2)) info.dano_porcento:SetPoint ("TOPRIGHT", background, "TOPRIGHT", -x + right, y + (-24)) info.dano_dps:SetPoint ("TOPRIGHT", background, "TOPRIGHT", -x + right, y + (-44)) - + info.bg:SetPoint ("TOPLEFT", background, "TOPLEFT", 1, -1) info.bg:SetHeight (background:GetHeight() - 2) info.bg:SetWidth (background:GetWidth()) - + info.bg_end:SetPoint ("LEFT", info.bg, "LEFT", info.bg:GetValue()*2.19, 0) info.bg_end:SetHeight (background:GetHeight()+2) info.bg_end:SetWidth (6) info.bg_end:SetAlpha (.75) - + info.bg.overlay:SetWidth (background:GetWidth() + 24) info.bg.overlay:SetHeight (background:GetHeight() + 16) - + info.bg:Hide() end @@ -744,7 +745,7 @@ end ------------------------------------------------------------------------------------------------------------------------------ function gump:SetaDetalheInfoTexto (index, p, arg1, arg2, arg3, arg4, arg5, arg6) local info = _detalhes.playerDetailWindow.grupos_detalhes [index] - + if (p) then if (_type (p) == "table") then info.bg:SetValue (p.p) @@ -758,46 +759,46 @@ function gump:SetaDetalheInfoTexto (index, p, arg1, arg2, arg3, arg4, arg5, arg6 info.bg_end:SetPoint ("LEFT", info.bg, "LEFT", (info.bg:GetValue() * (info.bg:GetWidth( ) / 100)) - 3, 0) -- 2.19 info.bg:Show() end - - if (info.IsPet) then + + if (info.IsPet) then info.bg.PetIcon:Hide() info.bg.PetText:Hide() info.bg.PetDps:Hide() Details.FadeHandler.Fader (info.bg.overlay, "IN") info.IsPet = false end - + if (arg1) then info.nome:SetText (arg1) end - + if (arg2) then info.dano:SetText (arg2) end - + if (arg3) then info.dano_porcento:SetText (arg3) end - + if (arg4) then info.dano_media:SetText (arg4) end - + if (arg5) then info.dano_dps:SetText (arg5) end - + if (arg6) then info.nome2:SetText (arg6) end - + info.nome:Show() info.dano:Show() info.dano_porcento:Show() info.dano_media:Show() info.dano_dps:Show() info.nome2:Show() - + end --> cria as 5 caixas de detalhes infos que ser�o usados @@ -816,9 +817,9 @@ end local function cria_textos (este_gump, SWW) este_gump.nome = este_gump:CreateFontString (nil, "OVERLAY", "QuestFont_Large") este_gump.nome:SetPoint ("TOPLEFT", este_gump, "TOPLEFT", 105, -54) - + este_gump.atributo_nome = este_gump:CreateFontString (nil, "OVERLAY", "GameFontHighlightSmall") - + este_gump.targets = SWW:CreateFontString (nil, "OVERLAY", "QuestFont_Large") este_gump.targets:SetPoint ("TOPLEFT", este_gump, "TOPLEFT", 24, -273) este_gump.targets:SetText (Loc ["STRING_TARGETS"] .. ":") @@ -830,17 +831,17 @@ local function cria_textos (este_gump, SWW) este_gump.avatar:SetDrawLayer ("overlay", 3) este_gump.avatar_bg:SetDrawLayer ("overlay", 2) este_gump.avatar_nick:SetDrawLayer ("overlay", 4) - + este_gump.avatar:SetPoint ("TOPLEFT", este_gump, "TOPLEFT", 60, -10) este_gump.avatar_bg:SetPoint ("TOPLEFT", este_gump, "TOPLEFT", 60, -12) este_gump.avatar_bg:SetSize (275, 60) - + este_gump.avatar_nick:SetPoint ("TOPLEFT", este_gump, "TOPLEFT", 195, -54) - + este_gump.avatar:Hide() este_gump.avatar_bg:Hide() este_gump.avatar_nick:Hide() - + end @@ -855,39 +856,39 @@ local function cria_container_barras (este_gump, SWW) container_barras:SetHeight (150) container_barras:EnableMouse (true) container_barras:SetMovable (true) - + container_barras_window:SetWidth (300) container_barras_window:SetHeight (145) container_barras_window:SetScrollChild (container_barras) container_barras_window:SetPoint ("TOPLEFT", este_gump, "TOPLEFT", 21, -76) - container_barras_window:SetScript ("OnSizeChanged", function (self) + container_barras_window:SetScript ("OnSizeChanged", function(self) container_barras:SetSize (self:GetSize()) end) - + gump:NewScrollBar (container_barras_window, container_barras, 6, -17) container_barras_window.slider:Altura (117) container_barras_window.slider:cimaPoint (0, 1) container_barras_window.slider:baixoPoint (0, -3) container_barras_window.ultimo = 0 - + container_barras_window.gump = container_barras --container_barras_window.slider = slider_gump este_gump.container_barras = container_barras_window - + end function gump:JI_AtualizaContainerBarras (amt) local container = _detalhes.playerDetailWindow.container_barras - + if (amt >= 9 and container.ultimo ~= amt) then local tamanho = (CONST_BAR_HEIGHT + 1) * amt container.gump:SetHeight (tamanho) container.slider:Update() container.ultimo = amt - + elseif (amt < 8 and container.slider.ativo) then container.slider:Update (true) container.gump:SetHeight (140) @@ -899,13 +900,13 @@ end function gump:JI_AtualizaContainerAlvos (amt) local container = _detalhes.playerDetailWindow.container_alvos - + if (amt >= 6 and container.ultimo ~= amt) then local tamanho = (CONST_TARGET_HEIGHT + 1) * amt container.gump:SetHeight (tamanho) container.slider:Update() container.ultimo = amt - + elseif (amt <= 5 and container.slider.ativo) then container.slider:Update (true) container.gump:SetHeight (100) @@ -917,14 +918,14 @@ end --> container direita local function cria_container_detalhes (este_gump, SWW) local container_detalhes = _CreateFrame ("Frame", "Details_Info_ContainerDetalhes", SWW, "BackdropTemplate") - + container_detalhes:SetPoint ("TOPRIGHT", este_gump, "TOPRIGHT", -74, -76) container_detalhes:SetWidth (220) container_detalhes:SetHeight (270) container_detalhes:EnableMouse (true) container_detalhes:SetResizable (false) container_detalhes:SetMovable (true) - + este_gump.container_detalhes = container_detalhes end @@ -938,30 +939,30 @@ local function cria_container_alvos (este_gump, SWW) container_alvos:SetHeight (100) container_alvos:EnableMouse (true) container_alvos:SetMovable (true) - + container_alvos_window:SetWidth (300) container_alvos_window:SetHeight (100) container_alvos_window:SetScrollChild (container_alvos) container_alvos_window:SetPoint ("BOTTOMLEFT", este_gump, "BOTTOMLEFT", 20, 6) --56 default - container_alvos_window:SetScript ("OnSizeChanged", function (self) + container_alvos_window:SetScript ("OnSizeChanged", function(self) container_alvos:SetSize (self:GetSize()) end) - + gump:NewScrollBar (container_alvos_window, container_alvos, 7, 4) container_alvos_window.slider:Altura (88) container_alvos_window.slider:cimaPoint (0, 1) container_alvos_window.slider:baixoPoint (0, -3) - + container_alvos_window.gump = container_alvos este_gump.container_alvos = container_alvos_window end -local default_icon_change = function (jogador, classe) +local default_icon_change = function(jogador, classe) if (classe ~= "UNKNOW" and classe ~= "UNGROUPPLAYER") then info.classe_icone:SetTexCoord (_detalhes.class_coords [classe][1], _detalhes.class_coords [classe][2], _detalhes.class_coords [classe][3], _detalhes.class_coords [classe][4]) - if (jogador.enemy) then + if (jogador.enemy) then if (_detalhes.faction_against == "Horde") then info.nome:SetTextColor (1, 91/255, 91/255, 1) else @@ -972,7 +973,7 @@ local default_icon_change = function (jogador, classe) info.nome:SetTextColor (1, 1, 1, 1) end else - if (jogador.enemy) then + if (jogador.enemy) then if (_detalhes.class_coords [_detalhes.faction_against]) then info.classe_icone:SetTexCoord (_unpack (_detalhes.class_coords [_detalhes.faction_against])) if (_detalhes.faction_against == "Horde") then @@ -996,7 +997,7 @@ function _detalhes:InstallPDWSkin (skin_name, func) elseif (_detalhes.playerdetailwindow_skins [skin_name]) then return false -- ja existe end - + _detalhes.playerdetailwindow_skins [skin_name] = func return true end @@ -1022,12 +1023,12 @@ function _detalhes:ApplyPDWSkin (skin_name) --apply default first local default_skin = _detalhes.playerdetailwindow_skins ["WoWClassic"] pcall (default_skin.func) - + --than do the change if (not skin_name) then skin_name = _detalhes.player_details_window.skin end - + local skin = _detalhes.playerdetailwindow_skins [skin_name] if (skin) then local successful, errortext = pcall (skin.func) @@ -1041,11 +1042,11 @@ function _detalhes:ApplyPDWSkin (skin_name) else _detalhes:Msg ("skin not found.") end - + if (info and info:IsShown() and info.jogador and info.jogador.classe) then info.SetClassIcon (info.jogador, info.jogador.classe) end - + _detalhes:ApplyRPSkin (skin_name) end @@ -1059,7 +1060,7 @@ function _detalhes:SetPDWBarConfig (texture) if (texture) then _detalhes.player_details_window.bar_texture = texture local texture = SharedMedia:Fetch ("statusbar", texture) - + for _, bar in ipairs (window.barras1) do bar.textura:SetStatusBarTexture (texture) end @@ -1083,7 +1084,7 @@ local default_skin = function() window:SetBackdropBorderColor (1, 1, 1, 1) window.bg_icone_bg:Show() window.bg_icone:Show() - + window.leftbars1_backgound:SetPoint ("topleft", window.container_barras, "topleft", -3, 3) window.leftbars1_backgound:SetPoint ("bottomright", window.container_barras, "bottomright", 3, -3) window.leftbars2_backgound:SetPoint ("topleft", window.container_alvos, "topleft", -3, 23) @@ -1095,50 +1096,50 @@ local default_skin = function() window.right_background3:SetAlpha (1) window.right_background4:SetAlpha (1) window.right_background5:SetAlpha (1) - + window.close_button:GetNormalTexture():SetDesaturated (false) - + window.title_string:ClearAllPoints() window.title_string:SetPoint ("center", window, "center") window.title_string:SetPoint ("top", window, "top", 0, -18) window.title_string:SetParent (window) window.title_string:SetTextColor (.890, .729, .015, 1) - + window.classe_icone:SetParent (window) window.classe_icone:SetPoint ("TOPLEFT", window, "TOPLEFT", 4, 0) window.classe_icone:SetWidth (64) window.classe_icone:SetHeight (64) window.classe_icone:SetDrawLayer ("BACKGROUND", 1) window.classe_icone:SetAlpha (1) - + window.close_button:SetWidth (32) window.close_button:SetHeight (32) window.close_button:SetPoint ("TOPRIGHT", window, "TOPRIGHT", 5, -8) - + window.options_button:SetPoint ("topright", window, "topright", -26, -16) window.options_button:SetSize (16, 16) - + window.avatar:SetParent (window) - + _detalhes:SetPDWBarConfig ("Skyline") - + --bar container window.container_barras:SetSize (300, 145) window.container_barras:SetPoint ("TOPLEFT", window, "TOPLEFT", 20, -76) - + --target container window.container_alvos:SetPoint ("BOTTOMLEFT", window, "BOTTOMLEFT", 20, 6) window.container_alvos:SetSize (300, 100) - + --icons window.SetClassIcon = default_icon_change window.apoio_icone_direito:SetBlendMode ("BLEND") window.apoio_icone_esquerdo:SetBlendMode ("BLEND") - + --texts window.targets:SetPoint ("TOPLEFT", window, "TOPLEFT", 24, -273) window.nome:SetPoint ("TOPLEFT", window, "TOPLEFT", 105, -54) - + --report button window.topleft_report:SetPoint ("BOTTOMLEFT", window.container_barras, "TOPLEFT", 33, 3) @@ -1146,7 +1147,7 @@ local default_skin = function() window.no_targets:SetPoint ("BOTTOMLEFT", window, "BOTTOMLEFT", 20, 6) window.no_targets:SetSize (301, 100) window.no_targets:SetAlpha (1) - + --right panel textures window.bg2_sec_texture:SetPoint ("topleft", window.bg1_sec_texture, "topleft", 8, 0) window.bg2_sec_texture:SetPoint ("bottomright", window.bg1_sec_texture, "bottomright", -30, 0) @@ -1157,39 +1158,39 @@ local default_skin = function() window.bg3_sec_texture:SetPoint ("topleft", window.bg2_sec_texture, "topleft", 0, 0) window.bg3_sec_texture:SetPoint ("bottomright", window.bg2_sec_texture, "bottomright", 0, 0) window.bg3_sec_texture:SetTexture (0, 0, 0, 1) - + --the 5 spell details blocks for i, infoblock in ipairs (_detalhes.playerDetailWindow.grupos_detalhes) do infoblock.bg:SetSize (219, 47) --219 original end local xLocation = {-85, -136, -191, -246, -301, -356} local heightTable = {43, 48, 48, 48, 48, 48} - + for i = 1, spellInfoSettings.amount do window ["right_background" .. i]:SetPoint ("topleft", window, "topleft", 357, xLocation [i]) --357 original window ["right_background" .. i]:SetSize (220, heightTable [i]) --220 end - + --info container info:SetDetailInfoConfigs ("Interface\\AddOns\\Details\\images\\bar_detalhes2", {1, 1, 1, 0.5}, 0, 0) window.bg1_sec_texture:SetPoint ("topleft", window.bg1, "topleft", 348, -86) window.bg1_sec_texture:SetHeight (262) window.bg1_sec_texture:SetWidth (264) - + --container bars 3 local x_start = 61 local y_start = -10 local janela = window.container_detalhes - - container3_bars_pointFunc = function (barra, index) + + container3_bars_pointFunc = function(barra, index) local y = (index-1) * 17 y = y*-1 barra:SetPoint ("LEFT", janela, "LEFT", x_start, 0) barra:SetPoint ("RIGHT", janela, "RIGHT", 65, 0) barra:SetPoint ("TOP", janela, "TOP", 0, y+y_start) end - + for index, barra in ipairs (window.barras3) do local y = (index-1) * 17 y = y*-1 @@ -1210,7 +1211,7 @@ local default_skin = function() window.container_barras.cima:GetDisabledTexture():SetPoint ("center", window.container_barras.cima, "center", 0, 0) window.container_barras.cima:SetSize (29, 32) window.container_barras.cima:SetBackdrop (nil) - + window.container_barras.baixo:SetNormalTexture ("Interface\\BUTTONS\\UI-ScrollBar-ScrollUpButton-Up") window.container_barras.baixo:SetPushedTexture ("Interface\\BUTTONS\\UI-ScrollBar-ScrollUpButton-Down") window.container_barras.baixo:SetDisabledTexture ("Interface\\BUTTONS\\UI-ScrollBar-ScrollUpButton-Disabled") @@ -1222,9 +1223,9 @@ local default_skin = function() window.container_barras.baixo:GetDisabledTexture():SetPoint ("center", window.container_barras.baixo, "center", 0, 0) window.container_barras.baixo:SetSize (29, 32) window.container_barras.baixo:SetBackdrop (nil) - + window.container_barras.slider:SetBackdrop (nil) - + window.container_barras.slider:Altura (117) window.container_barras.slider:cimaPoint (0, 1) window.container_barras.slider:baixoPoint (0, -3) @@ -1232,7 +1233,7 @@ local default_skin = function() window.container_barras.slider.thumb:SetTexCoord (0, 1, 0, 1) window.container_barras.slider.thumb:SetSize (29, 30) window.container_barras.slider.thumb:SetVertexColor (1, 1, 1, 1) - + -- window.container_alvos.cima:SetNormalTexture ("Interface\\BUTTONS\\UI-ScrollBar-ScrollUpButton-Up") window.container_alvos.cima:SetPushedTexture ("Interface\\BUTTONS\\UI-ScrollBar-ScrollUpButton-Down") @@ -1245,7 +1246,7 @@ local default_skin = function() window.container_alvos.cima:GetDisabledTexture():SetPoint ("center", window.container_alvos.cima, "center", 0, 0) window.container_alvos.cima:SetSize (29, 32) window.container_alvos.cima:SetBackdrop (nil) - + window.container_alvos.baixo:SetNormalTexture ("Interface\\BUTTONS\\UI-ScrollBar-ScrollUpButton-Up") window.container_alvos.baixo:SetPushedTexture ("Interface\\BUTTONS\\UI-ScrollBar-ScrollUpButton-Down") window.container_alvos.baixo:SetDisabledTexture ("Interface\\BUTTONS\\UI-ScrollBar-ScrollUpButton-Disabled") @@ -1280,30 +1281,30 @@ local elvui_skin = function() window.bg1:SetVertTile (true) window.bg1:SetHorizTile (true) window.bg1:SetSize (PLAYER_DETAILS_WINDOW_WIDTH, PLAYER_DETAILS_WINDOW_HEIGHT) - + window:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]]}) window:SetBackdropColor (1, 1, 1, 0.3) window:SetBackdropBorderColor (0, 0, 0, 1) window.bg_icone_bg:Hide() window.bg_icone:Hide() local bgs_alpha = 0.6 - + window.leftbars1_backgound:SetPoint ("topleft", window.container_barras, "topleft", -2, 3) window.leftbars1_backgound:SetPoint ("bottomright", window.container_barras, "bottomright", 3, -3) window.leftbars2_backgound:SetPoint ("topleft", window.container_alvos, "topleft", -2, 23) window.leftbars2_backgound:SetPoint ("bottomright", window.container_alvos, "bottomright", 4, 0) - + window.leftbars1_backgound:SetAlpha (bgs_alpha) window.leftbars2_backgound:SetAlpha (bgs_alpha) - + window.right_background1:SetAlpha (bgs_alpha) window.right_background2:SetAlpha (bgs_alpha) window.right_background3:SetAlpha (bgs_alpha) window.right_background4:SetAlpha (bgs_alpha) window.right_background5:SetAlpha (bgs_alpha) - + window.close_button:GetNormalTexture():SetDesaturated (true) - + local titlebar = window.extra_frames ["ElvUITitleBar"] if (not titlebar) then titlebar = CreateFrame ("frame", nil, window, "BackdropTemplate") @@ -1314,7 +1315,7 @@ local elvui_skin = function() titlebar:SetBackdropColor (.5, .5, .5, 1) titlebar:SetBackdropBorderColor (0, 0, 0, 1) window.extra_frames ["ElvUITitleBar"] = titlebar - + local name_bg_texture = window:CreateTexture (nil, "background") name_bg_texture:SetTexture ([[Interface\PetBattles\_PetBattleHorizTile]], true) name_bg_texture:SetHorizTile (true) @@ -1329,78 +1330,78 @@ local elvui_skin = function() titlebar:Show() window.extra_frames ["ElvUINameTexture"]:Show() end - + window.title_string:ClearAllPoints() window.title_string:SetPoint ("center", window, "center") window.title_string:SetPoint ("top", window, "top", 0, -7) window.title_string:SetParent (titlebar) window.title_string:SetTextColor (.8, .8, .8, 1) - + window.classe_icone:SetParent (titlebar) window.classe_icone:SetDrawLayer ("overlay") window.classe_icone:SetPoint ("TOPLEFT", window, "TOPLEFT", 2, -25) window.classe_icone:SetWidth (49) window.classe_icone:SetHeight (49) window.classe_icone:SetAlpha (1) - + window.close_button:SetWidth (20) window.close_button:SetHeight (20) window.close_button:SetPoint ("TOPRIGHT", window, "TOPRIGHT", 0, -3) - + window.options_button:SetPoint ("topright", window, "topright", -17, -7) window.options_button:SetSize (12, 12) - + window.avatar:SetParent (titlebar) - + --bar container window.container_barras:SetPoint (unpack (containerSettings.spells.point)) window.container_barras:SetSize (containerSettings.spells.width, containerSettings.spells.height) - + --target container window.container_alvos:SetPoint (unpack (containerSettings.targets.point)) window.container_alvos:SetSize (containerSettings.targets.width, containerSettings.targets.height) - + --texts window.targets:SetPoint ("topleft", window.container_alvos, "topleft", 3, 18) window.nome:SetPoint ("TOPLEFT", window, "TOPLEFT", 105, -48) - + --report button window.topleft_report:SetPoint ("BOTTOMLEFT", window.container_barras, "TOPLEFT", 43, 2) - + --icons window.apoio_icone_direito:SetBlendMode ("ADD") window.apoio_icone_esquerdo:SetBlendMode ("ADD") - + --no targets texture window.no_targets:SetPoint ("BOTTOMLEFT", window, "BOTTOMLEFT", 3, 6) window.no_targets:SetSize (418, 150) window.no_targets:SetAlpha (0.4) - + --right panel textures window.bg2_sec_texture:SetPoint ("topleft", window.bg1_sec_texture, "topleft", 7, 0) window.bg2_sec_texture:SetPoint ("bottomright", window.bg1_sec_texture, "bottomright", -30, 0) window.bg2_sec_texture:SetTexture ([[Interface\Glues\CREDITS\Warlords\Shadowmoon_Color_jlo3]]) window.bg2_sec_texture:SetDesaturated (true) window.bg2_sec_texture:SetAlpha (0) - + window.bg3_sec_texture:SetPoint ("topleft", window.bg2_sec_texture, "topleft", 0, 0) window.bg3_sec_texture:SetPoint ("bottomright", window.bg2_sec_texture, "bottomright", 0, 0) - window.bg3_sec_texture:SetTexture (0, 0, 0, 0.3) - + window.bg3_sec_texture:SetTexture (0, 0, 0, 0.3) + --the 5 spell details blocks - not working for i, infoblock in ipairs (_detalhes.playerDetailWindow.grupos_detalhes) do infoblock.bg:SetSize (330, 47) end local xLocation = {-85, -136, -191, -246, -301} local heightTable = {50, 50, 50, 50, 50, 48} - + for i = 1, spellInfoSettings.amount do window ["right_background" .. i]:SetPoint ("topleft", window, "topleft", 351, xLocation [i]) window ["right_background" .. i]:SetSize (spellInfoSettings.width, heightTable [i]) - + end - - --seta configs dos 5 blocos da direita + + --seta configs dos 5 blocos da direita info:SetDetailInfoConfigs ("Interface\\AddOns\\Details\\images\\bar_serenity", {1, 1, 1, 0.35}, -6 + 100, 0) window.bg1_sec_texture:SetPoint ("topleft", window.bg1, "topleft", 446, -86) @@ -1412,19 +1413,19 @@ local elvui_skin = function() local y_start = -10 local janela = window.container_detalhes - - container3_bars_pointFunc = function (barra, index) + + container3_bars_pointFunc = function(barra, index) local y = (index-1) * 17 y = y*-1 - + barra:SetPoint ("LEFT", info.bg1_sec_texture, "LEFT", 0, 0) barra:SetPoint ("RIGHT", info.bg1_sec_texture, "RIGHT", 0, 0) - + --barra:SetPoint ("LEFT", janela, "LEFT", x_start, 0) --barra:SetPoint ("RIGHT", janela, "RIGHT", 62, 0) barra:SetPoint ("TOP", janela, "TOP", 0, y+y_start) end - + for index, barra in ipairs (window.barras3) do local y = (index-1) * 17 y = y*-1 @@ -1432,26 +1433,26 @@ local elvui_skin = function() barra:SetPoint ("RIGHT", janela, "RIGHT", 62, 0) barra:SetPoint ("TOP", janela, "TOP", 0, y+y_start) end - + --scrollbar do --get textures local normalTexture = window.container_barras.cima:GetNormalTexture() local pushedTexture = window.container_barras.cima:GetPushedTexture() local disabledTexture = window.container_barras.cima:GetDisabledTexture() - + --set the new textures normalTexture:SetTexture ([[Interface\Buttons\Arrow-Up-Up]]) pushedTexture:SetTexture ([[Interface\Buttons\Arrow-Up-Down]]) disabledTexture:SetTexture ([[Interface\Buttons\Arrow-Up-Disabled]]) - + normalTexture:SetPoint ("topleft", window.container_barras.cima, "topleft", 1, 0) normalTexture:SetPoint ("bottomright", window.container_barras.cima, "bottomright", 1, 0) pushedTexture:SetPoint ("topleft", window.container_barras.cima, "topleft", 1, 0) pushedTexture:SetPoint ("bottomright", window.container_barras.cima, "bottomright", 1, 0) disabledTexture:SetPoint ("topleft", window.container_barras.cima, "topleft", 1, 0) disabledTexture:SetPoint ("bottomright", window.container_barras.cima, "bottomright", 1, 0) - + disabledTexture:SetAlpha (0.5) window.container_barras.cima:SetSize (16, 16) @@ -1459,29 +1460,29 @@ local elvui_skin = function() window.container_barras.cima:SetBackdropColor (0, 0, 0, 0.3) window.container_barras.cima:SetBackdropBorderColor (0, 0, 0, 1) end - + do --get textures local normalTexture = window.container_barras.baixo:GetNormalTexture() local pushedTexture = window.container_barras.baixo:GetPushedTexture() local disabledTexture = window.container_barras.baixo:GetDisabledTexture() - + --set the new textures normalTexture:SetTexture ([[Interface\Buttons\Arrow-Down-Up]]) pushedTexture:SetTexture ([[Interface\Buttons\Arrow-Down-Down]]) disabledTexture:SetTexture ([[Interface\Buttons\Arrow-Down-Disabled]]) - + normalTexture:SetPoint ("topleft", window.container_barras.baixo, "topleft", 1, -4) normalTexture:SetPoint ("bottomright", window.container_barras.baixo, "bottomright", 1, -4) - + pushedTexture:SetPoint ("topleft", window.container_barras.baixo, "topleft", 1, -4) pushedTexture:SetPoint ("bottomright", window.container_barras.baixo, "bottomright", 1, -4) disabledTexture:SetPoint ("topleft", window.container_barras.baixo, "topleft", 1, -4) disabledTexture:SetPoint ("bottomright", window.container_barras.baixo, "bottomright", 1, -4) - + disabledTexture:SetAlpha (0.5) - + window.container_barras.baixo:SetSize (16, 16) window.container_barras.baixo:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]]}) window.container_barras.baixo:SetBackdropColor (0, 0, 0, 0.3) @@ -1491,39 +1492,39 @@ local elvui_skin = function() window.container_barras.slider:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]]}) window.container_barras.slider:SetBackdropColor (0, 0, 0, 0.35) window.container_barras.slider:SetBackdropBorderColor (0, 0, 0, 1) - + window.container_barras.slider:Altura (containerSettings.spells.scrollHeight) window.container_barras.slider:cimaPoint (0, 13) window.container_barras.slider:baixoPoint (0, -13) - + window.container_barras.slider.thumb:SetTexture ([[Interface\AddOns\Details\images\icons2]]) window.container_barras.slider.thumb:SetTexCoord (482/512, 492/512, 104/512, 120/512) window.container_barras.slider.thumb:SetSize (12, 12) window.container_barras.slider.thumb:SetVertexColor (0.6, 0.6, 0.6, 0.95) - + -- - - + + do local f = window.container_alvos - + --get textures local normalTexture = f.cima:GetNormalTexture() local pushedTexture = f.cima:GetPushedTexture() local disabledTexture = f.cima:GetDisabledTexture() - + --set the new textures normalTexture:SetTexture ([[Interface\Buttons\Arrow-Up-Up]]) pushedTexture:SetTexture ([[Interface\Buttons\Arrow-Up-Down]]) disabledTexture:SetTexture ([[Interface\Buttons\Arrow-Up-Disabled]]) - + normalTexture:SetPoint ("topleft", f.cima, "topleft", 1, 0) normalTexture:SetPoint ("bottomright", f.cima, "bottomright", 1, 0) pushedTexture:SetPoint ("topleft", f.cima, "topleft", 1, 0) pushedTexture:SetPoint ("bottomright", f.cima, "bottomright", 1, 0) disabledTexture:SetPoint ("topleft", f.cima, "topleft", 1, 0) disabledTexture:SetPoint ("bottomright", f.cima, "bottomright", 1, 0) - + disabledTexture:SetAlpha (0.5) f.cima:SetSize (16, 16) @@ -1531,31 +1532,31 @@ local elvui_skin = function() f.cima:SetBackdropColor (0, 0, 0, 0.3) f.cima:SetBackdropBorderColor (0, 0, 0, 1) end - + do local f = window.container_alvos - + --get textures local normalTexture = f.baixo:GetNormalTexture() local pushedTexture = f.baixo:GetPushedTexture() local disabledTexture = f.baixo:GetDisabledTexture() - + --set the new textures normalTexture:SetTexture ([[Interface\Buttons\Arrow-Down-Up]]) pushedTexture:SetTexture ([[Interface\Buttons\Arrow-Down-Down]]) disabledTexture:SetTexture ([[Interface\Buttons\Arrow-Down-Disabled]]) - + normalTexture:SetPoint ("topleft", f.baixo, "topleft", 1, -4) normalTexture:SetPoint ("bottomright", f.baixo, "bottomright", 1, -4) - + pushedTexture:SetPoint ("topleft", f.baixo, "topleft", 1, -4) pushedTexture:SetPoint ("bottomright", f.baixo, "bottomright", 1, -4) disabledTexture:SetPoint ("topleft", f.baixo, "topleft", 1, -4) disabledTexture:SetPoint ("bottomright", f.baixo, "bottomright", 1, -4) - + disabledTexture:SetAlpha (0.5) - + f.baixo:SetSize (16, 16) f.baixo:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]]}) f.baixo:SetBackdropColor (0, 0, 0, 0.3) @@ -1565,22 +1566,22 @@ local elvui_skin = function() window.container_alvos.slider:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]]}) window.container_alvos.slider:SetBackdropColor (0, 0, 0, 0.35) window.container_alvos.slider:SetBackdropBorderColor (0, 0, 0, 1) - + window.container_alvos.slider:Altura (137) window.container_alvos.slider:cimaPoint (0, 13) window.container_alvos.slider:baixoPoint (0, -13) - + window.container_alvos.slider.thumb:SetTexture ([[Interface\AddOns\Details\images\icons2]]) window.container_alvos.slider.thumb:SetTexCoord (482/512, 492/512, 104/512, 120/512) window.container_alvos.slider.thumb:SetSize (12, 12) window.container_alvos.slider.thumb:SetVertexColor (0.6, 0.6, 0.6, 0.95) - + --class icon - window.SetClassIcon = function (player, class) + window.SetClassIcon = function(player, class) if (player.spellicon) then window.classe_icone:SetTexture(player.spellicon) window.classe_icone:SetTexCoord(.1, .9, .1, .9) - + elseif (player.spec) then window.classe_icone:SetTexture ([[Interface\AddOns\Details\images\spec_icons_normal_alpha]]) window.classe_icone:SetTexCoord (_unpack (_detalhes.class_specs_coords [player.spec])) @@ -1592,7 +1593,7 @@ local elvui_skin = function() local l, r, t, b = unpack (coords) info.classe_icone:SetTexCoord (l+0.01953125, r-0.01953125, t+0.01953125, b-0.01953125) else - + local c = _detalhes.class_coords ["MONSTER"] info.classe_icone:SetTexture ("Interface\\AddOns\\Details\\images\\classes") info.classe_icone:SetTexCoord (c[1], c[2], c[3], c[4]) @@ -1608,12 +1609,12 @@ function gump:CriaJanelaInfo() --> cria a janela em si local este_gump = info este_gump.Loaded = true - + este_gump:SetFrameStrata ("HIGH") este_gump:SetToplevel (true) - + este_gump.extra_frames = {} - + --> fehcar com o esc tinsert (UISpecialFrames, este_gump:GetName()) @@ -1622,7 +1623,7 @@ function gump:CriaJanelaInfo() este_gump:SetWidth (PLAYER_DETAILS_WINDOW_WIDTH) este_gump:SetHeight (PLAYER_DETAILS_WINDOW_HEIGHT) - + este_gump:EnableMouse (true) este_gump:SetResizable (false) este_gump:SetMovable (true) @@ -1631,14 +1632,14 @@ function gump:CriaJanelaInfo() local SWW = este_gump.SummaryWindowWidgets SWW:SetAllPoints() tinsert (SummaryWidgets, SWW) - + local scaleBar = Details.gump:CreateScaleBar (este_gump, Details.player_details_window) este_gump:SetScale (Details.player_details_window.scale) - + --classic: --este_gump:SetWidth (590) --este_gump:SetHeight (354) - + --> joga a janela para a global _detalhes.playerDetailWindow = este_gump @@ -1654,7 +1655,7 @@ function gump:CriaJanelaInfo() este_gump.classe_iconePlus:SetWidth (64) este_gump.classe_iconePlus:SetHeight (64) este_gump.classe_iconePlus:SetDrawLayer ("BACKGROUND", 2) - + --> top left este_gump.bg1 = este_gump:CreateTexture ("DetailsPSWBackground", "BORDER") este_gump.bg1:SetPoint ("TOPLEFT", este_gump, "TOPLEFT", 0, 0) @@ -1666,21 +1667,21 @@ function gump:CriaJanelaInfo() este_gump.close_button:SetHeight (32) este_gump.close_button:SetPoint ("TOPRIGHT", este_gump, "TOPRIGHT", 5, -8) este_gump.close_button:SetText ("X") - este_gump.close_button:SetFrameLevel (este_gump:GetFrameLevel()+5) - - + este_gump.close_button:SetFrameLevel (este_gump:GetFrameLevel()+5) + + --> �cone da magia selecionada para mais detalhes este_gump.bg_icone_bg = este_gump:CreateTexture (nil, "ARTWORK") este_gump.bg_icone_bg:SetPoint ("TOPRIGHT", este_gump, "TOPRIGHT", -15, -12) este_gump.bg_icone_bg:SetTexture ("Interface\\AddOns\\Details\\images\\icone_bg_fundo") este_gump.bg_icone_bg:SetDrawLayer ("ARTWORK", -1) este_gump.bg_icone_bg:Show() - + este_gump.bg_icone = este_gump:CreateTexture (nil, "OVERLAY") este_gump.bg_icone:SetPoint ("TOPRIGHT", este_gump, "TOPRIGHT", -15, -12) este_gump.bg_icone:SetTexture ("Interface\\AddOns\\Details\\images\\icone_bg") este_gump.bg_icone:Show() - + --> bot�o de op��es local open_options = function() _detalhes:OpenOptionsWindow (info.instancia, false, 6) @@ -1691,15 +1692,15 @@ function gump:CriaJanelaInfo() este_gump.options_button:SetAlpha (0.5) este_gump.options_button.button:GetNormalTexture():SetDesaturated (true) este_gump.options_button.tooltip = "Select Skin" - + --> desativando o bot�o de config este_gump.options_button:Hide() - + --> titulo gump:NewLabel (este_gump, este_gump, nil, "title_string", Loc ["STRING_PLAYER_DETAILS"], "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255}) este_gump.title_string:SetPoint ("center", este_gump, "center") este_gump.title_string:SetPoint ("top", este_gump, "top", 0, -18) - + este_gump.spell_icone = este_gump:CreateTexture (nil, "ARTWORK") este_gump.spell_icone:SetPoint ("BOTTOMRIGHT", este_gump.bg_icone, "BOTTOMRIGHT", -19, 2) este_gump.spell_icone:SetWidth (35) @@ -1707,26 +1708,26 @@ function gump:CriaJanelaInfo() este_gump.spell_icone:SetDrawLayer ("ARTWORK", 0) este_gump.spell_icone:Show() este_gump.spell_icone:SetTexCoord (4/64, 60/64, 4/64, 60/64) - + --> coisinhas do lado do icone este_gump.apoio_icone_esquerdo = este_gump:CreateTexture (nil, "ARTWORK") este_gump.apoio_icone_direito = este_gump:CreateTexture (nil, "ARTWORK") este_gump.apoio_icone_esquerdo:SetTexture ("Interface\\PaperDollInfoFrame\\PaperDollSidebarTabs") este_gump.apoio_icone_direito:SetTexture ("Interface\\PaperDollInfoFrame\\PaperDollSidebarTabs") - + local apoio_altura = 13/256 este_gump.apoio_icone_esquerdo:SetTexCoord (0, 1, 0, apoio_altura) este_gump.apoio_icone_direito:SetTexCoord (0, 1, apoio_altura+(1/256), apoio_altura+apoio_altura) - + este_gump.apoio_icone_esquerdo:SetPoint ("bottomright", este_gump.bg_icone, "bottomleft", 42, 0) este_gump.apoio_icone_direito:SetPoint ("bottomleft", este_gump.bg_icone, "bottomright", -17, 0) - + este_gump.apoio_icone_esquerdo:SetWidth (64) este_gump.apoio_icone_esquerdo:SetHeight (13) este_gump.apoio_icone_direito:SetWidth (64) este_gump.apoio_icone_direito:SetHeight (13) - - + + este_gump.topright_text1 = este_gump:CreateFontString (nil, "overlay", "GameFontNormal") este_gump.topright_text1:SetPoint ("bottomright", este_gump, "topright", -18 - (94 * (1-1)), -36) este_gump.topright_text1:SetJustifyH ("right") @@ -1734,9 +1735,9 @@ function gump:CriaJanelaInfo() este_gump.topright_text2 = este_gump:CreateFontString (nil, "overlay", "GameFontNormal") este_gump.topright_text2:SetPoint ("bottomright", este_gump, "topright", -18 - (94 * (1-1)), -48) - este_gump.topright_text2:SetJustifyH ("right") + este_gump.topright_text2:SetJustifyH ("right") _detalhes.gump:SetFontSize (este_gump.topright_text2, 10) - + function este_gump:SetTopRightTexts (text1, text2, size, color, font) if (text1) then este_gump.topright_text1:SetText (text1) @@ -1748,7 +1749,7 @@ function gump:CriaJanelaInfo() else este_gump.topright_text2:SetText ("") end - + if (size and type (size) == "number") then _detalhes.gump:SetFontSize (este_gump.topright_text1, size) _detalhes.gump:SetFontSize (este_gump.topright_text2, size) @@ -1762,7 +1763,7 @@ function gump:CriaJanelaInfo() _detalhes.gump:SetFontFace (este_gump.topright_text2, font) end end - + ------------------------------------------------- local alpha_bgs = 1 @@ -1770,7 +1771,7 @@ function gump:CriaJanelaInfo() -- backgrounds das 5 boxes do lado direito local right_background_X = 457 local right_background_Y = {-85, -136, -191, -246, -301} - + for i = 1, spellInfoSettings.amount do local right_background1 = CreateFrame ("frame", "DetailsPlayerDetailsWindow_right_background" .. i, SWW, "BackdropTemplate") right_background1:EnableMouse (false) @@ -1786,7 +1787,7 @@ function gump:CriaJanelaInfo() este_gump.bg1_sec_texture:SetPoint ("topleft", este_gump.bg1, "topleft", 450, -86) este_gump.bg1_sec_texture:SetHeight (462) este_gump.bg1_sec_texture:SetWidth (264) - + este_gump.bg2_sec_texture = SWW:CreateTexture ("DetailsPlayerDetailsWindow_BG2_SEC_Texture", "BORDER") este_gump.bg2_sec_texture:SetDrawLayer ("BORDER", 3) este_gump.bg2_sec_texture:SetPoint ("topleft", este_gump.bg1_sec_texture, "topleft", 8, 0) @@ -1802,7 +1803,7 @@ function gump:CriaJanelaInfo() este_gump.bg3_sec_texture:SetPoint ("bottomright", este_gump.bg2_sec_texture, "bottomright", 0, 0) --este_gump.bg3_sec_texture:SetColorTexture (0, 0, 0, 1) este_gump.bg3_sec_texture:Hide() - + este_gump.no_targets = SWW:CreateTexture ("DetailsPlayerDetailsWindow_no_targets", "overlay") este_gump.no_targets:SetPoint ("BOTTOMLEFT", este_gump, "BOTTOMLEFT", 20, 6) este_gump.no_targets:SetSize (301, 100) @@ -1817,14 +1818,14 @@ function gump:CriaJanelaInfo() este_gump.no_targets:Hide() --> cria os textos da janela - cria_textos (este_gump, SWW) - + cria_textos (este_gump, SWW) + --> cria o frama que vai abrigar as barras das habilidades cria_container_barras (este_gump, SWW) - + --> cria o container que vai abrirgar as 5 barras de detalhes cria_container_detalhes (este_gump, SWW) - + --> cria o container onde vai abrigar os alvos do jogador cria_container_alvos (este_gump, SWW) @@ -1833,7 +1834,7 @@ function gump:CriaJanelaInfo() -- leftbars1_backgound:SetSize (303, 149) -- leftbars1_backgound:SetAlpha (alpha_bgs) -- este_gump.leftbars1_backgound = leftbars1_backgound - + local leftbars1_backgound = CreateFrame ("frame", "DetailsPlayerDetailsWindow_Left_SpellsBackground", SWW, "BackdropTemplate") leftbars1_backgound:EnableMouse (false) leftbars1_backgound:SetSize (303, 149) @@ -1841,7 +1842,7 @@ function gump:CriaJanelaInfo() leftbars1_backgound:SetFrameLevel (SWW:GetFrameLevel()) Details.gump:ApplyStandardBackdrop (leftbars1_backgound) este_gump.leftbars1_backgound = leftbars1_backgound - + local leftbars2_backgound = CreateFrame ("frame", "DetailsPlayerDetailsWindow_Left_TargetBackground", SWW, "BackdropTemplate") leftbars2_backgound:EnableMouse (false) leftbars2_backgound:SetSize (303, 122) @@ -1849,7 +1850,7 @@ function gump:CriaJanelaInfo() leftbars2_backgound:SetFrameLevel (SWW:GetFrameLevel()) Details.gump:ApplyStandardBackdrop (leftbars2_backgound) este_gump.leftbars2_backgound = leftbars2_backgound - + leftbars1_backgound:SetPoint ("topleft", este_gump.container_barras, "topleft", -3, 3) leftbars1_backgound:SetPoint ("bottomright", este_gump.container_barras, "bottomright", 3, -3) leftbars2_backgound:SetPoint ("topleft", este_gump.container_alvos, "topleft", -3, 23) @@ -1857,18 +1858,18 @@ function gump:CriaJanelaInfo() --> cria as 5 barras de detalhes a direita da janela cria_barras_detalhes() - + --> seta os scripts dos frames da janela seta_scripts (este_gump) --> vai armazenar os objetos das barras de habilidade - este_gump.barras1 = {} - + este_gump.barras1 = {} + --> vai armazenar os objetos das barras de alvos - este_gump.barras2 = {} - + este_gump.barras2 = {} + --> vai armazenar os objetos das barras da caixa especial da direita - este_gump.barras3 = {} + este_gump.barras3 = {} este_gump.SetClassIcon = default_icon_change @@ -1879,7 +1880,7 @@ function gump:CriaJanelaInfo() este_gump.report_esquerda:SetPoint ("BOTTOMLEFT", este_gump.container_barras, "TOPLEFT", 33, 3) este_gump.report_esquerda:SetFrameLevel (este_gump:GetFrameLevel()+2) este_gump.topleft_report = este_gump.report_esquerda - + --> bot�o de reportar da caixa dos alvos este_gump.report_alvos = gump:NewDetailsButton (SWW, este_gump, nil, _detalhes.Reportar, este_gump, 3, 16, 16, "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", nil, "DetailsJanelaInfoReport3") @@ -1889,9 +1890,9 @@ function gump:CriaJanelaInfo() --> bot�o de reportar da caixa da direita, onde est�o os 5 quadrados este_gump.report_direita = gump:NewDetailsButton (SWW, este_gump, nil, _detalhes.Reportar, este_gump, 2, 16, 16, "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", nil, "DetailsJanelaInfoReport4") - este_gump.report_direita:SetPoint ("TOPRIGHT", este_gump, "TOPRIGHT", -10, -70) + este_gump.report_direita:SetPoint ("TOPRIGHT", este_gump, "TOPRIGHT", -10, -70) este_gump.report_direita:Show() - + --> statusbar local statusBar = CreateFrame ("frame", nil, este_gump, "BackdropTemplate") statusBar:SetPoint ("bottomleft", este_gump, "bottomleft") @@ -1899,10 +1900,10 @@ function gump:CriaJanelaInfo() statusBar:SetHeight (PLAYER_DETAILS_STATUSBAR_HEIGHT) DetailsFramework:ApplyStandardBackdrop (statusBar) statusBar:SetAlpha (PLAYER_DETAILS_STATUSBAR_ALPHA) - + statusBar.Text = DetailsFramework:CreateLabel (statusBar) statusBar.Text:SetPoint ("left", 2, 0) - + function este_gump:SetStatusbarText (text, fontSize, fontColor) if (not text) then este_gump:SetStatusbarText ("Details! Damage Meter | Use '/details stats' for statistics", 10, "gray") @@ -1912,37 +1913,37 @@ function gump:CriaJanelaInfo() statusBar.Text.fontsize = fontSize statusBar.Text.fontcolor = fontColor end - + --set default text este_gump:SetStatusbarText() --> apply default skin _detalhes:ApplyPDWSkin() - + -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> tabs local red = "FFFFAAAA" local green = "FFAAFFAA" - + --> tabs: --> tab default - + local iconTableSummary = { texture = [[Interface\AddOns\Details\images\icons]], coords = {238/512, 255/512, 0, 18/512}, width = 16, height = 16, } - + _detalhes:CreatePlayerDetailsTab ("Summary", Loc ["STRING_SPELLS"], --[1] tab name [2] localized name - function (tabOBject, playerObject) --[3] condition - if (playerObject) then - return true - else - return false + function(tabOBject, playerObject) --[3] condition + if (playerObject) then + return true + else + return false end - end, + end, nil, --[4] fill function function() --[5] onclick for _, tab in _ipairs (Details:GetBreakdownTabsInUse()) do @@ -1952,33 +1953,33 @@ function gump:CriaJanelaInfo() nil, --[6] oncreate iconTableSummary --[7] icon table ) - + --> search key: ~avoidance --> begining of avoidance tab - - local avoidance_create = function (tab, frame) - + + local avoidance_create = function(tab, frame) + --> Percent Desc local percent_desc = frame:CreateFontString (nil, "artwork", "GameFontNormal") percent_desc:SetText ("Percent values are comparisons with the previous try.") percent_desc:SetPoint ("bottomleft", frame, "bottomleft", 13, 13 + PLAYER_DETAILS_STATUSBAR_HEIGHT) percent_desc:SetTextColor (.5, .5, .5, 1) - + --> SUMMARY - + local summaryBox = CreateFrame ("frame", nil, frame, "BackdropTemplate") _detalhes.gump:ApplyStandardBackdrop (summaryBox) summaryBox:SetPoint ("topleft", frame, "topleft", 10, -15) summaryBox:SetSize (200, 160) - + local y = -5 local padding = 16 local summary_text = summaryBox:CreateFontString (nil, "artwork", "GameFontNormal") summary_text:SetText ("Summary") summary_text :SetPoint ("topleft", summaryBox, "topleft", 5, y) - + y = y - padding - + --total damage received local damagereceived = summaryBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") damagereceived:SetPoint ("topleft", summaryBox, "topleft", 15, y) @@ -1989,49 +1990,49 @@ function gump:CriaJanelaInfo() damagereceived_amt:SetPoint ("left", damagereceived, "right", 2, 0) damagereceived_amt:SetText ("0") tab.damagereceived = damagereceived_amt - + y = y - padding - + --per second local damagepersecond = summaryBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") damagepersecond:SetPoint ("topleft", summaryBox, "topleft", 20, y) damagepersecond:SetText ("Per Second:") --> localize-me - + local damagepersecond_amt = summaryBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") damagepersecond_amt:SetPoint ("left", damagepersecond, "right", 2, 0) damagepersecond_amt:SetText ("0") tab.damagepersecond = damagepersecond_amt - - y = y - padding - + + y = y - padding + --total absorbs local absorbstotal = summaryBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") absorbstotal:SetPoint ("topleft", summaryBox, "topleft", 15, y) absorbstotal:SetText ("Total Absorbs:") --> localize-me absorbstotal:SetTextColor (.8, .8, .8, 1) - + local absorbstotal_amt = summaryBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") absorbstotal_amt:SetPoint ("left", absorbstotal, "right", 2, 0) absorbstotal_amt:SetText ("0") tab.absorbstotal = absorbstotal_amt - + y = y - padding - + --per second local absorbstotalpersecond = summaryBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") absorbstotalpersecond:SetPoint ("topleft", summaryBox, "topleft", 20, y) absorbstotalpersecond:SetText ("Per Second:") --> localize-me - + local absorbstotalpersecond_amt = summaryBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") absorbstotalpersecond_amt:SetPoint ("left", absorbstotalpersecond, "right", 2, 0) absorbstotalpersecond_amt:SetText ("0") tab.absorbstotalpersecond = absorbstotalpersecond_amt - + --> MELEE - + y = -5 - + local meleeBox = CreateFrame ("frame", nil, frame, "BackdropTemplate") _detalhes.gump:ApplyStandardBackdrop (meleeBox) meleeBox:SetPoint ("topleft", summaryBox, "bottomleft", 0, -5) @@ -2040,9 +2041,9 @@ function gump:CriaJanelaInfo() local melee_text = meleeBox:CreateFontString (nil, "artwork", "GameFontNormal") melee_text:SetText ("Melee") melee_text :SetPoint ("topleft", meleeBox, "topleft", 5, y) - + y = y - padding - + --dodge local dodge = meleeBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") dodge:SetPoint ("topleft", meleeBox, "topleft", 15, y) @@ -2052,20 +2053,20 @@ function gump:CriaJanelaInfo() dodge_amt:SetPoint ("left", dodge, "right", 2, 0) dodge_amt:SetText ("0") tab.dodge = dodge_amt - + y = y - padding - + local dodgepersecond = meleeBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") dodgepersecond:SetPoint ("topleft", meleeBox, "topleft", 20, y) dodgepersecond:SetText ("Per Second:") --> localize-me - + local dodgepersecond_amt = meleeBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") dodgepersecond_amt:SetPoint ("left", dodgepersecond, "right", 2, 0) dodgepersecond_amt:SetText ("0") tab.dodgepersecond = dodgepersecond_amt - + y = y - padding - + -- parry local parry = meleeBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") parry:SetPoint ("topleft", meleeBox, "topleft", 15, y) @@ -2075,9 +2076,9 @@ function gump:CriaJanelaInfo() parry_amt:SetPoint ("left", parry, "right", 2, 0) parry_amt:SetText ("0") tab.parry = parry_amt - + y = y - padding - + local parrypersecond = meleeBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") parrypersecond:SetPoint ("topleft", meleeBox, "topleft", 20, y) parrypersecond:SetText ("Per Second:") --> localize-me @@ -2087,7 +2088,7 @@ function gump:CriaJanelaInfo() tab.parrypersecond = parrypersecond_amt y = y - padding - + -- block local block = meleeBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") block:SetPoint ("topleft", meleeBox, "topleft", 15, y) @@ -2097,9 +2098,9 @@ function gump:CriaJanelaInfo() block_amt:SetPoint ("left", block, "right", 2, 0) block_amt:SetText ("0") tab.block = block_amt - + y = y - padding - + local blockpersecond = meleeBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") blockpersecond:SetPoint ("topleft", meleeBox, "topleft", 20, y) blockpersecond:SetText ("Per Second:") --> localize-me @@ -2107,9 +2108,9 @@ function gump:CriaJanelaInfo() blockpersecond_amt:SetPoint ("left", blockpersecond, "right", 2, 0) blockpersecond_amt:SetText ("0") tab.blockpersecond = blockpersecond_amt - + y = y - padding - + local blockeddamage = meleeBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") blockeddamage:SetPoint ("topleft", meleeBox, "topleft", 20, y) blockeddamage:SetText ("Damage Blocked:") --> localize-me @@ -2117,23 +2118,23 @@ function gump:CriaJanelaInfo() blockeddamage_amt:SetPoint ("left", blockeddamage, "right", 2, 0) blockeddamage_amt:SetText ("0") tab.blockeddamage_amt = blockeddamage_amt - - + + --> ABSORBS - + y = -5 - + local absorbsBox = CreateFrame ("frame", nil, frame, "BackdropTemplate") _detalhes.gump:ApplyStandardBackdrop (absorbsBox) absorbsBox:SetPoint ("topleft", summaryBox, "topright", 10, 0) absorbsBox:SetSize (200, 160) - + local absorb_text = absorbsBox:CreateFontString (nil, "artwork", "GameFontNormal") absorb_text:SetText ("Absorb") absorb_text :SetPoint ("topleft", absorbsBox, "topleft", 5, y) - + y = y - padding - + --full absorbs local fullsbsorbed = absorbsBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") fullsbsorbed:SetPoint ("topleft", absorbsBox, "topleft", 20, y) @@ -2143,9 +2144,9 @@ function gump:CriaJanelaInfo() fullsbsorbed_amt:SetPoint ("left", fullsbsorbed, "right", 2, 0) fullsbsorbed_amt:SetText ("0") tab.fullsbsorbed = fullsbsorbed_amt - + y = y - padding - + --partially absorbs local partiallyabsorbed = absorbsBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") partiallyabsorbed:SetPoint ("topleft", absorbsBox, "topleft", 20, y) @@ -2155,9 +2156,9 @@ function gump:CriaJanelaInfo() partiallyabsorbed_amt:SetPoint ("left", partiallyabsorbed, "right", 2, 0) partiallyabsorbed_amt:SetText ("0") tab.partiallyabsorbed = partiallyabsorbed_amt - + y = y - padding - + --partially absorbs per second local partiallyabsorbedpersecond = absorbsBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") partiallyabsorbedpersecond:SetPoint ("topleft", absorbsBox, "topleft", 25, y) @@ -2166,9 +2167,9 @@ function gump:CriaJanelaInfo() partiallyabsorbedpersecond_amt:SetPoint ("left", partiallyabsorbedpersecond, "right", 2, 0) partiallyabsorbedpersecond_amt:SetText ("0") tab.partiallyabsorbedpersecond = partiallyabsorbedpersecond_amt - + y = y - padding - + --no absorbs local noabsorbs = absorbsBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") noabsorbs:SetPoint ("topleft", absorbsBox, "topleft", 20, y) @@ -2178,12 +2179,12 @@ function gump:CriaJanelaInfo() noabsorbs_amt:SetPoint ("left", noabsorbs, "right", 2, 0) noabsorbs_amt:SetText ("0") tab.noabsorbs = noabsorbs_amt - - + + --> HEALING - + y = -5 - + local healingBox = CreateFrame ("frame", nil, frame,"BackdropTemplate") _detalhes.gump:ApplyStandardBackdrop (healingBox) healingBox:SetPoint ("topleft", absorbsBox, "bottomleft", 0, -5) @@ -2192,9 +2193,9 @@ function gump:CriaJanelaInfo() local healing_text = healingBox:CreateFontString (nil, "artwork", "GameFontNormal") healing_text:SetText ("Healing") healing_text :SetPoint ("topleft", healingBox, "topleft", 5, y) - + y = y - padding - + --self healing local selfhealing = healingBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") selfhealing:SetPoint ("topleft", healingBox, "topleft", 20, y) @@ -2206,7 +2207,7 @@ function gump:CriaJanelaInfo() tab.selfhealing = selfhealing_amt y = y - padding - + --self healing per second local selfhealingpersecond = healingBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") selfhealingpersecond:SetPoint ("topleft", healingBox, "topleft", 25, y) @@ -2215,10 +2216,10 @@ function gump:CriaJanelaInfo() selfhealingpersecond_amt:SetPoint ("left", selfhealingpersecond, "right", 2, 0) selfhealingpersecond_amt:SetText ("0") tab.selfhealingpersecond = selfhealingpersecond_amt - + y = y - padding - - for i = 1, 5 do + + for i = 1, 5 do local healer = healingBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") healer:SetPoint ("topleft", healingBox, "topleft", 20, y + ((i-1)*15)*-1) healer:SetText ("healer name:") --> localize-me @@ -2228,24 +2229,24 @@ function gump:CriaJanelaInfo() healer_amt:SetText ("0") tab ["healer" .. i] = {healer, healer_amt} end - - - - + + + + --SPELLS - + y = -5 - + local spellsBox = CreateFrame ("frame", nil, frame,"BackdropTemplate") _detalhes.gump:ApplyStandardBackdrop (spellsBox) spellsBox:SetPoint ("topleft", absorbsBox, "topright", 10, 0) spellsBox:SetSize (346, 160 * 2 + 5) - + local spells_text = spellsBox:CreateFontString (nil, "artwork", "GameFontNormal") spells_text:SetText ("Spells") spells_text :SetPoint ("topleft", spellsBox, "topleft", 5, y) - - local frame_tooltip_onenter = function (self) + + local frame_tooltip_onenter = function(self) if (self.spellid) then --self:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 512, edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border", edgeSize = 8}) self:SetBackdropColor (.5, .5, .5, .5) @@ -2254,48 +2255,48 @@ function gump:CriaJanelaInfo() GameTooltip:Show() end end - local frame_tooltip_onleave = function (self) + local frame_tooltip_onleave = function(self) if (self.spellid) then self:SetBackdropColor (.5, .5, .5, .1) GameTooltip:Hide() end end - + y = y - padding - - for i = 1, 40 do + + for i = 1, 40 do local frame_tooltip = CreateFrame ("frame", nil, spellsBox,"BackdropTemplate") frame_tooltip:SetPoint ("topleft", spellsBox, "topleft", 5, y + ((i-1)*17)*-1) frame_tooltip:SetSize (spellsBox:GetWidth()-10, 16) frame_tooltip:SetScript ("OnEnter", frame_tooltip_onenter) frame_tooltip:SetScript ("OnLeave", frame_tooltip_onleave) frame_tooltip:Hide() - + frame_tooltip:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 512}) frame_tooltip:SetBackdropColor (.5, .5, .5, .1) - + local icon = frame_tooltip:CreateTexture (nil, "artwork") icon:SetSize (14, 14) icon:SetPoint ("left", frame_tooltip, "left") - + local spell = frame_tooltip:CreateFontString (nil, "artwork", "GameFontHighlightSmall") spell:SetPoint ("left", icon, "right", 2, 0) spell:SetText ("spell name:") --> localize-me spell:SetTextColor (.8, .8, .8, 1) - + local spell_amt = frame_tooltip:CreateFontString (nil, "artwork", "GameFontHighlightSmall") spell_amt:SetPoint ("left", spell, "right", 2, 0) spell_amt:SetText ("0") - + tab ["spell" .. i] = {spell, spell_amt, icon, frame_tooltip} end - + end - - local getpercent = function (value, lastvalue, elapsed_time, inverse) + + local getpercent = function(value, lastvalue, elapsed_time, inverse) local ps = value / elapsed_time local diff - + if (lastvalue == 0) then diff = "+0%" else @@ -2307,7 +2308,7 @@ function gump:CriaJanelaInfo() if (d > 999) then d = "> 999" end - + if (inverse) then diff = "|c" .. green .. "+" .. d .. "%|r" else @@ -2317,11 +2318,11 @@ function gump:CriaJanelaInfo() local d = lastvalue - ps d = d / max(ps, 0.001) * 100 d = _math_floor (math.abs (d)) - + if (d > 999) then d = "> 999" end - + if (inverse) then diff = "|c" .. red .. "-" .. d .. "%|r" else @@ -2329,14 +2330,14 @@ function gump:CriaJanelaInfo() end end end - + return ps, diff end - - local avoidance_fill = function (tab, player, combat) + + local avoidance_fill = function(tab, player, combat) local elapsed_time = combat:GetCombatTime() - + local last_combat = combat.previous_combat if (not last_combat or not last_combat [1]) then last_combat = combat @@ -2349,98 +2350,98 @@ function gump:CriaJanelaInfo() --> damage taken local playerdamage = combat (1, player.nome) - + if (not playerdamage.avoidance) then playerdamage.avoidance = _detalhes:CreateActorAvoidanceTable() end - + local damagetaken = playerdamage.damage_taken local last_damage_received = 0 if (last_actor) then last_damage_received = last_actor.damage_taken / last_combat:GetCombatTime() end - + tab.damagereceived:SetText (_detalhes:ToK2 (damagetaken)) - + local ps, diff = getpercent (damagetaken, last_damage_received, elapsed_time) tab.damagepersecond:SetText (_detalhes:comma_value (_math_floor (ps)) .. " (" .. diff .. ")") --> absorbs local totalabsorbs = playerdamage.avoidance.overall.ABSORB_AMT local incomingtotal = damagetaken + totalabsorbs - + local last_total_absorbs = 0 if (last_actor and last_actor.avoidance) then last_total_absorbs = last_actor.avoidance.overall.ABSORB_AMT / last_combat:GetCombatTime() end - + tab.absorbstotal:SetText (_detalhes:ToK2 (totalabsorbs) .. " (" .. _math_floor (totalabsorbs / incomingtotal * 100) .. "%)") - + local ps, diff = getpercent (totalabsorbs, last_total_absorbs, elapsed_time, true) tab.absorbstotalpersecond:SetText (_detalhes:comma_value (_math_floor (ps)) .. " (" .. diff .. ")") - + --> dodge local totaldodge = playerdamage.avoidance.overall.DODGE tab.dodge:SetText (totaldodge) - + local last_total_dodge = 0 if (last_actor and last_actor.avoidance) then last_total_dodge = last_actor.avoidance.overall.DODGE / last_combat:GetCombatTime() end local ps, diff = getpercent (totaldodge, last_total_dodge, elapsed_time, true) tab.dodgepersecond:SetText ( string.format ("%.2f", ps) .. " (" .. diff .. ")") - + --> parry local totalparry = playerdamage.avoidance.overall.PARRY tab.parry:SetText (totalparry) - + local last_total_parry = 0 if (last_actor and last_actor.avoidance) then last_total_parry = last_actor.avoidance.overall.PARRY / last_combat:GetCombatTime() end local ps, diff = getpercent (totalparry, last_total_parry, elapsed_time, true) tab.parrypersecond:SetText (string.format ("%.2f", ps) .. " (" .. diff .. ")") - + --> block local totalblock = playerdamage.avoidance.overall.BLOCKED_HITS tab.block:SetText (totalblock) - + local last_total_block = 0 if (last_actor and last_actor.avoidance) then last_total_block = last_actor.avoidance.overall.BLOCKED_HITS / last_combat:GetCombatTime() end local ps, diff = getpercent (totalblock, last_total_block, elapsed_time, true) tab.blockpersecond:SetText (string.format ("%.2f", ps) .. " (" .. diff .. ")") - + tab.blockeddamage_amt:SetText (_detalhes:ToK2 (playerdamage.avoidance.overall.BLOCKED_AMT)) - + --> absorb local fullabsorb = playerdamage.avoidance.overall.FULL_ABSORBED local halfabsorb = playerdamage.avoidance.overall.PARTIAL_ABSORBED local halfabsorb_amt = playerdamage.avoidance.overall.PARTIAL_ABSORB_AMT local noabsorb = playerdamage.avoidance.overall.FULL_HIT - + tab.fullsbsorbed:SetText (fullabsorb) tab.partiallyabsorbed:SetText (halfabsorb) tab.noabsorbs:SetText (noabsorb) - + if (halfabsorb_amt > 0) then local average = halfabsorb_amt / halfabsorb --tenho o average local last_average = 0 if (last_actor and last_actor.avoidance and last_actor.avoidance.overall.PARTIAL_ABSORBED > 0) then last_average = last_actor.avoidance.overall.PARTIAL_ABSORB_AMT / last_actor.avoidance.overall.PARTIAL_ABSORBED end - + local ps, diff = getpercent (halfabsorb_amt, last_average, halfabsorb, true) tab.partiallyabsorbedpersecond:SetText (_detalhes:comma_value (_math_floor (ps)) .. " (" .. diff .. ")") else tab.partiallyabsorbedpersecond:SetText ("0.00 (0%)") end - - + + --> healing - + local actor_heal = combat (2, player.nome) if (not actor_heal) then tab.selfhealing:SetText ("0") @@ -2451,51 +2452,51 @@ function gump:CriaJanelaInfo() if (este_alvo) then local heal_total = este_alvo tab.selfhealing:SetText (_detalhes:ToK2 (heal_total)) - + if (last_actor_heal) then local este_alvo = last_actor_heal.targets [player.nome] if (este_alvo) then local heal = este_alvo - + local last_heal = heal / last_combat:GetCombatTime() - + local ps, diff = getpercent (heal_total, last_heal, elapsed_time, true) tab.selfhealingpersecond:SetText (_detalhes:comma_value (_math_floor (ps)) .. " (" .. diff .. ")") - + else tab.selfhealingpersecond:SetText ("0 (0%)") end else tab.selfhealingpersecond:SetText ("0 (0%)") end - + else tab.selfhealing:SetText ("0") tab.selfhealingpersecond:SetText ("0 (0%)") end - - + + -- taken from healer local heal_from = actor_heal.healing_from local myReceivedHeal = {} - - for actorName, _ in pairs (heal_from) do + + for actorName, _ in pairs (heal_from) do local thisActor = combat (2, actorName) local targets = thisActor.targets --> targets is a container with target classes local amount = targets [player.nome] or 0 myReceivedHeal [#myReceivedHeal+1] = {actorName, amount, thisActor.classe} end - + table.sort (myReceivedHeal, _detalhes.Sort2) --> Sort2 sort by second index - - for i = 1, 5 do + + for i = 1, 5 do local label1, label2 = unpack (tab ["healer" .. i]) if (myReceivedHeal [i]) then local name = myReceivedHeal [i][1] - + name = _detalhes:GetOnlyName (name) --name = _detalhes:RemoveOwnerName (name) - + label1:SetText (name .. ":") local class = myReceivedHeal [i][3] if (class) then @@ -2506,26 +2507,26 @@ function gump:CriaJanelaInfo() else label1:SetTextColor (.8, .8, .8, 1) end - + local last_actor = last_combat (2, myReceivedHeal [i][1]) if (last_actor) then local targets = last_actor.targets local amount = targets [player.nome] or 0 if (amount) then - + local last_heal = amount - + local ps, diff = getpercent (myReceivedHeal[i][2], last_heal, 1, true) label2:SetText ( _detalhes:ToK2 (myReceivedHeal[i][2] or 0) .. " (" .. diff .. ")") - + else label2:SetText ( _detalhes:ToK2 (myReceivedHeal[i][2] or 0)) end else label2:SetText ( _detalhes:ToK2 (myReceivedHeal[i][2] or 0)) end - - + + else label1:SetText ("-- -- -- --") label1:SetTextColor (.8, .8, .8, 1) @@ -2533,20 +2534,20 @@ function gump:CriaJanelaInfo() end end end - + --> Spells --> cooldowns local index_used = 1 local misc_player = combat (4, player.nome) local encounter_time = combat:GetCombatTime() - + if (misc_player) then if (misc_player.cooldowns_defensive_spells) then local minha_tabela = misc_player.cooldowns_defensive_spells._ActorTable local buffUpdateSpells = misc_player.buff_uptime_spells -- ._ActorTable local cooldowns_usados = {} - + for _spellid, _tabela in pairs (minha_tabela) do cooldowns_usados [#cooldowns_usados+1] = {_spellid, _tabela.counter} end @@ -2554,15 +2555,15 @@ function gump:CriaJanelaInfo() if (#cooldowns_usados > 0) then table.sort (cooldowns_usados, _detalhes.Sort2) - + for i = 1, #cooldowns_usados do local esta_habilidade = cooldowns_usados[i] - local nome_magia, _, icone_magia = _GetSpellInfo (esta_habilidade[1]) - + local nome_magia, _, icone_magia = _GetSpellInfo(esta_habilidade[1]) + local label1, label2, icon1, framebg = unpack (tab ["spell" .. index_used]) framebg.spellid = esta_habilidade[1] framebg:Show() - + --> attempt to get the buff update local spellInfo = buffUpdateSpells:GetSpell (framebg.spellid) if (spellInfo) then @@ -2573,18 +2574,18 @@ function gump:CriaJanelaInfo() --> update the line label1:SetText (nome_magia .. ":") - + icon1:SetTexture (icone_magia) icon1:SetTexCoord (0.0625, 0.953125, 0.0625, 0.953125) - + index_used = index_used + 1 end end end end - + local cooldownInfo = DetailsFramework.CooldownsInfo - + --> see cooldowns that other players used in this actor for playerName, _ in pairs (combat.raid_roster) do if (playerName ~= player.nome) then @@ -2597,27 +2598,27 @@ function gump:CriaJanelaInfo() if (targets) then for targetName, amountCasted in pairs (targets) do if (targetName == player.nome) then - local spellName, _, spellIcon = _GetSpellInfo (spellID) + local spellName, _, spellIcon = _GetSpellInfo(spellID) local label1, label2, icon1, framebg = unpack (tab ["spell" .. index_used]) framebg.spellid = spellID framebg:Show() - + --> attempt to get the buff update local info = cooldownInfo [spellID] local cooldownDuration = info and info.duration or 0 - + if (cooldownDuration > 0) then label2:SetText (amountCasted .. " (" .. "|cFFFFFF00" .. miscPlayer.nome .. "|r " .. floor (cooldownDuration / encounter_time * 100) .. "% uptime)") else label2:SetText (amountCasted) end - + --> update the line label1:SetText (spellName .. ":") - + icon1:SetTexture (spellIcon) icon1:SetTexCoord (0.0625, 0.953125, 0.0625, 0.953125) - + index_used = index_used + 1 end end @@ -2627,58 +2628,58 @@ function gump:CriaJanelaInfo() end end end - - + + for i = index_used, 40 do local label1, label2, icon1, framebg = unpack (tab ["spell" .. i]) - + framebg.spellid = nil framebg:Hide() label1:SetText ("") label2:SetText ("") icon1:SetTexture ("") end - + --> habilidade usada para interromper - - - + + + --[[ - + --]] end - + local iconTableAvoidance = { texture = [[Interface\AddOns\Details\images\icons]], --coords = {363/512, 381/512, 0/512, 17/512}, coords = {384/512, 402/512, 19/512, 38/512}, width = 16, height = 16, - } - + } + _detalhes:CreatePlayerDetailsTab ("Avoidance", --[1] tab name Loc ["STRING_INFO_TAB_AVOIDANCE"], --[2] localized name - function (tabOBject, playerObject) --[3] condition - if (playerObject.isTank) then - return true - else - return false + function(tabOBject, playerObject) --[3] condition + if (playerObject.isTank) then + return true + else + return false end - end, - + end, + avoidance_fill, --[4] fill function - + nil, --[5] onclick - + avoidance_create, --[6] oncreate iconTableAvoidance --[7] icon ) - + ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> ~auras - local auras_tab_create = function (tab, frame) + local auras_tab_create = function(tab, frame) local DF = _detalhes.gump local scroll_line_amount = 22 local scroll_line_height = 19 @@ -2686,77 +2687,77 @@ function gump:CriaJanelaInfo() local scrollHeight = 445 local scroll_line_height = 19 local text_size = 10 - + local debuffScrollStartX = 445 - + local headerOffsetsBuffs = { --buff label, uptime, applications, refreshes, wa 6, 190, 290, 336, 380 } - + local headerOffsetsDebuffs = { --debuff label, uptime, applications, refreshes, wa 426, 630, 729, 775, 820 - } - - local line_onenter = function (self) + } + + local line_onenter = function(self) GameTooltip:SetOwner (self, "ANCHOR_TOPRIGHT") _detalhes:GameTooltipSetSpellByID (self.spellID) GameTooltip:Show() self:SetBackdropColor (1, 1, 1, .2) end - - local line_onleave = function (self) + + local line_onleave = function(self) GameTooltip:Hide() self:SetBackdropColor (unpack (self.BackgroundColor)) end - - local line_onclick = function (self) - + + local line_onclick = function(self) + end - + --buff scroll --icon - name - applications - refreshes - uptime -- - - --local wa_button = function (self, mouseButton, spellID, auraType) - -- local spellName, _, spellIcon = GetSpellInfo (spellID) + + --local wa_button = function(self, mouseButton, spellID, auraType) + -- local spellName, _, spellIcon = GetSpellInfo(spellID) -- _detalhes:OpenAuraPanel (spellID, spellName, spellIcon, nil, auraType == "BUFF" and 4 or 2, 1) --end - - local scroll_createline = function (self, index) + + local scroll_createline = function(self, index) local line = CreateFrame ("button", "$parentLine" .. index, self,"BackdropTemplate") line:SetPoint ("topleft", self, "topleft", 1, -((index-1)*(scroll_line_height+1))) line:SetSize (scroll_width -2, scroll_line_height) 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 (0, 0, 0, 0.2) - + local icon = line:CreateTexture ("$parentIcon", "overlay") icon:SetSize (scroll_line_height -2 , scroll_line_height - 2) local name = line:CreateFontString ("$parentName", "overlay", "GameFontNormal") local uptime = line:CreateFontString ("$parentName", "overlay", "GameFontNormal") local apply = line:CreateFontString ("$parentName", "overlay", "GameFontNormal") local refresh = line:CreateFontString ("$parentName", "overlay", "GameFontNormal") - + --local waButton = DF:CreateButton (line, wa_button, 18, 18) --waButton:SetIcon ([[Interface\AddOns\WeakAuras\Media\Textures\icon]]) - + DF:SetFontSize (name, text_size) DF:SetFontSize (uptime, text_size) DF:SetFontSize (apply, text_size) DF:SetFontSize (refresh, text_size) - + icon:SetPoint ("left", line, "left", 2, 0) name:SetPoint ("left", icon, "right", 2, 0) uptime:SetPoint ("left", line, "left", 186, 0) apply:SetPoint ("left", line, "left", 276, 0) refresh:SetPoint ("left", line, "left", 322, 0) --waButton:SetPoint ("left", line, "left", 372, 0) - + line.Icon = icon line.Name = name line.Uptime = uptime @@ -2766,43 +2767,43 @@ function gump:CriaJanelaInfo() name:SetJustifyH ("left") uptime:SetJustifyH ("left") - + apply:SetJustifyH ("center") refresh:SetJustifyH ("center") apply:SetWidth (26) refresh:SetWidth (26) - + return line end - + local line_bg_color = {{1, 1, 1, .1}, {1, 1, 1, 0}} - - local scroll_buff_refresh = function (self, data, offset, total_lines) - + + local scroll_buff_refresh = function(self, data, offset, total_lines) + local haveWA = false --_G.WeakAuras - + for i = 1, total_lines do local index = i + offset local aura = data [index] - + if (aura) then local line = self:GetLine (i) line.spellID = aura.spellID line.Icon:SetTexture (aura [1]) - + line.Icon:SetTexCoord (.1, .9, .1, .9) line.Name:SetText (aura [2]) line.Uptime:SetText (DF:IntegerToTimer (aura [3]) .. " (|cFFBBAAAA" .. floor (aura [6]) .. "%|r)") line.Apply:SetText (aura [4]) line.Refresh:SetText (aura [5]) - + --if (haveWA) then -- line.WaButton:SetClickFunction (wa_button, aura.spellID, line.AuraType) --else -- line.WaButton:Disable() --end - + if (i%2 == 0) then line:SetBackdropColor (unpack (line_bg_color [1])) line.BackgroundColor = line_bg_color [1] @@ -2813,8 +2814,8 @@ function gump:CriaJanelaInfo() end end end - - local create_titledesc_frame = function (anchorWidget, desc) + + local create_titledesc_frame = function(anchorWidget, desc) local f = CreateFrame ("frame", nil, frame) f:SetSize (40, 20) f:SetPoint ("center", anchorWidget, "center") @@ -2828,76 +2829,76 @@ function gump:CriaJanelaInfo() end) return f end - - + + local buffLabel = DF:CreateLabel (frame, "Buff Name") buffLabel:SetPoint (headerOffsetsBuffs[1], -10) local uptimeLabel = DF:CreateLabel (frame, "Uptime") uptimeLabel:SetPoint (headerOffsetsBuffs[2], -10) - + local appliedLabel = DF:CreateLabel (frame, "A") appliedLabel:SetPoint (headerOffsetsBuffs[3], -10) create_titledesc_frame (appliedLabel.widget, "applications") - + local refreshedLabel = DF:CreateLabel (frame, "R") refreshedLabel:SetPoint (headerOffsetsBuffs[4], -10) create_titledesc_frame (refreshedLabel.widget, "refreshes") - + --local waLabel = DF:CreateLabel (frame, "WA") --waLabel:SetPoint (headerOffsetsBuffs[5], -10) --create_titledesc_frame (waLabel.widget, "create weak aura") - + local buffScroll = DF:CreateScrollBox (frame, "$parentBuffUptimeScroll", scroll_buff_refresh, {}, scroll_width, scrollHeight, scroll_line_amount, scroll_line_height) buffScroll:SetPoint ("topleft", frame, "topleft", 5, -30) - for i = 1, scroll_line_amount do + for i = 1, scroll_line_amount do local line = buffScroll:CreateLine (scroll_createline) line.AuraType = "BUFF" end - DF:ReskinSlider (buffScroll) + DF:ReskinSlider(buffScroll) tab.BuffScroll = buffScroll - + --debuff scroll --icon - name - applications - refreshes - uptime -- - + local debuffLabel = DF:CreateLabel (frame, "Debuff Name") debuffLabel:SetPoint (headerOffsetsDebuffs[1], -10) local uptimeLabel2 = DF:CreateLabel (frame, "Uptime") uptimeLabel2:SetPoint (headerOffsetsDebuffs[2], -10) - + local appliedLabel2 = DF:CreateLabel (frame, "A") appliedLabel2:SetPoint (headerOffsetsDebuffs[3], -10) create_titledesc_frame (appliedLabel2.widget, "applications") - + local refreshedLabel2 = DF:CreateLabel (frame, "R") refreshedLabel2:SetPoint (headerOffsetsDebuffs[4], -10) create_titledesc_frame (refreshedLabel2.widget, "refreshes") - + --local waLabel2 = DF:CreateLabel (frame, "WA") --waLabel2:SetPoint (headerOffsetsDebuffs[5], -10) --create_titledesc_frame (waLabel2.widget, "create weak aura") local debuffScroll = DF:CreateScrollBox (frame, "$parentDebuffUptimeScroll", scroll_buff_refresh, {}, scroll_width, scrollHeight, scroll_line_amount, scroll_line_height) debuffScroll:SetPoint ("topleft", frame, "topleft", debuffScrollStartX, -30) - for i = 1, scroll_line_amount do + for i = 1, scroll_line_amount do local line = debuffScroll:CreateLine (scroll_createline) line.AuraType = "DEBUFF" end - DF:ReskinSlider (debuffScroll) + DF:ReskinSlider(debuffScroll) tab.DebuffScroll = debuffScroll end - - local auras_tab_fill = function (tab, player, combat) + + local auras_tab_fill = function(tab, player, combat) local miscActor = combat:GetActor (4, player:name()) local combatTime = combat:GetCombatTime() - + do --buffs local newAuraTable = {} if (miscActor and miscActor.buff_uptime_spells) then for spellID, spellObject in pairs (miscActor.buff_uptime_spells._ActorTable) do - local spellName, _, spellIcon = GetSpellInfo (spellID) + local spellName, _, spellIcon = GetSpellInfo(spellID) tinsert (newAuraTable, {spellIcon, spellName, spellObject.uptime, spellObject.appliedamt, spellObject.refreshamt, spellObject.uptime/combatTime*100, spellID = spellID}) end end @@ -2905,19 +2906,19 @@ function gump:CriaJanelaInfo() tab.BuffScroll:SetData (newAuraTable) tab.BuffScroll:Refresh() end - + do --debuffs local newAuraTable = {} if (miscActor and miscActor.debuff_uptime_spells) then for spellID, spellObject in pairs (miscActor.debuff_uptime_spells._ActorTable) do - local spellName, _, spellIcon = GetSpellInfo (spellID) + local spellName, _, spellIcon = GetSpellInfo(spellID) tinsert (newAuraTable, {spellIcon, spellName, spellObject.uptime, spellObject.appliedamt, spellObject.refreshamt, spellObject.uptime/combatTime*100, spellID = spellID}) end end table.sort (newAuraTable, _detalhes.Sort3) tab.DebuffScroll:SetData (newAuraTable) tab.DebuffScroll:Refresh() - end + end end local iconTableAuras = { @@ -2925,62 +2926,62 @@ function gump:CriaJanelaInfo() coords = {257/512, 278/512, 0/512, 19/512}, width = 16, height = 16, - } - + } + _detalhes:CreatePlayerDetailsTab ("Auras", --[1] tab name "Auras", --[2] localized name - function (tabOBject, playerObject) --[3] condition + function(tabOBject, playerObject) --[3] condition return true - end, - + end, + auras_tab_fill, --[4] fill function - + nil, --[5] onclick - + auras_tab_create, --[6] oncreate iconTableAuras --icon table ) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> ~compare +--> ~compare local target_texture = [[Interface\MINIMAP\TRACKING\Target]] local empty_text = "" - - local plus = red .. "-" + + local plus = red .. "-" local minor = green .. "+" - + local bar_color = {.5, .5, .5, .4} -- bar of the second and 3rd player local bar_color_on_enter = {.9, .9, .9, .9} - + local frame_backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true} local frame_backdrop_color = {0, 0, 0, 0.35} local frame_backdrop_border_color = {0, 0, 0, 0} - + local spell_compare_frame_width = {298, 225, 226} local spell_compare_frame_height = 200 local target_compare_frame_height = 142 - + local xLocation = 2 local yLocation = -20 local targetBars = 9 - - local fill_compare_targets = function (self, player, other_players, target_pool) - + + local fill_compare_targets = function(self, player, other_players, target_pool) + local offset = FauxScrollFrame_GetOffset (self) - + local frame2 = DetailsPlayerComparisonTarget2 local frame3 = DetailsPlayerComparisonTarget3 - + local total = player.total_without_pet - + if (not target_pool [1]) then - for i = 1, targetBars do + for i = 1, targetBars do local bar = self.bars [i] local bar_2 = frame2.bars [i] local bar_3 = frame3.bars [i] - + bar [1]:SetTexture ("") bar [2].lefttext:SetText (empty_text) bar [2].lefttext:SetTextColor (.5, .5, .5, 1) @@ -3006,12 +3007,12 @@ function gump:CriaJanelaInfo() bar_3 [2]:SetBackdropColor (1, 1, 1, 0) bar_3 [3][4] = nil end - + return end - + local top = target_pool [1] [2] - + --player 2 local player_2 = other_players [1] local player_2_target_pool @@ -3028,7 +3029,7 @@ function gump:CriaJanelaInfo() else player_2_top = 0 end - --1 skill, + --1 skill, end --player 3 @@ -3038,7 +3039,7 @@ function gump:CriaJanelaInfo() if (player_3) then local player_3_target = player_3.targets player_3_target_pool = {} - for target_name, amount in _pairs (player_3_target) do + for target_name, amount in _pairs (player_3_target) do player_3_target_pool [#player_3_target_pool+1] = {target_name, amount} end table.sort (player_3_target_pool, _detalhes.Sort2) @@ -3049,22 +3050,22 @@ function gump:CriaJanelaInfo() end end - for i = 1, targetBars do + for i = 1, targetBars do local bar = self.bars [i] local bar_2 = frame2.bars [i] local bar_3 = frame3.bars [i] - + local index = i + offset local data = target_pool [index] - + if (data) then --[name] [total] - + local target_name = data [1] - + bar [1]:SetTexture (target_texture) bar [1]:SetDesaturated (true) bar [1]:SetAlpha (.7) - + bar [2].lefttext:SetText (index .. ". " .. target_name) bar [2].lefttext:SetTextColor (1, 1, 1, 1) bar [2].righttext:SetText (_detalhes:ToK2Min (data [2])) -- .. " (" .. _math_floor (data [2] / total * 100) .. "%)" @@ -3074,13 +3075,13 @@ function gump:CriaJanelaInfo() bar [3][2] = target_name bar [3][3] = data [2] --total bar [3][4] = player - + -- 2 if (player_2) then local player_2_target_total local player_2_target_index - + for index, t in _ipairs (player_2_target_pool) do if (t[1] == target_name) then player_2_target_total = t[2] @@ -3088,15 +3089,15 @@ function gump:CriaJanelaInfo() break end end - + if (player_2_target_total) then bar_2 [1]:SetTexture (target_texture) bar_2 [1]:SetDesaturated (true) bar_2 [1]:SetAlpha (.7) - + bar_2 [2].lefttext:SetText (player_2_target_index .. ". " .. target_name) bar_2 [2].lefttext:SetTextColor (1, 1, 1, 1) - + if (data [2] > player_2_target_total) then local diff = data [2] - player_2_target_total local up = diff / player_2_target_total * 100 @@ -3104,7 +3105,7 @@ function gump:CriaJanelaInfo() if (up > 999) then up = "" .. 999 end - + bar_2 [2].righttext2:SetText (_detalhes:ToK2Min (player_2_target_total)) bar_2 [2].righttext:SetText (" |c" .. minor .. up .. "%|r") else @@ -3117,15 +3118,15 @@ function gump:CriaJanelaInfo() bar_2 [2].righttext2:SetText (_detalhes:ToK2Min (player_2_target_total)) bar_2 [2].righttext:SetText (" |c" .. plus .. down .. "%|r") end - + --bar_2 [2]:SetValue (player_2_target_total / player_2_top * 100) bar_2 [2]:SetValue (100) - + bar_2 [3][1] = player_2.nome bar_2 [3][2] = target_name bar_2 [3][3] = player_2_target_total bar_2 [3][4] = player_2 - + else bar_2 [1]:SetTexture ("") bar_2 [2].lefttext:SetText (empty_text) @@ -3146,13 +3147,13 @@ function gump:CriaJanelaInfo() bar_2 [2]:SetBackdropColor (1, 1, 1, 0) bar_2 [3][4] = nil end - + -- 3 if (player_3) then local player_3_target_total local player_3_target_index - + for index, t in _ipairs (player_3_target_pool) do if (t[1] == target_name) then player_3_target_total = t[2] @@ -3160,15 +3161,15 @@ function gump:CriaJanelaInfo() break end end - + if (player_3_target_total) then bar_3 [1]:SetTexture (target_texture) bar_3 [1]:SetDesaturated (true) bar_3 [1]:SetAlpha (.7) - + bar_3 [2].lefttext:SetText (player_3_target_index .. ". " .. target_name) bar_3 [2].lefttext:SetTextColor (1, 1, 1, 1) - + if (data [2] > player_3_target_total) then local diff = data [2] - player_3_target_total local up = diff / player_3_target_total * 100 @@ -3188,15 +3189,15 @@ function gump:CriaJanelaInfo() bar_3 [2].righttext:SetText (_detalhes:ToK2Min (player_3_target_total)) bar_3 [2].righttext:SetText (" |c" .. plus .. down .. "%|r") end - + --bar_3 [2]:SetValue (player_3_target_total / player_3_top * 100) bar_3 [2]:SetValue (100) - + bar_3 [3][1] = player_3.nome bar_3 [3][2] = target_name bar_3 [3][3] = player_3_target_total bar_3 [3][4] = player_3 - + else bar_3 [1]:SetTexture ("") bar_3 [2].lefttext:SetText (empty_text) @@ -3217,7 +3218,7 @@ function gump:CriaJanelaInfo() bar_3 [2]:SetBackdropColor (1, 1, 1, 0) bar_3 [3][4] = nil end - + else bar [1]:SetTexture ("") bar [2].lefttext:SetText (empty_text) @@ -3245,17 +3246,17 @@ function gump:CriaJanelaInfo() bar_3 [3][4] = nil end end - + end - local fill_compare_actors = function (self, player, other_players) - + local fill_compare_actors = function(self, player, other_players) + --main player skills local spells_sorted = {} for spellid, spelltable in _pairs (player.spells._ActorTable) do spells_sorted [#spells_sorted+1] = {spelltable, spelltable.total} end - + --main player pets for petIndex, petName in _ipairs (player:Pets()) do local petActor = info.instancia.showing [player.tipo]:PegarCombatente (nil, petName) @@ -3266,14 +3267,14 @@ function gump:CriaJanelaInfo() end end table.sort (spells_sorted, _detalhes.Sort2) - + self.player = player:Name() - + local offset = FauxScrollFrame_GetOffset (self) - + local total = player.total_without_pet local top = spells_sorted [1] and spells_sorted [1] [2] or 0 - + local frame2 = DetailsPlayerComparisonBox2 local frame3 = DetailsPlayerComparisonBox3 @@ -3281,12 +3282,12 @@ function gump:CriaJanelaInfo() local player_2_spells_sorted local player_2_top local player_2_spell_info - + if (other_players [1]) then frame2.player = other_players [1]:Name() player_2_total = other_players [1].total_without_pet player_2_spells_sorted = {} - + --player 2 spells for spellid, spelltable in _pairs (other_players [1].spells._ActorTable) do player_2_spells_sorted [#player_2_spells_sorted+1] = {spelltable, spelltable.total} @@ -3300,34 +3301,34 @@ function gump:CriaJanelaInfo() end end end - + table.sort (player_2_spells_sorted, _detalhes.Sort2) player_2_top = (player_2_spells_sorted [1] and player_2_spells_sorted [1] [2]) or 0 --se n�o existir uma magia no jogador e o jogador tiver um pet, ele n�o vai encontrar um valor em [1] e dar -- ~pet player_2_spell_info = {} - for index, spelltable in _ipairs (player_2_spells_sorted) do + for index, spelltable in _ipairs (player_2_spells_sorted) do player_2_spell_info [spelltable[1].id] = index end - + frame2.NoPLayersToShow:Hide() frame3.NoPLayersToShow:Hide() else frame2.NoPLayersToShow:Show() frame3.NoPLayersToShow:Show() end - + local player_3_total local player_3_spells_sorted local player_3_spell_info local player_3_top - + if (other_players [2]) then frame3.player = other_players [2] and other_players [2]:Name() player_3_total = other_players [2] and other_players [2].total_without_pet player_3_spells_sorted = {} player_3_spell_info = {} - + if (other_players [2]) then --player 3 spells for spellid, spelltable in _pairs (other_players [2].spells._ActorTable) do @@ -3342,27 +3343,27 @@ function gump:CriaJanelaInfo() end end end - + table.sort (player_3_spells_sorted, _detalhes.Sort2) player_3_top = player_3_spells_sorted [1] [2] - for index, spelltable in _ipairs (player_3_spells_sorted) do + for index, spelltable in _ipairs (player_3_spells_sorted) do player_3_spell_info [spelltable[1].id] = index end end end - for i = 1, 12 do + for i = 1, 12 do local bar = self.bars [i] local index = i + offset - + --main player spells local data = spells_sorted [index] - + if (data) then --if exists - + --main player - seta no primeiro box local spellid = data [1].id - local name, _, icon = _GetSpellInfo (spellid) + local name, _, icon = _GetSpellInfo(spellid) if (not name) then --no spell found? - tbc problem @@ -3374,7 +3375,7 @@ function gump:CriaJanelaInfo() bar [1]:SetTexCoord (unpack (IconTexCoord)) --bar[1] = spellicon bar[2] = statusbar bar [2]:SetBackdropColor (1, 1, 1, 0.1) - + if (petName) then bar [2].lefttext:SetText (index .. ". " .. name .. " (|cFFCCBBBB" .. petName:gsub (" <.*", "") .. "|r)") else @@ -3392,7 +3393,7 @@ function gump:CriaJanelaInfo() --player 2 local player_2 = other_players [1] local spell = player_2 and player_2.spells._ActorTable [spellid] - + if (not spell and petName and player_2) then for _petIndex, _petName in _ipairs (player_2:Pets()) do if (_petName:gsub (" <.*", "") == petName:gsub (" <.*", "")) then @@ -3402,9 +3403,9 @@ function gump:CriaJanelaInfo() end end end - + local bar_2 = frame2 and frame2.bars [i] - + -- ~compare if (spell) then bar_2 [1]:SetTexture (icon) @@ -3413,11 +3414,11 @@ function gump:CriaJanelaInfo() bar_2 [2].lefttext:SetTextColor (1, 1, 1, 1) bar_2 [2]:SetStatusBarColor (unpack (bar_color)) bar_2 [2]:SetBackdropColor (1, 1, 1, 0.1) - + if (spell.total == 0 and data [2] == 0) then bar_2 [2].righttext2:SetText ("0") bar_2 [2].righttext:SetText ("+0%") - + elseif (data [2] > spell.total) then if (spell.total > 0) then local diff = data [2] - spell.total @@ -3432,7 +3433,7 @@ function gump:CriaJanelaInfo() bar_2 [2].righttext2:SetText ("0") bar_2 [2].righttext:SetText ("+0%") end - + else if (data [2] > 0) then local diff = spell.total - data [2] @@ -3448,7 +3449,7 @@ function gump:CriaJanelaInfo() bar_2 [2].righttext:SetText ("+0%") end end - + bar_2 [2]:SetValue (spell.total / player_2_top * 100) bar_2 [2]:SetValue (100) bar_2 [3][1] = spell.counter --tooltip hits @@ -3464,25 +3465,25 @@ function gump:CriaJanelaInfo() bar_2 [2]:SetValue (0) bar_2 [2]:SetBackdropColor (1, 1, 1, 0) end - + --player 3 local bar_3 = frame3 and frame3.bars [i] - + if (player_3_total) then local player_3 = other_players [2] local spell = player_3 and player_3.spells._ActorTable [spellid] - + if (not spell and petName and player_3) then for _petIndex, _petName in _ipairs (player_3:Pets()) do if (_petName:gsub (" <.*", "") == petName:gsub (" <.*", "")) then local petActor = info.instancia.showing [player.tipo]:PegarCombatente (nil, _petName) spell = petActor and petActor.spells._ActorTable [spellid] - local name, _, icon = _GetSpellInfo (spellid) + local name, _, icon = _GetSpellInfo(spellid) name = name .. " (|cFFCCBBBB" .. _petName:gsub (" <.*", "") .. "|r)" end end end - + if (spell) then bar_3 [1]:SetTexture (icon) bar_3 [1]:SetTexCoord (unpack (IconTexCoord)) --bar[1] = spellicon bar[2] = statusbar @@ -3490,11 +3491,11 @@ function gump:CriaJanelaInfo() bar_3 [2].lefttext:SetTextColor (1, 1, 1, 1) bar_3 [2]:SetStatusBarColor (unpack (bar_color)) bar_3 [2]:SetBackdropColor (1, 1, 1, 0.1) - + if (spell.total == 0 and data [2] == 0) then bar_3 [2].righttext2:SetText ("0") bar_3 [2].righttext:SetText ("+0%") - + elseif (data [2] > spell.total) then if (spell.total > 0) then local diff = data [2] - spell.total @@ -3524,7 +3525,7 @@ function gump:CriaJanelaInfo() bar_3 [2].righttext:SetText ("+0%") end end - + bar_3 [2]:SetValue (spell.total / player_3_top * 100) bar_3 [2]:SetValue (100) bar_3 [3][1] = spell.counter --tooltip hits @@ -3572,50 +3573,50 @@ function gump:CriaJanelaInfo() bar_3 [2]:SetValue (0) bar_3 [2]:SetBackdropColor (1, 1, 1, 0) end - + end - + for index, spelltable in _ipairs (spells_sorted) do - + end - + end - - local refresh_comparison_box = function (self) + + local refresh_comparison_box = function(self) --atualiza a scroll fill_compare_actors (self, self.tab.player, self.tab.players) FauxScrollFrame_Update (self, self.tab.spells_amt, 12, 15) self:Show() end - - local refresh_target_box = function (self) - + + local refresh_target_box = function(self) + --player 1 targets local my_targets = self.tab.player.targets local target_pool = {} - for target_name, amount in _pairs (my_targets) do + for target_name, amount in _pairs (my_targets) do target_pool [#target_pool+1] = {target_name, amount} end table.sort (target_pool, _detalhes.Sort2) - + FauxScrollFrame_Update (self, #target_pool, targetBars, 14) self:Show() fill_compare_targets (self, self.tab.player, self.tab.players, target_pool) end - - local compare_fill = function (tab, player, combat) + + local compare_fill = function(tab, player, combat) local players_to_compare = tab.players - + local defaultPlayerName = _detalhes:GetOnlyName (player:Name()) DetailsPlayerComparisonBox1.name_label:SetText (defaultPlayerName) - + local label2 = _G ["DetailsPlayerComparisonBox2"].name_label local label3 = _G ["DetailsPlayerComparisonBox3"].name_label - + local label2_percent = _G ["DetailsPlayerComparisonBox2"].name_label_percent local label3_percent = _G ["DetailsPlayerComparisonBox3"].name_label_percent - + if (players_to_compare [1]) then local playerName = _detalhes:GetOnlyName (players_to_compare [1]:Name()) label2:SetText (playerName) @@ -3632,18 +3633,18 @@ function gump:CriaJanelaInfo() label3:SetText ("") label3_percent:SetText ("") end - + refresh_comparison_box (DetailsPlayerComparisonBox1) refresh_target_box (DetailsPlayerComparisonTarget1) - + end - - local on_enter_target = function (self) - + + local on_enter_target = function(self) + local frame1 = DetailsPlayerComparisonTarget1 local frame2 = DetailsPlayerComparisonTarget2 local frame3 = DetailsPlayerComparisonTarget3 - + local bar1 = frame1.bars [self.index] local bar2 = frame2.bars [self.index] local bar3 = frame3.bars [self.index] @@ -3654,9 +3655,9 @@ function gump:CriaJanelaInfo() end local player_2 = bar2 [3] [4] local player_3 = bar3 [3] [4] - + local target_name = bar1 [3] [2] - + frame1.tooltip:SetPoint ("bottomleft", bar1[2], "topleft", -18, 5) frame2.tooltip:SetPoint ("bottomleft", bar2[2], "topleft", -18, 5) frame3.tooltip:SetPoint ("bottomleft", bar3[2], "topleft", -18, 5) @@ -3664,7 +3665,7 @@ function gump:CriaJanelaInfo() local actor1_total = bar1 [3] [3] local actor2_total = bar1 [3] [3] local actor3_total = bar1 [3] [3] - + -- player 1 local player_1_skills = {} for spellid, spell in _pairs (player_1.spells._ActorTable) do @@ -3678,7 +3679,7 @@ function gump:CriaJanelaInfo() -- ~pet local player_1_top = player_1_skills [1] and player_1_skills [1][2] or 0 bar1 [2]:SetStatusBarColor (1, 1, 1, 1) - + -- player 2 local player_2_skills = {} local player_2_top @@ -3694,7 +3695,7 @@ function gump:CriaJanelaInfo() player_2_top = player_2_skills [1] and player_2_skills [1][2] or 0 bar2 [2]:SetStatusBarColor (unpack (bar_color_on_enter)) end - + -- player 3 local player_3_skills = {} local player_3_top @@ -3710,26 +3711,26 @@ function gump:CriaJanelaInfo() player_3_top = player_3_skills [1] and player_3_skills [1][2] or 0 bar3 [2]:SetStatusBarColor (unpack (bar_color_on_enter)) end - + -- build tooltip frame1.tooltip:Reset() frame2.tooltip:Reset() frame3.tooltip:Reset() - + frame1.tooltip:Show() frame2.tooltip:Show() frame3.tooltip:Show() - + local frame2_gotresults = false local frame3_gotresults = false - + for index, spell in _ipairs (player_1_skills) do local bar = frame1.tooltip.bars [index] if (not bar) then bar = frame1.tooltip:CreateBar() end - - local name, _, icon = _GetSpellInfo (spell[1]) + + local name, _, icon = _GetSpellInfo(spell[1]) bar [1]:SetTexture (icon) bar [1]:SetTexCoord (unpack (IconTexCoord)) --bar[1] = spellicon bar[2] = statusbar bar [2].lefttext:SetText (index .. ". " .. name) @@ -3737,9 +3738,9 @@ function gump:CriaJanelaInfo() bar [2]:SetValue (spell [2]/player_1_top*100) --bar [2]:SetValue (100) bar [2].bg:Show() - + if (player_2) then - + local player_2_skill local found_skill = false for this_index, this_spell in _ipairs (player_2_skills) do @@ -3748,12 +3749,12 @@ function gump:CriaJanelaInfo() if (not bar) then bar = frame2.tooltip:CreateBar (index) end - + bar [1]:SetTexture (icon) bar [1]:SetTexCoord (unpack (IconTexCoord)) --bar[1] = spellicon bar[2] = statusbar bar [2].lefttext:SetText (this_index .. ". " .. name) bar [2].bg:Show() - + if (spell [2] > this_spell [2]) then local diff = spell [2] - this_spell [2] local up = diff / this_spell [2] * 100 @@ -3793,7 +3794,7 @@ function gump:CriaJanelaInfo() bar [2].bg:Hide() end end - + if (player_3) then local player_3_skill local found_skill = false @@ -3803,12 +3804,12 @@ function gump:CriaJanelaInfo() if (not bar) then bar = frame3.tooltip:CreateBar (index) end - + bar [1]:SetTexture (icon) bar [1]:SetTexCoord (unpack (IconTexCoord)) --bar[1] = spellicon bar[2] = statusbar bar [2].lefttext:SetText (this_index .. ". " .. name) bar [2].bg:Show() - + if (spell [2] > this_spell [2]) then local diff = spell [2] - this_spell [2] local up = diff / this_spell [2] * 100 @@ -3847,13 +3848,13 @@ function gump:CriaJanelaInfo() bar [2].bg:Hide() end end - + end - + frame1.tooltip:SetHeight ( (#player_1_skills*15) + 2) frame2.tooltip:SetHeight ( (#player_1_skills*15) + 2) frame3.tooltip:SetHeight ( (#player_1_skills*15) + 2) - + if (not frame2_gotresults) then frame2.tooltip:Hide() end @@ -3862,34 +3863,34 @@ function gump:CriaJanelaInfo() end end - - local on_leave_target = function (self) + + local on_leave_target = function(self) local frame1 = DetailsPlayerComparisonTarget1 local frame2 = DetailsPlayerComparisonTarget2 local frame3 = DetailsPlayerComparisonTarget3 - + local bar1 = frame1.bars [self.index] local bar2 = frame2.bars [self.index] local bar3 = frame3.bars [self.index] - + bar1[2]:SetStatusBarColor (.5, .5, .5, 1) bar1[2].icon:SetTexCoord (0, 1, 0, 1) bar2[2]:SetStatusBarColor (unpack (bar_color)) bar2[2].icon:SetTexCoord (0, 1, 0, 1) bar3[2]:SetStatusBarColor (unpack (bar_color)) bar3[2].icon:SetTexCoord (0, 1, 0, 1) - + frame1.tooltip:Hide() frame2.tooltip:Hide() frame3.tooltip:Hide() end - - local on_enter = function (self) - + + local on_enter = function(self) + local frame1 = DetailsPlayerComparisonBox1 local frame2 = DetailsPlayerComparisonBox2 local frame3 = DetailsPlayerComparisonBox3 - + local bar1 = frame1.bars [self.index] local bar2 = frame2.bars [self.index] local bar3 = frame3.bars [self.index] @@ -3902,44 +3903,44 @@ function gump:CriaJanelaInfo() local player1 = frame1.player local player2 = frame2.player local player3 = frame3.player - + local hits = bar1[3][1] local average = bar1[3][2] local critical = bar1[3][3] - + local player1_misc = info.instancia.showing (4, player1) local player2_misc = info.instancia.showing (4, player2) local player3_misc = info.instancia.showing (4, player3) - + local player1_uptime local player1_casts - + local COMPARE_FIRSTPLAYER_PERCENT = "100%" local COMPARE_UNKNOWNDATA = "-" - + if (bar1[2].righttext:GetText()) then bar1[2]:SetStatusBarColor (1, 1, 1, 1) bar1[2].icon:SetTexCoord (.1, .9, .1, .9) - + frame1.tooltip.hits_label3:SetText (hits) frame1.tooltip.average_label3:SetText (_detalhes:ToK2Min (average)) frame1.tooltip.crit_label3:SetText (critical .. "%") - + --2 = far left text (percent comparison) --3 = total in numbers - + _detalhes.gump:SetFontColor (frame1.tooltip.hits_label2, "gray") _detalhes.gump:SetFontColor (frame1.tooltip.average_label2, "gray") _detalhes.gump:SetFontColor (frame1.tooltip.crit_label2, "gray") _detalhes.gump:SetFontColor (frame1.tooltip.casts_label2, "gray") _detalhes.gump:SetFontColor (frame1.tooltip.uptime_label2, "gray") - + frame1.tooltip.hits_label2:SetText (COMPARE_FIRSTPLAYER_PERCENT) frame1.tooltip.average_label2:SetText (COMPARE_FIRSTPLAYER_PERCENT) frame1.tooltip.crit_label2:SetText (COMPARE_FIRSTPLAYER_PERCENT) - + if (player1_misc) then - + --uptime local spell = player1_misc.debuff_uptime_spells and player1_misc.debuff_uptime_spells._ActorTable and player1_misc.debuff_uptime_spells._ActorTable [spellid] if (spell) then @@ -3955,37 +3956,37 @@ function gump:CriaJanelaInfo() _detalhes.gump:SetFontColor (frame1.tooltip.uptime_label2, "gray") _detalhes.gump:SetFontColor (frame1.tooltip.uptime_label3, "gray") end - + --total casts local amt_casts = player1_misc.spell_cast and player1_misc.spell_cast [spellid] if (amt_casts) then frame1.tooltip.casts_label3:SetText (amt_casts) frame1.tooltip.casts_label2:SetText (COMPARE_FIRSTPLAYER_PERCENT) - + _detalhes.gump:SetFontColor (frame1.tooltip.casts_label3, "white") - + player1_casts = amt_casts else - local spellname = GetSpellInfo (spellid) + local spellname = GetSpellInfo(spellid) local extra_search_found for casted_spellid, amount in _pairs (player1_misc.spell_cast or {}) do - local casted_spellname = GetSpellInfo (casted_spellid) + local casted_spellname = GetSpellInfo(casted_spellid) if (casted_spellname == spellname) then frame1.tooltip.casts_label3:SetText (amount) frame1.tooltip.casts_label2:SetText (COMPARE_FIRSTPLAYER_PERCENT) - + _detalhes.gump:SetFontColor (frame1.tooltip.casts_label3, "white") - + player1_casts = amount extra_search_found = true break end end - + if (not extra_search_found) then frame1.tooltip.casts_label3:SetText ("?") frame1.tooltip.casts_label2:SetText ("?") - + _detalhes.gump:SetFontColor (frame1.tooltip.casts_label3, "silver") _detalhes.gump:SetFontColor (frame1.tooltip.casts_label2, "silver") end @@ -3995,21 +3996,21 @@ function gump:CriaJanelaInfo() frame1.tooltip.uptime_label2:SetText (COMPARE_UNKNOWNDATA) _detalhes.gump:SetFontColor (frame1.tooltip.uptime_label2, "gray") _detalhes.gump:SetFontColor (frame1.tooltip.uptime_label3, "gray") - + frame1.tooltip.casts_label3:SetText ("?") frame1.tooltip.casts_label2:SetText ("?") _detalhes.gump:SetFontColor (frame1.tooltip.casts_label3, "gray") _detalhes.gump:SetFontColor (frame1.tooltip.casts_label2, "gray") end - + frame1.tooltip:Show() end - + if (bar2[2].righttext:GetText()) then - + bar2 [2]:SetStatusBarColor (unpack (bar_color_on_enter)) bar2[2].icon:SetTexCoord (.1, .9, .1, .9) - + -- hits if (hits > bar2[3][1]) then local diff = hits - bar2[3][1] @@ -4030,7 +4031,7 @@ function gump:CriaJanelaInfo() frame2.tooltip.hits_label3:SetText (bar2[3][1]) frame2.tooltip.hits_label2:SetText (" |c" .. plus .. down .. "%|r") end - + --average if (average > bar2[3][2]) then local diff = average - bar2[3][2] @@ -4051,7 +4052,7 @@ function gump:CriaJanelaInfo() frame2.tooltip.average_label3:SetText (_detalhes:ToK2Min (bar2[3][2])) frame2.tooltip.average_label2:SetText (" |c" .. plus .. down .. "%|r") end - + --criticals if (critical > bar2[3][3]) then --[[ @@ -4077,7 +4078,7 @@ function gump:CriaJanelaInfo() --bar2[3][3] = 62 critical = 53 diff = 9 --print (diff, bar2[3][3], critical) --print (math.max (critical * 100, 0.1)) - + down = _math_floor (down) if (down > 999) then down = "" .. 999 @@ -4085,19 +4086,19 @@ function gump:CriaJanelaInfo() frame2.tooltip.crit_label3:SetText (bar2[3][3] .. "%") frame2.tooltip.crit_label2:SetText (" |c" .. plus .. down .. "%|r") end - + --update and total casts if (player2_misc) then - + --uptime local spell = player2_misc.debuff_uptime_spells and player2_misc.debuff_uptime_spells._ActorTable and player2_misc.debuff_uptime_spells._ActorTable [spellid] if (spell and spell.uptime) then local minutos, segundos = _math_floor (spell.uptime/60), _math_floor (spell.uptime%60) - + if (not player1_uptime) then frame2.tooltip.uptime_label3:SetText (minutos .. "m" .. segundos .. "s") frame2.tooltip.uptime_label2:SetText ("0%|r") - + elseif (player1_uptime > spell.uptime) then local diff = player1_uptime - spell.uptime local up = diff / spell.uptime * 100 @@ -4117,23 +4118,23 @@ function gump:CriaJanelaInfo() frame2.tooltip.uptime_label3:SetText (minutos .. "m" .. segundos .. "s") frame2.tooltip.uptime_label2:SetText ("|c" .. plus .. down .. "%|r") end - + _detalhes.gump:SetFontColor (frame2.tooltip.uptime_label3, "white") _detalhes.gump:SetFontColor (frame2.tooltip.uptime_label2, "white") - + else frame2.tooltip.uptime_label3:SetText (COMPARE_UNKNOWNDATA) frame2.tooltip.uptime_label2:SetText (COMPARE_UNKNOWNDATA) _detalhes.gump:SetFontColor (frame2.tooltip.uptime_label3, "gray") _detalhes.gump:SetFontColor (frame2.tooltip.uptime_label2, "gray") end - + --total casts local amt_casts = player2_misc.spell_cast and player2_misc.spell_cast [spellid] if (not amt_casts) then - local spellname = GetSpellInfo (spellid) + local spellname = GetSpellInfo(spellid) for casted_spellid, amount in _pairs (player2_misc.spell_cast or {}) do - local casted_spellname = GetSpellInfo (casted_spellid) + local casted_spellname = GetSpellInfo(casted_spellid) if (casted_spellname == spellname) then amt_casts = amount break @@ -4141,11 +4142,11 @@ function gump:CriaJanelaInfo() end end if (amt_casts) then - + if (not player1_casts) then frame2.tooltip.casts_label3:SetText (amt_casts) frame2.tooltip.casts_label2:SetText (COMPARE_UNKNOWNDATA) - + elseif (player1_casts > amt_casts) then local diff = player1_casts - amt_casts local up = diff / amt_casts * 100 @@ -4165,7 +4166,7 @@ function gump:CriaJanelaInfo() frame2.tooltip.casts_label3:SetText (amt_casts) frame2.tooltip.casts_label2:SetText ("|c" .. plus .. down .. "%|r") end - + _detalhes.gump:SetFontColor (frame2.tooltip.casts_label3, "white") _detalhes.gump:SetFontColor (frame2.tooltip.casts_label2, "white") else @@ -4183,13 +4184,13 @@ function gump:CriaJanelaInfo() frame2.tooltip:Show() end - + --------------------------------------------------- - + if (bar3[2].righttext:GetText()) then bar3 [2]:SetStatusBarColor (unpack (bar_color_on_enter)) bar3[2].icon:SetTexCoord (.1, .9, .1, .9) - + --hits if (hits > bar3[3][1]) then local diff = hits - bar3[3][1] @@ -4231,7 +4232,7 @@ function gump:CriaJanelaInfo() frame3.tooltip.average_label3:SetText (_detalhes:ToK2Min (bar3[3][2])) frame3.tooltip.average_label2:SetText (" |c" .. plus .. down .. "%|r") end - + --critical if (critical > bar3[3][3]) then --[[ @@ -4266,16 +4267,16 @@ function gump:CriaJanelaInfo() --uptime and casts if (player3_misc) then - + --uptime local spell = player3_misc.debuff_uptime_spells and player3_misc.debuff_uptime_spells._ActorTable and player3_misc.debuff_uptime_spells._ActorTable [spellid] if (spell and spell.uptime) then local minutos, segundos = _math_floor (spell.uptime/60), _math_floor (spell.uptime%60) - + if (not player1_uptime) then frame3.tooltip.uptime_label3:SetText (minutos .. "m" .. segundos .. "s") frame3.tooltip.uptime_label2:SetText ("0%|r") - + elseif (player1_uptime > spell.uptime) then local diff = player1_uptime - spell.uptime local up = diff / spell.uptime * 100 @@ -4295,7 +4296,7 @@ function gump:CriaJanelaInfo() frame3.tooltip.uptime_label3:SetText (minutos .. "m" .. segundos .. "s") frame3.tooltip.uptime_label2:SetText ("|c" .. plus .. down .. "%|r") end - + _detalhes.gump:SetFontColor (frame3.tooltip.uptime_label3, "white") _detalhes.gump:SetFontColor (frame3.tooltip.uptime_label2, "white") else @@ -4304,22 +4305,22 @@ function gump:CriaJanelaInfo() _detalhes.gump:SetFontColor (frame3.tooltip.uptime_label3, "gray") _detalhes.gump:SetFontColor (frame3.tooltip.uptime_label2, "gray") end - + --total casts local amt_casts = player3_misc.spell_cast and player3_misc.spell_cast [spellid] if (not amt_casts) then - local spellname = GetSpellInfo (spellid) + local spellname = GetSpellInfo(spellid) for casted_spellid, amount in _pairs (player3_misc.spell_cast or {}) do - local casted_spellname = GetSpellInfo (casted_spellid) + local casted_spellname = GetSpellInfo(casted_spellid) if (casted_spellname == spellname) then amt_casts = amount break end end end - + if (amt_casts) then - + if (not player1_casts) then frame3.tooltip.casts_label2:SetText (amt_casts) elseif (player1_casts > amt_casts) then @@ -4341,7 +4342,7 @@ function gump:CriaJanelaInfo() frame3.tooltip.casts_label3:SetText (amt_casts) frame3.tooltip.casts_label2:SetText (" |c" .. plus .. down .. "%|r") end - + _detalhes.gump:SetFontColor (frame3.tooltip.casts_label3, "white") _detalhes.gump:SetFontColor (frame3.tooltip.casts_label2, "white") else @@ -4349,50 +4350,50 @@ function gump:CriaJanelaInfo() frame3.tooltip.casts_label3:SetText ("?") _detalhes.gump:SetFontColor (frame3.tooltip.casts_label3, "gray") _detalhes.gump:SetFontColor (frame3.tooltip.casts_label2, "gray") - end - + end + else frame3.tooltip.casts_label3:SetText (COMPARE_UNKNOWNDATA) frame3.tooltip.casts_label2:SetText (COMPARE_UNKNOWNDATA) frame3.tooltip.uptime_label3:SetText (COMPARE_UNKNOWNDATA) frame3.tooltip.uptime_label2:SetText (COMPARE_UNKNOWNDATA) end - + frame3.tooltip:Show() end end - - local on_leave = function (self) + + local on_leave = function(self) local frame1 = DetailsPlayerComparisonBox1 local frame2 = DetailsPlayerComparisonBox2 local frame3 = DetailsPlayerComparisonBox3 - + local bar1 = frame1.bars [self.index] local bar2 = frame2.bars [self.index] local bar3 = frame3.bars [self.index] - + bar1[2]:SetStatusBarColor (.5, .5, .5, 1) bar1[2].icon:SetTexCoord (0, 1, 0, 1) bar2[2]:SetStatusBarColor (unpack (bar_color)) bar2[2].icon:SetTexCoord (0, 1, 0, 1) bar3[2]:SetStatusBarColor (unpack (bar_color)) bar3[2].icon:SetTexCoord (0, 1, 0, 1) - + frame1.tooltip:Hide() frame2.tooltip:Hide() frame3.tooltip:Hide() end - - local compare_create = function (tab, frame) - - local create_bar = function (name, parent, index, main, is_target) + + local compare_create = function(tab, frame) + + local create_bar = function(name, parent, index, main, is_target) local y = ((index-1) * -15) - 7 - + local spellicon = parent:CreateTexture (nil, "overlay") spellicon:SetSize (14, 14) spellicon:SetPoint ("topleft", parent, "topleft", 4, y) spellicon:SetTexture ([[Interface\InventoryItems\WoWUnknownItem01]]) - + local bar = CreateFrame ("StatusBar", name, parent,"BackdropTemplate") bar.index = index bar:SetPoint ("topleft", spellicon, "topright", 0, 0) @@ -4400,15 +4401,15 @@ function gump:CriaJanelaInfo() bar:SetStatusBarTexture ([[Interface\AddOns\Details\images\bar_serenity]]) bar:SetStatusBarColor (.5, .5, .5, 1) bar:SetAlpha (ALPHA_BLEND_AMOUNT) - + bar:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) bar:SetBackdropColor (1, 1, 1, 0.1) - + bar:SetMinMaxValues (0, 100) bar:SetValue (100) bar:SetHeight (14) bar.icon = spellicon - + if (is_target) then bar:SetScript ("OnEnter", on_enter_target) bar:SetScript ("OnLeave", on_leave_target) @@ -4416,13 +4417,13 @@ function gump:CriaJanelaInfo() bar:SetScript ("OnEnter", on_enter) bar:SetScript ("OnLeave", on_leave) end - + bar.lefttext = bar:CreateFontString (nil, "OVERLAY", "GameFontHighlightSmall") - + local _, size, flags = bar.lefttext:GetFont() local font = SharedMedia:Fetch ("font", "Arial Narrow") bar.lefttext:SetFont (font, 11) - + bar.lefttext:SetPoint ("left", bar, "left", 4, 0) bar.lefttext:SetJustifyH ("left") bar.lefttext:SetTextColor (1, 1, 1, 1) @@ -4433,51 +4434,51 @@ function gump:CriaJanelaInfo() else bar.lefttext:SetWidth (110) end - + bar.righttext = bar:CreateFontString (nil, "OVERLAY", "GameFontHighlightSmall") - + local _, size, flags = bar.righttext:GetFont() local font = SharedMedia:Fetch ("font", "Arial Narrow") bar.righttext:SetFont (font, 11) - + bar.righttext:SetPoint ("right", bar, "right", -2, 0) bar.righttext:SetJustifyH ("right") bar.righttext:SetTextColor (1, 1, 1, 1) - + bar.righttext2 = bar:CreateFontString (nil, "OVERLAY", "GameFontHighlightSmall") - + local _, size, flags = bar.righttext2:GetFont() local font = SharedMedia:Fetch ("font", "Arial Narrow") bar.righttext2:SetFont (font, 11) - + bar.righttext2:SetPoint ("right", bar, "right", -42, 0) bar.righttext2:SetJustifyH ("right") bar.righttext2:SetTextColor (1, 1, 1, 1) - + tinsert (parent.bars, {spellicon, bar, {0, 0, 0}}) end - - local create_tooltip = function (name) + + local create_tooltip = function(name) local tooltip = CreateFrame ("frame", name, UIParent,"BackdropTemplate") - + _detalhes.gump:CreateBorder (tooltip) - + tooltip:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) tooltip:SetBackdropColor (0, 0, 0, 1) tooltip:SetBackdropBorderColor (0, 0, 0, 1) tooltip:SetSize (275, 77) tooltip:SetFrameStrata ("tooltip") - + local y = -3 local x_start = 2 - + local background = tooltip:CreateTexture (nil, "border") background:SetTexture ([[Interface\SPELLBOOK\Spellbook-Page-1]]) background:SetTexCoord (.6, 0.1, 0, 0.64453125) background:SetVertexColor (0, 0, 0, 0.2) background:SetPoint ("topleft", tooltip, "topleft", 0, 0) background:SetPoint ("bottomright", tooltip, "bottomright", 0, 0) - + tooltip.casts_label = tooltip:CreateFontString (nil, "overlay", "GameFontHighlightSmall") tooltip.casts_label:SetPoint ("topleft", tooltip, "topleft", x_start, -2 + (y*0)) tooltip.casts_label:SetText ("Total Casts:") @@ -4490,7 +4491,7 @@ function gump:CriaJanelaInfo() tooltip.casts_label3:SetPoint ("topright", tooltip, "topright", -x_start - 46, -2 + (y*0)) tooltip.casts_label3:SetText ("0") tooltip.casts_label3:SetJustifyH ("right") - + tooltip.hits_label = tooltip:CreateFontString (nil, "overlay", "GameFontHighlightSmall") tooltip.hits_label:SetPoint ("topleft", tooltip, "topleft", x_start, -14 + (y*1)) tooltip.hits_label:SetText ("Total Hits:") @@ -4503,7 +4504,7 @@ function gump:CriaJanelaInfo() tooltip.hits_label3:SetPoint ("topright", tooltip, "topright", -x_start - 46, -14 + (y*1)) tooltip.hits_label3:SetText ("0") tooltip.hits_label3:SetJustifyH ("right") - + tooltip.average_label = tooltip:CreateFontString (nil, "overlay", "GameFontHighlightSmall") tooltip.average_label:SetPoint ("topleft", tooltip, "topleft", x_start, -26 + (y*2)) tooltip.average_label:SetText ("Average:") @@ -4516,7 +4517,7 @@ function gump:CriaJanelaInfo() tooltip.average_label3:SetPoint ("topright", tooltip, "topright", -x_start - 46, -26 + (y*2)) tooltip.average_label3:SetText ("0") tooltip.average_label3:SetJustifyH ("right") - + tooltip.crit_label = tooltip:CreateFontString (nil, "overlay", "GameFontHighlightSmall") tooltip.crit_label:SetPoint ("topleft", tooltip, "topleft", x_start, -38 + (y*3)) tooltip.crit_label:SetText ("Critical:") @@ -4529,7 +4530,7 @@ function gump:CriaJanelaInfo() tooltip.crit_label3:SetPoint ("topright", tooltip, "topright", -x_start - 46, -38 + (y*3)) tooltip.crit_label3:SetText ("0") tooltip.crit_label3:SetJustifyH ("right") - + tooltip.uptime_label = tooltip:CreateFontString (nil, "overlay", "GameFontHighlightSmall") tooltip.uptime_label:SetPoint ("topleft", tooltip, "topleft", x_start, -50 + (y*4)) tooltip.uptime_label:SetText ("Uptime:") @@ -4542,13 +4543,13 @@ function gump:CriaJanelaInfo() tooltip.uptime_label3:SetPoint ("topright", tooltip, "topright", -x_start - 46, -50 + (y*4)) tooltip.uptime_label3:SetText ("0") tooltip.uptime_label3:SetJustifyH ("right") - + local bg_color = {0.5, 0.5, 0.5} local bg_texture = [[Interface\AddOns\Details\images\bar_background]] local bg_alpha = 1 local bg_height = 12 local colors = {{26/255, 26/255, 26/255}, {19/255, 19/255, 19/255}, {26/255, 26/255, 26/255}, {34/255, 39/255, 42/255}, {42/255, 51/255, 60/255}} - + for i = 1, 5 do local bg_line1 = tooltip:CreateTexture (nil, "artwork") bg_line1:SetTexture (bg_texture) @@ -4558,11 +4559,11 @@ function gump:CriaJanelaInfo() bg_line1:SetAlpha (bg_alpha) bg_line1:SetVertexColor (unpack (colors[i])) end - + return tooltip end - local create_tooltip_target = function (name) + local create_tooltip_target = function(name) local tooltip = CreateFrame ("frame", name, UIParent,"BackdropTemplate") tooltip:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) tooltip:SetBackdropColor (0, 0, 0, 1) @@ -4570,11 +4571,11 @@ function gump:CriaJanelaInfo() tooltip:SetSize (175, 67) tooltip:SetFrameStrata ("tooltip") tooltip.bars = {} - + _detalhes.gump:CreateBorder (tooltip) - + function tooltip:Reset() - for index, bar in _ipairs (tooltip.bars) do + for index, bar in _ipairs (tooltip.bars) do bar [1]:SetTexture ("") bar [2].lefttext:SetText ("") bar [2].righttext:SetText ("") @@ -4583,11 +4584,11 @@ function gump:CriaJanelaInfo() bar [2].bg:Hide() end end - + local bars_colors = {{19/255, 19/255, 19/255}, {26/255, 26/255, 26/255}} - + function tooltip:CreateBar (index) - + if (index) then if (index > #tooltip.bars+1) then for i = #tooltip.bars+1, index-1 do @@ -4595,16 +4596,16 @@ function gump:CriaJanelaInfo() end end end - + local index = #tooltip.bars + 1 local y = ((index-1) * -15) - 2 local parent = tooltip - + local spellicon = parent:CreateTexture (nil, "overlay") spellicon:SetSize (14, 14) spellicon:SetPoint ("topleft", parent, "topleft", 1, y) spellicon:SetTexture ([[Interface\InventoryItems\WoWUnknownItem01]]) - + local bar = CreateFrame ("StatusBar", name .. "Bar" .. index, parent, "BackdropTemplate") bar.index = index bar:SetPoint ("topleft", spellicon, "topright", 0, 0) @@ -4615,39 +4616,39 @@ function gump:CriaJanelaInfo() bar:SetValue (0) bar:SetHeight (14) bar.icon = spellicon - + bar.lefttext = bar:CreateFontString (nil, "OVERLAY", "GameFontHighlightSmall") local _, size, flags = bar.lefttext:GetFont() local font = SharedMedia:Fetch ("font", "Arial Narrow") - bar.lefttext:SetFont (font, 11) + bar.lefttext:SetFont (font, 11) bar.lefttext:SetPoint ("left", bar, "left", 2, 0) bar.lefttext:SetJustifyH ("left") bar.lefttext:SetTextColor (1, 1, 1, 1) bar.lefttext:SetNonSpaceWrap (true) bar.lefttext:SetWordWrap (false) - + if (name:find ("1")) then bar.lefttext:SetWidth (110) else bar.lefttext:SetWidth (80) end - - bar.righttext = bar:CreateFontString (nil, "OVERLAY", "GameFontHighlightSmall") + + bar.righttext = bar:CreateFontString (nil, "OVERLAY", "GameFontHighlightSmall") local _, size, flags = bar.righttext:GetFont() local font = SharedMedia:Fetch ("font", "Arial Narrow") - bar.righttext:SetFont (font, 11) + bar.righttext:SetFont (font, 11) bar.righttext:SetPoint ("right", bar, "right", -2, 0) bar.righttext:SetJustifyH ("right") bar.righttext:SetTextColor (1, 1, 1, 1) - - bar.righttext2 = bar:CreateFontString (nil, "OVERLAY", "GameFontHighlightSmall") + + bar.righttext2 = bar:CreateFontString (nil, "OVERLAY", "GameFontHighlightSmall") local _, size, flags = bar.righttext2:GetFont() local font = SharedMedia:Fetch ("font", "Arial Narrow") - bar.righttext2:SetFont (font, 11) + bar.righttext2:SetFont (font, 11) bar.righttext2:SetPoint ("right", bar, "right", -46, 0) bar.righttext2:SetJustifyH ("right") bar.righttext2:SetTextColor (1, 1, 1, 1) - + local bg_line1 = bar:CreateTexture (nil, "artwork") bg_line1:SetTexture ([[Interface\AddOns\Details\images\bar_background]]) bg_line1:SetAllPoints() @@ -4658,57 +4659,57 @@ function gump:CriaJanelaInfo() bg_line1:SetVertexColor (_unpack (bars_colors [2])) end bar.bg = bg_line1 - + local object = {spellicon, bar} tinsert (tooltip.bars, object) return object end - + local background = tooltip:CreateTexture (nil, "artwork") background:SetTexture ([[Interface\SPELLBOOK\Spellbook-Page-1]]) background:SetTexCoord (.6, 0.1, 0, 0.64453125) background:SetVertexColor (0, 0, 0, 0.6) background:SetPoint ("topleft", tooltip, "topleft", 2, -4) background:SetPoint ("bottomright", tooltip, "bottomright", -4, 2) - + return tooltip end - + local frame1 = CreateFrame ("scrollframe", "DetailsPlayerComparisonBox1", frame, "FauxScrollFrameTemplate,BackdropTemplate") - frame1:SetScript ("OnVerticalScroll", function (self, offset) FauxScrollFrame_OnVerticalScroll (self, offset, 14, refresh_comparison_box) end) + frame1:SetScript ("OnVerticalScroll", function(self, offset) FauxScrollFrame_OnVerticalScroll (self, offset, 14, refresh_comparison_box) end) frame1:SetSize (spell_compare_frame_width[1], spell_compare_frame_height) frame1:SetPoint ("topleft", frame, "topleft", xLocation, yLocation) - _detalhes.gump:ReskinSlider (frame1) - + _detalhes.gump:ReskinSlider(frame1) + frame1:SetBackdrop (frame_backdrop) frame1:SetBackdropColor (unpack (frame_backdrop_color)) frame1:SetBackdropBorderColor (unpack (frame_backdrop_border_color)) - + --override backdrop settings and use the framework defaults Details.gump:ApplyStandardBackdrop (frame1) - + frame1.bars = {} frame1.tab = tab frame1.tooltip = create_tooltip ("DetailsPlayerComparisonBox1Tooltip") frame1.tooltip:SetWidth (spell_compare_frame_width[1]) - + local playername1 = frame1:CreateFontString (nil, "overlay", "GameFontNormal") playername1:SetPoint ("bottomleft", frame1, "topleft", 2, 0) playername1:SetText ("Player 1") frame1.name_label = playername1 - + --criar as barras do frame1 for i = 1, 12 do create_bar ("DetailsPlayerComparisonBox1Bar"..i, frame1, i, true) end - + --cria o box dos targets local target1 = CreateFrame ("scrollframe", "DetailsPlayerComparisonTarget1", frame, "FauxScrollFrameTemplate,BackdropTemplate") - target1:SetScript ("OnVerticalScroll", function (self, offset) FauxScrollFrame_OnVerticalScroll (self, offset, 14, refresh_target_box) end) + target1:SetScript ("OnVerticalScroll", function(self, offset) FauxScrollFrame_OnVerticalScroll (self, offset, 14, refresh_target_box) end) target1:SetSize (spell_compare_frame_width[1], target_compare_frame_height) target1:SetPoint ("topleft", frame1, "bottomleft", 0, -10) - _detalhes.gump:ReskinSlider (target1) - + _detalhes.gump:ReskinSlider(target1) + target1:SetBackdrop (frame_backdrop) target1:SetBackdropColor (unpack (frame_backdrop_color)) target1:SetBackdropBorderColor (unpack (frame_backdrop_border_color)) @@ -4716,44 +4717,44 @@ function gump:CriaJanelaInfo() target1.tab = tab target1.tooltip = create_tooltip_target ("DetailsPlayerComparisonTarget1Tooltip") target1.tooltip:SetWidth (spell_compare_frame_width[1]) - + --override backdrop settings and use the framework defaults Details.gump:ApplyStandardBackdrop (target1) - + --criar as barras do target1 for i = 1, targetBars do create_bar ("DetailsPlayerComparisonTarget1Bar"..i, target1, i, true, true) end - + -------------------------------------------- local frame2 = CreateFrame ("frame", "DetailsPlayerComparisonBox2", frame,"BackdropTemplate") local frame3 = CreateFrame ("frame", "DetailsPlayerComparisonBox3", frame,"BackdropTemplate") - + frame2:SetPoint ("topleft", frame1, "topright", 27, 0) frame2:SetSize (spell_compare_frame_width[2], spell_compare_frame_height) - + frame2:SetBackdrop (frame_backdrop) frame2:SetBackdropColor (unpack (frame_backdrop_color)) frame2:SetBackdropBorderColor (unpack (frame_backdrop_border_color)) - + --override backdrop settings and use the framework defaults Details.gump:ApplyStandardBackdrop (frame2) - + frame2.bars = {} frame2.tooltip = create_tooltip ("DetailsPlayerComparisonBox2Tooltip") frame2.tooltip:SetWidth (spell_compare_frame_width[2]) - + local playername2 = frame2:CreateFontString (nil, "overlay", "GameFontNormal") playername2:SetPoint ("bottomleft", frame2, "topleft", 2, 0) playername2:SetText ("Player 2") frame2.name_label = playername2 - + local playername2_percent = frame2:CreateFontString (nil, "overlay", "GameFontHighlightSmall") playername2_percent:SetPoint ("bottomright", frame2, "topright", -2, 0) playername2_percent:SetText ("Player 1 %") playername2_percent:SetTextColor (.6, .6, .6) - + local noPLayersToShow = frame2:CreateFontString (nil, "overlay", "GameFontHighlightSmall") noPLayersToShow:SetPoint ("center") noPLayersToShow:SetText ("There's no more players to compare (with the same class/spec)") @@ -4763,15 +4764,15 @@ function gump:CriaJanelaInfo() _detalhes.gump:SetFontSize (noPLayersToShow, 14) _detalhes.gump:SetFontColor (noPLayersToShow, "gray") frame2.NoPLayersToShow = noPLayersToShow - - + + frame2.name_label_percent = playername2_percent - + --criar as barras do frame2 for i = 1, 12 do create_bar ("DetailsPlayerComparisonBox2Bar"..i, frame2, i) end - + --cria o box dos targets local target2 = CreateFrame ("frame", "DetailsPlayerComparisonTarget2", frame,"BackdropTemplate") target2:SetSize (spell_compare_frame_width[2], target_compare_frame_height) @@ -4782,41 +4783,41 @@ function gump:CriaJanelaInfo() target2.bars = {} target2.tooltip = create_tooltip_target ("DetailsPlayerComparisonTarget2Tooltip") target2.tooltip:SetWidth (spell_compare_frame_width[2]) - + --override backdrop settings and use the framework defaults Details.gump:ApplyStandardBackdrop (target2) - + --criar as barras do target2 for i = 1, targetBars do create_bar ("DetailsPlayerComparisonTarget2Bar"..i, target2, i, nil, true) end - + ----------------------------------------------------------------------- - + frame3:SetPoint ("topleft", frame2, "topright", 5, 0) frame3:SetSize (spell_compare_frame_width[3], spell_compare_frame_height) frame3:SetBackdrop (frame_backdrop) frame3:SetBackdropColor (unpack (frame_backdrop_color)) frame3:SetBackdropBorderColor (unpack (frame_backdrop_border_color)) - + --override backdrop settings and use the framework defaults Details.gump:ApplyStandardBackdrop (frame3) - + frame3.bars = {} frame3.tooltip = create_tooltip ("DetailsPlayerComparisonBox3Tooltip") frame3.tooltip:SetWidth (spell_compare_frame_width[3]) - + local playername3 = frame3:CreateFontString (nil, "overlay", "GameFontNormal") playername3:SetPoint ("bottomleft", frame3, "topleft", 2, 0) playername3:SetText ("Player 3") frame3.name_label = playername3 - + local playername3_percent = frame3:CreateFontString (nil, "overlay", "GameFontHighlightSmall") playername3_percent:SetPoint ("bottomright", frame3, "topright", -2, 0) playername3_percent:SetText ("Player 1 %") playername3_percent:SetTextColor (.6, .6, .6) frame3.name_label_percent = playername3_percent - + local noPLayersToShow = frame3:CreateFontString (nil, "overlay", "GameFontHighlightSmall") noPLayersToShow:SetPoint ("center") @@ -4827,12 +4828,12 @@ function gump:CriaJanelaInfo() _detalhes.gump:SetFontSize (noPLayersToShow, 14) _detalhes.gump:SetFontColor (noPLayersToShow, "gray") frame3.NoPLayersToShow = noPLayersToShow - + --criar as barras do frame3 for i = 1, 12 do create_bar ("DetailsPlayerComparisonBox3Bar"..i, frame3, i) end - + --cria o box dos targets local target3 = CreateFrame ("frame", "DetailsPlayerComparisonTarget3", frame,"BackdropTemplate") target3:SetSize (spell_compare_frame_width[3], target_compare_frame_height) @@ -4843,17 +4844,17 @@ function gump:CriaJanelaInfo() target3.bars = {} target3.tooltip = create_tooltip_target ("DetailsPlayerComparisonTarget3Tooltip") target3.tooltip:SetWidth (spell_compare_frame_width[3]) - + --override backdrop settings and use the framework defaults Details.gump:ApplyStandardBackdrop (target3) - + --criar as barras do target1 for i = 1, targetBars do create_bar ("DetailsPlayerComparisonTarget3Bar"..i, target3, i, nil, true) end end - - + + -- ~compare local iconTableCompare = { texture = [[Interface\AddOns\Details\images\icons]], @@ -4862,15 +4863,15 @@ function gump:CriaJanelaInfo() width = 16, height = 14, } - + _detalhes:CreatePlayerDetailsTab ("Compare", --[1] tab name Loc ["STRING_INFO_TAB_COMPARISON"], --[2] localized name - function (tabOBject, playerObject) --[3] condition - + function(tabOBject, playerObject) --[3] condition + if (info.atributo > 2) then return false end - + local same_class = {} local class = playerObject.classe local my_spells = {} @@ -4880,16 +4881,16 @@ function gump:CriaJanelaInfo() my_spells [spellid] = true my_spells_total = my_spells_total + 1 end - + tabOBject.players = {} tabOBject.player = playerObject tabOBject.spells_amt = my_spells_total - + if (not info.instancia.showing) then return false end - for index, actor in _ipairs (info.instancia.showing [info.atributo]._ActorTable) do + for index, actor in _ipairs (info.instancia.showing [info.atributo]._ActorTable) do if (actor.classe == class and actor ~= playerObject) then local same_spells = 0 @@ -4898,7 +4899,7 @@ function gump:CriaJanelaInfo() same_spells = same_spells + 1 end end - + local match_percentage = same_spells / max (my_spells_total, 0.000001) * 100 if (match_percentage > 30) then @@ -4906,12 +4907,12 @@ function gump:CriaJanelaInfo() end end end - + if (#tabOBject.players > 0) then --tutorial flash local blink = _detalhes:GetTutorialCVar ("DETAILS_INFO_TUTORIAL2") or 0 if (type (blink) == "number" and blink < 10) then - + if (not tabOBject.FlashAnimation) then local flashAnimation = tabOBject:CreateTexture (nil, "overlay") flashAnimation:SetPoint ("topleft", tabOBject.widget, "topleft", 1, -1) @@ -4922,34 +4923,34 @@ function gump:CriaJanelaInfo() DetailsFramework:CreateAnimation (flashHub, "alpha", 1, 1, 0, 0.3) DetailsFramework:CreateAnimation (flashHub, "alpha", 2, 1, 0.45, 0) flashHub:SetLooping ("REPEAT") - + tabOBject.FlashAnimation = flashHub end - + _detalhes:SetTutorialCVar ("DETAILS_INFO_TUTORIAL2", blink+1) tabOBject.FlashAnimation:Play() end - + return true end - + --return false return true --debug? - end, - + end, + compare_fill, --[4] fill function - + nil, --[5] onclick - + compare_create, --[6] oncreate iconTableCompare --icon table ) - + -- ~compare ~newcompare -- ~compare - + -- ~tab ~tabs function este_gump:ShowTabs() local tabsShown = 0 @@ -4960,14 +4961,14 @@ function gump:CriaJanelaInfo() for index = 1, #tablePool do local tab = tablePool[index] - + if (tab:condition(info.jogador, info.atributo, info.sub_atributo) and not tab.replaced) then --test if can show the tutorial for the comparison tab if (tab.tabname == "Compare") then --_detalhes:SetTutorialCVar ("DETAILS_INFO_TUTORIAL1", false) if (not _detalhes:GetTutorialCVar ("DETAILS_INFO_TUTORIAL1")) then _detalhes:SetTutorialCVar ("DETAILS_INFO_TUTORIAL1", true) - + local alert = CreateFrame ("frame", "DetailsInfoPopUp1", info, "DetailsHelpBoxTemplate") alert.ArrowUP:Show() alert.ArrowGlowUP:Show() @@ -4976,16 +4977,16 @@ function gump:CriaJanelaInfo() alert:Show() end end - + tab:Show() tabsShown = tabsShown + 1 - + tab:ClearAllPoints() - + --get the button width local buttonTemplate = gump:GetTemplate ("button", "DETAILS_TAB_BUTTON_TEMPLATE") local buttonWidth = buttonTemplate.width + 1 - + --pixelutil might not be compatible with classic wow if (PixelUtil) then PixelUtil.SetSize (tab, buttonTemplate.width, buttonTemplate.height) @@ -5004,18 +5005,18 @@ function gump:CriaJanelaInfo() tab:SetPoint ("bottomright", info, "topright", -514 + (buttonWidth * tabsShown), -72) end end - + tab:SetAlpha (0.8) else tab.frame:Hide() tab:Hide() end end - + if (tabsShown < 2) then tablePool[1]:SetPoint ("BOTTOMLEFT", info.container_barras, "TOPLEFT", 490 - (94 * (1-0)), 1) end - + --selected by default tablePool[1]:Click() end @@ -5027,12 +5028,12 @@ function gump:CriaJanelaInfo() tab.frame:Hide() end end) - + --DetailsInfoWindowTab1Text:SetText ("Avoidance") este_gump.tipo = 1 --> tipo da janela // 1 = janela normal - + return este_gump - + end info.selectedTab = "Summary" @@ -5041,7 +5042,7 @@ function _detalhes:CreatePlayerDetailsTab (tabname, localized_name, condition, f if (not tabname) then tabname = "unnamed" end - + --create a button for the tab local newTabButton = gump:CreateButton (info, onclick, 20, 20, nil, nil, nil, nil, nil, "DetailsPlayerBreakdownWindowTab" .. tabname) newTabButton:SetTemplate ("DETAILS_TAB_BUTTON_TEMPLATE") @@ -5052,14 +5053,14 @@ function _detalhes:CreatePlayerDetailsTab (tabname, localized_name, condition, f newTabButton:SetFrameStrata ("HIGH") newTabButton:SetFrameLevel (info:GetFrameLevel()+1) newTabButton:Hide() - + newTabButton.condition = condition newTabButton.tabname = tabname newTabButton.localized_name = localized_name newTabButton.onclick = onclick newTabButton.fillfunction = fillfunction newTabButton.last_actor = {} - + newTabButton.frame = CreateFrame ("frame", "DetailsPDWTabFrame" .. tabname, UIParent,"BackdropTemplate") newTabButton.frame:SetParent (info) newTabButton.frame:SetFrameStrata ("HIGH") @@ -5071,15 +5072,15 @@ function _detalhes:CreatePlayerDetailsTab (tabname, localized_name, condition, f local coords = iconSettings.coords local width = iconSettings.width local height = iconSettings.height - + local overlay, textdistance, leftpadding, textheight, short_method --nil - + newTabButton:SetIcon (texture, width, height, "overlay", coords, overlay, textdistance, leftpadding, textheight, short_method) if (iconSettings.desaturated) then newTabButton.icon:SetDesaturated (true) end end - + if (newTabButton.fillfunction) then newTabButton.frame:SetScript ("OnShow", function() if (newTabButton.last_actor == info.jogador) then @@ -5089,73 +5090,73 @@ function _detalhes:CreatePlayerDetailsTab (tabname, localized_name, condition, f newTabButton:fillfunction (info.jogador, info.instancia.showing) end) end - + if (oncreate) then oncreate (newTabButton, newTabButton.frame) end - + newTabButton.frame:SetBackdrop({ - edgeFile = [[Interface\Buttons\WHITE8X8]], - edgeSize = 1, + edgeFile = [[Interface\Buttons\WHITE8X8]], + edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], - tileSize = 64, + tileSize = 64, tile = true, insets = {left = 0, right = 0, top = 0, bottom = 0}} ) - + newTabButton.frame:SetBackdropColor (0, 0, 0, 0.3) newTabButton.frame:SetBackdropBorderColor (.3, .3, .3, 0) - + newTabButton.frame:SetPoint ("TOPLEFT", info.container_barras, "TOPLEFT", 0, 2) newTabButton.frame:SetPoint ("bottomright", info, "bottomright", -3, 3) newTabButton.frame:SetSize (569, 274) - + newTabButton.frame:Hide() - + newTabButton.replaces = replace _detalhes.player_details_tabs [#_detalhes.player_details_tabs+1] = newTabButton - + if (not onclick) then --> hide all tabs - newTabButton.OnShowFunc = function (self) + newTabButton.OnShowFunc = function(self) self = self.MyObject or self - + for _, tab in _ipairs (Details:GetBreakdownTabsInUse()) do tab.frame:Hide() tab:SetTemplate ("DETAILS_TAB_BUTTON_TEMPLATE") end - + self:SetTemplate ("DETAILS_TAB_BUTTONSELECTED_TEMPLATE") self.frame:Show() info.selectedTab = self.tabname end - + newTabButton:SetScript ("OnClick", newTabButton.OnShowFunc) else --> custom - newTabButton.OnShowFunc = function (self) + newTabButton.OnShowFunc = function(self) self = self.MyObject or self - + for _, tab in _ipairs (Details:GetBreakdownTabsInUse()) do tab.frame:Hide() tab:SetTemplate ("DETAILS_TAB_BUTTON_TEMPLATE") end - + self:SetTemplate ("DETAILS_TAB_BUTTONSELECTED_TEMPLATE") - + info.selectedTab = self.tabname - + --run onclick func local result, errorText = pcall (self.onclick) if (not result) then print (errorText) end end - + newTabButton:SetScript ("OnClick", newTabButton.OnShowFunc) end - - newTabButton:SetScript ("PostClick", function (self) + + newTabButton:SetScript ("PostClick", function(self) CurrentTab = self.tabname or self.MyObject.tabname if (CurrentTab ~= "Summary") then @@ -5168,49 +5169,49 @@ function _detalhes:CreatePlayerDetailsTab (tabname, localized_name, condition, f end end end) - + return newTabButton, newTabButton.frame end function _detalhes.playerDetailWindow:monta_relatorio (botao) - + local atributo = info.atributo local sub_atributo = info.sub_atributo local player = info.jogador local instancia = info.instancia local amt = _detalhes.report_lines - + if (not player) then _detalhes:Msg ("Player not found.") return end - + local report_lines - + if (botao == 1) then --> bot�o da esquerda - + if (atributo == 1 and sub_atributo == 4) then --> friendly fire report_lines = {"Details!: " .. player.nome .. " " .. Loc ["STRING_ATTRIBUTE_DAMAGE_FRIENDLYFIRE"] .. ":"} - + elseif (atributo == 1 and sub_atributo == 3) then --> damage taken report_lines = {"Details!: " .. player.nome .. " " .. Loc ["STRING_ATTRIBUTE_DAMAGE_TAKEN"] .. ":"} - + else -- report_lines = {"Details! " .. Loc ["STRING_ACTORFRAME_SPELLSOF"] .. " " .. player.nome .. " (" .. _detalhes.sub_atributos [atributo].lista [sub_atributo] .. ")"} report_lines = {"Details!: " .. player.nome .. " - " .. _detalhes.sub_atributos [atributo].lista [sub_atributo] .. ""} - + end - - for index, barra in _ipairs (info.barras1) do + + for index, barra in _ipairs (info.barras1) do if (barra:IsShown()) then local spellid = barra.show if (atributo == 1 and sub_atributo == 4) then --> friendly fire report_lines [#report_lines+1] = barra.lineText1:GetText() .. ": " .. barra.lineText4:GetText() - + elseif (type (spellid) == "number" and spellid > 10) then - local link = GetSpellLink (spellid) + local link = GetSpellLink(spellid) report_lines [#report_lines+1] = index .. ". " .. link .. ": " .. barra.lineText4:GetText() else local spellname = barra.lineText1:GetText():gsub ((".*%."), "") @@ -5223,14 +5224,14 @@ function _detalhes.playerDetailWindow:monta_relatorio (botao) break end end - + elseif (botao == 3) then --> bot�o dos alvos - + if (atributo == 1 and sub_atributo == 3) then print (Loc ["STRING_ACTORFRAME_NOTHING"]) return end - + report_lines = {"Details! " .. Loc ["STRING_ACTORFRAME_REPORTTARGETS"] .. " " .. _detalhes.sub_atributos [1].lista [1] .. " " .. Loc ["STRING_ACTORFRAME_REPORTOF"] .. " " .. player.nome} for index, barra in _ipairs (info.barras2) do @@ -5241,9 +5242,9 @@ function _detalhes.playerDetailWindow:monta_relatorio (botao) break end end - + elseif (botao == 2) then --> bot�o da direita - + --> diferentes tipos de amostragem na caixa da direita --dano --damage done --dps --heal if ((atributo == 1 and (sub_atributo == 1 or sub_atributo == 2)) or (atributo == 2)) then @@ -5251,16 +5252,16 @@ function _detalhes.playerDetailWindow:monta_relatorio (botao) print (Loc ["STRING_ACTORFRAME_NOTHING"]) return end - local nome = _GetSpellInfo (player.detalhes) - report_lines = {"Details! " .. Loc ["STRING_ACTORFRAME_REPORTTO"] .. " " .. _detalhes.sub_atributos [atributo].lista [sub_atributo] .. " " .. Loc ["STRING_ACTORFRAME_REPORTOF"] .. " " .. player.nome, + local nome = _GetSpellInfo(player.detalhes) + report_lines = {"Details! " .. Loc ["STRING_ACTORFRAME_REPORTTO"] .. " " .. _detalhes.sub_atributos [atributo].lista [sub_atributo] .. " " .. Loc ["STRING_ACTORFRAME_REPORTOF"] .. " " .. player.nome, Loc ["STRING_ACTORFRAME_SPELLDETAILS"] .. ": " .. nome} - + for i = 1, 5 do - + --> pega os dados dos quadrados --> Aqui mostra o resumo de todos os quadrados... local caixa = info.grupos_detalhes [i] if (caixa.bg:IsShown()) then - + local linha = "" local nome2 = caixa.nome2:GetText() --> golpes @@ -5270,43 +5271,43 @@ function _detalhes.playerDetailWindow:monta_relatorio (botao) else linha = linha..caixa.nome:GetText().." "..nome2.." / " end - end - + end + local dano = caixa.dano:GetText() --> dano if (dano and dano ~= "") then linha = linha..dano.." / " end - + local media = caixa.dano_media:GetText() --> media if (media and media ~= "") then linha = linha..media.." / " - end - + end + local dano_dps = caixa.dano_dps:GetText() if (dano_dps and dano_dps ~= "") then linha = linha..dano_dps.." / " end - + local dano_porcento = caixa.dano_porcento:GetText() if (dano_porcento and dano_porcento ~= "") then linha = linha..dano_porcento.." " end - + report_lines [#report_lines+1] = linha - + end - + if (i == amt) then break end - + end - + --dano --damage tanken (mostra as magias que o alvo usou) elseif ( (atributo == 1 and sub_atributo == 3) or atributo == 3) then if (player.detalhes) then report_lines = {"Details! " .. Loc ["STRING_ACTORFRAME_REPORTTO"] .. " " .. _detalhes.sub_atributos [1].lista [1] .. " " .. Loc ["STRING_ACTORFRAME_REPORTOF"] .. " " .. player.detalhes.. " " .. Loc ["STRING_ACTORFRAME_REPORTAT"] .. " " .. player.nome} - for index, barra in _ipairs (info.barras3) do + for index, barra in _ipairs (info.barras3) do if (barra:IsShown()) then report_lines [#report_lines+1] = barra.lineText1:GetText().." ....... ".. barra.lineText4:GetText() end @@ -5318,30 +5319,30 @@ function _detalhes.playerDetailWindow:monta_relatorio (botao) report_lines = {} end end - + elseif (botao >= 11) then --> primeira caixa dos detalhes - + botao = botao - 10 - + local nome if (_type (spellid) == "string") then --> is a pet else - nome = _GetSpellInfo (player.detalhes) - local spelllink = GetSpellLink (player.detalhes) + nome = _GetSpellInfo(player.detalhes) + local spelllink = GetSpellLink(player.detalhes) if (spelllink) then nome = spelllink end end - + if (not nome) then nome = "" end - report_lines = {"Details! " .. Loc ["STRING_ACTORFRAME_REPORTTO"] .. " " .. _detalhes.sub_atributos [atributo].lista [sub_atributo].. " " .. Loc ["STRING_ACTORFRAME_REPORTOF"] .. " " .. player.nome, - Loc ["STRING_ACTORFRAME_SPELLDETAILS"] .. ": " .. nome} - + report_lines = {"Details! " .. Loc ["STRING_ACTORFRAME_REPORTTO"] .. " " .. _detalhes.sub_atributos [atributo].lista [sub_atributo].. " " .. Loc ["STRING_ACTORFRAME_REPORTOF"] .. " " .. player.nome, + Loc ["STRING_ACTORFRAME_SPELLDETAILS"] .. ": " .. nome} + local caixa = info.grupos_detalhes [botao] - + local linha = "" local nome2 = caixa.nome2:GetText() --> golpes if (nome2 and nome2 ~= "") then @@ -5375,48 +5376,48 @@ function _detalhes.playerDetailWindow:monta_relatorio (botao) --> remove a cor da school linha = linha:gsub ("|c%x?%x?%x?%x?%x?%x?%x?%x?", "") linha = linha:gsub ("|r", "") - + report_lines [#report_lines+1] = linha - + end - + --local report_lines = {"Details! Relatorio para ".._detalhes.sub_atributos [self.atributo].lista [self.sub_atributo]} - + --> pega o conte�do da janela da direita - + return instancia:envia_relatorio (report_lines) end -local row_backdrop = {bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", +local row_backdrop = {bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", insets = {left = 0, right = 0, top = 0, bottom = 0}} local row_backdrop_onleave = {bgFile = "", edgeFile = "", tile = true, tileSize = 16, edgeSize = 32, insets = {left = 1, right = 1, top = 0, bottom = 1}} -local row_on_enter = function (self) +local row_on_enter = function(self) if (info.fading_in or info.faded) then return end - + self.mouse_over = true for index, block in pairs (_detalhes.playerDetailWindow.grupos_detalhes) do detalhe_infobg_onleave (block.bg) end - + --> aumenta o tamanho da barra self:SetHeight (CONST_BAR_HEIGHT + 1) --> poe a barra com alfa 1 ao inv�s de 0.9 self:SetAlpha(1) --> troca a cor da barra enquanto o mouse estiver em cima dela - self:SetBackdrop (row_backdrop) + self:SetBackdrop (row_backdrop) self:SetBackdropColor (0.8, 0.8, 0.8, 0.3) - + if (self.isAlvo) then --> monta o tooltip do alvo --> talvez devesse escurecer a janela no fundo... pois o tooltip � transparente e pode confundir GameTooltip:SetOwner (self, "ANCHOR_TOPRIGHT") - + if (self.spellid == "enemies") then --> damage taken enemies if (not self.minha_tabela or not self.minha_tabela:MontaTooltipDamageTaken (self, self._index, info.instancia)) then -- > poderia ser aprimerado para uma tailcall return @@ -5431,27 +5432,27 @@ local row_on_enter = function (self) end elseif (self.isMain) then - + if (IsShiftKeyDown()) then if (type (self.show) == "number") then GameTooltip:SetOwner (self, "ANCHOR_TOPRIGHT") GameTooltip:AddLine (Loc ["ABILITY_ID"] .. ": " .. self.show) - GameTooltip:Show() + GameTooltip:Show() end end - + if (self.show == 98021) then GameTooltip:SetOwner (self, "ANCHOR_TOPLEFT") GameTooltip:AddLine (Loc ["STRING_SPIRIT_LINK_TOTEM_DESC"]) - GameTooltip:Show() + GameTooltip:Show() end - + --> da zoom no icone self.icone:SetWidth (CONST_BAR_HEIGHT + 2) self.icone:SetHeight (CONST_BAR_HEIGHT + 2) --> poe a alfa do icone em 1.0 self.icone:SetAlpha (1) - + --> mostrar temporariamente o conteudo da barra nas caixas de detalhes if (not info.mostrando) then --> n�o esta mostrando nada na direita info.mostrando = self --> agora o mostrando � igual a esta barra @@ -5464,7 +5465,7 @@ local row_on_enter = function (self) end end -local row_on_leave = function (self) +local row_on_leave = function(self) if (self.fading_in or self.faded or not self:IsShown() or self.hidden) then return end @@ -5475,39 +5476,39 @@ local row_on_leave = function (self) self:SetHeight (CONST_BAR_HEIGHT) --> volta com o alfa antigo da barra que era de 0.9 self:SetAlpha(0.9) - + --> volto o background ao normal - self:SetBackdrop (row_backdrop_onleave) + self:SetBackdrop (row_backdrop_onleave) self:SetBackdropBorderColor (0, 0, 0, 0) self:SetBackdropColor (0, 0, 0, 0) - - GameTooltip:Hide() - + + GameTooltip:Hide() + GameCooltip:Hide() - + if (self.isMain) then --> retira o zoom no icone self.icone:SetWidth (CONST_BAR_HEIGHT) self.icone:SetHeight (CONST_BAR_HEIGHT) --> volta com a alfa antiga da barra self.icone:SetAlpha (1) - + --> remover o conte�do que estava sendo mostrado na direita if (info.mostrando_mouse_over) then info.mostrando = nil info.mostrando_mouse_over = false info.showing = nil - + info.jogador.detalhes = nil gump:HidaAllDetalheInfo() end - + elseif (self.isAlvo) then self:SetHeight (CONST_TARGET_HEIGHT) end end -local row_on_mousedown = function (self, button) +local row_on_mousedown = function(self, button) if (self.fading_in) then return end @@ -5519,14 +5520,14 @@ local row_on_mousedown = function (self, button) if (button == "RightButton" and not info.isMoving) then _detalhes:FechaJanelaInfo() - + elseif (not info.isMoving and button == "LeftButton" and not self.isDetalhe) then info:StartMoving() info.isMoving = true end end -local row_on_mouseup = function (self, button) +local row_on_mouseup = function(self, button) if (self.fading_in) then return end @@ -5541,51 +5542,51 @@ local row_on_mouseup = function (self, button) y = _math_floor (y) if ((self.mouse_down+0.4 > _GetTime() and (x == self.x and y == self.y)) or (x == self.x and y == self.y)) then --> setar os textos - + if (self.isMain) then --> se n�o for uma barra de alvo - - local barra_antiga = info.mostrando + + local barra_antiga = info.mostrando if (barra_antiga and not info.mostrando_mouse_over) then - + barra_antiga.textura:SetStatusBarColor (1, 1, 1, 1) --> volta a textura normal barra_antiga.on_focus = false --> n�o esta mais no foco --> clicou na mesma barra - if (barra_antiga == self) then --> + if (barra_antiga == self) then --> info.mostrando_mouse_over = true return - + --> clicou em outra barra else --> clicou em outra barra e trocou o foco barra_antiga:SetAlpha (.9) --> volta a alfa antiga - + info.mostrando = self info.showing = i - + info.jogador.detalhes = self.show info.jogador:MontaDetalhes (self.show, self) - + self:SetAlpha (1) self.textura:SetStatusBarColor (129/255, 125/255, 69/255, 1) self.on_focus = true return end end - + --> nao tinha barras pressionadas info.mostrando_mouse_over = false self:SetAlpha (1) self.textura:SetStatusBarColor (129/255, 125/255, 69/255, 1) self.on_focus = true end - + end end local function SetBarraScripts (esta_barra, instancia, i) - + esta_barra._index = i - + esta_barra:SetScript ("OnEnter", row_on_enter) esta_barra:SetScript ("OnLeave", row_on_leave) @@ -5600,7 +5601,7 @@ local function CriaTexturaBarra(newLine) newLine.textura:SetAllPoints(newLine) newLine.textura:SetAlpha(0.5) newLine.textura:Show() - + local textureObject = newLine.textura:CreateTexture(nil, "artwork") local texturePath = SharedMedia:Fetch("statusbar", _detalhes.player_details_window.bar_texture) textureObject:SetTexture(texturePath) @@ -5613,12 +5614,12 @@ local function CriaTexturaBarra(newLine) backgroundTexture:SetAllPoints() backgroundTexture:SetColorTexture(.5, .5, .5, 0.18) newLine.textura.bg = backgroundTexture - + if (newLine.targets) then newLine.targets:SetParent(newLine.textura) newLine.targets:SetFrameLevel(newLine.textura:GetFrameLevel()+2) end - + --create the left text newLine.lineText1 = newLine:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall") newLine.lineText1:SetPoint("LEFT", newLine.icone, "RIGHT", 2, 0) @@ -5638,10 +5639,10 @@ local function CriaTexturaBarra(newLine) newLine.lineText4:SetTextColor(1,1,1,1) end -local miniframe_func_on_enter = function (self) +local miniframe_func_on_enter = function(self) local barra = self:GetParent() if (barra.show and type (barra.show) == "number") then - local spellname = _GetSpellInfo (barra.show) + local spellname = _GetSpellInfo(barra.show) if (spellname) then GameTooltip:SetOwner (self, "ANCHOR_TOPLEFT") _detalhes:GameTooltipSetSpellByID (barra.show) @@ -5651,24 +5652,24 @@ local miniframe_func_on_enter = function (self) barra:GetScript("OnEnter")(barra) end -local miniframe_func_on_leave = function (self) +local miniframe_func_on_leave = function(self) GameTooltip:Hide() self:GetParent():GetScript("OnLeave")(self:GetParent()) end -local target_on_enter = function (self) +local target_on_enter = function(self) local barra = self:GetParent():GetParent() - + if (barra.show and type (barra.show) == "number") then local actor = barra.other_actor or info.jogador local spell = actor.spells and actor.spells:PegaHabilidade (barra.show) if (spell) then - + local ActorTargetsSortTable = {} local ActorTargetsContainer local total = 0 - + if (spell.isReflection) then ActorTargetsContainer = spell.extra else @@ -5685,7 +5686,7 @@ local target_on_enter = function (self) end end end - + --add and sort for target_name, amount in _pairs (ActorTargetsContainer) do --print (target_name, amount) @@ -5693,14 +5694,14 @@ local target_on_enter = function (self) total = total + (amount or 0) end table.sort (ActorTargetsSortTable, _detalhes.Sort2) - - local spellname = _GetSpellInfo (barra.show) - + + local spellname = _GetSpellInfo(barra.show) + GameTooltip:SetOwner (self, "ANCHOR_TOPRIGHT") GameTooltip:AddLine (barra.index .. ". " .. spellname) GameTooltip:AddLine (info.target_text) GameTooltip:AddLine (" ") - + --get time type local meu_tempo if (_detalhes.time_type == 1 or not actor.grupo) then @@ -5708,9 +5709,9 @@ local target_on_enter = function (self) elseif (_detalhes.time_type == 2) then meu_tempo = info.instancia.showing:GetCombatTime() end - + local SelectedToKFunction = _detalhes.ToKFunctions [_detalhes.ps_abbreviation] - + if (spell.isReflection) then _detalhes:FormatCooltipForSpells() GameCooltip:SetOwner(self, "bottomright", "top", 4, -2) @@ -5723,7 +5724,7 @@ local target_on_enter = function (self) local topDamage = ActorTargetsSortTable[1] and ActorTargetsSortTable[1][2] - for index, target in ipairs (ActorTargetsSortTable) do + for index, target in ipairs (ActorTargetsSortTable) do if (target [2] > 0) then local spellId = target[1] local damageDone = target[2] @@ -5741,7 +5742,7 @@ local target_on_enter = function (self) barra:GetScript("OnEnter")(barra) return else - for index, target in ipairs (ActorTargetsSortTable) do + for index, target in ipairs (ActorTargetsSortTable) do if (target [2] > 0) then local class = _detalhes:GetClass (target [1]) if (class and _detalhes.class_coords [class]) then @@ -5761,7 +5762,7 @@ local target_on_enter = function (self) end end end - + GameTooltip:Show() else GameTooltip:SetOwner (self, "ANCHOR_TOPRIGHT") @@ -5779,13 +5780,13 @@ local target_on_enter = function (self) GameTooltip:AddLine (Loc ["STRING_MORE_INFO"], 1, 1, 1) GameTooltip:Show() end - + self.texture:SetAlpha (1) self:SetAlpha (1) barra:GetScript("OnEnter")(barra) end -local target_on_leave = function (self) +local target_on_leave = function(self) GameTooltip:Hide() GameCooltip:Hide() self:GetParent():GetParent():GetScript("OnLeave")(self:GetParent():GetParent()) @@ -5808,14 +5809,14 @@ function gump:CriaNovaBarraInfo1 (instancia, index) local y = (index-1) * (CONST_BAR_HEIGHT + 1) y = y * -1 - + newLine:SetPoint("LEFT", parentFrame, "LEFT", CONST_BAR_HEIGHT, 0) newLine:SetPoint("RIGHT", parentFrame, "RIGHT") newLine:SetPoint("TOP", parentFrame, "TOP", 0, y) newLine:SetFrameLevel(parentFrame:GetFrameLevel() + 1) newLine:SetAlpha(1) newLine:EnableMouse(true) - newLine:RegisterForClicks("LeftButtonDown","RightButtonUp") + newLine:RegisterForClicks("LeftButtonDown","RightButtonUp") newLine.isMain = true --create a square frame which is placed at the right side of the line to show which targets for damaged by the spell @@ -5843,14 +5844,14 @@ function gump:CriaNovaBarraInfo1 (instancia, index) newLine.miniframe:SetPoint("right", newLine, "left", CONST_BAR_HEIGHT, 0) newLine.miniframe:SetScript("OnEnter", miniframe_func_on_enter) newLine.miniframe:SetScript("OnLeave", miniframe_func_on_leave) - + CriaTexturaBarra(newLine) SetBarraScripts (newLine, instancia, index) - + info.barras1[index] = newLine newLine.textura:SetStatusBarColor(1, 1, 1, 1) newLine.on_focus = false - + return newLine end @@ -5860,7 +5861,7 @@ function gump:CriaNovaBarraInfo2(instancia, index) print ("erro a barra "..index.." ja existe na janela de detalhes...") return end - + local janela = info.container_alvos.gump local esta_barra = _CreateFrame ("Button", "Details_infobox2_bar_"..index, info.container_alvos.gump, "BackdropTemplate") @@ -5868,14 +5869,14 @@ function gump:CriaNovaBarraInfo2(instancia, index) local y = (index-1) * (CONST_TARGET_HEIGHT + 1) y = y*-1 --> baixo - + esta_barra:SetPoint("LEFT", janela, "LEFT", CONST_TARGET_HEIGHT, 0) esta_barra:SetPoint("RIGHT", janela, "RIGHT", 0, 0) esta_barra:SetPoint("TOP", janela, "TOP", 0, y) esta_barra:SetFrameLevel (janela:GetFrameLevel() + 1) esta_barra:EnableMouse (true) - esta_barra:RegisterForClicks ("LeftButtonDown","RightButtonUp") + esta_barra:RegisterForClicks ("LeftButtonDown","RightButtonUp") --> icone esta_barra.icone = esta_barra:CreateTexture(nil, "OVERLAY") @@ -5884,16 +5885,16 @@ function gump:CriaNovaBarraInfo2(instancia, index) esta_barra.icone:SetPoint("RIGHT", esta_barra, "LEFT", 0, 0) CriaTexturaBarra(esta_barra) - + esta_barra:SetAlpha(ALPHA_BLEND_AMOUNT) esta_barra.icone:SetAlpha(1) - + esta_barra.isAlvo = true - + SetBarraScripts(esta_barra, instancia, index) - + info.barras2 [index] = esta_barra --> barra adicionada - + return esta_barra end @@ -5911,18 +5912,18 @@ function gump:CriaNovaBarraInfo3 (instancia, index) local esta_barra = CreateFrame ("Button", "Details_infobox3_bar_"..index, janela, "BackdropTemplate") esta_barra:SetHeight (16) - + local y = (index-1) * 17 y = y*-1 - + --esta_barra:SetPoint ("LEFT", janela, "LEFT", x_start, 0) --esta_barra:SetPoint ("RIGHT", janela, "RIGHT", 65, 0) --esta_barra:SetPoint ("TOP", janela, "TOP", 0, y+y_start) - + container3_bars_pointFunc (esta_barra, index) - + esta_barra:EnableMouse (true) - + CriaTexturaBarra(esta_barra) --> icone @@ -5930,15 +5931,15 @@ function gump:CriaNovaBarraInfo3 (instancia, index) esta_barra.icone:SetWidth (14) esta_barra.icone:SetHeight (14) esta_barra.icone:SetPoint ("RIGHT", esta_barra.textura, "LEFT", 18, 0) - + esta_barra:SetAlpha (0.9) esta_barra.icone:SetAlpha (1) - + esta_barra.isDetalhe = true - + SetBarraScripts (esta_barra, instancia, index) - + info.barras3 [index] = esta_barra --> barra adicionada - + return esta_barra end diff --git a/frames/window_playerbreakdown_list.lua b/frames/window_playerbreakdown_list.lua index 3c0da458..8a9b4170 100644 --- a/frames/window_playerbreakdown_list.lua +++ b/frames/window_playerbreakdown_list.lua @@ -1,10 +1,10 @@ local Details = _G.Details - local DF = _G.DetailsFramework + local detailsFramework = _G.DetailsFramework local breakdownWindowPlayerList = {} - local unpack = _G.unpack + local unpack = table.unpack or unpack local C_Timer = _G.C_Timer local tinsert = _G.tinsert @@ -15,16 +15,17 @@ local scrollbox_line_backdrop_color_selected = {.6, .6, .1, 0.7} local scrollbox_line_backdrop_color_highlight = {.9, .9, .9, 0.5} local player_scroll_size = {180, 288} - + function breakdownWindowPlayerList.CreatePlayerListFrame() local f = _G.DetailsPlayerDetailsWindow - + local refreshPlayerList = function(self, data, offset, totalLines) --update the scroll local topResult = data[1] if (topResult) then topResult = topResult.total end + for i = 1, totalLines do local index = i + offset local playerObject = data[index] @@ -36,20 +37,20 @@ end end end - + local lineOnClick = function(self) if (self.playerObject ~= Details:GetPlayerObjectFromBreakdownWindow()) then Details:OpenPlayerBreakdown(Details:GetActiveWindowFromBreakdownWindow(), self.playerObject) f.playerScrollBox:Refresh() end end - + local lineOnEnter = function(self) self:SetBackdropColor(unpack(scrollbox_line_backdrop_color_highlight)) self.specIcon:SetBlendMode("ADD") self.roleIcon:SetBlendMode("ADD") end - + local lineOnLeave = function(self) if (self.isSelected) then self:SetBackdropColor(unpack(scrollbox_line_backdrop_color_selected)) @@ -78,7 +79,6 @@ self.specIcon:SetTexCoord(.1, .9, .1, .9) else local specIcon, L, R, T, B = Details:GetSpecIcon(self.playerObject.spec, false) - local specId, specName, specDescription, specIconId, specClass if (specIcon) then self.specIcon:SetTexture(specIcon) @@ -87,7 +87,7 @@ if (DetailsFramework.IsTimewalkWoW()) then specRole = "NONE" else - specId, specName, specDescription, specIconId, specRole, specClass = _G.GetSpecializationInfoByID(self.playerObject.spec) + specRole = select(5, _G.GetSpecializationInfoByID(self.playerObject.spec)) end else self.specIcon:SetTexture("") @@ -106,14 +106,14 @@ else self.roleIcon:SetTexture("") end - + --do not show the role icon self.roleIcon:SetTexture("") - + --set the player name self.playerName:SetText(Details:GetOnlyName(self.playerObject.nome)) self.rankText:SetText(self.index) - + --set the player class name self.className:SetText(string.lower(_G.UnitClass(self.playerObject.nome) or self.playerObject:Class())) @@ -124,6 +124,21 @@ self.totalStatusBar:SetValue(self.playerObject.total) end + --get a Details! window + local lowerInstanceId = Details:GetLowerInstanceNumber() + local fontFile + local fontSize + local fontOutline + + if (lowerInstanceId) then + local instance = Details:GetInstance(lowerInstanceId) + if (instance) then + fontFile = instance.row_info.font_face + fontSize = instance.row_info.font_size + fontOutline = instance.row_info.textL_outline + end + end + local createPlayerLine = function(self, index) --create a new line local line = _G.CreateFrame("button", "$parentLine" .. index, self, "BackdropTemplate") @@ -144,18 +159,29 @@ local specIcon = line:CreateTexture("$parentSpecIcon", "artwork") specIcon:SetSize(player_line_height, player_line_height) specIcon:SetAlpha(0.71) + local roleIcon = line:CreateTexture("$parentRoleIcon", "overlay") roleIcon:SetSize((player_line_height-2) / 2, (player_line_height-2) / 2) roleIcon:SetAlpha(0.71) - local playerName = DF:CreateLabel(line, "", "GameFontNormal") + local playerName = detailsFramework:CreateLabel(line, "", 11, "white", "GameFontNormal") + if (fontFile) then + playerName.fontface = fontFile + end + if (fontSize) then + playerName.fontsize = fontSize + end + if (fontOutline) then + playerName.outline = fontOutline + end + playerName.textcolor = {1, 1, 1, .9} - playerName.textsize = 11 - local className = DF:CreateLabel(line, "", "GameFontNormal") + + local className = detailsFramework:CreateLabel(line, "", "GameFontNormal") className.textcolor = {.95, .8, .2, 0} className.textsize = 9 - local rankText = DF:CreateLabel(line, "", "GameFontNormal") + local rankText = detailsFramework:CreateLabel(line, "", "GameFontNormal") rankText.textcolor = {.3, .3, .3, .7} rankText.textsize = 13 @@ -184,9 +210,9 @@ return line end - - local playerScroll = DF:CreateScrollBox(f, "$parentPlayerScrollBox", refreshPlayerList, {}, player_scroll_size[1] + 22, player_scroll_size[2], scrollbox_lines, player_line_height) - DF:ReskinSlider (playerScroll) + + local playerScroll = detailsFramework:CreateScrollBox(f, "$parentPlayerScrollBox", refreshPlayerList, {}, player_scroll_size[1] + 22, player_scroll_size[2], scrollbox_lines, player_line_height) + detailsFramework:ReskinSlider(playerScroll) playerScroll.ScrollBar:ClearAllPoints() playerScroll.ScrollBar:SetPoint("topright", playerScroll, "topright", -2, -17) playerScroll.ScrollBar:SetPoint("bottomright", playerScroll, "bottomright", -2, 17) @@ -196,12 +222,12 @@ playerScroll:SetBackdropColor(0, 0, 0, 0.2) playerScroll:SetBackdropBorderColor(0, 0, 0, 1) f.playerScrollBox = playerScroll - + --create the scrollbox lines for i = 1, scrollbox_lines do playerScroll:CreateLine(createPlayerLine) end - + local classIds = { WARRIOR = 1, PALADIN = 2, @@ -221,21 +247,23 @@ function breakdownWindowPlayerList.BuildPlayerList() local segment = Details:GetCombatFromBreakdownWindow() local playerTable = {} + if (segment) then local displayType = Details:GetDisplayTypeFromBreakdownWindow() local containerType = displayType == 1 and DETAILS_ATTRIBUTE_DAMAGE or DETAILS_ATTRIBUTE_HEAL local container = segment:GetContainer(containerType) + for index, playerObject in container:ListActors() do if (playerObject:IsPlayer()) then local unitClassID = classIds [playerObject:Class()] or 13 local unitName = playerObject:Name() - local playerPosition = (((unitClassID or 0) + 128) ^ 4) + tonumber (string.byte (unitName, 1) .. "" .. string.byte (unitName, 2)) + local playerPosition = (((unitClassID or 0) + 128) ^ 4) + tonumber (string.byte(unitName, 1) .. "" .. string.byte(unitName, 2)) tinsert(playerTable, {playerObject, playerPosition, playerObject.total}) end end end - table.sort(playerTable, DF.SortOrder3) + table.sort(playerTable, detailsFramework.SortOrder3) local resultTable = {} for i = 1, #playerTable do @@ -263,5 +291,9 @@ end) end - breakdownWindowPlayerList.CreatePlayerListFrame() - + function Details.PlayerBreakdown.CreatePlayerListFrame() + if (not Details.PlayerBreakdown.playerListFrameCreated) then + breakdownWindowPlayerList.CreatePlayerListFrame() + Details.PlayerBreakdown.playerListFrameCreated = true + end + end \ No newline at end of file diff --git a/frames/window_profiler.lua b/frames/window_profiler.lua index 9c311e4b..605c047f 100644 --- a/frames/window_profiler.lua +++ b/frames/window_profiler.lua @@ -48,7 +48,7 @@ function Details:OpenProfiler() --> get the new profile name local current_profile = Details:GetCurrentProfileName() - local on_select_profile = function (_, _, profilename) + local on_select_profile = function(_, _, profilename) if (profilename ~= Details:GetCurrentProfileName()) then Details:ApplyProfile (profilename) if (_G.DetailsOptionsWindow and _G.DetailsOptionsWindow:IsShown()) then diff --git a/frames/window_rowtexteditor.lua b/frames/window_rowtexteditor.lua index 433be68b..642a4d5a 100644 --- a/frames/window_rowtexteditor.lua +++ b/frames/window_rowtexteditor.lua @@ -37,7 +37,7 @@ local textentry = DF:NewSpecialLuaEditorEntry (panel, scrollWidth, 555, "editbox textentry:SetPoint ("topleft", panel, "topleft", 10, y) DF:ApplyStandardBackdrop (textentry) DF:SetFontSize (textentry.editbox, 14) -DF:ReskinSlider (textentry.scroll) +DF:ReskinSlider(textentry.scroll) local arg1_button = DF:NewButton (panel, nil, "$parentButton1", nil, 80, 20, function() textentry.editbox:Insert ("{data1}") end, nil, nil, nil, string.format (Loc ["STRING_OPTIONS_TEXTEDITOR_DATA"], "1"), 1) local arg2_button = DF:NewButton (panel, nil, "$parentButton2", nil, 80, 20, function() textentry.editbox:Insert ("{data2}") end, nil, nil, nil, string.format (Loc ["STRING_OPTIONS_TEXTEDITOR_DATA"], "2"), 1) @@ -157,7 +157,7 @@ local function ColorSelection ( self, ColorCode ) self:HighlightText( Start, #ColorCode + ( #Replacement - #Selection ) + #COLOR_END + End ); end -local color_func = function (_, r, g, b, a) +local color_func = function(_, r, g, b, a) local hex = Details:hex (a*255)..Details:hex (r*255)..Details:hex (g*255)..Details:hex (b*255) ColorSelection ( textentry.editbox, "|c" .. hex) end diff --git a/frames/window_runcode.lua b/frames/window_runcode.lua index 222441db..9cecfe64 100644 --- a/frames/window_runcode.lua +++ b/frames/window_runcode.lua @@ -42,7 +42,7 @@ function Details.OpenRunCodeWindow() code_editor.editbox:SetBackdrop (nil) code_editor:SetBackdrop (nil) - DF:ReskinSlider (code_editor.scroll) + DF:ReskinSlider(code_editor.scroll) if (not code_editor.__background) then code_editor.__background = code_editor:CreateTexture (nil, "background") @@ -74,7 +74,7 @@ function Details.OpenRunCodeWindow() errortext_label:SetPoint ("left", errortext_frame, "left", 3, 0) code_editor.NextCodeCheck = 0.33 - code_editor:HookScript ("OnUpdate", function (self, deltaTime) + code_editor:HookScript ("OnUpdate", function(self, deltaTime) code_editor.NextCodeCheck = code_editor.NextCodeCheck - deltaTime if (code_editor.NextCodeCheck < 0) then @@ -97,7 +97,7 @@ function Details.OpenRunCodeWindow() end) --> script selector - local on_select_CodeType_option = function (self, fixedParameter, value) + local on_select_CodeType_option = function(self, fixedParameter, value) --> set the current editing code type f.EditingCode = Details.RunCodeTypes [value].Value f.EditingCodeKey = Details.RunCodeTypes [value].ProfileKey diff --git a/frames/window_scrolldamage.lua b/frames/window_scrolldamage.lua index 53a52b35..7e875203 100644 --- a/frames/window_scrolldamage.lua +++ b/frames/window_scrolldamage.lua @@ -103,7 +103,7 @@ function Details:ScrollDamage() end end - local lineOnEnter = function (self) + local lineOnEnter = function(self) if (self.IsCritical) then self:SetBackdropColor(unpack(backdrop_color_is_critical_on_enter)) else @@ -119,7 +119,7 @@ function Details:ScrollDamage() end end - local lineOnLeave = function (self) + local lineOnLeave = function(self) if (self.IsCritical) then self:SetBackdropColor(unpack(backdrop_color_is_critical)) else @@ -207,7 +207,7 @@ function Details:ScrollDamage() local combatLogReader = CreateFrame("frame") local playerSerial = UnitGUID("player") - combatLogReader:SetScript("OnEvent", function (self) + combatLogReader:SetScript("OnEvent", function(self) local timew, token, hidding, sourceSerial, sourceName, sourceFlag, sourceFlag2, targetSerial, targetName, targetFlag, targetFlag2, spellID, spellName, spellType, amount, overKill, school, resisted, blocked, absorbed, isCritical = CombatLogGetCurrentEventInfo() if (sourceSerial == playerSerial) then if (token == "SPELL_DAMAGE" or token == "SPELL_PERIODIC_DAMAGE" or token == "RANGE_DAMAGE" or token == "DAMAGE_SHIELD") then diff --git a/frames/window_statistics.lua b/frames/window_statistics.lua index 3aad43e2..09d0f4d3 100644 --- a/frames/window_statistics.lua +++ b/frames/window_statistics.lua @@ -263,7 +263,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild --> report results function f.BuildReport() if (f.LatestResourceTable) then - local reportFunc = function (IsCurrent, IsReverse, AmtLines) + local reportFunc = function(IsCurrent, IsReverse, AmtLines) local bossName = f.select_boss.label:GetText() local bossDiff = f.select_diff.label:GetText() local guildName = f.select_guild.label:GetText() @@ -363,7 +363,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild end --> select raid: - local onRaidSelect = function (_, _, raid) + local onRaidSelect = function(_, _, raid) Details.rank_window.last_raid = raid f:UpdateDropdowns (true) on_select() @@ -376,7 +376,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild raid_dropdown:SetTemplate (DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) --> select boss: - local on_boss_select = function (_, _, boss) + local on_boss_select = function(_, _, boss) on_select() end local build_boss_list = function() @@ -387,7 +387,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild boss_dropdown:SetTemplate (DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) --> select difficulty: - local on_diff_select = function (_, _, diff) + local on_diff_select = function(_, _, diff) Details.rank_window.last_difficulty = diff on_select() end @@ -400,7 +400,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild diff_dropdown:SetTemplate (DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) --> select role: - local on_role_select = function (_, _, role) + local on_role_select = function(_, _, role) on_select() end local build_role_list = function() @@ -414,7 +414,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild role_dropdown:SetTemplate (DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) --> select guild: - local on_guild_select = function (_, _, guild) + local on_guild_select = function(_, _, guild) on_select() end local build_guild_list = function() @@ -425,7 +425,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild guild_dropdown:SetTemplate (DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) --> select playerbase: - local on_player_select = function (_, _, player) + local on_player_select = function(_, _, player) on_select() end local build_player_list = function() @@ -439,7 +439,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild player_dropdown:SetTemplate (DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) --> select player: - local onPlayer2Select = function (_, _, player) + local onPlayer2Select = function(_, _, player) f.latest_player_selected = player f:BuildPlayerTable (player) end @@ -551,7 +551,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild end end - table.sort (bossList, function (t1, t2) return t1.label < t2.label end) + table.sort (bossList, function(t1, t2) return t1.label < t2.label end) diff_dropdown:Refresh() @@ -632,7 +632,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild end end - table.sort (bossList, function (t1, t2) return t1.label < t2.label end) + table.sort (bossList, function(t1, t2) return t1.label < t2.label end) boss_dropdown:Refresh() end @@ -690,7 +690,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild --> update graphic if (not f.gframe) then - local onenter = function (self) + local onenter = function(self) GameCooltip:Reset() GameCooltip:SetType ("tooltip") GameCooltip:Preset (2) @@ -703,7 +703,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild GameCooltip:SetOwner (self.ball.tooltip_anchor) GameCooltip:Show() end - local onleave = function (self) + local onleave = function(self) GameCooltip:Hide() end f.gframe = DF:CreateGFrame (f, 650, 400, 35, onenter, onleave, "gframe", "$parentGF") @@ -795,7 +795,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild t [1] = i .. ". " .. t [1] end - fillpanel:SetFillFunction (function (index) return sortTable [index] end) + fillpanel:SetFillFunction (function(index) return sortTable [index] end) fillpanel:SetTotalFunction (function() return #sortTable end) fillpanel:UpdateRows (header) fillpanel:Refresh() @@ -870,7 +870,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild end end - fillpanel:SetFillFunction (function (index) return players [index] end) + fillpanel:SetFillFunction (function(index) return players [index] end) fillpanel:SetTotalFunction (function() return #players end) fillpanel:UpdateRows (header) diff --git a/frames/window_switch.lua b/frames/window_switch.lua index 323e3c12..4c6c48fa 100644 --- a/frames/window_switch.lua +++ b/frames/window_switch.lua @@ -98,7 +98,7 @@ do end end - local on_click_all_switch_button = function (self, button) + local on_click_all_switch_button = function(self, button) if (button == "LeftButton") then local attribute = self.attribute local subAttribute = self.sub_attribute @@ -175,7 +175,7 @@ do end end - local create_all_switch_button = function (attribute, sub_attribute, x, y) + local create_all_switch_button = function(attribute, sub_attribute, x, y) local button = CreateFrame ("button", "DetailsAllAttributesFrame" .. attribute .. sub_attribute, allDisplaysFrame) button:SetSize (130, 16) button.texture = button:CreateTexture (nil, "overlay") @@ -488,7 +488,7 @@ function Details.switch:ShowMe(instancia) elseif (IsShiftKeyDown()) then if (not Details.switch.segments_blocks) then - local segment_switch = function (self, button, segment) + local segment_switch = function(self, button, segment) if (button == "LeftButton") then Details.switch.current_instancia:TrocaTabela (segment) Details.switch.CloseMe() @@ -497,26 +497,26 @@ function Details.switch:ShowMe(instancia) end end - local hide_label = function (self) + local hide_label = function(self) self.texture:Hide() self.button:Hide() self.background:Hide() self:Hide() end - local show_label = function (self) + local show_label = function(self) self.texture:Show() self.button:Show() self.background:Show() self:Show() end - local on_enter = function (self) + local on_enter = function(self) --self.MyObject.this_background:SetBlendMode ("ADD") --self.MyObject.boss_texture:SetBlendMode ("ADD") end - local on_leave = function (self) + local on_leave = function(self) self.MyObject.this_background:SetBlendMode ("BLEND") self.MyObject.boss_texture:SetBlendMode ("BLEND") end @@ -1078,7 +1078,7 @@ end local scroll = CreateFrame ("scrollframe", "DetailsSwitchPanelScroll", DetailsSwitchPanel, "FauxScrollFrameTemplate") scroll:SetAllPoints() -scroll:SetScript ("OnVerticalScroll", function (self, offset) FauxScrollFrame_OnVerticalScroll (self, offset, 20, Details.switch.Update) end) --altura +scroll:SetScript ("OnVerticalScroll", function(self, offset) FauxScrollFrame_OnVerticalScroll (self, offset, 20, Details.switch.Update) end) --altura scroll.ScrollBar:Hide() scroll.ScrollBar.ScrollUpButton:Hide() scroll.ScrollBar.ScrollDownButton:Hide() diff --git a/frames/window_wa.lua b/frames/window_wa.lua index 8526f1d9..a58a0187 100644 --- a/frames/window_wa.lua +++ b/frames/window_wa.lua @@ -68,7 +68,7 @@ local text_dispell_prototype = { ["events"] = "COMBAT_LOG_EVENT_UNFILTERED, ENCOUNTER_START", ["use_spellName"] = false, ["use_spellId"] = false, - ["custom"] = "function (event, time, token, hidding, who_serial, who_name, who_flags, who_flags2, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, extraSpellID, extraSpellName, extraSchool)\n if (event == \"COMBAT_LOG_EVENT_UNFILTERED\") then\n \n if ((token == \"SPELL_DISPEL\" or token == \"SPELL_STOLEN\") and extraSpellID == 159947) then\n aura_env.dispelled = aura_env.dispelled + 1\n aura_env.dispels_by [who_name] = (aura_env.dispels_by [who_name] or 0) + 1\n \n aura_env.text = aura_env.text .. \"|cffd2e8ff\" .. who_name .. \" (\" .. aura_env.dispels_by [who_name] .. \") \".. \"|r\\n\"\n \n if (select (2, aura_env.text:gsub (\"\\n\", \"\")) == 9) then\n aura_env.text = aura_env.text:gsub (\".-\\n\", \"\", 1)\n end\n return true\n end \n else\n aura_env.text = \"\"\n aura_env.success = 0\n aura_env.dispelled = 0\n wipe (aura_env.dispels_by)\n return true \n end\nend", + ["custom"] = "function(event, time, token, hidding, who_serial, who_name, who_flags, who_flags2, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, extraSpellID, extraSpellName, extraSchool)\n if (event == \"COMBAT_LOG_EVENT_UNFILTERED\") then\n \n if ((token == \"SPELL_DISPEL\" or token == \"SPELL_STOLEN\") and extraSpellID == 159947) then\n aura_env.dispelled = aura_env.dispelled + 1\n aura_env.dispels_by [who_name] = (aura_env.dispels_by [who_name] or 0) + 1\n \n aura_env.text = aura_env.text .. \"|cffd2e8ff\" .. who_name .. \" (\" .. aura_env.dispels_by [who_name] .. \") \".. \"|r\\n\"\n \n if (select (2, aura_env.text:gsub (\"\\n\", \"\")) == 9) then\n aura_env.text = aura_env.text:gsub (\".-\\n\", \"\", 1)\n end\n return true\n end \n else\n aura_env.text = \"\"\n aura_env.success = 0\n aura_env.dispelled = 0\n wipe (aura_env.dispels_by)\n return true \n end\nend", ["spellIds"] = { }, ["use_message"] = true, @@ -176,7 +176,7 @@ local text_interrupt_prototype = { }, ["use_spellName"] = false, ["use_spellId"] = false, - ["custom"] = "function (evento, time, token, hidding, who_serial, who_name, who_flags, who_flags2, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, extraSpellID, extraSpellName, extraSchool)\n \n if (evento == \"COMBAT_LOG_EVENT_UNFILTERED\") then\n \n if (token == \"SPELL_CAST_SUCCESS\" and spellid == 165416) then\n aura_env.success = aura_env.success + 1\n aura_env.text = aura_env.text .. \"SUCCESS! (\" .. aura_env.success .. \")\\n\"\n \n return true\n \n elseif (token == \"SPELL_INTERRUPT\" and extraSpellID == 165416) then\n aura_env.interrupted = aura_env.interrupted + 1\n aura_env.text = aura_env.text .. who_name .. \" (\" .. aura_env.interrupted .. \") \".. \"\\n\"\n return true\n end\n else\n aura_env.text = \"\"\n aura_env.success = 0\n aura_env.interrupted = 0\n return true \n end\n \nend\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", + ["custom"] = "function(evento, time, token, hidding, who_serial, who_name, who_flags, who_flags2, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, extraSpellID, extraSpellName, extraSchool)\n \n if (evento == \"COMBAT_LOG_EVENT_UNFILTERED\") then\n \n if (token == \"SPELL_CAST_SUCCESS\" and spellid == 165416) then\n aura_env.success = aura_env.success + 1\n aura_env.text = aura_env.text .. \"SUCCESS! (\" .. aura_env.success .. \")\\n\"\n \n return true\n \n elseif (token == \"SPELL_INTERRUPT\" and extraSpellID == 165416) then\n aura_env.interrupted = aura_env.interrupted + 1\n aura_env.text = aura_env.text .. who_name .. \" (\" .. aura_env.interrupted .. \") \".. \"\\n\"\n return true\n end\n else\n aura_env.text = \"\"\n aura_env.success = 0\n aura_env.interrupted = 0\n return true \n end\n \nend\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", ["events"] = "COMBAT_LOG_EVENT_UNFILTERED, ENCOUNTER_START", ["use_message"] = true, ["unevent"] = "timed", @@ -1457,7 +1457,7 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n new_aura = _detalhes.table.copy ({}, text_interrupt_prototype) new_aura.trigger.custom = [[ - function (event, time, token, hidding, who_serial, who_name, who_flags, who_flags2, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, extraSpellID, extraSpellName, extraSchool) + function(event, time, token, hidding, who_serial, who_name, who_flags, who_flags2, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, extraSpellID, extraSpellName, extraSchool) if (event == "COMBAT_LOG_EVENT_UNFILTERED") then if (token == "SPELL_CAST_SUCCESS" and spellid == @spellid) then aura_env.success = aura_env.success + 1 @@ -1502,7 +1502,7 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n new_aura = _detalhes.table.copy ({}, text_dispell_prototype) new_aura.trigger.custom = [[ - function (event, time, token, hidding, who_serial, who_name, who_flags, who_flags2, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, extraSpellID, extraSpellName, extraSchool) + function(event, time, token, hidding, who_serial, who_name, who_flags, who_flags2, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, extraSpellID, extraSpellName, extraSchool) if (event == "COMBAT_LOG_EVENT_UNFILTERED") then if ((token == "SPELL_DISPEL" or token == "SPELL_STOLEN") and extraSpellID == @spellid) then aura_env.dispelled = aura_env.dispelled + 1 @@ -1958,7 +1958,7 @@ local empty_other_values = {} function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, triggertype, auratype, other_values) if (not spellname) then - spellname = select (1, GetSpellInfo (spellid)) + spellname = select (1, GetSpellInfo(spellid)) end wipe (empty_other_values) @@ -2008,7 +2008,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr LibWindow.MakeDraggable (f) LibWindow.SavePosition (f) - f:SetScript ("OnMouseDown", function (self, button) + f:SetScript ("OnMouseDown", function(self, button) if (button == "RightButton") then f:Hide() end @@ -2059,7 +2059,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr f.name = name_textentry --aura type - local on_select_aura_type = function (_, _, aura_type) + local on_select_aura_type = function(_, _, aura_type) if (f.UpdateLabels) then f:UpdateLabels() end @@ -2090,7 +2090,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr local AuraTypeBorderColor = {.3, .3, .3, 0.5} local AuraTypeBorderSelectedColor = {1, 1, 1, 0.4} - local OnSelectAuraType = function (self, fixedParam, auraType, noUpdate) + local OnSelectAuraType = function(self, fixedParam, auraType, noUpdate) if (type (auraType) == "number") then if (auraType == 1) then @@ -2156,7 +2156,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr --trigger list --target - local on_select_aura_trigger = function (_, _, aura_trigger) + local on_select_aura_trigger = function(_, _, aura_trigger) if (f.UpdateLabels) then f:UpdateLabels() end @@ -2204,7 +2204,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr {name = "Spell Dispell", value = 42}, } - local SetTriggerState = function (triggerID) + local SetTriggerState = function(triggerID) for i = 1, #triggerList do triggerList[i].checkBox:SetValue (false) if (triggerList[i].value == triggerID) then @@ -2216,7 +2216,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr f.SetTriggerState = SetTriggerState f.TriggerList = triggerList - local OnChangeTriggerState = function (self, triggerID, state) + local OnChangeTriggerState = function(self, triggerID, state) SetTriggerState (triggerID) aura_on:SetValue (triggerID) @@ -2276,7 +2276,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr --aura icon local icon_label = fw:CreateLabel (f, "Icon: ", nil, nil, "GameFontNormal") - local icon_button_func = function (texture) + local icon_button_func = function(texture) f.IconButton.icon.texture = texture end local icon_pick_button = fw:NewButton (f, nil, "$parentIconButton", "IconButton", 20, 20, function() fw:IconPick (icon_button_func, true) end) @@ -2305,7 +2305,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr stack_slider.tooltip = "Minimum amount of stacks to trigger the aura." --sound effect - local play_sound = function (self, fixedParam, file) + local play_sound = function(self, fixedParam, file) if (type (file) == "table") then PlaySoundFile (file.sound_path, "Master") else @@ -2313,10 +2313,10 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr end end - local sort = function (t1, t2) + local sort = function(t1, t2) return t1.name < t2.name end - local titlecase = function (first, rest) + local titlecase = function(first, rest) return first:upper()..rest:lower() end local iconsize = {14, 14} @@ -2473,7 +2473,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr local folder_texcoord = {435/512, 469/512, 189/512, 241/512} local folder_iconsize = {14, 14} - local sort_func = function (t1, t2) return t1.label < t2.label end + local sort_func = function(t1, t2) return t1.label < t2.label end local weakauras_folder_options = function() local t = {} diff --git a/frames/window_welcome.lua b/frames/window_welcome.lua index 02224800..e620670d 100644 --- a/frames/window_welcome.lua +++ b/frames/window_welcome.lua @@ -141,7 +141,7 @@ function _detalhes:OpenWelcomeWindow() local f = CreateFrame ("frame") local got = false - f:SetScript ("OnUpdate", function (self, elapsed) + f:SetScript ("OnUpdate", function(self, elapsed) if (not got and not InCombatLockdown()) then local r = math.random for i = 1, 2500000 do @@ -295,7 +295,7 @@ local window_openned_at = time() skins_image:SetTexCoord (0, 0.41796875, 0, 0.259765625) --0, 0, 214 133 --skin - local onSelectSkin = function (_, _, skin_name) + local onSelectSkin = function(_, _, skin_name) local instance1 = _detalhes:GetInstance (1) if (instance1 and instance1:IsEnabled()) then instance1:ChangeSkin (skin_name) @@ -340,7 +340,7 @@ local window_openned_at = time() local allAlphabetCheckBoxes = {} local allAlphabetLabels = {} - local onSelectAlphabet = function (self, fixedParameter, value) + local onSelectAlphabet = function(self, fixedParameter, value) if (not value) then self:SetValue (true) @@ -488,7 +488,7 @@ local window_openned_at = time() local buttonWidth = 160 -- create second window button - local new_window = function (self) + local new_window = function(self) if (#_detalhes.tabela_instancias == 1) then local newwindow = _detalhes:CreateInstance (true) newwindow.baseframe:SetPoint ("topleft", _detalhes.tabela_instancias[1].baseframe, "topright", 50, 0) @@ -510,7 +510,7 @@ local window_openned_at = time() -- window color window.editing_window = nil - local windowcolor_callback = function (button, r, g, b, a) + local windowcolor_callback = function(button, r, g, b, a) local instance = window.editing_window if (instance.menu_alpha.enabled and a ~= instance.color[4]) then @@ -562,7 +562,7 @@ local window_openned_at = time() window.BarHeightSlider:SetPoint ("left", window.BarHeightLabel, "right", 2, 0) window.BarHeightSlider:SetTemplate (g:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE")) - window.BarHeightSlider:SetHook ("OnValueChange", function (self, _, amount) + window.BarHeightSlider:SetHook ("OnValueChange", function(self, _, amount) local instance1 = Details:GetInstance (1) local instance2 = Details:GetInstance (2) @@ -582,7 +582,7 @@ local window_openned_at = time() window.TextSizeSlider:SetPoint ("left", window.TextSizeLabel, "right", 2, 0) window.TextSizeSlider:SetTemplate (g:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE")) - window.TextSizeSlider:SetHook ("OnValueChange", function (self, _, amount) + window.TextSizeSlider:SetHook ("OnValueChange", function(self, _, amount) local instance1 = Details:GetInstance (1) local instance2 = Details:GetInstance (2) @@ -595,7 +595,7 @@ local window_openned_at = time() end) --font - local onSelectFont = function (_, instance, fontName) + local onSelectFont = function(_, instance, fontName) local instance1 = Details:GetInstance (1) local instance2 = Details:GetInstance (2) @@ -613,7 +613,7 @@ local window_openned_at = time() for name, fontPath in pairs (fontObjects) do fontTable[#fontTable+1] = {value = name, label = name, icon = font_select_icon, texcoord = font_select_texcoord, onclick = onSelectFont, font = fontPath, descfont = name, desc = Loc ["STRING_MUSIC_DETAILS_ROBERTOCARLOS"]} end - table.sort (fontTable, function (t1, t2) return t1.label < t2.label end) + table.sort (fontTable, function(t1, t2) return t1.label < t2.label end) return fontTable end @@ -633,7 +633,7 @@ local window_openned_at = time() window.ShowPercentCheckBox:SetFixedParameter (1) window.ShowPercentCheckBox:SetTemplate (g:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE")) - window.ShowPercentCheckBox.OnSwitch = function (self, fixedParameter, value) + window.ShowPercentCheckBox.OnSwitch = function(self, fixedParameter, value) local instance1 = Details:GetInstance (1) local instance2 = Details:GetInstance (2) @@ -995,7 +995,7 @@ local window_openned_at = time() window.updatespeedSlider:SetTemplate (g:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE")) window.updatespeedSlider:SetThumbSize (50) window.updatespeedSlider.useDecimals = true - local updateColor = function (slider, value) + local updateColor = function(slider, value) if (value < 1) then slider.amt:SetTextColor (1, value, 0) elseif (value > 1) then @@ -1005,7 +1005,7 @@ local window_openned_at = time() end end - window.updatespeedSlider:SetHook("OnValueChange", function (self, _, amount) + window.updatespeedSlider:SetHook("OnValueChange", function(self, _, amount) Details:SetWindowUpdateSpeed(amount) updateColor(self, amount) end) @@ -1023,7 +1023,7 @@ local window_openned_at = time() -- g:NewSwitch (window, _, "$parentAnimateSlider", "animateSlider", 60, 20, _, _, _detalhes.use_row_animations) -- ltext, rtext, defaultv window.animateSlider:SetPoint ("left",window.animateLabel, "right", 2, 0) - window.animateSlider.OnSwitch = function (self, _, value) --> slider, fixedValue, sliderValue (false, true) + window.animateSlider.OnSwitch = function(self, _, value) --> slider, fixedValue, sliderValue (false, true) _detalhes:SetUseAnimations (value) end @@ -1038,7 +1038,7 @@ local window_openned_at = time() -- g:NewSwitch (window, _, "$parentDpsHpsSlider", "DpsHpsSlider", 60, 20, _, _, _detalhes:GetInstance(1).row_info.fast_ps_update) -- ltext, rtext, defaultv window.DpsHpsSlider:SetPoint ("left",window.DpsHpsLabel, "right", 2, 0) - window.DpsHpsSlider.OnSwitch = function (self, _, value) --> slider, fixedValue, sliderValue (false, true) + window.DpsHpsSlider.OnSwitch = function(self, _, value) --> slider, fixedValue, sliderValue (false, true) _detalhes:GetInstance(1):FastPSUpdate (value) end @@ -1053,7 +1053,7 @@ local window_openned_at = time() -- -- g:NewSlider (window, _, "$parentSlider", "segmentsSlider", 120, 20, 1, 25, 1, _detalhes.segments_amount) -- min, max, step, defaultv -- window.segmentsSlider:SetPoint ("left", window.segmentsLabel, "right", 2, 0) - -- window.segmentsSlider:SetHook ("OnValueChange", function (self, _, amount) --> slider, fixedValue, sliderValue + -- window.segmentsSlider:SetHook ("OnValueChange", function(self, _, amount) --> slider, fixedValue, sliderValue -- _detalhes.segments_amount = math.floor (amount) -- end) -- window.segmentsSlider.tooltip = Loc ["STRING_WELCOME_22"] @@ -1283,7 +1283,7 @@ local window_openned_at = time() bg_string:SetPoint ("right", bookmark_frame, "right", 0, 0) bg_string:SetPoint ("center", bmf_string, "center", 0, 0) - bookmark_frame:SetScript ("OnMouseDown", function (self, button) + bookmark_frame:SetScript ("OnMouseDown", function(self, button) if (button == "RightButton") then _detalhes.switch:ShowMe (instance1) self:Hide() @@ -1375,7 +1375,7 @@ local window_openned_at = time() micro_image1:SetTexCoord (326/512, 1, 85/512, 185/512) local tooltip_frame = CreateFrame ("frame", nil, window) - tooltip_frame:SetScript ("OnShow", function (self) + tooltip_frame:SetScript ("OnShow", function(self) _detalhes.tabela_historico:resetar() created_test_bars = 0 diff --git a/functions/api2.lua b/functions/api2.lua index 7a157943..e19d64d6 100644 --- a/functions/api2.lua +++ b/functions/api2.lua @@ -8,7 +8,7 @@ This is a high level API for Details! Damage Meter --]=] --local helpers -local getCombatObject = function (segmentNumber) +local getCombatObject = function(segmentNumber) local combatObject --select which segment to use, use low level variables for performance @@ -23,12 +23,12 @@ local getCombatObject = function (segmentNumber) return combatObject end -local getActorObjectFromCombat = function (combatObject, containerID, actorName) +local getActorObjectFromCombat = function(combatObject, containerID, actorName) local index = combatObject [containerID]._NameIndexTable [actorName] return combatObject [containerID]._ActorTable [index] end -local getUnitName = function (unitId) +local getUnitName = function(unitId) local unitName, serverName = UnitName (unitId) if (unitName) then if (serverName and serverName ~= "") then @@ -42,7 +42,7 @@ local getUnitName = function (unitId) end --return the spell object and the spellId -local getSpellObject = function (playerObject, spellId, isLiteral) +local getSpellObject = function(playerObject, spellId, isLiteral) local parameterType = type (spellId) if (parameterType == "number" and isLiteral) then @@ -57,7 +57,7 @@ local getSpellObject = function (playerObject, spellId, isLiteral) elseif (parameterType == "number") then --passed a number but with literal off, transform the spellId into a spell name - local spellName = GetSpellInfo (spellid) + local spellName = GetSpellInfo(spellid) if (spellName) then passedSpellName = spellName:lower() end @@ -65,7 +65,7 @@ local getSpellObject = function (playerObject, spellId, isLiteral) if (passedSpellName) then for thisSpellId, spellObject in pairs (playerObject.spells._ActorTable) do - local spellName = Details.GetSpellInfo (thisSpellId) + local spellName = Details.GetSpellInfo(thisSpellId) if (spellName) then if (spellName:lower() == passedSpellName) then return spellObject, thisSpellId @@ -938,14 +938,14 @@ function Details.UnitDamageSpellInfo (unitId, spellId, isLiteral, segment) local miscPlayerObject = getActorObjectFromCombat (combatObject, 4, unitName) if (miscPlayerObject) then - local spellName = GetSpellInfo (spellId) + local spellName = GetSpellInfo(spellId) local castedAmount = miscPlayerObject.spell_cast and miscPlayerObject.spell_cast [spellId] if (castedAmount) then spellInfo.casted = castedAmount else for castedSpellId, castedAmount in pairs (miscPlayerObject.spell_cast) do - local castedSpellName = GetSpellInfo (castedSpellId) + local castedSpellName = GetSpellInfo(castedSpellId) if (castedSpellName == spellName) then spellInfo.casted = castedAmount break @@ -1211,10 +1211,10 @@ function Details.UnitDamageTakenFromSpell (unitId, spellId, isLiteral, segment) end end else - local spellName = GetSpellInfo (spellId) or spellId + local spellName = GetSpellInfo(spellId) or spellId for i = 1, #damageContainer._ActorTable do for thisSpellId, spellObject in pairs (damageContainer._ActorTable [i].spells._ActorTable) do - local thisSpellName = GetSpellInfo (thisSpellId) + local thisSpellName = GetSpellInfo(thisSpellId) if (thisSpellName == spellName) then totalDamageTaken = totalDamageTaken + (spellObject.targets [unitName] or 0) end @@ -1669,14 +1669,14 @@ function Details.UnitHealingSpellInfo (unitId, spellId, isLiteral, segment) local miscPlayerObject = getActorObjectFromCombat (combatObject, 4, unitName) if (miscPlayerObject) then - local spellName = GetSpellInfo (spellId) + local spellName = GetSpellInfo(spellId) local castedAmount = miscPlayerObject.spell_cast and miscPlayerObject.spell_cast [spellId] if (castedAmount) then spellInfo.casted = castedAmount else for castedSpellId, castedAmount in pairs (miscPlayerObject.spell_cast) do - local castedSpellName = GetSpellInfo (castedSpellId) + local castedSpellName = GetSpellInfo(castedSpellId) if (castedSpellName == spellName) then spellInfo.casted = castedAmount break @@ -1950,10 +1950,10 @@ function Details.UnitHealingTakenFromSpell (unitId, spellId, isLiteral, segment) end end else - local spellName = GetSpellInfo (spellId) or spellId + local spellName = GetSpellInfo(spellId) or spellId for i = 1, #healingContainer._ActorTable do for thisSpellId, spellObject in pairs (healingContainer._ActorTable [i].spells._ActorTable) do - local thisSpellName = GetSpellInfo (thisSpellId) + local thisSpellName = GetSpellInfo(thisSpellId) if (thisSpellName == spellName) then totalHealingTaken = totalHealingTaken + (spellObject.targets [unitName] or 0) end diff --git a/functions/bossmods.lua b/functions/bossmods.lua index 233f0e99..6710b146 100644 --- a/functions/bossmods.lua +++ b/functions/bossmods.lua @@ -105,7 +105,7 @@ function Details:CreateCallbackListeners() local current_table_bigwigs = {} local event_frame = CreateFrame ("frame", nil, UIParent, "BackdropTemplate") - event_frame:SetScript ("OnEvent", function (self, event, ...) + event_frame:SetScript ("OnEvent", function(self, event, ...) if (event == "ENCOUNTER_START") then local encounterID, encounterName, difficultyID, raidSize = select (1, ...) current_encounter = encounterID @@ -142,7 +142,7 @@ function Details:CreateCallbackListeners() event_frame:RegisterEvent ("PLAYER_REGEN_ENABLED") if (_G.DBM) then - local dbm_timer_callback = function (bar_type, id, msg, timer, icon, bartype, spellId, colorId, modid) + local dbm_timer_callback = function(bar_type, id, msg, timer, icon, bartype, spellId, colorId, modid) local spell = tostring (spellId) if (spell and not current_table_dbm [spell]) then current_table_dbm [spell] = {spell, id, msg, timer, icon, bartype, spellId, colorId, modid} diff --git a/functions/buff.lua b/functions/buff.lua index 0b85062b..35f3f1f7 100644 --- a/functions/buff.lua +++ b/functions/buff.lua @@ -48,7 +48,7 @@ --> register a new buff name function _detalhes.Buffs:NewBuff (BuffName, BuffId) if (not BuffName) then - BuffName = GetSpellInfo (BuffId) + BuffName = GetSpellInfo(BuffId) end if (_detalhes.Buffs.BuffsTable [BuffName]) then return false diff --git a/functions/deathmenu.lua b/functions/deathmenu.lua index 45e2787b..21547eeb 100644 --- a/functions/deathmenu.lua +++ b/functions/deathmenu.lua @@ -23,7 +23,7 @@ detailsOnDeathMenu.warningLabel.textcolor = "red" detailsOnDeathMenu.warningLabel:SetPoint ("bottomleft", detailsOnDeathMenu, "bottomleft", 5, 2) detailsOnDeathMenu.warningLabel:Hide() -detailsOnDeathMenu:SetScript ("OnEvent", function (self, event, ...) +detailsOnDeathMenu:SetScript ("OnEvent", function(self, event, ...) if (event == "ENCOUNTER_END") then C_Timer.After (0.5, detailsOnDeathMenu.ShowPanel) end @@ -130,10 +130,10 @@ detailsOnDeathMenu.breakdownButton.CoolTip = { end end, --> called when user mouse over the frame - OnEnterFunc = function (self) + OnEnterFunc = function(self) detailsOnDeathMenu.button_mouse_over = true end, - OnLeaveFunc = function (self) + OnLeaveFunc = function(self) detailsOnDeathMenu.button_mouse_over = false end, FixedValue = "none", @@ -171,10 +171,10 @@ detailsOnDeathMenu.enduranceButton.CoolTip = { end end, --> called when user mouse over the frame - OnEnterFunc = function (self) + OnEnterFunc = function(self) detailsOnDeathMenu.button_mouse_over = true end, - OnLeaveFunc = function (self) + OnLeaveFunc = function(self) detailsOnDeathMenu.button_mouse_over = false end, FixedValue = "none", @@ -203,10 +203,10 @@ detailsOnDeathMenu.spellsButton.CoolTip = { GameCooltip2:AddLine ("Open your player Details! breakdown.") end, --> called when user mouse over the frame - OnEnterFunc = function (self) + OnEnterFunc = function(self) detailsOnDeathMenu.button_mouse_over = true end, - OnLeaveFunc = function (self) + OnLeaveFunc = function(self) detailsOnDeathMenu.button_mouse_over = false end, FixedValue = "none", @@ -289,7 +289,7 @@ function detailsOnDeathMenu.ShowPanel() end end -hooksecurefunc ("StaticPopup_Show", function (which, text_arg1, text_arg2, data, insertedFrame) +hooksecurefunc ("StaticPopup_Show", function(which, text_arg1, text_arg2, data, insertedFrame) if (which == "DEATH") then if (detailsOnDeathMenu.Debug) then C_Timer.After (0.5, detailsOnDeathMenu.ShowPanel) @@ -297,7 +297,7 @@ hooksecurefunc ("StaticPopup_Show", function (which, text_arg1, text_arg2, data, end end) -hooksecurefunc ("StaticPopup_Hide", function (which, data) +hooksecurefunc ("StaticPopup_Hide", function(which, data) if (which == "DEATH") then detailsOnDeathMenu:Hide() end diff --git a/functions/deathrecap.lua b/functions/deathrecap.lua index 6c49d045..974e2372 100644 --- a/functions/deathrecap.lua +++ b/functions/deathrecap.lua @@ -5,7 +5,7 @@ local textAlpha = 0.9 local AceLocale = LibStub ("AceLocale-3.0") local L = AceLocale:GetLocale ( "Details" ) -local on_deathrecap_line_enter = function (self) +local on_deathrecap_line_enter = function(self) if (self.spellid) then GameTooltip:SetOwner (self, "ANCHOR_RIGHT") Details:GameTooltipSetSpellByID (self.spellid) @@ -19,7 +19,7 @@ local on_deathrecap_line_enter = function (self) end end -local on_deathrecap_line_leave = function (self) +local on_deathrecap_line_leave = function(self) GameTooltip:Hide() self:SetBackdropColor (.3, .3, .3, 0) self.backgroundTextureOverlay:Hide() @@ -29,7 +29,7 @@ local on_deathrecap_line_leave = function (self) self.lifePercent:SetAlpha (textAlpha) end -local create_deathrecap_line = function (parent, n) +local create_deathrecap_line = function(parent, n) local line = CreateFrame ("frame", "DetailsDeathRecapLine" .. n, parent, "BackdropTemplate") line:SetPoint ("topleft", parent, "topleft", 10, (-24 * n) - 17) line:SetPoint ("topright", parent, "topright", -10, (-24 * n) - 17) @@ -155,7 +155,7 @@ local create_deathrecap_line = function (parent, n) return line end -local OpenDetailsDeathRecapAtSegment = function (segment) +local OpenDetailsDeathRecapAtSegment = function(segment) Details.OpenDetailsDeathRecap (segment, RecapID) end @@ -393,7 +393,7 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat) for i = #events, 1, -1 do tinsert (BiggestDamageHits, events [i]) end - table.sort (BiggestDamageHits, function (t1, t2) + table.sort (BiggestDamageHits, function(t1, t2) return t1[3] > t2[3] end) for i = #BiggestDamageHits, 1, -1 do @@ -460,7 +460,7 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat) end end - table.sort (BiggestDamageHits, function (t1, t2) + table.sort (BiggestDamageHits, function(t1, t2) return t1[4] > t2[4] end) @@ -475,7 +475,7 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat) local evType = event [1] local hp = min (floor (event [5] / maxHP * 100), 100) - local spellName, _, spellIcon = Details.GetSpellInfo (event [2]) + local spellName, _, spellIcon = Details.GetSpellInfo(event [2]) local amount = event [3] local eventTime = event [4] local source = event [6] diff --git a/functions/dungeon.lua b/functions/dungeon.lua index 4130050f..b1c65f7d 100644 --- a/functions/dungeon.lua +++ b/functions/dungeon.lua @@ -28,7 +28,7 @@ function mythicDungeonCharts:Debug (...) end end -local addPlayerDamage = function (unitName, unitRealm) +local addPlayerDamage = function(unitName, unitRealm) --get the combatlog name local CLName @@ -134,7 +134,7 @@ local addPlayerDamage = function (unitName, unitRealm) end end -local tickerCallback = function (tickerObject) +local tickerCallback = function(tickerObject) --check if is inside the dungeon local inInstance = IsInInstance(); @@ -319,7 +319,7 @@ function mythicDungeonCharts.ShowReadyPanel() f.DiscartButton:SetPoint ("right", f.ShowButton, "left", -5, 0) --disable feature check box (dont show this again) - local on_switch_enable = function (self, _, value) + local on_switch_enable = function(self, _, value) _detalhes.mythic_plus.show_damage_graphic = not value end local notAgainSwitch, notAgainLabel = DetailsFramework:CreateSwitch (f, on_switch_enable, not _detalhes.mythic_plus.show_damage_graphic, _, _, _, _, _, _, _, _, _, Loc ["STRING_MINITUTORIAL_BOOKMARK4"], DetailsFramework:GetTemplate ("switch", "OPTIONS_CHECKBOX_BRIGHT_TEMPLATE"), "GameFontHighlightLeft") @@ -502,7 +502,7 @@ function mythicDungeonCharts.ShowChart() end) --> replace the default click function - local minimize_func = function (self) + local minimize_func = function(self) if (f.IsMinimized) then f.IsMinimized = false fMinimized:Hide() @@ -523,7 +523,7 @@ function mythicDungeonCharts.ShowChart() --enabled box -- /run _G.DetailsMythicDungeonChartHandler.ShowChart(); DetailsMythicDungeonChartFrame.ShowChartFrame() - local on_switch_enable = function (_, _, state) + local on_switch_enable = function(_, _, state) _detalhes.mythic_plus.show_damage_graphic = state end local enabledSwitch, enabledLabel = Details.gump:CreateSwitch (f, on_switch_enable, _detalhes.mythic_plus.show_damage_graphic, _, _, _, _, _, _, _, _, _, "Enabled", Details.gump:GetTemplate ("switch", "OPTIONS_CHECKBOX_BRIGHT_TEMPLATE"), "GameFontHighlightLeft") @@ -698,14 +698,14 @@ function mythicDungeonCharts.ShowChart() end local showID = 0 -local HideTooltip = function (ticker) +local HideTooltip = function(ticker) if (showID == ticker.ShowID) then GameCooltip2:Hide() mythicDungeonCharts.Frame.BossWidgetsFrame.GraphPin:Hide() mythicDungeonCharts.Frame.BossWidgetsFrame.GraphPinGlow:Hide() end end -local PixelFrameOnEnter = function (self) +local PixelFrameOnEnter = function(self) local playerName = self.PlayerName --get the percent from the pixel height relative to the chart window local dps = self.Height / mythicDungeonCharts.Frame.ChartFrame:GetHeight() @@ -731,7 +731,7 @@ local PixelFrameOnEnter = function (self) GameCooltip2:Show() showID = showID + 1 end -local PixelFrameOnLeave = function (self) +local PixelFrameOnLeave = function(self) local timer = C_Timer.NewTimer (1, HideTooltip) timer.ShowID = showID end diff --git a/functions/events.lua b/functions/events.lua index 1adcc2ee..fd58ca9c 100644 --- a/functions/events.lua +++ b/functions/events.lua @@ -238,7 +238,7 @@ local common_events = { ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> internal functions - local dispatch_error = function (name, errortext) + local dispatch_error = function(name, errortext) _detalhes:Msg ((name or ""), " |cFFFF9900error|r: ", errortext) end @@ -323,7 +323,7 @@ local common_events = { end end - --if no function (only registred the event) sent the event to OnDetailsEvent + --if no function(only registred the event) sent the event to OnDetailsEvent else if (PluginObject.Enabled and PluginObject.__enabled) then _detalhes:QuickDispatchEventWithContext (PluginObject, PluginObject.OnDetailsEvent, event, ...) diff --git a/functions/immersion.lua b/functions/immersion.lua index 4b781d8d..3c865a26 100644 --- a/functions/immersion.lua +++ b/functions/immersion.lua @@ -40,7 +40,7 @@ function immersionFrame.CheckIfCanEnableImmersion() end --check events -immersionFrame:SetScript("OnEvent", function (_, event, ...) +immersionFrame:SetScript("OnEvent", function(_, event, ...) if (event == "ZONE_CHANGED_NEW_AREA") then C_Timer.After(3, immersionFrame.CheckIfCanEnableImmersion) end diff --git a/functions/mythicdungeon.lua b/functions/mythicdungeon.lua index a719d8a1..c3031118 100644 --- a/functions/mythicdungeon.lua +++ b/functions/mythicdungeon.lua @@ -814,7 +814,7 @@ function DetailsMythicPlusFrame.EventListener.OnDetailsEvent (contextObject, eve end end -DetailsMythicPlusFrame:SetScript ("OnEvent", function (_, event, ...) +DetailsMythicPlusFrame:SetScript ("OnEvent", function(_, event, ...) if (event == "START_TIMER") then DetailsMythicPlusFrame.LastTimer = GetTime() diff --git a/functions/plater.lua b/functions/plater.lua index bde9fb59..ab02010d 100644 --- a/functions/plater.lua +++ b/functions/plater.lua @@ -18,7 +18,7 @@ PLATER_DPS_SAMPLE_SIZE = CONST_BUFFER_SIZE * CONST_REALTIME_UPDATE_TIME plater_integration_frame.OnTickFrame = CreateFrame ("frame", "DetailsPlaterFrameOnTicker", UIParent, "BackdropTemplate") --> on tick function -plater_integration_frame.OnTickFrameFunc = function (self, deltaTime) +plater_integration_frame.OnTickFrameFunc = function(self, deltaTime) if (self.NextUpdate < 0) then for targetGUID, damageTable in pairs (plater_integration_frame.DamageTaken) do @@ -96,7 +96,7 @@ function plater_integration_frame.AddDamageToGUID (sourceGUID, targetGUID, time, end end -plater_integration_frame:SetScript ("OnEvent", function (self) +plater_integration_frame:SetScript ("OnEvent", function(self) local time, token, hidding, sourceGUID, sourceName, sourceFlag, sourceFlag2, targetGUID, targetName, targetFlag, targetFlag2, spellID, spellName, spellType, amount, overKill, school, resisted, blocked, absorbed, isCritical = CombatLogGetCurrentEventInfo() --> tamage taken by the GUID unit diff --git a/functions/profiles.lua b/functions/profiles.lua index 85d41005..d1b98708 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -203,7 +203,7 @@ function _detalhes:CreatePanicWarning() _detalhes.instance_load_failed:SetPoint ("topright", UIParent, "topright", 0, -250) end -local safe_load = function (func, param1, ...) +local safe_load = function(func, param1, ...) local okey, errortext = pcall (func, param1, ...) if (not okey) then if (not _detalhes.instance_load_failed) then diff --git a/functions/rowanimation.lua b/functions/rowanimation.lua index 3fe01696..3f6785e2 100644 --- a/functions/rowanimation.lua +++ b/functions/rowanimation.lua @@ -56,7 +56,7 @@ --> install default animations do - local fade_func = function (row, state) + local fade_func = function(row, state) if (state) then Details.FadeHandler.Fader (row, "out") else diff --git a/functions/skins.lua b/functions/skins.lua index 3d4323c7..dd38e099 100644 --- a/functions/skins.lua +++ b/functions/skins.lua @@ -525,7 +525,7 @@ local _ }, }, - callback = function (skin, instance, just_updating) + callback = function(skin, instance, just_updating) --none end, @@ -748,7 +748,7 @@ local _ ["bg_b"] = 0.0941, }, - callback = function (skin, instance, just_updating) + callback = function(skin, instance, just_updating) --none end, @@ -1110,7 +1110,7 @@ local _ right_corner_anchor_bottom = {96, 0}, --[[ callback function execute after all changes on the window, first argument is this skin table, second is the instance where the skin was applied --]] - callback = function (self, instance) end, + callback = function(self, instance) end, --[[ control_script is a OnUpdate script, it start right after all changes on the window and also after the callback --]] --[[ control_script_on_start run before the control_script, use it to reset values if needed --]] control_script_on_start = nil, @@ -1372,7 +1372,7 @@ local _ right_corner_anchor_bottom = {96, 0}, --[[ callback function execute after all changes on the window, first argument is this skin table, second is the instance where the skin was applied --]] - callback = function (self, instance) end, + callback = function(self, instance) end, --[[ control_script is a OnUpdate script, it start right after all changes on the window and also after the callback --]] --[[ control_script_on_start run before the control_script, use it to reset values if needed --]] control_script_on_start = nil, @@ -1623,7 +1623,7 @@ local _ right_corner_anchor_bottom = {96, 0}, --[[ callback function execute after all changes on the window, first argument is this skin table, second is the instance where the skin was applied --]] - callback = function (self, instance) end, + callback = function(self, instance) end, --[[ control_script is a OnUpdate script, it start right after all changes on the window and also after the callback --]] --[[ control_script_on_start run before the control_script, use it to reset values if needed --]] control_script_on_start = nil, @@ -1811,7 +1811,7 @@ local _ right_corner_anchor_bottom = {95, 0}, --[[ callback function execute after all changes on the window, first argument is this skin table, second is the instance where the skin was applied --]] - callback = function (self, instance) end, + callback = function(self, instance) end, --[[ control_script is a OnUpdate script, it start right after all changes on the window and also after the callback --]] --[[ control_script_on_start run before the control_script, use it to reset values if needed --]] control_script_on_start = nil, @@ -2509,7 +2509,7 @@ local _ ["bars_inverted"] = false, }, - callback = function (skin, instance, just_updating) + callback = function(skin, instance, just_updating) --none end, @@ -2793,7 +2793,7 @@ local _ ["bars_sort_direction"] = 1, }, - callback = function (skin, instance, just_updating) + callback = function(skin, instance, just_updating) --none end, diff --git a/functions/slash.lua b/functions/slash.lua index c2097086..f8c3d354 100644 --- a/functions/slash.lua +++ b/functions/slash.lua @@ -674,7 +674,7 @@ function SlashCmdList.DETAILS (msg, editbox) if (playerActor and playerActor.buff_uptime_spells and playerActor.buff_uptime_spells._ActorTable) then for spellid, spellTable in pairs (playerActor.buff_uptime_spells._ActorTable) do - local spellname = GetSpellInfo (spellid) + local spellname = GetSpellInfo(spellid) if (spellname) then print (spellid, spellname, spellTable.uptime) end @@ -692,7 +692,7 @@ function SlashCmdList.DETAILS (msg, editbox) elseif (msg == "imageedit") then - local callback = function (width, height, overlayColor, alpha, texCoords) + local callback = function(width, height, overlayColor, alpha, texCoords) print (width, height, alpha) print ("overlay: ", unpack (overlayColor)) print ("crop: ", unpack (texCoords)) @@ -798,7 +798,7 @@ function SlashCmdList.DETAILS (msg, editbox) Details.id_frame.texto:SetText ("") Details.id_frame.texto.perdeu_foco = nil - Details.id_frame.texto:SetScript ("OnEnterPressed", function () + Details.id_frame.texto:SetScript ("OnEnterPressed", function() Details.id_frame.texto:ClearFocus() Details.id_frame:Hide() end) @@ -855,7 +855,7 @@ function SlashCmdList.DETAILS (msg, editbox) _detalhes.id_frame.texto:SetText ("") --localize-me _detalhes.id_frame.texto.perdeu_foco = nil - _detalhes.id_frame.texto:SetScript ("OnEnterPressed", function () + _detalhes.id_frame.texto:SetScript ("OnEnterPressed", function() _detalhes.id_frame.texto:ClearFocus() _detalhes.id_frame:Hide() end) @@ -1300,7 +1300,7 @@ function SlashCmdList.DETAILS (msg, editbox) -- https://www.dropbox.com/s/ulyeqa2z0ummlu7/1024.tga?dl=0 local time = 0 - a:SetScript ("OnUpdate", function (self, deltaTime) + a:SetScript ("OnUpdate", function(self, deltaTime) time = time + deltaTime --texture:SetSize (math.random (50, 300), math.random (50, 300)) @@ -1318,7 +1318,7 @@ function SlashCmdList.DETAILS (msg, editbox) elseif (msg == "alert") then --local instancia = _detalhes.tabela_instancias [1] - local f = function (a, b, c, d, e, f, g) print (a, b, c, d, e, f, g) end + local f = function(a, b, c, d, e, f, g) print (a, b, c, d, e, f, g) end --instancia:InstanceAlert (Loc ["STRING_PLEASE_WAIT"], {[[Interface\COMMON\StreamCircle]], 22, 22, true}, 5, {f, 1, 2, 3, 4, 5}) local lower_instance = _detalhes:GetLowerInstanceNumber() @@ -1796,7 +1796,7 @@ function Details:UpdateUserPanel (usersTable) DetailsUserPanel.Header = DetailsFramework:CreateHeader (DetailsUserPanel, headerTable, headerOptions) DetailsUserPanel.Header:SetPoint ("topleft", DetailsUserPanel, "topleft", 5, headerY) - local scroll_refresh = function (self, data, offset, total_lines) + local scroll_refresh = function(self, data, offset, total_lines) --store user names shown local userShown = {} @@ -1819,7 +1819,7 @@ function Details:UpdateUserPanel (usersTable) end end - local lineOnEnter = function (self) + local lineOnEnter = function(self) if (self.IsCritical) then self:SetBackdropColor (unpack (backdrop_color_is_critical_on_enter)) else @@ -1827,7 +1827,7 @@ function Details:UpdateUserPanel (usersTable) end end - local lineOnLeave = function (self) + local lineOnLeave = function(self) if (self.IsCritical) then self:SetBackdropColor (unpack (backdrop_color_is_critical)) else @@ -1837,7 +1837,7 @@ function Details:UpdateUserPanel (usersTable) GameTooltip:Hide() end - local scroll_createline = function (self, index) + local scroll_createline = function(self, index) local line = CreateFrame ("button", "$parentLine" .. index, self, "BackdropTemplate") line:SetPoint ("topleft", self, "topleft", 3, -((index-1)*(scroll_line_height+1)) - 1) line:SetSize (scroll_width - 2, scroll_line_height) @@ -1873,7 +1873,7 @@ function Details:UpdateUserPanel (usersTable) end local usersScroll = DetailsFramework:CreateScrollBox (DetailsUserPanel, "$parentUsersScroll", scroll_refresh, DetailsUserPanel.Data, scroll_width, scroll_height, scroll_lines, scroll_line_height) - DetailsFramework:ReskinSlider (usersScroll) + DetailsFramework:ReskinSlider(usersScroll) usersScroll:SetPoint ("topleft", DetailsUserPanel, "topleft", 5, scrollY) Details.UserPanel.ScrollBox = usersScroll diff --git a/functions/spellcache.lua b/functions/spellcache.lua index 5af413b5..8783271b 100644 --- a/functions/spellcache.lua +++ b/functions/spellcache.lua @@ -49,7 +49,7 @@ do spellIcon = [[Interface\ICONS\INV_Weapon_Bow_07]] else - spellName, _, spellIcon = GetSpellInfo (spell) + spellName, _, spellIcon = GetSpellInfo(spell) end if (not spellName) then @@ -62,7 +62,7 @@ do --> reset spell cache function _detalhes:ClearSpellCache() _detalhes.spellcache = _setmetatable ({}, - {__index = function (tabela, valor) + {__index = function(tabela, valor) local esta_magia = _rawget (tabela, valor) if (esta_magia) then return esta_magia @@ -74,7 +74,7 @@ do if (is_classic_exp) then cache = {GetSpellInfoClassic(valor)} else - cache = {_GetSpellInfo (valor)} + cache = {_GetSpellInfo(valor)} end tabela [valor] = cache return cache @@ -90,7 +90,7 @@ do --> built-in overwrites for spellId, spellTable in pairs (_detalhes.SpellOverwrite) do - local name, _, icon = _GetSpellInfo (spellId) + local name, _, icon = _GetSpellInfo(spellId) _rawset (_detalhes.spellcache, spellId, {spellTable.name or name, 1, spellTable.icon or icon}) end @@ -101,7 +101,7 @@ do end end - local lightOfTheMartyr_Name, _, lightOfTheMartyr_Icon = _GetSpellInfo (196917) + local lightOfTheMartyr_Name, _, lightOfTheMartyr_Icon = _GetSpellInfo(196917) lightOfTheMartyr_Name = lightOfTheMartyr_Name or "Deprecated Spell - Light of the Martyr" lightOfTheMartyr_Icon = lightOfTheMartyr_Icon or "" @@ -154,30 +154,30 @@ do [7] = {name = Loc ["STRING_ENVIRONMENTAL_LAVA"], icon = [[Interface\ICONS\Ability_Rhyolith_Volcano]]}, [8] = {name = Loc ["STRING_ENVIRONMENTAL_SLIME"], icon = [[Interface\ICONS\Ability_Creature_Poison_02]]}, [98021] = {name = Loc ["STRING_SPIRIT_LINK_TOTEM"]}, - [108271] = {name = GetSpellInfo (108271), icon = "Interface\\Addons\\Details\\images\\icon_astral_shift"}, + [108271] = {name = GetSpellInfo(108271), icon = "Interface\\Addons\\Details\\images\\icon_astral_shift"}, [196917] = {name = lightOfTheMartyr_Name .. " (" .. Loc ["STRING_DAMAGE"] .. ")", icon = lightOfTheMartyr_Icon}, --> bfa trinkets (deprecated) - [278155] = {name = GetSpellInfo (278155) .. " (Trinket)"}, --[Twitching Tentacle of Xalzaix] - [279664] = {name = GetSpellInfo (279664) .. " (Trinket)"}, --[Vanquished Tendril of G'huun] - [278227] = {name = GetSpellInfo (278227) .. " (Trinket)"}, --[T'zane's Barkspines] - [278383] = {name = GetSpellInfo (278383) .. " (Trinket)"}, --[Azurethos' Singed Plumage] - [278862] = {name = GetSpellInfo (278862) .. " (Trinket)"}, --[Drust-Runed Icicle] - [278359] = {name = GetSpellInfo (278359) .. " (Trinket)"}, --[Doom's Hatred] - [278812] = {name = GetSpellInfo (278812) .. " (Trinket)"}, --[Lion's Grace] - [270827] = {name = GetSpellInfo (270827) .. " (Trinket)"}, --[Vessel of Skittering Shadows] - [271071] = {name = GetSpellInfo (271071) .. " (Trinket)"}, --[Conch of Dark Whispers] - [270925] = {name = GetSpellInfo (270925) .. " (Trinket)"}, --[Hadal's Nautilus] - [271115] = {name = GetSpellInfo (271115) .. " (Trinket)"}, --[Ignition Mage's Fuse] - [271462] = {name = GetSpellInfo (271462) .. " (Trinket)"}, --[Rotcrusted Voodoo Doll] - [271465] = {name = GetSpellInfo (271465) .. " (Trinket)"}, --[Rotcrusted Voodoo Doll] - [268998] = {name = GetSpellInfo (268998) .. " (Trinket)"}, --[Balefire Branch] - [271671] = {name = GetSpellInfo (271671) .. " (Trinket)"}, --[Lady Waycrest's Music Box] - [277179] = {name = GetSpellInfo (277179) .. " (Trinket)"}, --[Dread Gladiator's Medallion] - [277187] = {name = GetSpellInfo (277187) .. " (Trinket)"}, --[Dread Gladiator's Emblem] - [277181] = {name = GetSpellInfo (277181) .. " (Trinket)"}, --[Dread Gladiator's Insignia] - [277185] = {name = GetSpellInfo (277185) .. " (Trinket)"}, --[Dread Gladiator's Badge] - [278057] = {name = GetSpellInfo (278057) .. " (Trinket)"}, --[Vigilant's Bloodshaper] + [278155] = {name = GetSpellInfo(278155) .. " (Trinket)"}, --[Twitching Tentacle of Xalzaix] + [279664] = {name = GetSpellInfo(279664) .. " (Trinket)"}, --[Vanquished Tendril of G'huun] + [278227] = {name = GetSpellInfo(278227) .. " (Trinket)"}, --[T'zane's Barkspines] + [278383] = {name = GetSpellInfo(278383) .. " (Trinket)"}, --[Azurethos' Singed Plumage] + [278862] = {name = GetSpellInfo(278862) .. " (Trinket)"}, --[Drust-Runed Icicle] + [278359] = {name = GetSpellInfo(278359) .. " (Trinket)"}, --[Doom's Hatred] + [278812] = {name = GetSpellInfo(278812) .. " (Trinket)"}, --[Lion's Grace] + [270827] = {name = GetSpellInfo(270827) .. " (Trinket)"}, --[Vessel of Skittering Shadows] + [271071] = {name = GetSpellInfo(271071) .. " (Trinket)"}, --[Conch of Dark Whispers] + [270925] = {name = GetSpellInfo(270925) .. " (Trinket)"}, --[Hadal's Nautilus] + [271115] = {name = GetSpellInfo(271115) .. " (Trinket)"}, --[Ignition Mage's Fuse] + [271462] = {name = GetSpellInfo(271462) .. " (Trinket)"}, --[Rotcrusted Voodoo Doll] + [271465] = {name = GetSpellInfo(271465) .. " (Trinket)"}, --[Rotcrusted Voodoo Doll] + [268998] = {name = GetSpellInfo(268998) .. " (Trinket)"}, --[Balefire Branch] + [271671] = {name = GetSpellInfo(271671) .. " (Trinket)"}, --[Lady Waycrest's Music Box] + [277179] = {name = GetSpellInfo(277179) .. " (Trinket)"}, --[Dread Gladiator's Medallion] + [277187] = {name = GetSpellInfo(277187) .. " (Trinket)"}, --[Dread Gladiator's Emblem] + [277181] = {name = GetSpellInfo(277181) .. " (Trinket)"}, --[Dread Gladiator's Insignia] + [277185] = {name = GetSpellInfo(277185) .. " (Trinket)"}, --[Dread Gladiator's Badge] + [278057] = {name = GetSpellInfo(278057) .. " (Trinket)"}, --[Vigilant's Bloodshaper] } end @@ -204,7 +204,7 @@ do local t = _detalhes.savedCustomSpells[index] if (t) then local spellid = t [1] - local name, _, icon = _GetSpellInfo (spellid) + local name, _, icon = _GetSpellInfo(spellid) if (defaultSpellCustomization [spellid]) then name = defaultSpellCustomization [spellid].name @@ -236,7 +236,7 @@ do end if (not already_have) then - local name, _, icon = GetSpellInfo (spellid) + local name, _, icon = GetSpellInfo(spellid) _detalhes:UserCustomSpellAdd (spellid, t.name or name or "Unknown", t.icon or icon or [[Interface\InventoryItems\WoWUnknownItem01]]) end @@ -246,7 +246,7 @@ do local spelltable = _detalhes.savedCustomSpells [i] local spellid = spelltable [1] if (spellid > 10) then - local exists = _GetSpellInfo (spellid) + local exists = _GetSpellInfo(spellid) if (not exists) then tremove (_detalhes.savedCustomSpells, i) end @@ -274,7 +274,7 @@ do local t = _detalhes.savedCustomSpells [index] if (t) then local spellid = t [1] - local name, _, icon = _GetSpellInfo (spellid) + local name, _, icon = _GetSpellInfo(spellid) if (name) then _rawset (_detalhes.spellcache, spellid, {name, 1, icon}) end @@ -286,12 +286,12 @@ do --> overwrite for API GetSpellInfo function - _detalhes.getspellinfo = function (spellid) return _unpack (_detalhes.spellcache[spellid]) end + _detalhes.getspellinfo = function(spellid) return _unpack (_detalhes.spellcache[spellid]) end _detalhes.GetSpellInfo = _detalhes.getspellinfo --> overwrite SpellInfo if the spell is a DoT, so Details.GetSpellInfo will return the name modified function _detalhes:SpellIsDot (spellid) - local spellName, rank, spellIcon = _GetSpellInfo (spellid) + local spellName, rank, spellIcon = _GetSpellInfo(spellid) if (spellName) then _rawset (_detalhes.spellcache, spellid, {spellName .. Loc ["STRING_DOT"], rank, spellIcon}) diff --git a/functions/spells.lua b/functions/spells.lua index 055dca59..390f1737 100644 --- a/functions/spells.lua +++ b/functions/spells.lua @@ -3902,7 +3902,7 @@ do local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) _detalhes.SpellOverwrite = { - --[124464] = {name = GetSpellInfo (124464) .. " (" .. Loc ["STRING_MASTERY"] .. ")"}, --> shadow word: pain mastery proc (priest) + --[124464] = {name = GetSpellInfo(124464) .. " (" .. Loc ["STRING_MASTERY"] .. ")"}, --> shadow word: pain mastery proc (priest) } _detalhes.spells_school = { @@ -3971,7 +3971,7 @@ local MiscContainerNames = { "cc_break_spells", "ress_spells", } -local SplitLoadFunc = function (self, deltaTime) +local SplitLoadFunc = function(self, deltaTime) --which container it will iterate on this tick local container = Details.tabela_vigente and Details.tabela_vigente [SplitLoadFrame.NextActorContainer] and Details.tabela_vigente [SplitLoadFrame.NextActorContainer]._ActorTable diff --git a/functions/testbars.lua b/functions/testbars.lua index 38f743c5..96693401 100644 --- a/functions/testbars.lua +++ b/functions/testbars.lua @@ -32,15 +32,17 @@ end function Details:CreateTestBars (alphabet, isArena) local current_combat = Details:GetCombat ("current") local pclass = select (2, UnitClass ("player")) - + local actors_name = { - {"Spiro", "EVOKER"}, - {"Spiro", "EVOKER"}, - {"Spiro", "EVOKER"}, - {"Spiro", "EVOKER"}, - {"Spiro", "EVOKER"}, - {"Spiro", "EVOKER"}, - {"Drakaris", "EVOKER"}, + {"Spiro", "EVOKER", 1467}, + {"Spiro", "EVOKER", 1467}, + {"Spiro", "EVOKER", 1467}, + {"Spiro", "EVOKER", 1467}, + {"Spiro", "EVOKER", 1468}, + {"Spiro", "EVOKER", 1468}, + {"Spiro", "EVOKER", 1468}, + {"Spiro", "EVOKER", 1468}, + {"Drakaris", "EVOKER", 1468}, {"Ragnaros", "MAGE", 63}, {"The Lich King", "DEATHKNIGHT", }, {"Your Neighbor", "SHAMAN", }, diff --git a/functions/timedata.lua b/functions/timedata.lua index e5ccae2b..6dadf149 100644 --- a/functions/timedata.lua +++ b/functions/timedata.lua @@ -214,7 +214,7 @@ return data_captured end - local exec_user_func = function (func, attributes, data, this_second) + local exec_user_func = function(func, attributes, data, this_second) local okey, result = _pcall (func, attributes) if (not okey) then diff --git a/images/bar_textures/gradient_white_10percent_left.tga b/images/bar_textures/gradient_white_10percent_left.tga new file mode 100644 index 00000000..7f9cd4ef Binary files /dev/null and b/images/bar_textures/gradient_white_10percent_left.tga differ diff --git a/images/spec_icons_normal.tga b/images/spec_icons_normal.tga index 97c837e2..da9d00ed 100644 Binary files a/images/spec_icons_normal.tga and b/images/spec_icons_normal.tga differ diff --git a/plugins/Details_DataStorage/Details_DataStorage.lua b/plugins/Details_DataStorage/Details_DataStorage.lua index e9896d1c..f089b74e 100644 --- a/plugins/Details_DataStorage/Details_DataStorage.lua +++ b/plugins/Details_DataStorage/Details_DataStorage.lua @@ -17,7 +17,7 @@ local f = CreateFrame ("frame", nil, UIParent) f:Hide() f:RegisterEvent ("ADDON_LOADED") -f:SetScript ("OnEvent", function (self, event, addonName) +f:SetScript ("OnEvent", function(self, event, addonName) if (addonName == "Details_DataStorage") then diff --git a/plugins/Details_EncounterDetails/Details_EncounterDetails.lua b/plugins/Details_EncounterDetails/Details_EncounterDetails.lua index fdfe914e..04dfbde0 100644 --- a/plugins/Details_EncounterDetails/Details_EncounterDetails.lua +++ b/plugins/Details_EncounterDetails/Details_EncounterDetails.lua @@ -52,7 +52,7 @@ local class_type_misc = _detalhes.atributos.misc --> misc --> main combat object local _combat_object -local sort_by_name = function (t1, t2) return t1.nome < t2.nome end +local sort_by_name = function(t1, t2) return t1.nome < t2.nome end local CLASS_ICON_TCOORDS = _G.CLASS_ICON_TCOORDS @@ -132,7 +132,7 @@ local function CreatePluginFrames (data) EncounterDetails:WasEncounter() end - local damage_done_func = function (support_table, time_table, tick_second) + local damage_done_func = function(support_table, time_table, tick_second) local current_total_damage = _detalhes.tabela_vigente.totals_grupo[1] local current_damage = current_total_damage - support_table.last_damage time_table [tick_second] = current_damage @@ -273,7 +273,7 @@ local function CreatePluginFrames (data) local current_table_bigwigs = {} local event_frame = CreateFrame ("frame", nil, UIParent, "BackdropTemplate") - event_frame:SetScript ("OnEvent", function (self, event, ...) + event_frame:SetScript ("OnEvent", function(self, event, ...) if (event == "ENCOUNTER_START") then local encounterID, encounterName, difficultyID, raidSize = select (1, ...) current_encounter = encounterID @@ -316,7 +316,7 @@ local function CreatePluginFrames (data) --EncounterDetails.DBM_timers if (_G.DBM) then - local dbm_timer_callback = function (bar_type, id, msg, timer, icon, bartype, spellId, colorId, modid) + local dbm_timer_callback = function(bar_type, id, msg, timer, icon, bartype, spellId, colorId, modid) --print (bar_type, id, msg, timer, icon, bartype, spellId, colorId, modid) local spell = tostring (spellId) if (spell and not current_table_dbm [spell]) then @@ -591,7 +591,7 @@ local function CreatePluginFrames (data) end -local sort_damage_from = function (a, b) +local sort_damage_from = function(a, b) if (a[3] ~= "PET" and b[3] ~= "PET") then return a[2] > b[2] elseif (a[3] == "PET" and b[3] ~= "PET") then @@ -638,7 +638,7 @@ end end local evtype = event [1] - local spellname, _, spellicon = _GetSpellInfo (event [2]) + local spellname, _, spellicon = _GetSpellInfo(event [2]) local amount = event [3] local time = event [4] local source = event [6] @@ -714,7 +714,7 @@ end GameCooltip:AddStatusBar (0, 1, .5, .5, .5, .5, false, {value = 100, color = {.5, .5, .5, 1}, specialSpark = false, texture = [[Interface\AddOns\Details\images\bar4_vidro]]}) if (battleress) then - local nome_magia, _, icone_magia = _GetSpellInfo (battleress [2]) + local nome_magia, _, icone_magia = _GetSpellInfo(battleress [2]) GameCooltip:AddLine ("+" .. _cstr ("%.1f", battleress[4] - hora_da_morte) .. "s " .. nome_magia .. " (" .. battleress[6] .. ")", "", 1, "white") GameCooltip:AddIcon ("Interface\\Glues\\CharacterSelect\\Glues-AddOn-Icons", 1, 1, nil, nil, .75, 1, 0, 1) GameCooltip:AddStatusBar (0, 1, .5, .5, .5, .5, false, {value = 100, color = {.5, .5, .5, 1}, specialSpark = false, texture = [[Interface\AddOns\Details\images\bar4_vidro]]}) @@ -722,7 +722,7 @@ end if (lastcooldown) then if (lastcooldown[3] == 1) then - local nome_magia, _, icone_magia = _GetSpellInfo (lastcooldown [2]) + local nome_magia, _, icone_magia = _GetSpellInfo(lastcooldown [2]) GameCooltip:AddLine (_cstr ("%.1f", lastcooldown[4] - hora_da_morte) .. "s " .. nome_magia .. " (" .. Loc ["STRING_LAST_COOLDOWN"] .. ")") GameCooltip:AddIcon (icone_magia) else @@ -776,10 +776,10 @@ local function DispellInfo (dispell, barra) end end - local spellname = GetSpellInfo (barra.spellid) + local spellname = GetSpellInfo(barra.spellid) if (spellname) then GameTooltip:SetOwner (GameCooltipFrame1, "ANCHOR_NONE") - GameTooltip:SetSpellByID (barra.spellid) + GameTooltip:SetSpellByID(barra.spellid) GameTooltip:SetPoint ("topright", GameCooltipFrame1, "topleft", -2, 0) GameTooltip:Show() end @@ -798,7 +798,7 @@ local function KickBy (magia, barra) _table_sort (tabela_jogadores, _detalhes.Sort2) - local spellName, _, spellIcon = GetSpellInfo (barra.lineText1:GetText()) + local spellName, _, spellIcon = GetSpellInfo(barra.lineText1:GetText()) GameCooltip:AddLine (barra.lineText1:GetText()) if (spellIcon) then GameCooltip:AddIcon (spellIcon, nil, 1, EncounterDetails.CooltipLineHeight, EncounterDetails.CooltipLineHeight, 5/64, 59/64, 5/64, 59/64) @@ -819,10 +819,10 @@ local function KickBy (magia, barra) GameCooltip:AddStatusBar (100, 1, .3, .3, .3, .3, false, false, false) end - local spellname = GetSpellInfo (barra.spellid) + local spellname = GetSpellInfo(barra.spellid) if (spellname) then GameTooltip:SetOwner (GameCooltipFrame1, "ANCHOR_NONE") - GameTooltip:SetSpellByID (barra.spellid) + GameTooltip:SetSpellByID(barra.spellid) GameTooltip:SetPoint ("topright", GameCooltipFrame1, "topleft", -2, 0) GameTooltip:Show() end @@ -878,10 +878,10 @@ local function EnemySkills (habilidade, barra) end end - local spellname = GetSpellInfo (barra.spellid) + local spellname = GetSpellInfo(barra.spellid) if (spellname) then GameTooltip:SetOwner (GameCooltipFrame1, "ANCHOR_NONE") - GameTooltip:SetSpellByID (barra.spellid) + GameTooltip:SetSpellByID(barra.spellid) GameTooltip:SetPoint ("right", barra, "left", -2, 0) GameTooltip:Show() end @@ -930,7 +930,7 @@ local function DamageTakenDetails (jogador, barra) local topDamage = meus_agressores[1] and meus_agressores[1][2] for i = 1, max do - local nome_magia, _, icone_magia = _GetSpellInfo (meus_agressores[i][1]) + local nome_magia, _, icone_magia = _GetSpellInfo(meus_agressores[i][1]) if (meus_agressores[i][1] == 1) then nome_magia = "*"..meus_agressores[i][3] @@ -1016,7 +1016,7 @@ local backdrop_bar_onleave = {bgFile = [[Interface\AddOns\Details\images\backgro function EncounterDetails:SetRowScripts (barra, index, container) - barra:SetScript ("OnMouseDown", function (self) + barra:SetScript ("OnMouseDown", function(self) if (self.fading_in) then return end @@ -1031,7 +1031,7 @@ function EncounterDetails:SetRowScripts (barra, index, container) end) - barra:SetScript ("OnMouseUp", function (self) + barra:SetScript ("OnMouseUp", function(self) if (self.fading_in) then return @@ -1053,7 +1053,7 @@ function EncounterDetails:SetRowScripts (barra, index, container) end) barra:SetScript ("OnEnter", --> MOUSE OVER - function (self) + function(self) --> aqui 1 if (container.fading_in or container.faded) then return @@ -1096,7 +1096,7 @@ function EncounterDetails:SetRowScripts (barra, index, container) end) barra:SetScript ("OnLeave", --> MOUSE OUT - function (self) + function(self) self:SetScript ("OnUpdate", nil) @@ -1525,7 +1525,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) barra.t:SetVertexColor (1, .8, .8, .8) end - local nome_magia, _, icone_magia = _GetSpellInfo (habilidade[4]) + local nome_magia, _, icone_magia = _GetSpellInfo(habilidade[4]) barra.lineText1:SetText (nome_magia) -- .. " (|cFFa0a0a0" .. habilidade[4] .. "|r) barra.lineText4:SetText (ToK (_, habilidade[1])) @@ -1905,7 +1905,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) local spellid = tabela [3] - local nome_magia, _, icone_magia = _GetSpellInfo (tabela [3]) + local nome_magia, _, icone_magia = _GetSpellInfo(tabela [3]) local successful = 0 --> pegar quantas vezes a magia passou com sucesso. for _, enemy_actor in _ipairs (DamageContainer._ActorTable) do @@ -2017,7 +2017,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) barra:SetWidth (160) end - local nome_magia, _, icone_magia = _GetSpellInfo (tabela [3]) + local nome_magia, _, icone_magia = _GetSpellInfo(tabela [3]) barra.lineText1:SetText (nome_magia) barra.lineText4:SetText (tabela [2]) @@ -2129,7 +2129,7 @@ local events_to_track = { } local enemy_spell_pool -local CLEvents = function (self, event) +local CLEvents = function(self, event) local time, token, hidding, who_serial, who_name, who_flags, who_flags2, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, school, aura_type = CombatLogGetCurrentEventInfo() diff --git a/plugins/Details_EncounterDetails/frames.lua b/plugins/Details_EncounterDetails/frames.lua index 5777fd45..f6b7a4f8 100644 --- a/plugins/Details_EncounterDetails/frames.lua +++ b/plugins/Details_EncounterDetails/frames.lua @@ -36,7 +36,7 @@ do backdropbordercolor = {.9, .7, 0, 1}, } - local set_backdrop = function (frame) + 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) @@ -46,14 +46,14 @@ do 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 - EncounterDetails.SetBarBackdrop_OnEnter = function (self) + EncounterDetails.SetBarBackdrop_OnEnter = function(self) self:SetBackdropColor (unpack (BGColorDefault_Hover)) end - EncounterDetails.SetBarBackdrop_OnLeave = function (self) + EncounterDetails.SetBarBackdrop_OnLeave = function(self) self:SetBackdropColor (unpack (BGColorDefault)) end @@ -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, @@ -499,7 +499,7 @@ _detalhes.EncounterDetailsTempWindow = function (EncounterDetails) 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 @@ -519,7 +519,7 @@ _detalhes.EncounterDetailsTempWindow = function (EncounterDetails) 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]) + 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:AddIcon (spellicon, 1, 1, 12, 12, 0.1, 0.9, 0.1, 0.9) @@ -538,7 +538,7 @@ _detalhes.EncounterDetailsTempWindow = function (EncounterDetails) end end) - vRowFrame:SetScript ("OnLeave", function (frame) + vRowFrame:SetScript ("OnLeave", function(frame) _detalhes.popup:ShowMe (false) end) @@ -701,7 +701,7 @@ _detalhes.EncounterDetailsTempWindow = function (EncounterDetails) t:Hide() 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() @@ -716,7 +716,7 @@ _detalhes.EncounterDetailsTempWindow = function (EncounterDetails) end end - local phase_on_enter = function (self) + local phase_on_enter = function(self) local spark1 = get_spark (1) local spark2 = get_spark (2) @@ -830,7 +830,7 @@ _detalhes.EncounterDetailsTempWindow = function (EncounterDetails) end end - local phase_on_leave = function (self) + local phase_on_leave = function(self) table.wipe (self.damage_actors) table.wipe (self.heal_actors) @@ -843,11 +843,11 @@ _detalhes.EncounterDetailsTempWindow = function (EncounterDetails) 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 @@ -867,7 +867,7 @@ _detalhes.EncounterDetailsTempWindow = function (EncounterDetails) 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 @@ -1103,7 +1103,7 @@ _detalhes.EncounterDetailsTempWindow = function (EncounterDetails) ---- BossFrame:SetScript ("OnMouseDown", - function (self, botao) + function(self, botao) if (botao == "LeftButton") then self:StartMoving() self.isMoving = true @@ -1113,7 +1113,7 @@ _detalhes.EncounterDetailsTempWindow = function (EncounterDetails) end) BossFrame:SetScript ("OnMouseUp", - function (self) + function(self) if (self.isMoving) then self:StopMovingOrSizing() self.isMoving = false @@ -1204,7 +1204,7 @@ _detalhes.EncounterDetailsTempWindow = function (EncounterDetails) BossFrame.buttonSwitchBossEmotes:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) end - BossFrame.switch = function (to, _, to2) + BossFrame.switch = function(to, _, to2) if (type (to) == "string") then to = to elseif (type (to2) == "string") then @@ -1433,7 +1433,7 @@ _detalhes.EncounterDetailsTempWindow = function (EncounterDetails) local CONST_EMOTES_MAX_LINES = 32 - local refresh_emotes = function (self) + local refresh_emotes = function(self) --update emote scroll local offset = FauxScrollFrame_GetOffset (self) @@ -1512,17 +1512,17 @@ _detalhes.EncounterDetailsTempWindow = function (EncounterDetails) 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: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) - local row_on_enter = function (self) + 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 @@ -1532,13 +1532,13 @@ _detalhes.EncounterDetailsTempWindow = function (EncounterDetails) GameCooltip:Show() end end - local row_on_leave = function (self) + 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 time = self.lefttext:GetText() @@ -1552,7 +1552,7 @@ _detalhes.EncounterDetailsTempWindow = function (EncounterDetails) -- replace links for _, spellid in text:gmatch ("(|Hspell:)(.-)(|h)") do local spell = tonumber (spellid) - local link = GetSpellLink (spell) + local link = GetSpellLink(spell) text = text:gsub ("(|Hspell).*(|h)", link) end -- remove unit links @@ -1605,7 +1605,7 @@ _detalhes.EncounterDetailsTempWindow = function (EncounterDetails) 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() @@ -1679,7 +1679,7 @@ _detalhes.EncounterDetailsTempWindow = function (EncounterDetails) -- report button local report_emote_button = DetailsFrameWork:NewButton (BossFrame, nil, "$parentReportEmoteButton", "ReportEmoteButton", 180, 20, function() - local reportFunc = function (IsCurrent, IsReverse, AmtLines) + local reportFunc = function(IsCurrent, IsReverse, AmtLines) local segment = EncounterDetails.charsaved.emotes and EncounterDetails.charsaved.emotes [emote_segment] if (segment) then @@ -1702,7 +1702,7 @@ _detalhes.EncounterDetailsTempWindow = function (EncounterDetails) -- replace links for _, spellid in text:gmatch ("(|Hspell:)(.-)(|h)") do local spell = tonumber (spellid) - local link = GetSpellLink (spell) + local link = GetSpellLink(spell) text = text:gsub ("(|Hspell).*(|h)", link) end -- remove unit links @@ -1761,15 +1761,15 @@ _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") @@ -1790,17 +1790,17 @@ _detalhes.EncounterDetailsTempWindow = function (EncounterDetails) end end - local on_leave_spell = function (self, capsule) + local on_leave_spell = function(self, capsule) GameTooltip:Hide() 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] @@ -1823,7 +1823,7 @@ _detalhes.EncounterDetailsTempWindow = function (EncounterDetails) 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) end @@ -2055,7 +2055,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 @@ -2098,7 +2098,7 @@ _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: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 @@ -2111,7 +2111,7 @@ _detalhes.EncounterDetailsTempWindow = function (EncounterDetails) 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: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 @@ -2141,7 +2141,7 @@ _detalhes.EncounterDetailsTempWindow = function (EncounterDetails) 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) + 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 @@ -2193,7 +2193,7 @@ function PhaseFrame:ClearAll() PhaseFrame:ClearPhaseBars() end -local selectSegment = function (_, _, phaseSelected) +local selectSegment = function(_, _, phaseSelected) PhaseFrame ["OnSelectPhase"] (phaseSelected) end @@ -2263,9 +2263,9 @@ 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 @@ -2290,7 +2290,7 @@ 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 @@ -2325,7 +2325,7 @@ for i = 1, 10 do 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 @@ -2353,15 +2353,15 @@ local ScrollRefresh = function (self, data, offset, total_lines) end end -local line_onenter = function (self) +local line_onenter = function(self) self:SetBackdropColor (unpack (BGColorDefault_Hover)) end -local line_onleave = function (self) +local line_onleave = function(self) self:SetBackdropColor (unpack (BGColorDefault)) end -local ScrollCreateLine = function (self, index) +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) @@ -2406,8 +2406,8 @@ local Heal_Scroll = _detalhes.gump:CreateScrollBox (PhaseFrame, "$parentHealScro 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) @@ -2429,15 +2429,15 @@ 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)) end -local PhaseBarOnLeave = function (self) +local PhaseBarOnLeave = function(self) PhaseFrame:ClearSegmentCompareBars() self:SetBackdropColor (unpack (BGColorDefault)) end -local PhaseBarOnClick = function (self) +local PhaseBarOnClick = function(self) --report end @@ -2532,7 +2532,7 @@ function PhaseFrame:GetPhaseTimers (segment, ordered) 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 @@ -2613,7 +2613,7 @@ end --> Selecionar o segmento - local buildSegmentosMenu = function (self) + local buildSegmentosMenu = function(self) local historico = _detalhes.tabela_historico.tabelas local return_table = {} @@ -2715,7 +2715,7 @@ end 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 @@ -2768,7 +2768,7 @@ end 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 @@ -2814,7 +2814,7 @@ end 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 @@ -2859,7 +2859,7 @@ end 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 @@ -2905,7 +2905,7 @@ end 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 @@ -2955,7 +2955,7 @@ end 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 @@ -2983,7 +2983,7 @@ end ["CHAT_MSG_MONSTER_YELL"] = 7, } - emote_frame:SetScript ("OnEvent", function (...) + emote_frame:SetScript ("OnEvent", function(...) if (not EncounterDetails.current_whisper_table) then return diff --git a/plugins/Details_RaidCheck/Details_RaidCheck.lua b/plugins/Details_RaidCheck/Details_RaidCheck.lua index a2f1397b..deb578f9 100644 --- a/plugins/Details_RaidCheck/Details_RaidCheck.lua +++ b/plugins/Details_RaidCheck/Details_RaidCheck.lua @@ -727,7 +727,7 @@ local CreatePluginFrames = function() raidCheckFrame:SetScript("OnUpdate", updateRaidCheckFrame) end) - DetailsRaidCheck.ToolbarButton:SetScript("OnLeave", function (self) + DetailsRaidCheck.ToolbarButton:SetScript("OnLeave", function(self) raidCheckFrame:SetScript("OnUpdate", nil) raidCheckFrame:Hide() end) @@ -903,21 +903,21 @@ local buildOptionsPanel = function() { type = "toggle", get = function() return DetailsRaidCheck.db.pre_pot_healers end, - set = function (self, fixedparam, value) DetailsRaidCheck.db.pre_pot_healers = value end, + set = function(self, fixedparam, value) DetailsRaidCheck.db.pre_pot_healers = value end, desc = "If enabled, pre potion for healers are also shown.", name = "Track Healers Pre Pot" }, { type = "toggle", get = function() return DetailsRaidCheck.db.pre_pot_tanks end, - set = function (self, fixedparam, value) DetailsRaidCheck.db.pre_pot_tanks = value end, + set = function(self, fixedparam, value) DetailsRaidCheck.db.pre_pot_tanks = value end, desc = "If enabled, pre potion for tanks are also shown.", name = "Track Tank Pre Pot" }, { type = "toggle", get = function() return DetailsRaidCheck.db.mythic_1_4 end, - set = function (self, fixedparam, value) DetailsRaidCheck.db.mythic_1_4 = value end, + set = function(self, fixedparam, value) DetailsRaidCheck.db.mythic_1_4 = value end, desc = "When raiding on Mythic difficult, only check the first 4 groups.", name = "Mythic 1-4 Group Only" }, @@ -928,21 +928,21 @@ local buildOptionsPanel = function() { type = "toggle", get = function() return DetailsRaidCheck.db.food_tier1 end, - set = function (self, fixedparam, value) DetailsRaidCheck.db.food_tier1 = value end, + set = function(self, fixedparam, value) DetailsRaidCheck.db.food_tier1 = value end, desc = "Consider players using Tier 1 food.", name = "Food Tier 1 [41]" }, { type = "toggle", get = function() return DetailsRaidCheck.db.food_tier2 end, - set = function (self, fixedparam, value) DetailsRaidCheck.db.food_tier2 = value end, + set = function(self, fixedparam, value) DetailsRaidCheck.db.food_tier2 = value end, desc = "Consider players using Tier 2 food.", name = "Food Tier 2 [55]" }, { type = "toggle", get = function() return DetailsRaidCheck.db.food_tier3 end, - set = function (self, fixedparam, value) DetailsRaidCheck.db.food_tier3 = value end, + set = function(self, fixedparam, value) DetailsRaidCheck.db.food_tier3 = value end, desc = "Consider players using Tier 3 food.", name = "Food Tier 3 [>= 75]" }, diff --git a/plugins/Details_Streamer/Details_Streamer.lua b/plugins/Details_Streamer/Details_Streamer.lua index 10befad1..2bccf587 100644 --- a/plugins/Details_Streamer/Details_Streamer.lua +++ b/plugins/Details_Streamer/Details_Streamer.lua @@ -148,7 +148,7 @@ local function CreatePluginFrames() titlebar.text = titlebar:CreateFontString (nil, "overlay", "GameFontNormal") titlebar.text:SetPoint ("center", titlebar, "center") titlebar.text:SetText ("Details! Streamer: Action Tracker") - titlebar:SetScript ("OnEnter", function (self) + titlebar:SetScript ("OnEnter", function(self) GameTooltip:SetOwner (self) GameTooltip:SetOwner (self, "ANCHOR_TOPLEFT") GameTooltip:AddLine ("|cFFFF7700Left Click|r: Open Options\n|cFFFF7700Right Click|r: Lock the Frame\n|cFFFF7700Slash Command|r: /streamer") @@ -158,14 +158,14 @@ local function CreatePluginFrames() GameTooltip:Hide() end) - SOF:SetScript ("OnMouseDown", function (self) + SOF:SetScript ("OnMouseDown", function(self) end) - SOF:SetScript ("OnMouseUp", function (self) + SOF:SetScript ("OnMouseUp", function(self) end) - titlebar:SetScript ("OnMouseDown", function (self, button) + titlebar:SetScript ("OnMouseDown", function(self, button) if (not SOF.moving and not StreamOverlay.db.main_frame_locked) then SOF:StartMoving() SOF.moving = true @@ -173,7 +173,7 @@ local function CreatePluginFrames() end end) - titlebar:SetScript ("OnMouseUp", function (self, button) + titlebar:SetScript ("OnMouseUp", function(self, button) if (SOF.movingAt) then if (SOF.moving) then @@ -262,13 +262,13 @@ local function CreatePluginFrames() left_resize:GetHighlightTexture():SetTexCoord (1, 0, 0, 1) left_resize:GetPushedTexture():SetTexCoord (1, 0, 0, 1) - left_resize:SetScript ("OnMouseDown", function (self) + left_resize:SetScript ("OnMouseDown", function(self) if (not SOF.resizing and not StreamOverlay.db.main_frame_locked) then SOF.resizing = true SOF:StartSizing ("bottomleft") end end) - left_resize:SetScript ("OnMouseUp", function (self) + left_resize:SetScript ("OnMouseUp", function(self) if (SOF.resizing) then SOF.resizing = false SOF:StopMovingOrSizing() @@ -277,13 +277,13 @@ local function CreatePluginFrames() StreamOverlay:SaveWindowSizeAnLocation() end end) - right_resize:SetScript ("OnMouseDown", function (self) + right_resize:SetScript ("OnMouseDown", function(self) if (not SOF.resizing and not StreamOverlay.db.main_frame_locked) then SOF.resizing = true SOF:StartSizing ("bottomright") end end) - right_resize:SetScript ("OnMouseUp", function (self) + right_resize:SetScript ("OnMouseUp", function(self) if (SOF.resizing) then SOF.resizing = false SOF:StopMovingOrSizing() @@ -293,17 +293,17 @@ local function CreatePluginFrames() end end) - SOF:SetScript ("OnSizeChanged", function (self) + SOF:SetScript ("OnSizeChanged", function(self) StreamOverlay:Refresh() end) - SOF:SetScript ("OnMouseDown", function (self) + SOF:SetScript ("OnMouseDown", function(self) if (not SOF.moving and not StreamOverlay.db.main_frame_locked) then SOF:StartMoving() SOF.moving = true end end) - SOF:SetScript ("OnMouseUp", function (self) + SOF:SetScript ("OnMouseUp", function(self) if (SOF.moving) then SOF.moving = false SOF:StopMovingOrSizing() @@ -315,7 +315,7 @@ local function CreatePluginFrames() --> scroll frame local autoscroll = CreateFrame ("scrollframe", "Details_StreamOverlayScrollFrame", SOF, "FauxScrollFrameTemplate, BackdropTemplate") - autoscroll:SetScript ("OnVerticalScroll", function (self, offset) FauxScrollFrame_OnVerticalScroll (self, offset, 20, StreamOverlay.UpdateLines) end) + autoscroll:SetScript ("OnVerticalScroll", function(self, offset) FauxScrollFrame_OnVerticalScroll (self, offset, 20, StreamOverlay.UpdateLines) end) --> looks like this isn't working function StreamOverlay:ClearAll() @@ -960,11 +960,11 @@ local DefaultCoords = {0, 1, 0, 1} local DefaultColor = {r=1, g=1, b=1} local PetCoords = {0.25, 0.49609375, 0.75, 1} -local parse_target_name = function (target) +local parse_target_name = function(target) return StreamOverlay:GetOnlyName (target) end -local parse_target_icon = function (targetObject, target) +local parse_target_icon = function(targetObject, target) local icon2, icon2coords, pclass if (targetObject) then local role = targetObject.role @@ -1022,7 +1022,7 @@ local parse_target_icon = function (targetObject, target) return icon2, icon2coords, pclass end -local parse_target_color = function (class) +local parse_target_color = function(class) local color2 = RAID_CLASS_COLORS [class] return color2 end @@ -1040,7 +1040,7 @@ function StreamOverlay:CastStart (castGUID) end local icon, backgroundcolor, bordercolor = StreamOverlay:GetSpellInformation (spellid) - local spellname, _, spellicon = GetSpellInfo (spellid) + local spellname, _, spellicon = GetSpellInfo(spellid) local targetObject = Details:GetActor ("current", 1, target) or Details:GetActor ("current", 2, target) local icon2, icon2coords, class = parse_target_icon (targetObject, target) @@ -1078,7 +1078,7 @@ function StreamOverlay:CastFinished (castid) --just casted a instant spell local icon, backgroundcolor, bordercolor = StreamOverlay:GetSpellInformation (spellid) - local spellname, _, spellicon = GetSpellInfo (spellid) + local spellname, _, spellicon = GetSpellInfo(spellid) local targetObject = Details:GetActor ("current", 1, target) or Details:GetActor ("current", 2, target) @@ -1346,7 +1346,7 @@ APM_FRAME:SetScript ("OnEvent", function() ACTIONS = ACTIONS + 1 end) -eventFrame:SetScript ("OnEvent", function (self, event, ...) +eventFrame:SetScript ("OnEvent", function(self, event, ...) if (event ~= "UNIT_SPELLCAST_SENT" and event ~= "UNIT_SPELLCAST_SUCCEEDED" and ACTIONS_EVENT_TIME [event] ~= GetTime()) then ACTIONS = ACTIONS + 1 ACTIONS_EVENT_TIME [event] = GetTime() @@ -1355,7 +1355,7 @@ eventFrame:SetScript ("OnEvent", function (self, event, ...) if (event == "UNIT_SPELLCAST_SENT") then local unitID, target, castGUID, spellID = ... --local unitID, spell, rank, target, id = ... - local spell = GetSpellInfo (spellID) + local spell = GetSpellInfo(spellID) if (unitID == "player") then CastsTable [castGUID] = {Target = target or "", Id = castGUID, CastStart = GetTime()} @@ -1447,7 +1447,7 @@ eventFrame:SetScript ("OnEvent", function (self, event, ...) elseif (event == "UNIT_SPELLCAST_SUCCEEDED") then --local unitID, spell, rank, id, spellID = ... local unitID, castGUID, spellID = ... - local spell = GetSpellInfo (spellID) + local spell = GetSpellInfo(spellID) if (unitID == "player" and CastsTable[castGUID] and not channelspells [spell]) then if (CastsTable[castGUID].HasCastTime and not CastsTable[castGUID].IsChanneled) then @@ -1466,7 +1466,7 @@ eventFrame:SetScript ("OnEvent", function (self, event, ...) end) -local format_time = function (v) return "-" .. format ("%.2f", v) end +local format_time = function(v) return "-" .. format ("%.2f", v) end --when the player die, show the events before the death function StreamOverlay.OnDeath (_, token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, death_table, last_cooldown, death_at_combattime, max_health) @@ -1576,14 +1576,14 @@ screen_frame:SetBackdropColor (.1, .1, .1, .9) screen_frame:SetMovable (true) screen_frame:Hide() screen_frame:SetPoint ("center", UIParent, "center") -screen_frame:SetScript ("OnMouseDown", function (self) +screen_frame:SetScript ("OnMouseDown", function(self) if (not screen_frame.moving and not StreamOverlay.db.main_frame_locked) then screen_frame:StartMoving() screen_frame.moving = true screen_frame.movingAt = GetTime() end end) -screen_frame:SetScript ("OnMouseUp", function (self) +screen_frame:SetScript ("OnMouseUp", function(self) if (screen_frame.movingAt) then if (screen_frame.moving) then screen_frame.moving = false @@ -1599,7 +1599,7 @@ screen_frame:SetScript ("OnMouseUp", function (self) StreamOverlay.OpenOptionsPanel() end end) -screen_frame:SetScript ("OnEnter", function (self) +screen_frame:SetScript ("OnEnter", function(self) GameTooltip:SetOwner (self) GameTooltip:SetOwner (self, "ANCHOR_TOPLEFT") GameTooltip:AddLine ("|cFFFF7700Left Click|r: Open Options\n|cFFFF7700Slash Command|r: /streamer") @@ -1790,7 +1790,7 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) for name, fontPath in pairs(fontObjects) do fontTable[#fontTable+1] = {value = name, label = name, onclick = setFontFace, font = fontPath, descfont = name} end - table.sort(fontTable, function (t1, t2) return t1.label < t2.label end) + table.sort(fontTable, function(t1, t2) return t1.label < t2.label end) -- select arrow local arrows = { @@ -1831,7 +1831,7 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) -- - local setWindowStrataCallback = function (_, _, strata) + local setWindowStrataCallback = function(_, _, strata) StreamOverlay.db.main_frame_strata = strata SOF:SetFrameStrata(strata) StreamerOverlayDpsHpsFrame:SetFrameStrata(strata) @@ -1868,7 +1868,7 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) desc = "Can't move or interact within the frame when it's locked.", order = 1, get = function() return StreamOverlay.db.main_frame_locked end, - set = function (self, fixedParam, val) + set = function(self, fixedParam, val) StreamOverlay:SetLocked (not StreamOverlay.db.main_frame_locked) end, }, @@ -1879,7 +1879,7 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) desc = "Show/Hide minimap icon.", order = 1, get = function() return not StreamOverlay.db.minimap.hide end, - set = function (self, fixedParam, val) + set = function(self, fixedParam, val) StreamOverlay.db.minimap.hide = not StreamOverlay.db.minimap.hide if (LDBIcon) then LDBIcon:Refresh ("DetailsStreamer", StreamOverlay.db.minimap) @@ -1890,7 +1890,7 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) { type = "color", get = function() return StreamOverlay.db.main_frame_color end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) StreamOverlay:SetBackgroundColor (r, g, b, a) end, desc = "Color used on the background.", @@ -1900,7 +1900,7 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) { type = "range", get = function() return StreamOverlay.db.scale or 1 end, - set = function (self, fixedparam, value) StreamOverlay.db.scale = value; StreamOverlay.Frame:SetScale(value) end, + set = function(self, fixedparam, value) StreamOverlay.db.scale = value; StreamOverlay.Frame:SetScale(value) end, min = 0.6, max = 2, step = 0.1, @@ -1914,7 +1914,7 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) { type = "range", get = function() return StreamOverlay.db.row_height end, - set = function (self, fixedparam, value) StreamOverlay.db.row_height = value; StreamOverlay:RefreshAllBattleLineStyle() end, + set = function(self, fixedparam, value) StreamOverlay.db.row_height = value; StreamOverlay:RefreshAllBattleLineStyle() end, min = 10, max = 30, step = 1, @@ -1925,7 +1925,7 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) { type = "range", get = function() return StreamOverlay.db.row_spacement end, - set = function (self, fixedparam, value) StreamOverlay.db.row_spacement = value; StreamOverlay:RefreshAllBattleLineStyle() end, + set = function(self, fixedparam, value) StreamOverlay.db.row_spacement = value; StreamOverlay:RefreshAllBattleLineStyle() end, min = 8, max = 31, step = 1, @@ -1944,7 +1944,7 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) { type = "color", get = function() return StreamOverlay.db.row_color end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) local c = StreamOverlay.db.row_color c[1], c[2], c[3], c[4] = r, g, b, a StreamOverlay:RefreshAllBattleLineStyle() @@ -1958,7 +1958,7 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) { type = "range", get = function() return StreamOverlay.db.font_size end, - set = function (self, fixedparam, value) StreamOverlay.db.font_size = value; StreamOverlay:RefreshAllBattleLineStyle() end, + set = function(self, fixedparam, value) StreamOverlay.db.font_size = value; StreamOverlay:RefreshAllBattleLineStyle() end, min = 8, max = 32, step = 1, @@ -1977,7 +1977,7 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) { type = "color", get = function() return StreamOverlay.db.font_color end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) local c = StreamOverlay.db.font_color c[1], c[2], c[3], c[4] = r, g, b, a StreamOverlay:RefreshAllBattleLineStyle() @@ -1994,7 +1994,7 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) desc = "Show in the screen your current Dps or Hps.", order = 1, get = function() return StreamOverlay.db.per_second.enabled end, - set = function (self, fixedParam, val) + set = function(self, fixedParam, val) StreamOverlay.db.per_second.enabled = not StreamOverlay.db.per_second.enabled -- update hps dps frame StreamOverlay:UpdateDpsHpsFrameConfig() @@ -2012,7 +2012,7 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) { type = "range", get = function() return StreamOverlay.db.per_second.size end, - set = function (self, fixedparam, value) StreamOverlay.db.per_second.size = value; + set = function(self, fixedparam, value) StreamOverlay.db.per_second.size = value; -- update hps dps frame StreamOverlay:UpdateDpsHpsFrameConfig() end, @@ -2026,7 +2026,7 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) { type = "range", get = function() return StreamOverlay.db.per_second.scale end, - set = function (self, fixedparam, value) StreamOverlay.db.per_second.scale = value; + set = function(self, fixedparam, value) StreamOverlay.db.per_second.scale = value; -- update hps dps frame StreamOverlay:UpdateDpsHpsFrameConfig() end, @@ -2041,7 +2041,7 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) { type = "range", get = function() return StreamOverlay.db.per_second.update_speed end, - set = function (self, fixedparam, value) StreamOverlay.db.per_second.update_speed = value; + set = function(self, fixedparam, value) StreamOverlay.db.per_second.update_speed = value; -- update hps dps frame StreamOverlay:UpdateDpsHpsFrameConfig() end, @@ -2059,7 +2059,7 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) desc = "Enable text shadow.", order = 1, get = function() return StreamOverlay.db.per_second.font_shadow end, - set = function (self, fixedParam, val) + set = function(self, fixedParam, val) StreamOverlay.db.per_second.font_shadow = not StreamOverlay.db.per_second.font_shadow -- update hps dps frame StreamOverlay:UpdateDpsHpsFrameConfig() @@ -2071,7 +2071,7 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) { type = "range", get = function() return StreamOverlay.db.square_amount end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) StreamOverlay.db.square_amount = value StreamOverlay:Refresh() end, @@ -2084,7 +2084,7 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) { type = "range", get = function() return StreamOverlay.db.square_size end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) StreamOverlay.db.square_size = value StreamOverlay:RefreshAllBoxesStyle() end, @@ -2115,7 +2115,7 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) { type = "range", get = function() return StreamOverlay.db.arrow_size end, - set = function (self, fixedparam, value) StreamOverlay.db.arrow_size = value; StreamOverlay:RefreshAllBattleLineStyle() end, + set = function(self, fixedparam, value) StreamOverlay.db.arrow_size = value; StreamOverlay:RefreshAllBattleLineStyle() end, min = 6, max = 32, step = 1, @@ -2126,7 +2126,7 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) { type = "color", get = function() return StreamOverlay.db.arrow_color end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) local c = StreamOverlay.db.arrow_color c[1], c[2], c[3], c[4] = r, g, b, a StreamOverlay:RefreshAllBattleLineStyle() @@ -2138,7 +2138,7 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) { type = "range", get = function() return StreamOverlay.db.arrow_anchor_x end, - set = function (self, fixedparam, value) StreamOverlay.db.arrow_anchor_x = value; StreamOverlay:RefreshAllBattleLineStyle() end, + set = function(self, fixedparam, value) StreamOverlay.db.arrow_anchor_x = value; StreamOverlay:RefreshAllBattleLineStyle() end, min = -16, max = 16, step = 1, @@ -2149,7 +2149,7 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) { type = "range", get = function() return StreamOverlay.db.arrow_anchor_y end, - set = function (self, fixedparam, value) StreamOverlay.db.arrow_anchor_y = value; StreamOverlay:RefreshAllBattleLineStyle() end, + set = function(self, fixedparam, value) StreamOverlay.db.arrow_anchor_y = value; StreamOverlay:RefreshAllBattleLineStyle() end, min = -16, max = 16, step = 1, @@ -2162,7 +2162,7 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) { type = "range", get = function() return StreamOverlay.db.main_frame_size[1] end, - set = function (self, fixedparam, value) StreamOverlay.db.main_frame_size[1] = value; StreamOverlay:RestoreWindowSizeAndLocation() end, + set = function(self, fixedparam, value) StreamOverlay.db.main_frame_size[1] = value; StreamOverlay:RestoreWindowSizeAndLocation() end, min = 150, max = 800, step = 1, @@ -2173,7 +2173,7 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) { type = "range", get = function() return StreamOverlay.db.main_frame_size[2] end, - set = function (self, fixedparam, value) StreamOverlay.db.main_frame_size[2] = value; StreamOverlay:RestoreWindowSizeAndLocation() end, + set = function(self, fixedparam, value) StreamOverlay.db.main_frame_size[2] = value; StreamOverlay:RestoreWindowSizeAndLocation() end, min = 40, max = 1024, step = 1, @@ -2196,7 +2196,7 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) desc = "Show or hide the spark at bars", order = 1, get = function() return StreamOverlay.db.use_spark end, - set = function (self, fixedParam, val) + set = function(self, fixedParam, val) StreamOverlay.db.use_spark = not StreamOverlay.db.use_spark @@ -2543,7 +2543,7 @@ function StreamOverlay:CreateMinimapIcon() type = "data source", icon = [[Interface\MINIMAP\MOVIERECORDINGICON]], - OnClick = function (self, button) + OnClick = function(self, button) if (button == "LeftButton") then StreamOverlay.OpenOptionsPanel() elseif (button == "RightButton") then @@ -2554,7 +2554,7 @@ function StreamOverlay:CreateMinimapIcon() end end, - OnTooltipShow = function (tooltip) + OnTooltipShow = function(tooltip) tooltip:AddLine ("Details!: Action Tracker", 1, 1, 1) tooltip:AddLine ("|cFFFF7700Left Click|r: open options.") tooltip:AddLine ("|cFFFF7700Right Click|r: hide this icon.") diff --git a/plugins/Details_TinyThreat/Details_TinyThreat.lua b/plugins/Details_TinyThreat/Details_TinyThreat.lua index 68542e3e..868ac70d 100644 --- a/plugins/Details_TinyThreat/Details_TinyThreat.lua +++ b/plugins/Details_TinyThreat/Details_TinyThreat.lua @@ -259,7 +259,7 @@ local function CreatePluginFrames (data) return newrow end - local absoluteSort = function (table1, table2) + local absoluteSort = function(table1, table2) if (table1[6] > table2[6]) then return true else @@ -267,7 +267,7 @@ local function CreatePluginFrames (data) end end - local relativeSort = function (table1, table2) + local relativeSort = function(table1, table2) if (table1[2] > table2[2]) then return true else @@ -528,7 +528,7 @@ local function CreatePluginFrames (data) end if gougeThreshold and ((not threatActor) or (threatActor[6] < gougeThreshold)) then - local spellName, _, spellTexture = GetSpellInfo (gougeSpellId) + local spellName, _, spellTexture = GetSpellInfo(gougeSpellId) thisRow._icon:SetTexture (spellTexture) thisRow._icon:SetTexCoord (0, 1, 0, 1) @@ -736,7 +736,7 @@ local build_options_panel = function() { type = "range", get = function() return ThreatMeter.saveddata.updatespeed end, - set = function (self, fixedparam, value) ThreatMeter.saveddata.updatespeed = value end, + set = function(self, fixedparam, value) ThreatMeter.saveddata.updatespeed = value end, min = 0.2, max = 3, step = 0.2, @@ -747,14 +747,14 @@ local build_options_panel = function() { type = "toggle", get = function() return ThreatMeter.saveddata.useplayercolor end, - set = function (self, fixedparam, value) ThreatMeter.saveddata.useplayercolor = value end, + set = function(self, fixedparam, value) ThreatMeter.saveddata.useplayercolor = value end, desc = "When enabled, your bar get the following color.", name = "Player Color Enabled" }, { type = "color", get = function() return ThreatMeter.saveddata.playercolor end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) local current = ThreatMeter.saveddata.playercolor current[1], current[2], current[3], current[4] = r, g, b, a end, @@ -764,7 +764,7 @@ local build_options_panel = function() { type = "toggle", get = function() return ThreatMeter.saveddata.useclasscolors end, - set = function (self, fixedparam, value) ThreatMeter.saveddata.useclasscolors = value end, + set = function(self, fixedparam, value) ThreatMeter.saveddata.useclasscolors = value end, desc = "When enabled, threat bars uses the class color of the character.", name = "Use Class Colors" }, @@ -774,14 +774,14 @@ local build_options_panel = function() { type = "toggle", get = function() return ThreatMeter.saveddata.usefocus end, - set = function (self, fixedparam, value) ThreatMeter.saveddata.usefocus = value end, + set = function(self, fixedparam, value) ThreatMeter.saveddata.usefocus = value end, desc = "Show threat for the focus target if there's one.", name = "Track Focus Target (if any)" }, { type = "toggle", get = function() return not ThreatMeter.saveddata.hide_pull_bar end, - set = function (self, fixedparam, value) ThreatMeter.saveddata.hide_pull_bar = not value end, + set = function(self, fixedparam, value) ThreatMeter.saveddata.hide_pull_bar = not value end, desc = "Show Pull Aggro Bar", name = "Show Pull Aggro Bar" }, @@ -805,7 +805,7 @@ local build_options_panel = function() { type = "toggle", get = function() return ThreatMeter.saveddata.playSound end, - set = function (self, fixedparam, value) ThreatMeter.saveddata.playSound = value end, + set = function(self, fixedparam, value) ThreatMeter.saveddata.playSound = value end, desc = "Except for tanks", name = "Play Audio On High Threat" }, diff --git a/plugins/Details_Vanguard/Details_Vanguard.lua b/plugins/Details_Vanguard/Details_Vanguard.lua index 525fa23a..7e8e5f0f 100644 --- a/plugins/Details_Vanguard/Details_Vanguard.lua +++ b/plugins/Details_Vanguard/Details_Vanguard.lua @@ -311,7 +311,7 @@ local function CreatePluginFrames (data) end end - local SetTank = function (self, index) + local SetTank = function(self, index) local name = Vanguard.TankList [index] self.tankname:SetText (Vanguard:GetOnlyName (name)) self.tankname_string = name @@ -354,22 +354,22 @@ local function CreatePluginFrames (data) self.unitFrame.castBar:SetTexture (SharedMedia:Fetch("statusbar", Vanguard.db.tank_block_texture)) end - local debuff_on_enter = function (self) + local debuff_on_enter = function(self) if (self.spellid) then --self.texture:SetBlendMode ("ADD") GameTooltip:SetOwner (self, "ANCHOR_TOPLEFT") - GameTooltip:SetSpellByID (self.spellid) + GameTooltip:SetSpellByID(self.spellid) GameTooltip:Show() end end - local debuff_on_leave = function (self) + local debuff_on_leave = function(self) --self.texture:SetBlendMode ("BLEND") if (self.spellid) then GameTooltip:Hide() end end - local on_click = function (self, button) + local on_click = function(self, button) if (button == "LeftButton") then Vanguard.OpenOptionsPanel() @@ -928,7 +928,7 @@ end local build_options_panel = function() local options_frame = Vanguard:CreatePluginOptionsFrame ("VanguardOptionsWindow", "Vanguard Options", 1) - local tank_texture_set = function (_, _, value) + local tank_texture_set = function(_, _, value) Vanguard.db.tank_block_texture = value; Vanguard:ResetBars() Vanguard:RefreshTanks() @@ -944,7 +944,7 @@ local build_options_panel = function() for name, texturePath in pairs (textures) do texTable[#texTable+1] = {value = name, label = name, iconsize = texture_icon_size, statusbar = texturePath, onclick = tank_texture_set, icon = texture_icon, texcoord = texture_texcoord} end - table.sort (texTable, function (t1, t2) return t1.label < t2.label end) + table.sort (texTable, function(t1, t2) return t1.label < t2.label end) local tank_texture_menu = texTable @@ -969,14 +969,14 @@ local build_options_panel = function() { type = "toggle", get = function() return Vanguard.db.show_inc_bars end, - set = function (self, fixedparam, value) Vanguard.db.show_inc_bars = value; Vanguard:ResetBars() end, + set = function(self, fixedparam, value) Vanguard.db.show_inc_bars = value; Vanguard:ResetBars() end, --desc = "Shows the incoming heal vs incoming damage.", name = "Show Incoming Damage" }, { type = "range", get = function() return Vanguard.db.bar_height end, - set = function (self, fixedparam, value) + set = function(self, fixedparam, value) Vanguard.db.bar_height = value Vanguard:ResetBars() Vanguard:RefreshTanks() @@ -992,26 +992,26 @@ local build_options_panel = function() { type = "toggle", get = function() return Vanguard.db.show_health_bar end, - set = function (self, fixedparam, value) Vanguard.db.show_health_bar = value; Vanguard:RefreshTanks(); Vanguard:ResetBars() end, + set = function(self, fixedparam, value) Vanguard.db.show_health_bar = value; Vanguard:RefreshTanks(); Vanguard:ResetBars() end, name = "Show Health Bar" }, { type = "toggle", get = function() return Vanguard.db.show_cast_bar end, - set = function (self, fixedparam, value) Vanguard.db.show_cast_bar = value; Vanguard:RefreshTanks(); Vanguard:ResetBars() end, + set = function(self, fixedparam, value) Vanguard.db.show_cast_bar = value; Vanguard:RefreshTanks(); Vanguard:ResetBars() end, name = "Show Cast Bar" }, { type = "toggle", get = function() return Vanguard.db.show_power_bar end, - set = function (self, fixedparam, value) Vanguard.db.show_power_bar = value; Vanguard:RefreshTanks(); Vanguard:ResetBars() end, + set = function(self, fixedparam, value) Vanguard.db.show_power_bar = value; Vanguard:RefreshTanks(); Vanguard:ResetBars() end, name = "Show Power Bar" }, { type = "range", get = function() return Vanguard.db.tank_block_size end, - set = function (self, fixedparam, value) Vanguard.db.tank_block_size = value; Vanguard:RefreshTanks() end, + set = function(self, fixedparam, value) Vanguard.db.tank_block_size = value; Vanguard:RefreshTanks() end, min = 70, max = 250, step = 1, @@ -1021,7 +1021,7 @@ local build_options_panel = function() { type = "range", get = function() return Vanguard.db.tank_block_size_height end, - set = function (self, fixedparam, value) Vanguard.db.tank_block_size_height = value; Vanguard:RefreshTanks() end, + set = function(self, fixedparam, value) Vanguard.db.tank_block_size_height = value; Vanguard:RefreshTanks() end, min = 10, max = 100, step = 1, @@ -1030,7 +1030,7 @@ local build_options_panel = function() { type = "range", get = function() return Vanguard.db.tank_block_castbar_size_height end, - set = function (self, fixedparam, value) Vanguard.db.tank_block_castbar_size_height = value; Vanguard:RefreshTanks() end, + set = function(self, fixedparam, value) Vanguard.db.tank_block_castbar_size_height = value; Vanguard:RefreshTanks() end, min = 10, max = 60, step = 1, @@ -1039,7 +1039,7 @@ local build_options_panel = function() { type = "range", get = function() return Vanguard.db.tank_block_powerbar_size_height end, - set = function (self, fixedparam, value) Vanguard.db.tank_block_powerbar_size_height = value; Vanguard:RefreshTanks() end, + set = function(self, fixedparam, value) Vanguard.db.tank_block_powerbar_size_height = value; Vanguard:RefreshTanks() end, min = 10, max = 60, step = 1, @@ -1048,7 +1048,7 @@ local build_options_panel = function() { type = "color", get = function() return Vanguard.db.tank_block_color end, - set = function (self, r, g, b, a) + set = function(self, r, g, b, a) local current = Vanguard.db.tank_block_color; current[1], current[2], current[3], current[4] = r, g, b, a; Vanguard:RefreshTanks() @@ -1061,7 +1061,7 @@ local build_options_panel = function() { type = "range", get = function() return Vanguard.db.aura_offset_y end, - set = function (self, fixedparam, value) Vanguard.db.aura_offset_y = value; Vanguard.RefreshWidgets() end, + set = function(self, fixedparam, value) Vanguard.db.aura_offset_y = value; Vanguard.RefreshWidgets() end, min = -20, max = 20, step = 1, @@ -1070,7 +1070,7 @@ local build_options_panel = function() { type = "range", get = function() return Vanguard.db.aura_timer_text_size end, - set = function (self, fixedparam, value) Vanguard.db.aura_timer_text_size = value; Vanguard.RefreshWidgets() end, + set = function(self, fixedparam, value) Vanguard.db.aura_timer_text_size = value; Vanguard.RefreshWidgets() end, min = 6, max = 24, step = 1,