diff --git a/API Custom Displays.txt b/API Custom Displays.txt index d2429fa3..38498eec 100644 --- a/API Custom Displays.txt +++ b/API Custom Displays.txt @@ -152,7 +152,7 @@ checkTop is for some special cases when the top value needs to be calculated imm nameComplement is a string to add on the end of the actor's name, for instance, in cases where the actor is a spell and its name is generated by the container. returns the current value for the actor. -container:SetValue (actor, amount, nameComplement) +container:SetValue(actor, amount, nameComplement) actor is any actor object or any other table containing a member "name" or "id", e.g. {name = "Jeff"} {id = 186451} amount is the amount to set to this actor on the container. nameComplement is a string to add on the end of the actor's name, for instance, in cases where the actor is a spell and its name is generated by the container. diff --git a/API.lua b/API.lua index f6ce850e..aab257de 100644 --- a/API.lua +++ b/API.lua @@ -756,7 +756,7 @@ checkTop is for some special cases when the top value needs to be calculated imm nameComplement is a string to add on the end of the actor's name, for instance, in cases where the actor is a spell and its name is generated by the container. returns the current value for the actor. -container:SetValue (actor, amount, nameComplement) +container:SetValue(actor, amount, nameComplement) actor is any actor object or any other table containing a member "name" or "id", e.g. {name = "Jeff"} {id = 186451} amount is the amount to set to this actor on the container. nameComplement is a string to add on the end of the actor's name, for instance, in cases where the actor is a spell and its name is generated by the container. diff --git a/Libs/DF/auras.lua b/Libs/DF/auras.lua index ab16dc6a..8caeb672 100644 --- a/Libs/DF/auras.lua +++ b/Libs/DF/auras.lua @@ -50,22 +50,22 @@ function DF:LoadAllSpells (hashMap, indexTable, allSpellsSameName) --pre checking which tables to fill to avoid checking if the table exists during the gigantic loop for performance if (not DF.LoadingAuraAlertFrame) then - DF.LoadingAuraAlertFrame = CreateFrame ("frame", "DetailsFrameworkLoadingAurasAlert", UIParent, "BackdropTemplate") - DF.LoadingAuraAlertFrame:SetSize (340, 75) - DF.LoadingAuraAlertFrame:SetPoint ("center") + DF.LoadingAuraAlertFrame = CreateFrame("frame", "DetailsFrameworkLoadingAurasAlert", UIParent, "BackdropTemplate") + DF.LoadingAuraAlertFrame:SetSize(340, 75) + DF.LoadingAuraAlertFrame:SetPoint("center") DF.LoadingAuraAlertFrame:SetFrameStrata ("TOOLTIP") DF:ApplyStandardBackdrop (DF.LoadingAuraAlertFrame) - DF.LoadingAuraAlertFrame:SetBackdropBorderColor (1, 0.8, 0.1) + DF.LoadingAuraAlertFrame:SetBackdropBorderColor(1, 0.8, 0.1) - DF.LoadingAuraAlertFrame.IsLoadingLabel1 = DF:CreateLabel (DF.LoadingAuraAlertFrame, "We are currently loading spell names and spell IDs") - DF.LoadingAuraAlertFrame.IsLoadingLabel2 = DF:CreateLabel (DF.LoadingAuraAlertFrame, "This may take only a few seconds") + DF.LoadingAuraAlertFrame.IsLoadingLabel1 = DF:CreateLabel(DF.LoadingAuraAlertFrame, "We are currently loading spell names and spell IDs") + DF.LoadingAuraAlertFrame.IsLoadingLabel2 = DF:CreateLabel(DF.LoadingAuraAlertFrame, "This may take only a few seconds") DF.LoadingAuraAlertFrame.IsLoadingImage1 = DF:CreateImage (DF.LoadingAuraAlertFrame, [[Interface\DialogFrame\UI-Dialog-Icon-AlertOther]], 32, 32) DF.LoadingAuraAlertFrame.IsLoadingLabel1.align = "center" DF.LoadingAuraAlertFrame.IsLoadingLabel2.align = "center" - DF.LoadingAuraAlertFrame.IsLoadingLabel1:SetPoint ("center", 16, 10) - DF.LoadingAuraAlertFrame.IsLoadingLabel2:SetPoint ("center", 16, -5) - DF.LoadingAuraAlertFrame.IsLoadingImage1:SetPoint ("left", 10, 0) + DF.LoadingAuraAlertFrame.IsLoadingLabel1:SetPoint("center", 16, 10) + DF.LoadingAuraAlertFrame.IsLoadingLabel2:SetPoint("center", 16, -5) + DF.LoadingAuraAlertFrame.IsLoadingImage1:SetPoint("left", 10, 0) end DF.LoadingAuraAlertFrame:Show() @@ -181,16 +181,16 @@ local on_profile_changed = function(self, newdb) self.f_auto:Show() self.f_manual:Hide() - self.AutomaticTrackingCheckbox:SetValue (true) - self.ManualTrackingCheckbox:SetValue (false) + self.AutomaticTrackingCheckbox:SetValue(true) + self.ManualTrackingCheckbox:SetValue(false) self.desc_label.text = self.LocTexts.AUTOMATIC_DESC elseif (newdb.aura_tracker.track_method == 0x2) then self.f_auto:Hide() self.f_manual:Show() - self.AutomaticTrackingCheckbox:SetValue (false) - self.ManualTrackingCheckbox:SetValue (true) + self.AutomaticTrackingCheckbox:SetValue(false) + self.ManualTrackingCheckbox:SetValue(true) self.desc_label.text = self.LocTexts.MANUAL_DESC end end @@ -210,24 +210,24 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t local options_slider_template = DF:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE") local options_button_template = DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE") - local f = CreateFrame ("frame", name, parent, "BackdropTemplate") + local f = CreateFrame("frame", name, parent, "BackdropTemplate") f.db = db f.OnProfileChanged = on_profile_changed f.LocTexts = texts options = options or {} self.table.deploy (options, aura_panel_defaultoptions) - local f_auto = CreateFrame ("frame", "$parent_Automatic", f, "BackdropTemplate") - local f_manual = CreateFrame ("frame", "$parent_Manual", f, "BackdropTemplate") - f_auto:SetPoint ("topleft", f, "topleft", 0, -24) - f_manual:SetPoint ("topleft", f, "topleft", 0, -24) - f_auto:SetSize (600, 600) - f_manual:SetSize (600, 600) + local f_auto = CreateFrame("frame", "$parent_Automatic", f, "BackdropTemplate") + local f_manual = CreateFrame("frame", "$parent_Manual", f, "BackdropTemplate") + f_auto:SetPoint("topleft", f, "topleft", 0, -24) + f_manual:SetPoint("topleft", f, "topleft", 0, -24) + f_auto:SetSize(600, 600) + f_manual:SetSize(600, 600) f.f_auto = f_auto f.f_manual = f_manual --check if the texts table is valid and also deploy default values into the table in case some value is nil - texts = (type (texts == "table") and texts) or default_text_for_aura_frame + texts = (type(texts == "table") and texts) or default_text_for_aura_frame DF.table.deploy (texts, default_text_for_aura_frame) ------------- @@ -243,52 +243,52 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t if (method == 0x1) then f_auto:Show() f_manual:Hide() - f.AutomaticTrackingCheckbox:SetValue (true) - f.ManualTrackingCheckbox:SetValue (false) + f.AutomaticTrackingCheckbox:SetValue(true) + f.ManualTrackingCheckbox:SetValue(false) f.desc_label.text = texts.AUTOMATIC_DESC elseif (method == 0x2) then f_auto:Hide() f_manual:Show() - f.AutomaticTrackingCheckbox:SetValue (false) - f.ManualTrackingCheckbox:SetValue (true) + f.AutomaticTrackingCheckbox:SetValue(false) + f.ManualTrackingCheckbox:SetValue(true) f.desc_label.text = texts.MANUAL_DESC end end - local background_method_selection = CreateFrame ("frame", nil, f, "BackdropTemplate") - background_method_selection:SetHeight (82) - background_method_selection:SetPoint ("topleft", f, "topleft", 0, 0) - background_method_selection:SetPoint ("topright", f, "topright", 0, 0) + local background_method_selection = CreateFrame("frame", nil, f, "BackdropTemplate") + background_method_selection:SetHeight(82) + background_method_selection:SetPoint("topleft", f, "topleft", 0, 0) + background_method_selection:SetPoint("topright", f, "topright", 0, 0) DF:ApplyStandardBackdrop (background_method_selection) - local tracking_method_label = self:CreateLabel (background_method_selection, texts.METHOD, 12, "orange") - tracking_method_label:SetPoint ("topleft", background_method_selection, "topleft", 6, -4) + local tracking_method_label = self:CreateLabel(background_method_selection, texts.METHOD, 12, "orange") + tracking_method_label:SetPoint("topleft", background_method_selection, "topleft", 6, -4) - f.desc_label = self:CreateLabel (background_method_selection, "", 10, "silver") - f.desc_label:SetPoint ("left", background_method_selection, "left", 130, 0) + f.desc_label = self:CreateLabel(background_method_selection, "", 10, "silver") + f.desc_label:SetPoint("left", background_method_selection, "left", 130, 0) f.desc_label:SetJustifyV ("top") local automatic_tracking_checkbox = DF:CreateSwitch (background_method_selection, on_switch_tracking_method, f.db.aura_tracker.track_method == 0x1, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, DF:GetTemplate ("switch", "OPTIONS_CHECKBOX_BRIGHT_TEMPLATE")) automatic_tracking_checkbox.Method = 0x1 automatic_tracking_checkbox:SetAsCheckBox() - automatic_tracking_checkbox:SetSize (24, 24) + automatic_tracking_checkbox:SetSize(24, 24) f.AutomaticTrackingCheckbox = automatic_tracking_checkbox - local automatic_tracking_label = DF:CreateLabel (background_method_selection, "Automatic") - automatic_tracking_label:SetPoint ("left", automatic_tracking_checkbox, "right", 2, 0) + local automatic_tracking_label = DF:CreateLabel(background_method_selection, "Automatic") + automatic_tracking_label:SetPoint("left", automatic_tracking_checkbox, "right", 2, 0) local manual_tracking_checkbox = DF:CreateSwitch (background_method_selection, on_switch_tracking_method, f.db.aura_tracker.track_method == 0x2, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, DF:GetTemplate ("switch", "OPTIONS_CHECKBOX_BRIGHT_TEMPLATE")) manual_tracking_checkbox.Method = 0x2 manual_tracking_checkbox:SetAsCheckBox() - manual_tracking_checkbox:SetSize (24, 24) + manual_tracking_checkbox:SetSize(24, 24) f.ManualTrackingCheckbox = manual_tracking_checkbox - local manual_tracking_label = DF:CreateLabel (background_method_selection, "Manual") - manual_tracking_label:SetPoint ("left", manual_tracking_checkbox, "right", 2, 0) + local manual_tracking_label = DF:CreateLabel(background_method_selection, "Manual") + manual_tracking_label:SetPoint("left", manual_tracking_checkbox, "right", 2, 0) - automatic_tracking_checkbox:SetPoint ("topleft", tracking_method_label, "bottomleft", 0, -6) - manual_tracking_checkbox:SetPoint ("topleft", automatic_tracking_checkbox, "bottomleft", 0, -6) + automatic_tracking_checkbox:SetPoint("topleft", tracking_method_label, "bottomleft", 0, -6) + manual_tracking_checkbox:SetPoint("topleft", automatic_tracking_checkbox, "bottomleft", 0, -6) -------- anchors points @@ -342,30 +342,30 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t local textEntryWidth = 120 --create the background - local background_add_blacklist = CreateFrame ("frame", nil, f_auto, "BackdropTemplate") - background_add_blacklist:SetSize (textEntryWidth + 10, 135) + local background_add_blacklist = CreateFrame("frame", nil, f_auto, "BackdropTemplate") + background_add_blacklist:SetSize(textEntryWidth + 10, 135) DF:ApplyStandardBackdrop (background_add_blacklist) background_add_blacklist.__background:SetVertexColor (0.47, 0.27, 0.27) - local background_add_tracklist = CreateFrame ("frame", nil, f_auto, "BackdropTemplate") - background_add_tracklist:SetSize (textEntryWidth + 10, 135) + local background_add_tracklist = CreateFrame("frame", nil, f_auto, "BackdropTemplate") + background_add_tracklist:SetSize(textEntryWidth + 10, 135) DF:ApplyStandardBackdrop (background_add_tracklist) background_add_tracklist.__background:SetVertexColor (0.27, 0.27, 0.47) --black list --create labels - local buff_blacklist_label = self:CreateLabel (background_add_blacklist, texts.MANUAL_ADD_BLACKLIST_BUFF, DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")) - local debuff_blacklist_label = self:CreateLabel (background_add_blacklist, texts.MANUAL_ADD_BLACKLIST_DEBUFF, DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")) + local buff_blacklist_label = self:CreateLabel(background_add_blacklist, texts.MANUAL_ADD_BLACKLIST_BUFF, DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")) + local debuff_blacklist_label = self:CreateLabel(background_add_blacklist, texts.MANUAL_ADD_BLACKLIST_DEBUFF, DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")) local buff_name_blacklist_entry = self:CreateTextEntry (background_add_blacklist, function()end, textEntryWidth, 20, "AddBuffBlacklistTextBox", _, _, options_dropdown_template) - buff_name_blacklist_entry:SetHook ("OnEditFocusGained", load_all_spells) - buff_name_blacklist_entry:SetJustifyH ("left") + buff_name_blacklist_entry:SetHook("OnEditFocusGained", load_all_spells) + buff_name_blacklist_entry:SetJustifyH("left") buff_name_blacklist_entry.tooltip = "Enter the buff name using lower case letters." f_auto.AddBuffBlacklistTextBox = buff_name_blacklist_entry local debuff_name_blacklist_entry = self:CreateTextEntry (background_add_blacklist, function()end, textEntryWidth, 20, "AddDebuffBlacklistTextBox", _, _, options_dropdown_template) - debuff_name_blacklist_entry:SetHook ("OnEditFocusGained", load_all_spells) - debuff_name_blacklist_entry:SetJustifyH ("left") + debuff_name_blacklist_entry:SetHook("OnEditFocusGained", load_all_spells) + debuff_name_blacklist_entry:SetJustifyH("left") debuff_name_blacklist_entry.tooltip = "Enter the debuff name using lower case letters." f_auto.AddDebuffBlacklistTextBox = debuff_name_blacklist_entry @@ -413,7 +413,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t local add_blacklist_buff_button = self:CreateButton (background_add_blacklist, function() local text = buff_name_blacklist_entry.text - buff_name_blacklist_entry:SetText ("") + buff_name_blacklist_entry:SetText("") buff_name_blacklist_entry:ClearFocus() if (text ~= "") then @@ -440,7 +440,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t local add_blacklist_buff_button_id = self:CreateButton (background_add_blacklist, function() local text = buff_name_blacklist_entry.text - buff_name_blacklist_entry:SetText ("") + buff_name_blacklist_entry:SetText("") buff_name_blacklist_entry:ClearFocus() if (text ~= "") then @@ -471,7 +471,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t local add_blacklist_debuff_button = self:CreateButton (background_add_blacklist, function() local text = debuff_name_blacklist_entry.text - debuff_name_blacklist_entry:SetText ("") + debuff_name_blacklist_entry:SetText("") debuff_name_blacklist_entry:ClearFocus() if (text ~= "") then @@ -497,7 +497,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t local add_blacklist_debuff_button_id = self:CreateButton (background_add_blacklist, function() local text = debuff_name_blacklist_entry.text - debuff_name_blacklist_entry:SetText ("") + debuff_name_blacklist_entry:SetText("") debuff_name_blacklist_entry:ClearFocus() if (text ~= "") then @@ -527,24 +527,24 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t --track list - local buff_tracklist_label = self:CreateLabel (background_add_tracklist, texts.MANUAL_ADD_TRACKLIST_BUFF, DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")) - local debuff_tracklist_label = self:CreateLabel (background_add_tracklist, texts.MANUAL_ADD_TRACKLIST_DEBUFF, DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")) + local buff_tracklist_label = self:CreateLabel(background_add_tracklist, texts.MANUAL_ADD_TRACKLIST_BUFF, DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")) + local debuff_tracklist_label = self:CreateLabel(background_add_tracklist, texts.MANUAL_ADD_TRACKLIST_DEBUFF, DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")) local buff_name_tracklist_entry = self:CreateTextEntry (background_add_tracklist, function()end, textEntryWidth, 20, "AddBuffTracklistTextBox", _, _, options_dropdown_template) - buff_name_tracklist_entry:SetHook ("OnEditFocusGained", load_all_spells) - buff_name_tracklist_entry:SetJustifyH ("left") + buff_name_tracklist_entry:SetHook("OnEditFocusGained", load_all_spells) + buff_name_tracklist_entry:SetJustifyH("left") buff_name_tracklist_entry.tooltip = "Enter the buff name using lower case letters." f_auto.AddBuffTracklistTextBox = buff_name_tracklist_entry local debuff_name_tracklist_entry = self:CreateTextEntry (background_add_tracklist, function()end, textEntryWidth, 20, "AddDebuffTracklistTextBox", _, _, options_dropdown_template) - debuff_name_tracklist_entry:SetHook ("OnEditFocusGained", load_all_spells) - debuff_name_tracklist_entry:SetJustifyH ("left") + debuff_name_tracklist_entry:SetHook("OnEditFocusGained", load_all_spells) + debuff_name_tracklist_entry:SetJustifyH("left") debuff_name_tracklist_entry.tooltip = "Enter the debuff name using lower case letters." f_auto.AddDebuffTracklistTextBox = debuff_name_tracklist_entry local add_tracklist_debuff_button = self:CreateButton (background_add_tracklist, function() local text = debuff_name_tracklist_entry.text - debuff_name_tracklist_entry:SetText ("") + debuff_name_tracklist_entry:SetText("") debuff_name_tracklist_entry:ClearFocus() if (text ~= "") then @@ -570,7 +570,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t local add_tracklist_debuff_button_id = self:CreateButton (background_add_tracklist, function() local text = debuff_name_tracklist_entry.text - debuff_name_tracklist_entry:SetText ("") + debuff_name_tracklist_entry:SetText("") debuff_name_tracklist_entry:ClearFocus() if (text ~= "") then @@ -599,7 +599,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t local add_tracklist_buff_button = self:CreateButton (background_add_tracklist, function() local text = buff_name_tracklist_entry.text - buff_name_tracklist_entry:SetText ("") + buff_name_tracklist_entry:SetText("") buff_name_tracklist_entry:ClearFocus() if (text ~= "") then @@ -627,7 +627,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t local add_tracklist_buff_button_id = self:CreateButton (background_add_tracklist, function() local text = buff_name_tracklist_entry.text - buff_name_tracklist_entry:SetText ("") + buff_name_tracklist_entry:SetText("") buff_name_tracklist_entry:ClearFocus() if (text ~= "") then @@ -657,33 +657,33 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t end, textEntryWidth/2 -3, 20, "By ID", nil, nil, nil, nil, nil, nil, DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE"), DF:GetTemplate ("font", options.button_text_template)) --anchors: - background_add_blacklist:SetPoint ("topleft", f_auto, "topleft", 0, y) - background_add_tracklist:SetPoint ("topleft", background_add_blacklist, "bottomleft", 0, -10) + background_add_blacklist:SetPoint("topleft", f_auto, "topleft", 0, y) + background_add_tracklist:SetPoint("topleft", background_add_blacklist, "bottomleft", 0, -10) --debuff blacklist - debuff_name_blacklist_entry:SetPoint ("topleft", background_add_blacklist, "topleft", 5, -20) - debuff_blacklist_label:SetPoint ("bottomleft", debuff_name_blacklist_entry, "topleft", 0, 2) - add_blacklist_debuff_button:SetPoint ("topleft", debuff_name_blacklist_entry, "bottomleft", 0, -2) - add_blacklist_debuff_button_id:SetPoint ("left", add_blacklist_debuff_button, "right", 1, 0) + debuff_name_blacklist_entry:SetPoint("topleft", background_add_blacklist, "topleft", 5, -20) + debuff_blacklist_label:SetPoint("bottomleft", debuff_name_blacklist_entry, "topleft", 0, 2) + add_blacklist_debuff_button:SetPoint("topleft", debuff_name_blacklist_entry, "bottomleft", 0, -2) + add_blacklist_debuff_button_id:SetPoint("left", add_blacklist_debuff_button, "right", 1, 0) --buff blacklist - buff_blacklist_label:SetPoint ("topleft", add_blacklist_debuff_button.widget, "bottomleft", 0, -10) - buff_name_blacklist_entry:SetPoint ("topleft", buff_blacklist_label, "bottomleft", 0, -2) - add_blacklist_buff_button:SetPoint ("topleft", buff_name_blacklist_entry, "bottomleft", 0, -2) - add_blacklist_buff_button_id:SetPoint ("left", add_blacklist_buff_button, "right", 1, 0) + buff_blacklist_label:SetPoint("topleft", add_blacklist_debuff_button.widget, "bottomleft", 0, -10) + buff_name_blacklist_entry:SetPoint("topleft", buff_blacklist_label, "bottomleft", 0, -2) + add_blacklist_buff_button:SetPoint("topleft", buff_name_blacklist_entry, "bottomleft", 0, -2) + add_blacklist_buff_button_id:SetPoint("left", add_blacklist_buff_button, "right", 1, 0) --debuff tracklist - debuff_name_tracklist_entry:SetPoint ("topleft", background_add_tracklist, "topleft", 5, -20) - debuff_tracklist_label:SetPoint ("bottomleft", debuff_name_tracklist_entry, "topleft", 0, 2) - add_tracklist_debuff_button:SetPoint ("topleft", debuff_name_tracklist_entry, "bottomleft", 0, -2) - add_tracklist_debuff_button_id:SetPoint ("left", add_tracklist_debuff_button, "right", 1, 0) + debuff_name_tracklist_entry:SetPoint("topleft", background_add_tracklist, "topleft", 5, -20) + debuff_tracklist_label:SetPoint("bottomleft", debuff_name_tracklist_entry, "topleft", 0, 2) + add_tracklist_debuff_button:SetPoint("topleft", debuff_name_tracklist_entry, "bottomleft", 0, -2) + add_tracklist_debuff_button_id:SetPoint("left", add_tracklist_debuff_button, "right", 1, 0) --buff tracklist - buff_tracklist_label:SetPoint ("topleft", add_tracklist_debuff_button.widget, "bottomleft", 0, -10) - buff_name_tracklist_entry:SetPoint ("topleft", buff_tracklist_label, "bottomleft", 0, -2) - add_tracklist_buff_button:SetPoint ("topleft", buff_name_tracklist_entry, "bottomleft", 0, -2) - add_tracklist_buff_button_id:SetPoint ("left", add_tracklist_buff_button, "right", 1, 0) + buff_tracklist_label:SetPoint("topleft", add_tracklist_debuff_button.widget, "bottomleft", 0, -10) + buff_name_tracklist_entry:SetPoint("topleft", buff_tracklist_label, "bottomleft", 0, -2) + add_tracklist_buff_button:SetPoint("topleft", buff_name_tracklist_entry, "bottomleft", 0, -2) + add_tracklist_buff_button_id:SetPoint("left", add_tracklist_buff_button, "right", 1, 0) local ALL_BUFFS = {} local ALL_DEBUFFS = {} @@ -699,7 +699,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t if not flag then GameCooltip2:Preset (2) GameCooltip2:SetOwner (self, "left", "right", 2, 0) - GameCooltip2:SetOption ("TextSize", 10) + GameCooltip2:SetOption("TextSize", 10) local spellName, _, spellIcon = GetSpellInfo(value) if (spellName) then @@ -721,9 +721,9 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t if (spellsWithSameName) then GameCooltip2:Preset (2) GameCooltip2:SetOwner (self, "left", "right", 2, 0) - GameCooltip2:SetOption ("TextSize", 10) + GameCooltip2:SetOption("TextSize", 10) - for i, spellID in ipairs (spellsWithSameName) do + for i, spellID in ipairs(spellsWithSameName) do local spellName, _, spellIcon = GetSpellInfo(spellID) if (spellName) then GameCooltip2:AddLine (spellName .. " (" .. spellID .. ")") @@ -766,18 +766,18 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t line.Flag = flag if flag then - line.name:SetText (spellName) + line.name:SetText(spellName) else - line.name:SetText (spellName .. " (" .. spellID .. ")") + line.name:SetText(spellName .. " (" .. spellID .. ")") end - line.icon:SetTexture (spellIcon) + line.icon:SetTexture(spellIcon) line.icon:SetTexCoord (.1, .9, .1, .9) end end end local lineOnEnter = function(self) - self:SetBackdropColor (unpack (backdropColor_OnEnter)) + self:SetBackdropColor(unpack (backdropColor_OnEnter)) --GameTooltip:SetOwner (self, "ANCHOR_CURSOR") --GameTooltip:SetSpellByID(self.SpellID) @@ -786,7 +786,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t end local lineOnLeave = function(self) - self:SetBackdropColor (unpack (backdropColor)) + self:SetBackdropColor(unpack (backdropColor)) --GameTooltip:Hide() end @@ -801,31 +801,31 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t end 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) - line:SetScript ("OnEnter", autoTrackList_LineOnEnter) + local line = CreateFrame("button", "$parentLine" .. index, self, "BackdropTemplate") + line:SetPoint("topleft", self, "topleft", 1, - ((index - 1) * (lineHeight + 1)) - 1) + line:SetSize(scrollWidth - 2, lineHeight) + line:SetScript("OnEnter", autoTrackList_LineOnEnter) line:HookScript ("OnEnter", lineOnEnter) - line:SetScript ("OnLeave", autoTrackList_LineOnLeave) + line:SetScript("OnLeave", autoTrackList_LineOnLeave) line:HookScript ("OnLeave", lineOnLeave) - line:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - line:SetBackdropColor (unpack (backdropColor)) + line:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + line:SetBackdropColor(unpack (backdropColor)) - local icon = line:CreateTexture ("$parentIcon", "overlay") - icon:SetSize (lineHeight - 2, lineHeight - 2) + local icon = line:CreateTexture("$parentIcon", "overlay") + icon:SetSize(lineHeight - 2, lineHeight - 2) local name = line:CreateFontString ("$parentName", "overlay", "GameFontNormal") DF:SetFontSize (name, 10) - local remove_button = CreateFrame ("button", "$parentRemoveButton", line, "UIPanelCloseButton") - remove_button:SetSize (16, 16) - remove_button:SetScript ("OnClick", onRemoveClick) - remove_button:SetPoint ("topright", line, "topright") + local remove_button = CreateFrame("button", "$parentRemoveButton", line, "UIPanelCloseButton") + remove_button:SetSize(16, 16) + remove_button:SetScript("OnClick", onRemoveClick) + remove_button:SetPoint("topright", line, "topright") remove_button:GetNormalTexture():SetDesaturated (true) - icon:SetPoint ("left", line, "left", 2, 0) - name:SetPoint ("left", icon, "right", 3, 0) + icon:SetPoint("left", line, "left", 2, 0) + name:SetPoint("left", icon, "right", 3, 0) line.icon = icon line.name = name @@ -863,9 +863,9 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t self:DoRefresh() end - local title = DF:CreateLabel (parent, title) + local title = DF:CreateLabel(parent, title) title.textcolor = "silver" - title:SetPoint ("bottomleft", scroll, "topleft", 0, 2) + title:SetPoint("bottomleft", scroll, "topleft", 0, 2) for i = 1, lineAmount do scroll:CreateLine (createLineFunc) @@ -900,17 +900,17 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t local xLocation = 140 scrollWidth = scrollWidth + 20 - debuff_ignored:SetPoint ("topleft", f_auto, "topleft", 0 + xLocation, y) - buff_ignored:SetPoint ("topleft", f_auto, "topleft", 8 + scrollWidth + xLocation, y) - debuff_tracked:SetPoint ("topleft", f_auto, "topleft", 16 + (scrollWidth * 2) + xLocation, y) - buff_tracked:SetPoint ("topleft", f_auto, "topleft", 24 + (scrollWidth * 3) + xLocation, y) + debuff_ignored:SetPoint("topleft", f_auto, "topleft", 0 + xLocation, y) + buff_ignored:SetPoint("topleft", f_auto, "topleft", 8 + scrollWidth + xLocation, y) + debuff_tracked:SetPoint("topleft", f_auto, "topleft", 16 + (scrollWidth * 2) + xLocation, y) + buff_tracked:SetPoint("topleft", f_auto, "topleft", 24 + (scrollWidth * 3) + xLocation, y) f.buff_ignored = buff_ignored f.debuff_ignored = debuff_ignored f.buff_tracked = buff_tracked f.debuff_tracked = debuff_tracked - f_auto:SetScript ("OnShow", function() + f_auto:SetScript("OnShow", function() for i = 1, BUFF_MAX_DISPLAY do local name, texture, count, debuffType, duration, expirationTime, caster, _, nameplateShowPersonal, spellId, _, _, _, nameplateShowAll = UnitAura ("player", i, "HELPFUL") if (name) then @@ -928,7 +928,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t debuff_ignored:DoRefresh() end) - f_auto:SetScript ("OnHide", function() + f_auto:SetScript("OnHide", function() -- end) @@ -942,7 +942,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t -------manual - --> build the two aura scrolls for buff and debuff + --build the two aura scrolls for buff and debuff local scroll_width = width local scroll_height = height @@ -953,7 +953,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t local backdrop_color_on_enter = {.8, .8, .8, 0.4} local line_onenter = function(self) - self:SetBackdropColor (unpack (backdrop_color_on_enter)) + self:SetBackdropColor(unpack (backdrop_color_on_enter)) local spellid = select (7, GetSpellInfo(self.value)) if (spellid) then GameTooltip:SetOwner (self, "ANCHOR_CURSOR") @@ -964,7 +964,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t end local line_onleave = function(self) - self:SetBackdropColor (unpack (backdrop_color)) + self:SetBackdropColor(unpack (backdrop_color)) GameTooltip:Hide() end @@ -983,28 +983,28 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t end 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) - line:SetScript ("OnEnter", line_onenter) - line:SetScript ("OnLeave", line_onleave) + 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) + line:SetScript("OnEnter", line_onenter) + line:SetScript("OnLeave", line_onleave) - line:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - line:SetBackdropColor (unpack (backdrop_color)) + line:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + line:SetBackdropColor(unpack (backdrop_color)) - local icon = line:CreateTexture ("$parentIcon", "overlay") - icon:SetSize (scroll_line_height - 2, scroll_line_height - 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 remove_button = CreateFrame ("button", "$parentRemoveButton", line, "UIPanelCloseButton") - remove_button:SetSize (16, 16) - remove_button:SetScript ("OnClick", onclick_remove_button) - remove_button:SetPoint ("topright", line, "topright") + local remove_button = CreateFrame("button", "$parentRemoveButton", line, "UIPanelCloseButton") + remove_button:SetSize(16, 16) + remove_button:SetScript("OnClick", onclick_remove_button) + remove_button:SetPoint("topright", line, "topright") remove_button:GetNormalTexture():SetDesaturated (true) - icon:SetPoint ("left", line, "left", 2, 0) - name:SetPoint ("left", icon, "right", 2, 0) + icon:SetPoint("left", line, "left", 2, 0) + name:SetPoint("left", icon, "right", 2, 0) line.icon = icon line.name = name @@ -1022,19 +1022,19 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t local name, _, icon = GetSpellInfo(aura) line.value = aura if (name) then - line.name:SetText (name) - line.icon:SetTexture (icon) + line.name:SetText(name) + line.icon:SetTexture(icon) line.icon:SetTexCoord (.1, .9, .1, .9) else - line.name:SetText (aura) - line.icon:SetTexture ([[Interface\InventoryItems\WoWUnknownItem01]]) + line.name:SetText(aura) + line.icon:SetTexture([[Interface\InventoryItems\WoWUnknownItem01]]) end end end end 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) + buffs_added:SetPoint("topleft", f_manual, "topleft", 0, y) DF:ReskinSlider(buffs_added) for i = 1, scroll_lines do @@ -1042,7 +1042,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t end 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) + debuffs_added:SetPoint("topleft", f_manual, "topleft", width+30, y) DF:ReskinSlider(debuffs_added) for i = 1, scroll_lines do @@ -1052,40 +1052,40 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t f.buffs_added = buffs_added f.debuffs_added = debuffs_added - local buffs_added_name = DF:CreateLabel (buffs_added, "Buffs", 12, "silver") + local buffs_added_name = DF:CreateLabel(buffs_added, "Buffs", 12, "silver") buffs_added_name:SetTemplate (DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")) - buffs_added_name:SetPoint ("bottomleft", buffs_added, "topleft", 0, 2) + buffs_added_name:SetPoint("bottomleft", buffs_added, "topleft", 0, 2) buffs_added.Title = buffs_added_name - local debuffs_added_name = DF:CreateLabel (debuffs_added, "Debuffs", 12, "silver") + local debuffs_added_name = DF:CreateLabel(debuffs_added, "Debuffs", 12, "silver") debuffs_added_name:SetTemplate (DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")) - debuffs_added_name:SetPoint ("bottomleft", debuffs_added, "topleft", 0, 2) + debuffs_added_name:SetPoint("bottomleft", debuffs_added, "topleft", 0, 2) debuffs_added.Title = debuffs_added_name - --> build the text entry to type the spellname - local new_buff_string = self:CreateLabel (f_manual, "Add Buff") - local new_debuff_string = self:CreateLabel (f_manual, "Add Debuff") + -- build the text entry to type the spellname + local new_buff_string = self:CreateLabel(f_manual, "Add Buff") + local new_debuff_string = self:CreateLabel(f_manual, "Add Debuff") local new_buff_entry = self:CreateTextEntry (f_manual, function()end, 200, 20, "NewBuffTextBox", _, _, options_dropdown_template) local new_debuff_entry = self:CreateTextEntry (f_manual, function()end, 200, 20, "NewDebuffTextBox", _, _, options_dropdown_template) - new_buff_entry:SetHook ("OnEditFocusGained", load_all_spells) - new_debuff_entry:SetHook ("OnEditFocusGained", load_all_spells) + new_buff_entry:SetHook("OnEditFocusGained", load_all_spells) + new_debuff_entry:SetHook("OnEditFocusGained", load_all_spells) new_buff_entry.tooltip = "Enter the buff name using lower case letters.\n\nYou can add several spells at once using |cFFFFFF00;|r to separate each spell name." new_debuff_entry.tooltip = "Enter the debuff name using lower case letters.\n\nYou can add several spells at once using |cFFFFFF00;|r to separate each spell name." - new_buff_entry:SetJustifyH ("left") - new_debuff_entry:SetJustifyH ("left") + new_buff_entry:SetJustifyH("left") + new_debuff_entry:SetJustifyH("left") local add_buff_button = self:CreateButton (f_manual, function() local text = new_buff_entry.text - new_buff_entry:SetText ("") + new_buff_entry:SetText("") new_buff_entry:ClearFocus() if (text ~= "") then - --> check for more than one spellname + --check for more than one spellname if (text:find (";")) then - for _, spellName in ipairs ({strsplit (";", text)}) do + for _, spellName in ipairs({strsplit (";", text)}) do spellName = self:trim (spellName) local spellID = get_spellID_from_string (spellName) @@ -1127,12 +1127,12 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t local add_debuff_button = self:CreateButton (f_manual, function() local text = new_debuff_entry.text - new_debuff_entry:SetText ("") + new_debuff_entry:SetText("") new_debuff_entry:ClearFocus() if (text ~= "") then - --> check for more than one spellname + --check for more than one spellname if (text:find (";")) then - for _, spellName in ipairs ({strsplit (";", text)}) do + for _, spellName in ipairs({strsplit (";", text)}) do spellName = self:trim (spellName) local spellID = get_spellID_from_string (spellName) @@ -1173,15 +1173,15 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t end end, 100, 20, "Add Debuff", nil, nil, nil, nil, nil, nil, DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) - local multiple_spells_label = DF:CreateLabel (buffs_added, "You can add multiple auras at once by separating them with ';'.\nExample: Fireball; Frostbolt; Flamestrike", 10, "gray") - multiple_spells_label:SetSize (350, 24) + local multiple_spells_label = DF:CreateLabel(buffs_added, "You can add multiple auras at once by separating them with ';'.\nExample: Fireball; Frostbolt; Flamestrike", 10, "gray") + multiple_spells_label:SetSize(350, 24) multiple_spells_label:SetJustifyV ("top") local export_box = self:CreateTextEntry (f_manual, function()end, 242, 20, "ExportAuraTextBox", _, _, options_dropdown_template) local export_buff_button = self:CreateButton (f_manual, function() local str = "" - for _, spellId in ipairs (f.db.aura_tracker.buff) do + for _, spellId in ipairs(f.db.aura_tracker.buff) do local spellName = GetSpellInfo(spellId) if (spellName) then str = str .. spellName .. "; " @@ -1195,7 +1195,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 + for _, spellId in ipairs(f.db.aura_tracker.debuff) do local spellName = GetSpellInfo(spellId) if (spellName) then str = str .. spellName .. "; " @@ -1208,21 +1208,21 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t end, 120, 20, "Export Debuffs", nil, nil, nil, nil, nil, nil, DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) - new_buff_entry:SetPoint ("topleft", f_manual, "topleft", 480, y) - new_buff_string:SetPoint ("bottomleft", new_buff_entry, "topleft", 0, 2) - add_buff_button:SetPoint ("left", new_buff_entry, "right", 2, 0) + new_buff_entry:SetPoint("topleft", f_manual, "topleft", 480, y) + new_buff_string:SetPoint("bottomleft", new_buff_entry, "topleft", 0, 2) + add_buff_button:SetPoint("left", new_buff_entry, "right", 2, 0) add_buff_button.tooltip = "Add the aura to be tracked.\n\nClick an aura on the list to remove it." - new_debuff_string:SetPoint ("topleft", new_buff_entry, "bottomleft", 0, -6) - new_debuff_entry:SetPoint ("topleft", new_debuff_string, "bottomleft", 0, -2) - add_debuff_button:SetPoint ("left", new_debuff_entry, "right", 2, 0) + new_debuff_string:SetPoint("topleft", new_buff_entry, "bottomleft", 0, -6) + new_debuff_entry:SetPoint("topleft", new_debuff_string, "bottomleft", 0, -2) + add_debuff_button:SetPoint("left", new_debuff_entry, "right", 2, 0) add_debuff_button.tooltip = "Add the aura to be tracked.\n\nClick an aura on the list to remove it." - multiple_spells_label:SetPoint ("topleft", new_debuff_entry, "bottomleft", 0, -6) + multiple_spells_label:SetPoint("topleft", new_debuff_entry, "bottomleft", 0, -6) - export_buff_button:SetPoint ("topleft", multiple_spells_label, "bottomleft", 0, -12) - export_debuff_button:SetPoint ("left",export_buff_button, "right", 2, 0) - export_box:SetPoint ("topleft", export_buff_button, "bottomleft", 0, -6) + export_buff_button:SetPoint("topleft", multiple_spells_label, "bottomleft", 0, -12) + export_debuff_button:SetPoint("left",export_buff_button, "right", 2, 0) + export_box:SetPoint("topleft", export_buff_button, "bottomleft", 0, -6) buffs_added:Refresh() debuffs_added:Refresh() @@ -1230,7 +1230,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t ----------------------- ---------------------------------------------- ---------------------------------------------- ----------------------- - f:SetScript ("OnShow", function() + f:SetScript("OnShow", function() buffs_added:Refresh() debuffs_added:Refresh() end) @@ -1257,7 +1257,7 @@ function DF:GetAllPlayerSpells (include_lower_case) end function DF:SetAutoCompleteWithSpells (textentry) - textentry:SetHook ("OnEditFocusGained", function() + textentry:SetHook("OnEditFocusGained", function() local playerSpells = DF:GetAllPlayerSpells (true) textentry.WordList = playerSpells end) diff --git a/Libs/DF/button.lua b/Libs/DF/button.lua index 3082208f..ae542a74 100644 --- a/Libs/DF/button.lua +++ b/Libs/DF/button.lua @@ -167,17 +167,17 @@ DF:Mixin(ButtonMetaFunctions, DF.FrameMixin) --frame width local smember_width = function(_object, _value) - return _object.button:SetWidth (_value) + return _object.button:SetWidth(_value) end --frame height local smember_height = function(_object, _value) - return _object.button:SetHeight (_value) + return _object.button:SetHeight(_value) end --text local smember_text = function(_object, _value) - return _object.button.text:SetText (_value) + return _object.button.text:SetText(_value) end --function @@ -197,7 +197,7 @@ DF:Mixin(ButtonMetaFunctions, DF.FrameMixin) --text color local smember_textcolor = function(_object, _value) - local _value1, _value2, _value3, _value4 = DF:ParseColors (_value) + local _value1, _value2, _value3, _value4 = DF:ParseColors(_value) return _object.button.text:SetTextColor (_value1, _value2, _value3, _value4) end @@ -213,24 +213,24 @@ DF:Mixin(ButtonMetaFunctions, DF.FrameMixin) --texture local smember_texture = function(_object, _value) - if (type (_value) == "table") then + if (type(_value) == "table") then local _value1, _value2, _value3, _value4 = unpack (_value) if (_value1) then - _object.button:SetNormalTexture (_value1) + _object.button:SetNormalTexture(_value1) end if (_value2) then - _object.button:SetHighlightTexture (_value2, "ADD") + _object.button:SetHighlightTexture(_value2, "ADD") end if (_value3) then - _object.button:SetPushedTexture (_value3) + _object.button:SetPushedTexture(_value3) end if (_value4) then _object.button:SetDisabledTexture (_value4) end else - _object.button:SetNormalTexture (_value) - _object.button:SetHighlightTexture (_value, "ADD") - _object.button:SetPushedTexture (_value) + _object.button:SetNormalTexture(_value) + _object.button:SetHighlightTexture(_value, "ADD") + _object.button:SetPushedTexture(_value) _object.button:SetDisabledTexture (_value) end return @@ -251,13 +251,13 @@ DF:Mixin(ButtonMetaFunctions, DF.FrameMixin) --text align local smember_textalign = function(_object, _value) if (_value == "left" or _value == "<") then - _object.button.text:SetPoint ("left", _object.button, "left", 2, 0) + _object.button.text:SetPoint("left", _object.button, "left", 2, 0) _object.capsule_textalign = "left" elseif (_value == "center" or _value == "|") then - _object.button.text:SetPoint ("center", _object.button, "center", 0, 0) + _object.button.text:SetPoint("center", _object.button, "center", 0, 0) _object.capsule_textalign = "center" elseif (_value == "right" or _value == ">") then - _object.button.text:SetPoint ("right", _object.button, "right", -2, 0) + _object.button.text:SetPoint("right", _object.button, "right", -2, 0) _object.capsule_textalign = "right" end end @@ -407,7 +407,7 @@ DF:Mixin(ButtonMetaFunctions, DF.FrameMixin) self.icon:SetPoint("left", self.widget, "left", 4 + (leftPadding or 0), 0) self.icon.leftPadding = leftPadding or 0 self.widget.text:ClearAllPoints() - self.widget.text:SetPoint ("left", self.icon, "right", textDistance or 2, 0 + (textHeight or 0)) + self.widget.text:SetPoint("left", self.icon, "right", textDistance or 2, 0 + (textHeight or 0)) end if (type(texture) == "string") then @@ -919,9 +919,9 @@ end local textWidth = buttonObject.button.text:GetStringWidth() if (textWidth > width - 15 and buttonObject.button.text:GetText() ~= "") then - if (shortMethod == false) then --> if is false, do not use auto resize + if (shortMethod == false) then --if is false, do not use auto resize --do nothing - elseif (not shortMethod) then --> if the value is omitted, use the default resize + elseif (not shortMethod) then --if the value is omitted, use the default resize local new_width = textWidth + 15 buttonObject.button:SetWidth(new_width) diff --git a/Libs/DF/cooltip.lua b/Libs/DF/cooltip.lua index ddd84325..9e38d139 100644 --- a/Libs/DF/cooltip.lua +++ b/Libs/DF/cooltip.lua @@ -296,7 +296,7 @@ function DF:CreateCoolTip() end end - --> main frame + --main frame local frame1 = GameCooltipFrame1 if (not GameCooltipFrame1) then frame1 = CreateFrame("Frame", "GameCooltipFrame1", UIParent, "BackdropTemplate") @@ -310,7 +310,7 @@ function DF:CreateCoolTip() createTooltipFrames(frame1) - --> secondary frame + --secondary frame local frame2 = GameCooltipFrame2 if (not GameCooltipFrame2) then frame2 = CreateFrame("Frame", "GameCooltipFrame2", UIParent, "BackdropTemplate") @@ -1863,13 +1863,13 @@ function DF:CreateCoolTip() if (centerY) then if (centerY + helpScreenHeight > screenHeight) then - --> out of top side + --out of top side local moveDownOffset = (centerY + helpScreenHeight) - screenHeight gameCooltip.internal_y_mod = -moveDownOffset return gameCooltip:SetMyPoint(host, 0, -moveDownOffset) elseif (centerY - helpScreenHeight < 0) then - --> out of bottom side + --out of bottom side local moveUpOffset = centerY - helpScreenHeight gameCooltip.internal_y_mod = moveUpOffset * -1 return gameCooltip:SetMyPoint(host, 0, moveUpOffset * -1) diff --git a/Libs/DF/dropdown.lua b/Libs/DF/dropdown.lua index 3395fc0c..f056fabd 100644 --- a/Libs/DF/dropdown.lua +++ b/Libs/DF/dropdown.lua @@ -48,7 +48,7 @@ DF:Mixin(DropDownMetaFunctions, DF.FrameMixin) end ------------------------------------------------------------------------------------------------------------ ---> members +--members --selected value local gmember_value = function(object) @@ -910,7 +910,7 @@ function DF:BuildDropDownFontList(onClick, icon, iconTexcoord, iconSize) end ------------------------------------------------------------------------------------------------------------ ---> template +--template function DropDownMetaFunctions:SetTemplate(template) self.template = template @@ -991,7 +991,7 @@ function DropDownMetaFunctions:RefreshDropIcon() end ------------------------------------------------------------------------------------------------------------ ---> object constructor +--object constructor function DF:CreateDropDown(parent, func, default, width, height, member, name, template) return DF:NewDropDown(parent, parent, name, member, width, height, func, default, template) @@ -1150,11 +1150,11 @@ function DF:CreateNewDropdownFrame(parent, name) newDropdownFrame.text = text local arrowHightlight = newDropdownFrame:CreateTexture("$parent_ArrowTexture2", "OVERLAY", nil, 2) - arrowHightlight:SetPoint ("right", newDropdownFrame, "right", 5, -1) - arrowHightlight:SetBlendMode ("ADD") - arrowHightlight:SetTexture ([[Interface\Buttons\UI-ScrollBar-ScrollDownButton-Highlight]]) + arrowHightlight:SetPoint("right", newDropdownFrame, "right", 5, -1) + arrowHightlight:SetBlendMode("ADD") + arrowHightlight:SetTexture([[Interface\Buttons\UI-ScrollBar-ScrollDownButton-Highlight]]) arrowHightlight:Hide() - arrowHightlight:SetSize (32, 28) + arrowHightlight:SetSize(32, 28) newDropdownFrame.arrowTexture2 = arrowHightlight local arrowTexture = newDropdownFrame:CreateTexture("$parent_ArrowTexture", "OVERLAY", nil, 1) @@ -1190,7 +1190,7 @@ function DF:CreateNewDropdownFrame(parent, name) child:SetSize(150, 150) child:SetPoint("topleft", scroll, "topleft", 0, 0) child:SetBackdrop(childBackdrop) - child:SetBackdropColor (0, 0, 0, 1) + child:SetBackdropColor(0, 0, 0, 1) local backgroundTexture = child:CreateTexture(nil, "background") backgroundTexture:SetAllPoints() diff --git a/Libs/DF/fw.lua b/Libs/DF/fw.lua index b118a3be..a16324e0 100644 --- a/Libs/DF/fw.lua +++ b/Libs/DF/fw.lua @@ -488,7 +488,7 @@ function DF.table.duplicate(t1, t2) return t1 end ---> copy from table2 to table1 overwriting values +--copy from table2 to table1 overwriting values function DF.table.copy(t1, t2) for key, value in pairs(t2) do if (key ~= "__index" and key ~= "__newindex") then @@ -503,7 +503,7 @@ function DF.table.copy(t1, t2) return t1 end ---> copy from table2 to table1 overwriting values but do not copy data that cannot be compressed +--copy from table2 to table1 overwriting values but do not copy data that cannot be compressed function DF.table.copytocompress(t1, t2) for key, value in pairs(t2) do if (key ~= "__index" and type(value) ~= "function") then @@ -528,7 +528,7 @@ function DF.table.append(t1, t2) return t1 end ---> copy values that does exist on table2 but not on table1 +--copy values that does exist on table2 but not on table1 function DF.table.deploy(t1, t2) for key, value in pairs (t2) do if (type(value) == "table") then @@ -731,13 +731,13 @@ function DF:SetFontFace(fontString, fontface) local _, size, flags = fontString:GetFont() fontString:SetFont(fontface, size, flags) end -function DF:SetFontColor (fontString, r, g, b, a) - r, g, b, a = DF:ParseColors (r, g, b, a) +function DF:SetFontColor(fontString, r, g, b, a) + r, g, b, a = DF:ParseColors(r, g, b, a) fontString:SetTextColor (r, g, b, a) end function DF:SetFontShadow (fontString, r, g, b, a, x, y) - r, g, b, a = DF:ParseColors (r, g, b, a) + r, g, b, a = DF:ParseColors(r, g, b, a) fontString:SetShadowColor (r, g, b, a) local offSetX, offSetY = fontString:GetShadowOffset() @@ -907,7 +907,7 @@ function DF:TruncateText(fontString, maxWidth) end text = DF:CleanTruncateUTF8String(text) - fontString:SetText (text) + fontString:SetText(text) end function DF:CleanTruncateUTF8String(text) @@ -1351,7 +1351,7 @@ end end ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> menus +--menus --get the text for the widget name and description from the language system local parseWidgetNameAndDesc = function(languageTable, namePhraseId, descPhraseId, widgetName, widgetDesc) local returnedName = widgetName @@ -1579,7 +1579,7 @@ end label._get = widgetTable.get label.widget_type = "label" label:ClearAllPoints() - label:SetPoint (currentXOffset, currentYOffset) + label:SetPoint(currentXOffset, currentYOffset) if (widgetTable.id) then parent.widgetids [widgetTable.id] = label @@ -1668,8 +1668,8 @@ end switch.hasLabel:ClearAllPoints() if (widgetTable.boxfirst or useBoxFirstOnAllWidgets) then - switch:SetPoint (currentXOffset, currentYOffset) - switch.hasLabel:SetPoint ("left", switch, "right", 2) + switch:SetPoint(currentXOffset, currentYOffset) + switch.hasLabel:SetPoint("left", switch, "right", 2) local nextWidgetTable = menuOptions[index+1] if (nextWidgetTable) then @@ -1678,8 +1678,8 @@ end end end else - switch.hasLabel:SetPoint (currentXOffset, currentYOffset) - switch:SetPoint ("left", switch.hasLabel, "right", 2) + switch.hasLabel:SetPoint(currentXOffset, currentYOffset) + switch:SetPoint("left", switch.hasLabel, "right", 2) end if (widgetTable.id) then @@ -2404,13 +2404,13 @@ end in_combat_background:SetColorTexture (.6, 0, 0, .1) in_combat_background:Hide() - local in_combat_label = Plater:CreateLabel (frame, "you are in combat", 24, "silver") - in_combat_label:SetPoint ("right", in_combat_background, "right", -10, 0) + local in_combat_label = Plater:CreateLabel(frame, "you are in combat", 24, "silver") + in_combat_label:SetPoint("right", in_combat_background, "right", -10, 0) in_combat_label:Hide() 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 +2424,7 @@ end end ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> tutorials +--tutorials function DF:ShowTutorialAlertFrame (maintext, desctext, clickfunc) @@ -2432,13 +2432,13 @@ end if (not TutorialAlertFrame) then - TutorialAlertFrame = CreateFrame ("frame", "DetailsFrameworkAlertFrame", UIParent, "MicroButtonAlertTemplate") + TutorialAlertFrame = CreateFrame("frame", "DetailsFrameworkAlertFrame", UIParent, "MicroButtonAlertTemplate") TutorialAlertFrame.isFirst = true - TutorialAlertFrame:SetPoint ("left", UIParent, "left", -20, 100) + TutorialAlertFrame:SetPoint("left", UIParent, "left", -20, 100) 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 @@ -2457,21 +2457,21 @@ end end local refresh_options = function(self) - for _, widget in ipairs (self.widget_list) do + for _, widget in ipairs(self.widget_list) do if (widget._get) then if (widget.widget_type == "label") then if (widget._get()) then - widget:SetText (widget._get()) + widget:SetText(widget._get()) end elseif (widget.widget_type == "select") then widget:Select (widget._get()) elseif (widget.widget_type == "toggle" or widget.widget_type == "range") then - widget:SetValue (widget._get()) + widget:SetValue(widget._get()) elseif (widget.widget_type == "textentry") then - widget:SetText (widget._get()) + widget:SetText(widget._get()) elseif (widget.widget_type == "color") then local default_value, g, b, a = widget._get() - if (type (default_value) == "table") then + if (type(default_value) == "table") then widget:SetColor (unpack (default_value)) else widget:SetColor (default_value, g, b, a) @@ -2517,13 +2517,13 @@ end template = template or 1 if (template == 2) then - local options_frame = CreateFrame ("frame", name, UIParent, "ButtonFrameTemplate") + local options_frame = CreateFrame("frame", name, UIParent, "ButtonFrameTemplate") tinsert (UISpecialFrames, name) - options_frame:SetSize (500, 200) + options_frame:SetSize(500, 200) options_frame.RefreshOptions = refresh_options options_frame.widget_list = {} - options_frame:SetScript ("OnMouseDown", function(self, button) + options_frame:SetScript("OnMouseDown", function(self, button) if (button == "RightButton") then if (self.moving) then self.moving = false @@ -2535,7 +2535,7 @@ end self:StartMoving() end end) - options_frame:SetScript ("OnMouseUp", function(self) + options_frame:SetScript("OnMouseUp", function(self) if (self.moving) then self.moving = false self:StopMovingOrSizing() @@ -2549,21 +2549,21 @@ end options_frame:Hide() - options_frame:SetPoint ("center", UIParent, "center") - options_frame.TitleText:SetText (title) --10.0 fuck - --options_frame.portrait:SetTexture ([[Interface\CHARACTERFRAME\TEMPORARYPORTRAIT-FEMALE-BLOODELF]]) + options_frame:SetPoint("center", UIParent, "center") + options_frame.TitleText:SetText(title) --10.0 fuck + --options_frame.portrait:SetTexture([[Interface\CHARACTERFRAME\TEMPORARYPORTRAIT-FEMALE-BLOODELF]]) return options_frame elseif (template == 1) then - local options_frame = CreateFrame ("frame", name, UIParent) + local options_frame = CreateFrame("frame", name, UIParent) tinsert (UISpecialFrames, name) - options_frame:SetSize (500, 200) + options_frame:SetSize(500, 200) options_frame.RefreshOptions = refresh_options options_frame.widget_list = {} - options_frame:SetScript ("OnMouseDown", function(self, button) + options_frame:SetScript("OnMouseDown", function(self, button) if (button == "RightButton") then if (self.moving) then self.moving = false @@ -2575,7 +2575,7 @@ end self:StartMoving() end end) - options_frame:SetScript ("OnMouseUp", function(self) + options_frame:SetScript("OnMouseUp", function(self) if (self.moving) then self.moving = false self:StopMovingOrSizing() @@ -2589,29 +2589,29 @@ end options_frame:Hide() - options_frame:SetPoint ("center", UIParent, "center") + options_frame:SetPoint("center", UIParent, "center") - options_frame:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, + options_frame:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, insets = {left = 1, right = 1, top = 1, bottom = 1}}) - options_frame:SetBackdropColor (0, 0, 0, .7) + options_frame:SetBackdropColor(0, 0, 0, .7) - local texturetitle = options_frame:CreateTexture (nil, "artwork") - texturetitle:SetTexture ([[Interface\CURSOR\Interact]]) + local texturetitle = options_frame:CreateTexture(nil, "artwork") + texturetitle:SetTexture([[Interface\CURSOR\Interact]]) texturetitle:SetTexCoord (0, 1, 0, 1) texturetitle:SetVertexColor (1, 1, 1, 1) - texturetitle:SetPoint ("topleft", options_frame, "topleft", 2, -3) - texturetitle:SetWidth (36) - texturetitle:SetHeight (36) + texturetitle:SetPoint("topleft", options_frame, "topleft", 2, -3) + texturetitle:SetWidth(36) + texturetitle:SetHeight(36) - local title = DF:NewLabel (options_frame, nil, "$parentTitle", nil, title, nil, 20, "yellow") - title:SetPoint ("left", texturetitle, "right", 2, -1) + local title = DF:NewLabel(options_frame, nil, "$parentTitle", nil, title, nil, 20, "yellow") + title:SetPoint("left", texturetitle, "right", 2, -1) DF:SetFontOutline (title, true) - local c = CreateFrame ("Button", nil, options_frame, "UIPanelCloseButton") - c:SetWidth (32) - c:SetHeight (32) - c:SetPoint ("TOPRIGHT", options_frame, "TOPRIGHT", -3, -3) + local c = CreateFrame("Button", nil, options_frame, "UIPanelCloseButton") + c:SetWidth(32) + c:SetHeight(32) + c:SetPoint("TOPRIGHT", options_frame, "TOPRIGHT", -3, -3) c:SetFrameLevel (options_frame:GetFrameLevel()+1) return options_frame @@ -2619,7 +2619,7 @@ end end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> ~templates +--~templates --fonts DF.font_templates = DF.font_templates or {} @@ -2827,7 +2827,7 @@ function DF.GetParentName (frame) end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> widget scripts and hooks +--widget scripts and hooks function DF:RunHooksForWidget (event, ...) local hooks = self.HookList [event] @@ -2837,7 +2837,7 @@ function DF:RunHooksForWidget (event, ...) return end - for i, func in ipairs (hooks) do + for i, func in ipairs(hooks) do local success, canInterrupt = pcall (func, ...) if (not success) then error ("Details! Framework: " .. event .. " hook for " .. self:GetName() .. ": " .. canInterrupt) @@ -2847,9 +2847,9 @@ function DF:RunHooksForWidget (event, ...) end end -function DF:SetHook (hookType, func) +function DF:SetHook(hookType, func) if (self.HookList [hookType]) then - if (type (func) == "function") then + if (type(func) == "function") then local isRemoval = false for i = #self.HookList [hookType], 1, -1 do if (self.HookList [hookType] [i] == func) then @@ -2876,7 +2876,7 @@ end function DF:HasHook (hookType, func) if (self.HookList [hookType]) then - if (type (func) == "function") then + if (type(func) == "function") then for i = #self.HookList [hookType], 1, -1 do if (self.HookList [hookType] [i] == func) then return true @@ -2897,7 +2897,7 @@ function DF:Error (errortext) end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> members +--members DF.GlobalWidgetControlNames = { textentry = "DF_TextEntryMetaFunctions", @@ -2916,7 +2916,7 @@ DF.GlobalWidgetControlNames = { function DF:AddMemberForWidget (widgetName, memberType, memberName, func) if (DF.GlobalWidgetControlNames [widgetName]) then - if (type (memberName) == "string" and (memberType == "SET" or memberType == "GET")) then + if (type(memberName) == "string" and (memberType == "SET" or memberType == "GET")) then if (func) then local widgetControlObject = _G [DF.GlobalWidgetControlNames [widgetName]] @@ -3016,7 +3016,7 @@ function DF:Mixin(object, ...) end ----------------------------- ---> animations +--animations function DF:CreateAnimationHub(parent, onPlay, onFinished) local newAnimation = parent:CreateAnimationGroup() @@ -3061,25 +3061,25 @@ function DF:CreateAnimation(animation, animationType, order, duration, arg1, arg end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> frame shakes +--frame shakes ---> frame shakes rely on OnUpdate scripts, we are using a built-in OnUpdate so is guarantee it'll run -local FrameshakeUpdateFrame = DetailsFrameworkFrameshakeControl or CreateFrame ("frame", "DetailsFrameworkFrameshakeControl", UIParent) ---> store the frame which has frame shakes registered +--frame shakes rely on OnUpdate scripts, we are using a built-in OnUpdate so is guarantee it'll run +local FrameshakeUpdateFrame = DetailsFrameworkFrameshakeControl or CreateFrame("frame", "DetailsFrameworkFrameshakeControl", UIParent) +--store the frame which has frame shakes registered FrameshakeUpdateFrame.RegisteredFrames = FrameshakeUpdateFrame.RegisteredFrames or {} FrameshakeUpdateFrame.RegisterFrame = function(newFrame) - --> add the frame into the registered frames to update + --add the frame into the registered frames to update DF.table.addunique (FrameshakeUpdateFrame.RegisteredFrames, newFrame) 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 + --check if there's a shake running if (parent.__frameshakes.enabled > 0) then --update all shakes for this frame for i = 1, #parent.__frameshakes do @@ -3100,31 +3100,31 @@ local frameshake_shake_finished = function(parent, shakeObject) shakeObject.IsFadingOut = false shakeObject.IsFadingIn = false - --> update the amount of shake running on this frame + --update the amount of shake running on this frame parent.__frameshakes.enabled = parent.__frameshakes.enabled - 1 - --> restore the default anchors, in case where deltaTime was too small that didn't triggered an update + --restore the default anchors, in case where deltaTime was too small that didn't triggered an update for i = 1, #shakeObject.Anchors do local anchor = shakeObject.Anchors [i] - --> automatic anchoring and reanching needs to the reviwed in the future + --automatic anchoring and reanching needs to the reviwed in the future if (#anchor == 1) then local anchorTo = unpack (anchor) parent:ClearAllPoints() - parent:SetPoint (anchorTo) + parent:SetPoint(anchorTo) elseif (#anchor == 2) then local anchorTo, point1 = unpack (anchor) parent:ClearAllPoints() - parent:SetPoint (anchorTo, point1) + parent:SetPoint(anchorTo, point1) elseif (#anchor == 3) then local anchorTo, point1, point2 = unpack (anchor) - parent:SetPoint (anchorTo, point1, point2) + parent:SetPoint(anchorTo, point1, point2) elseif (#anchor == 5) then local anchorName1, anchorTo, anchorName2, point1, point2 = unpack (anchor) - parent:SetPoint (anchorName1, anchorTo, anchorName2, point1, point2) + parent:SetPoint(anchorName1, anchorTo, anchorName2, point1, point2) end end end @@ -3133,14 +3133,14 @@ end --already declared above the update function frameshake_do_update = function(parent, shakeObject, deltaTime) - --> check delta time + --check delta time deltaTime = deltaTime or 0 - --> update time left + --update time left shakeObject.TimeLeft = max (shakeObject.TimeLeft - deltaTime, 0) if (shakeObject.TimeLeft > 0) then - --> update fade in and out + --update fade in and out if (shakeObject.IsFadingIn) then shakeObject.IsFadingInTime = shakeObject.IsFadingInTime + deltaTime end @@ -3148,27 +3148,27 @@ frameshake_do_update = function(parent, shakeObject, deltaTime) shakeObject.IsFadingOutTime = shakeObject.IsFadingOutTime + deltaTime end - --> check if can disable fade in + --check if can disable fade in if (shakeObject.IsFadingIn and shakeObject.IsFadingInTime > shakeObject.FadeInTime) then shakeObject.IsFadingIn = false end - --> check if can enable fade out + --check if can enable fade out if (not shakeObject.IsFadingOut and shakeObject.TimeLeft < shakeObject.FadeOutTime) then shakeObject.IsFadingOut = true shakeObject.IsFadingOutTime = shakeObject.FadeOutTime - shakeObject.TimeLeft end - --> update position + --update position local scaleShake = min (shakeObject.IsFadingIn and (shakeObject.IsFadingInTime / shakeObject.FadeInTime) or 1, shakeObject.IsFadingOut and (1 - shakeObject.IsFadingOutTime / shakeObject.FadeOutTime) or 1) if (scaleShake > 0) then - --> delate the time by the frequency on both X and Y offsets + --delate the time by the frequency on both X and Y offsets shakeObject.XSineOffset = shakeObject.XSineOffset + (deltaTime * shakeObject.Frequency) shakeObject.YSineOffset = shakeObject.YSineOffset + (deltaTime * shakeObject.Frequency) - --> calc the new position + --calc the new position local newX, newY if (shakeObject.AbsoluteSineX) then --absoluting only the sine wave, passing a negative scale will reverse the absolute direction @@ -3183,7 +3183,7 @@ frameshake_do_update = function(parent, shakeObject, deltaTime) newY = shakeObject.Amplitude * math.sin (shakeObject.YSineOffset) * scaleShake * shakeObject.ScaleY end - --> apply the offset to the frame anchors + --apply the offset to the frame anchors for i = 1, #shakeObject.Anchors do local anchor = shakeObject.Anchors [i] @@ -3191,13 +3191,13 @@ frameshake_do_update = function(parent, shakeObject, deltaTime) local anchorTo, point1, point2 = unpack (anchor) point1 = point1 or 0 point2 = point2 or 0 - parent:SetPoint (anchorTo, point1 + newX, point2 + newY) + parent:SetPoint(anchorTo, point1 + newX, point2 + newY) elseif (#anchor == 5) then local anchorName1, anchorTo, anchorName2, point1, point2 = unpack (anchor) --parent:ClearAllPoints() - parent:SetPoint (anchorName1, anchorTo, anchorName2, point1 + newX, point2 + newY) + parent:SetPoint(anchorName1, anchorTo, anchorName2, point1 + newX, point2 + newY) end end @@ -3211,38 +3211,38 @@ 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 +--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) - --> check if is already playing + --check if is already playing if (shakeObject.TimeLeft > 0) then - --> reset the time left + --reset the time left shakeObject.TimeLeft = shakeObject.Duration if (shakeObject.IsFadingOut) then if (shakeObject.FadeInTime > 0) then shakeObject.IsFadingIn = true - --> scale the current fade out into fade in, so it starts the fade in at the point where it was fading out + --scale the current fade out into fade in, so it starts the fade in at the point where it was fading out shakeObject.IsFadingInTime = shakeObject.FadeInTime * (1 - shakeObject.IsFadingOutTime / shakeObject.FadeOutTime) else shakeObject.IsFadingIn = false shakeObject.IsFadingInTime = 0 end - --> disable fade out and enable fade in + --disable fade out and enable fade in shakeObject.IsFadingOut = false shakeObject.IsFadingOutTime = 0 end else - --> create a new random offset + --create a new random offset shakeObject.XSineOffset = math.pi * 2 * math.random() shakeObject.YSineOffset = math.pi * 2 * math.random() - --> store the initial position if case it needs a reset + --store the initial position if case it needs a reset shakeObject.StartedXSineOffset = shakeObject.XSineOffset shakeObject.StartedYSineOffset = shakeObject.YSineOffset - --> check if there's a fade in time + --check if there's a fade in time if (shakeObject.FadeInTime > 0) then shakeObject.IsFadingIn = true else @@ -3253,17 +3253,17 @@ local frameshake_play = function(parent, shakeObject, scaleDirection, scaleAmpli shakeObject.IsFadingOut = false shakeObject.IsFadingOutTime = 0 - --> apply custom scale + --apply custom scale shakeObject.ScaleX = (scaleDirection or 1) * shakeObject.OriginalScaleX shakeObject.ScaleY = (scaleDirection or 1) * shakeObject.OriginalScaleY shakeObject.Frequency = (scaleFrequency or 1) * shakeObject.OriginalFrequency shakeObject.Amplitude = (scaleAmplitude or 1) * shakeObject.OriginalAmplitude shakeObject.Duration = (scaleDuration or 1) * shakeObject.OriginalDuration - --> update the time left + --update the time left shakeObject.TimeLeft = shakeObject.Duration - --> check if is dynamic points + --check if is dynamic points if (shakeObject.IsDynamicAnchor) then wipe (shakeObject.Anchors) for i = 1, parent:GetNumPoints() do @@ -3272,11 +3272,11 @@ local frameshake_play = function(parent, shakeObject, scaleDirection, scaleAmpli end end - --> update the amount of shake running on this frame + --update the amount of shake running on this frame parent.__frameshakes.enabled = parent.__frameshakes.enabled + 1 if (not parent:GetScript ("OnUpdate")) then - parent:SetScript ("OnUpdate", function()end) + parent:SetScript("OnUpdate", function()end) end end @@ -3310,7 +3310,7 @@ end function DF:CreateFrameShake (parent, duration, amplitude, frequency, absoluteSineX, absoluteSineY, scaleX, scaleY, fadeInTime, fadeOutTime, anchorPoints) - --> create the shake table + --create the shake table local frameShake = { Amplitude = amplitude or 2, Frequency = frequency or 5, @@ -3332,14 +3332,14 @@ function DF:CreateFrameShake (parent, duration, amplitude, frequency, absoluteSi frameShake.OriginalAmplitude = frameShake.Amplitude frameShake.OriginalDuration = frameShake.Duration - if (type (anchorPoints) ~= "table") then + if (type(anchorPoints) ~= "table") then frameShake.IsDynamicAnchor = true frameShake.Anchors = {} else frameShake.Anchors = anchorPoints end - --> inject frame shake table into the frame + --inject frame shake table into the frame if (not parent.__frameshakes) then parent.__frameshakes = { enabled = 0, @@ -3349,7 +3349,7 @@ function DF:CreateFrameShake (parent, duration, amplitude, frequency, absoluteSi parent.UpdateFrameShake = frameshake_do_update parent.SetFrameShakeSettings = frameshake_set_config - --> register the frame within the frame shake updater + --register the frame within the frame shake updater FrameshakeUpdateFrame.RegisterFrame (parent) end @@ -3360,7 +3360,7 @@ end ----------------------------- ---> glow overlay +--glow overlay local glow_overlay_play = function(self) if (not self:IsShown()) then @@ -3389,7 +3389,7 @@ end local glow_overlay_setcolor = function(self, antsColor, glowColor) if (antsColor) then - local r, g, b, a = DF:ParseColors (antsColor) + local r, g, b, a = DF:ParseColors(antsColor) self.ants:SetVertexColor (r, g, b, a) self.AntsColor.r = r self.AntsColor.g = g @@ -3398,7 +3398,7 @@ local glow_overlay_setcolor = function(self, antsColor, glowColor) end if (glowColor) then - local r, g, b, a = DF:ParseColors (glowColor) + local r, g, b, a = DF:ParseColors(glowColor) self.outerGlow:SetVertexColor (r, g, b, a) self.GlowColor.r = r self.GlowColor.g = g @@ -3417,7 +3417,7 @@ end --this is most copied from the wow client code, few changes applied to customize it function DF:CreateGlowOverlay (parent, antsColor, glowColor) - local glowFrame = CreateFrame ("frame", parent:GetName() and "$parentGlow2" or "OverlayActionGlow" .. math.random (1, 10000000), parent, "ActionBarButtonSpellActivationAlert") + local glowFrame = CreateFrame("frame", parent:GetName() and "$parentGlow2" or "OverlayActionGlow" .. math.random (1, 10000000), parent, "ActionBarButtonSpellActivationAlert") glowFrame:HookScript ("OnShow", glow_overlay_onshow) glowFrame:HookScript ("OnHide", glow_overlay_onhide) @@ -3437,20 +3437,20 @@ function DF:CreateGlowOverlay (parent, antsColor, glowColor) parent.overlay:SetPoint("TOPLEFT", parent, "TOPLEFT", -frameWidth * 0.32, frameHeight * 0.36) parent.overlay:SetPoint("BOTTOMRIGHT", parent, "BOTTOMRIGHT", frameWidth * 0.32, -frameHeight * 0.36) - local r, g, b, a = DF:ParseColors (antsColor or defaultColor) + local r, g, b, a = DF:ParseColors(antsColor or defaultColor) glowFrame.ants:SetVertexColor (r, g, b, a) glowFrame.AntsColor = {r, g, b, a} - local r, g, b, a = DF:ParseColors (glowColor or defaultColor) + local r, g, b, a = DF:ParseColors(glowColor or defaultColor) glowFrame.outerGlow:SetVertexColor (r, g, b, a) glowFrame.GlowColor = {r, g, b, a} - glowFrame.outerGlow:SetScale (1.2) + glowFrame.outerGlow:SetScale(1.2) glowFrame:EnableMouse(false) return glowFrame end ---> custom glow with ants animation +--custom glow with ants animation local ants_set_texture_offset = function(self, leftOffset, rightOffset, topOffset, bottomOffset) leftOffset = leftOffset or 0 rightOffset = rightOffset or 0 @@ -3458,8 +3458,8 @@ local ants_set_texture_offset = function(self, leftOffset, rightOffset, topOffse bottomOffset = bottomOffset or 0 self:ClearAllPoints() - self:SetPoint ("topleft", leftOffset, topOffset) - self:SetPoint ("bottomright", rightOffset, bottomOffset) + self:SetPoint("topleft", leftOffset, topOffset) + self:SetPoint("bottomright", rightOffset, bottomOffset) end function DF:CreateAnts (parent, antTable, leftOffset, rightOffset, topOffset, bottomOffset, antTexture) @@ -3468,22 +3468,22 @@ function DF:CreateAnts (parent, antTable, leftOffset, rightOffset, topOffset, bo topOffset = topOffset or 0 bottomOffset = bottomOffset or 0 - local f = CreateFrame ("frame", nil, parent) - f:SetPoint ("topleft", leftOffset, topOffset) - f:SetPoint ("bottomright", rightOffset, bottomOffset) + local f = CreateFrame("frame", nil, parent) + f:SetPoint("topleft", leftOffset, topOffset) + f:SetPoint("bottomright", rightOffset, bottomOffset) f.SetOffset = ants_set_texture_offset - local t = f:CreateTexture (nil, "overlay") + local t = f:CreateTexture(nil, "overlay") t:SetAllPoints() - t:SetTexture (antTable.Texture) - t:SetBlendMode (antTable.BlendMode or "ADD") - t:SetVertexColor (DF:ParseColors (antTable.Color or "white")) + t:SetTexture(antTable.Texture) + t:SetBlendMode(antTable.BlendMode or "ADD") + t:SetVertexColor (DF:ParseColors(antTable.Color or "white")) f.Texture = t 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) @@ -3497,7 +3497,7 @@ end --]=] ----------------------------- ---> borders +--borders local default_border_color1 = .5 local default_border_color2 = .3 @@ -3508,40 +3508,40 @@ local SetBorderAlpha = function(self, alpha1, alpha2, alpha3) self.Borders.Alpha2 = alpha2 or self.Borders.Alpha2 self.Borders.Alpha3 = alpha3 or self.Borders.Alpha3 - for _, texture in ipairs (self.Borders.Layer1) do + for _, texture in ipairs(self.Borders.Layer1) do texture:SetAlpha (self.Borders.Alpha1) end - for _, texture in ipairs (self.Borders.Layer2) do + for _, texture in ipairs(self.Borders.Layer2) do texture:SetAlpha (self.Borders.Alpha2) end - for _, texture in ipairs (self.Borders.Layer3) do + for _, texture in ipairs(self.Borders.Layer3) do texture:SetAlpha (self.Borders.Alpha3) end end local SetBorderColor = function(self, r, g, b) - for _, texture in ipairs (self.Borders.Layer1) do + for _, texture in ipairs(self.Borders.Layer1) do texture:SetColorTexture (r, g, b) end - for _, texture in ipairs (self.Borders.Layer2) do + for _, texture in ipairs(self.Borders.Layer2) do texture:SetColorTexture (r, g, b) end - for _, texture in ipairs (self.Borders.Layer3) do + for _, texture in ipairs(self.Borders.Layer3) do texture:SetColorTexture (r, g, b) end end local SetLayerVisibility = function(self, layer1Shown, layer2Shown, layer3Shown) - for _, texture in ipairs (self.Borders.Layer1) do + for _, texture in ipairs(self.Borders.Layer1) do texture:SetShown (layer1Shown) end - for _, texture in ipairs (self.Borders.Layer2) do + for _, texture in ipairs(self.Borders.Layer2) do texture:SetShown (layer2Shown) end - for _, texture in ipairs (self.Borders.Layer3) do + for _, texture in ipairs(self.Borders.Layer3) do texture:SetShown (layer3Shown) end @@ -3562,15 +3562,15 @@ function DF:CreateBorder (parent, alpha1, alpha2, alpha3) parent.SetBorderColor = SetBorderColor parent.SetLayerVisibility = SetLayerVisibility - local border1 = parent:CreateTexture (nil, "background") + local border1 = parent:CreateTexture(nil, "background") PixelUtil.SetPoint (border1, "topleft", parent, "topleft", -1, 1) PixelUtil.SetPoint (border1, "bottomleft", parent, "bottomleft", -1, -1) border1:SetColorTexture (0, 0, 0, alpha1 or default_border_color1) - local border2 = parent:CreateTexture (nil, "background") + local border2 = parent:CreateTexture(nil, "background") PixelUtil.SetPoint (border2, "topleft", parent, "topleft", -2, 2) PixelUtil.SetPoint (border2, "bottomleft", parent, "bottomleft", -2, -2) border2:SetColorTexture (0, 0, 0, alpha2 or default_border_color2) - local border3 = parent:CreateTexture (nil, "background") + local border3 = parent:CreateTexture(nil, "background") PixelUtil.SetPoint (border3, "topleft", parent, "topleft", -3, 3) PixelUtil.SetPoint (border3, "bottomleft", parent, "bottomleft", -3, -3) border3:SetColorTexture (0, 0, 0, alpha3 or default_border_color3) @@ -3579,15 +3579,15 @@ function DF:CreateBorder (parent, alpha1, alpha2, alpha3) tinsert (parent.Borders.Layer2, border2) tinsert (parent.Borders.Layer3, border3) - local border1 = parent:CreateTexture (nil, "background") + local border1 = parent:CreateTexture(nil, "background") PixelUtil.SetPoint (border1, "topleft", parent, "topleft", 0, 1) PixelUtil.SetPoint (border1, "topright", parent, "topright", 1, 1) border1:SetColorTexture (0, 0, 0, alpha1 or default_border_color1) - local border2 = parent:CreateTexture (nil, "background") + local border2 = parent:CreateTexture(nil, "background") PixelUtil.SetPoint (border2, "topleft", parent, "topleft", -1, 2) PixelUtil.SetPoint (border2, "topright", parent, "topright", 2, 2) border2:SetColorTexture (0, 0, 0, alpha2 or default_border_color2) - local border3 = parent:CreateTexture (nil, "background") + local border3 = parent:CreateTexture(nil, "background") PixelUtil.SetPoint (border3, "topleft", parent, "topleft", -2, 3) PixelUtil.SetPoint (border3, "topright", parent, "topright", 3, 3) border3:SetColorTexture (0, 0, 0, alpha3 or default_border_color3) @@ -3596,15 +3596,15 @@ function DF:CreateBorder (parent, alpha1, alpha2, alpha3) tinsert (parent.Borders.Layer2, border2) tinsert (parent.Borders.Layer3, border3) - local border1 = parent:CreateTexture (nil, "background") + local border1 = parent:CreateTexture(nil, "background") PixelUtil.SetPoint (border1, "topright", parent, "topright", 1, 0) PixelUtil.SetPoint (border1, "bottomright", parent, "bottomright", 1, -1) border1:SetColorTexture (0, 0, 0, alpha1 or default_border_color1) - local border2 = parent:CreateTexture (nil, "background") + local border2 = parent:CreateTexture(nil, "background") PixelUtil.SetPoint (border2, "topright", parent, "topright", 2, 1) PixelUtil.SetPoint (border2, "bottomright", parent, "bottomright", 2, -2) border2:SetColorTexture (0, 0, 0, alpha2 or default_border_color2) - local border3 = parent:CreateTexture (nil, "background") + local border3 = parent:CreateTexture(nil, "background") PixelUtil.SetPoint (border3, "topright", parent, "topright", 3, 2) PixelUtil.SetPoint (border3, "bottomright", parent, "bottomright", 3, -3) border3:SetColorTexture (0, 0, 0, alpha3 or default_border_color3) @@ -3613,15 +3613,15 @@ function DF:CreateBorder (parent, alpha1, alpha2, alpha3) tinsert (parent.Borders.Layer2, border2) tinsert (parent.Borders.Layer3, border3) - local border1 = parent:CreateTexture (nil, "background") + local border1 = parent:CreateTexture(nil, "background") PixelUtil.SetPoint (border1, "bottomleft", parent, "bottomleft", 0, -1) PixelUtil.SetPoint (border1, "bottomright", parent, "bottomright", 0, -1) border1:SetColorTexture (0, 0, 0, alpha1 or default_border_color1) - local border2 = parent:CreateTexture (nil, "background") + local border2 = parent:CreateTexture(nil, "background") PixelUtil.SetPoint (border2, "bottomleft", parent, "bottomleft", -1, -2) PixelUtil.SetPoint (border2, "bottomright", parent, "bottomright", 1, -2) border2:SetColorTexture (0, 0, 0, alpha2 or default_border_color2) - local border3 = parent:CreateTexture (nil, "background") + local border3 = parent:CreateTexture(nil, "background") PixelUtil.SetPoint (border3, "bottomleft", parent, "bottomleft", -2, -3) PixelUtil.SetPoint (border3, "bottomright", parent, "bottomright", 2, -3) border3:SetColorTexture (0, 0, 0, alpha3 or default_border_color3) @@ -3751,19 +3751,19 @@ function DF:CreateBorderWithSpread (parent, alpha1, alpha2, alpha3, size, spread local spread = 0 --left - local border1 = parent:CreateTexture (nil, "background") + local border1 = parent:CreateTexture(nil, "background") border1:SetColorTexture (0, 0, 0, alpha1 or default_border_color1) PixelUtil.SetPoint (border1, "topleft", parent, "topleft", -1 + spread, 1 + (-spread), 0, 0) PixelUtil.SetPoint (border1, "bottomleft", parent, "bottomleft", -1 + spread, -1 + spread, 0, 0) PixelUtil.SetWidth (border1, size, minPixels) - local border2 = parent:CreateTexture (nil, "background") + local border2 = parent:CreateTexture(nil, "background") PixelUtil.SetPoint (border2, "topleft", parent, "topleft", -2 + spread, 2 + (-spread)) PixelUtil.SetPoint (border2, "bottomleft", parent, "bottomleft", -2 + spread, -2 + spread) border2:SetColorTexture (0, 0, 0, alpha2 or default_border_color2) PixelUtil.SetWidth (border2, size, minPixels) - local border3 = parent:CreateTexture (nil, "background") + local border3 = parent:CreateTexture(nil, "background") PixelUtil.SetPoint (border3, "topleft", parent, "topleft", -3 + spread, 3 + (-spread)) PixelUtil.SetPoint (border3, "bottomleft", parent, "bottomleft", -3 + spread, -3 + spread) border3:SetColorTexture (0, 0, 0, alpha3 or default_border_color3) @@ -3774,19 +3774,19 @@ function DF:CreateBorderWithSpread (parent, alpha1, alpha2, alpha3, size, spread tinsert (parent.Borders.Layer3, border3) --top - local border1 = parent:CreateTexture (nil, "background") + local border1 = parent:CreateTexture(nil, "background") PixelUtil.SetPoint (border1, "topleft", parent, "topleft", 0 + spread, 1 + (-spread)) PixelUtil.SetPoint (border1, "topright", parent, "topright", 1 + (-spread), 1 + (-spread)) border1:SetColorTexture (0, 0, 0, alpha1 or default_border_color1) PixelUtil.SetHeight (border1, size, minPixels) - local border2 = parent:CreateTexture (nil, "background") + local border2 = parent:CreateTexture(nil, "background") PixelUtil.SetPoint (border2, "topleft", parent, "topleft", -1 + spread, 2 + (-spread)) PixelUtil.SetPoint (border2, "topright", parent, "topright", 2 + (-spread), 2 + (-spread)) border2:SetColorTexture (0, 0, 0, alpha2 or default_border_color2) PixelUtil.SetHeight (border2, size, minPixels) - local border3 = parent:CreateTexture (nil, "background") + local border3 = parent:CreateTexture(nil, "background") PixelUtil.SetPoint (border3, "topleft", parent, "topleft", -2 + spread, 3 + (-spread)) PixelUtil.SetPoint (border3, "topright", parent, "topright", 3 + (-spread), 3 + (-spread)) border3:SetColorTexture (0, 0, 0, alpha3 or default_border_color3) @@ -3797,19 +3797,19 @@ function DF:CreateBorderWithSpread (parent, alpha1, alpha2, alpha3, size, spread tinsert (parent.Borders.Layer3, border3) --right - local border1 = parent:CreateTexture (nil, "background") + local border1 = parent:CreateTexture(nil, "background") PixelUtil.SetPoint (border1, "topright", parent, "topright", 1 + (-spread), 0 + (-spread)) PixelUtil.SetPoint (border1, "bottomright", parent, "bottomright", 1 + (-spread), -1 + spread) border1:SetColorTexture (0, 0, 0, alpha1 or default_border_color1) PixelUtil.SetWidth (border1, size, minPixels) - local border2 = parent:CreateTexture (nil, "background") + local border2 = parent:CreateTexture(nil, "background") PixelUtil.SetPoint (border2, "topright", parent, "topright", 2 + (-spread), 1 + (-spread)) PixelUtil.SetPoint (border2, "bottomright", parent, "bottomright", 2 + (-spread), -2 + spread) border2:SetColorTexture (0, 0, 0, alpha2 or default_border_color2) PixelUtil.SetWidth (border2, size, minPixels) - local border3 = parent:CreateTexture (nil, "background") + local border3 = parent:CreateTexture(nil, "background") PixelUtil.SetPoint (border3, "topright", parent, "topright", 3 + (-spread), 2 + (-spread)) PixelUtil.SetPoint (border3, "bottomright", parent, "bottomright", 3 + (-spread), -3 + spread) border3:SetColorTexture (0, 0, 0, alpha3 or default_border_color3) @@ -3819,19 +3819,19 @@ function DF:CreateBorderWithSpread (parent, alpha1, alpha2, alpha3, size, spread tinsert (parent.Borders.Layer2, border2) tinsert (parent.Borders.Layer3, border3) - local border1 = parent:CreateTexture (nil, "background") + local border1 = parent:CreateTexture(nil, "background") PixelUtil.SetPoint (border1, "bottomleft", parent, "bottomleft", 0 + spread, -1 + spread) PixelUtil.SetPoint (border1, "bottomright", parent, "bottomright", 0 + (-spread), -1 + spread) border1:SetColorTexture (0, 0, 0, alpha1 or default_border_color1) PixelUtil.SetHeight (border1, size, minPixels) - local border2 = parent:CreateTexture (nil, "background") + local border2 = parent:CreateTexture(nil, "background") PixelUtil.SetPoint (border2, "bottomleft", parent, "bottomleft", -1 + spread, -2 + spread) PixelUtil.SetPoint (border2, "bottomright", parent, "bottomright", 1 + (-spread), -2 + spread) border2:SetColorTexture (0, 0, 0, alpha2 or default_border_color2) PixelUtil.SetHeight (border2, size, minPixels) - local border3 = parent:CreateTexture (nil, "background") + local border3 = parent:CreateTexture(nil, "background") PixelUtil.SetPoint (border3, "bottomleft", parent, "bottomleft", -2 + spread, -3 + spread) PixelUtil.SetPoint (border3, "bottomright", parent, "bottomright", 2 + (-spread), -3 + spread) border3:SetColorTexture (0, 0, 0, alpha3 or default_border_color3) @@ -3928,7 +3928,7 @@ function DF:ReskinSlider(slider, heightOffset) 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:SetSize(16, 16) end --if the parent has a editbox, this is a code editor @@ -3984,16 +3984,16 @@ local dispatch_error = function(context, errortext) DF:Msg ( (context or "") .. " |cFFFF9900error|r: " .. (errortext or "")) end ---> safe call an external func with payload and without telling who is calling +--safe call an external func with payload and without telling who is calling function DF:QuickDispatch (func, ...) - if (type (func) ~= "function") then + if (type(func) ~= "function") then return end local okay, errortext = pcall (func, ...) if (not okay) then - --> trigger an error msg + --trigger an error msg dispatch_error (_, errortext) return end @@ -4002,7 +4002,7 @@ function DF:QuickDispatch (func, ...) end function DF:Dispatch(func, ...) - if (type (func) ~= "function") then + if (type(func) ~= "function") then return dispatch_error (_, "DF:Dispatch expect a function as parameter 1.") end @@ -4027,7 +4027,7 @@ end ... parameters to pass in the function call --]=] function DF:CoreDispatch (context, func, ...) - if (type (func) ~= "function") then + if (type(func) ~= "function") then local stack = debugstack(2) local errortext = "D!Framework " .. context .. " error: invalid function to call\n====================\n" .. stack .. "\n====================\n" error (errortext) @@ -4047,16 +4047,16 @@ end --/run local a, b =32,3; local f=function(c,d) return c+d, 2, 3;end; print (xpcall(f,geterrorhandler(),a,b)) function DF_CALC_PERFORMANCE() - local F = CreateFrame ("frame") + 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 end print ("Elapsed Time:", deltaTime) - F:SetScript ("OnUpdate", nil) + F:SetScript("OnUpdate", nil) end) end @@ -4171,7 +4171,7 @@ function DF:GetArmorIconByArmorSlot(equipSlotId) end ---> store and return a list of character races, always return the non-localized value +--store and return a list of character races, always return the non-localized value DF.RaceCache = {} function DF:GetCharacterRaceList() if (next (DF.RaceCache)) then @@ -4227,7 +4227,7 @@ function DF:GetCharacterPvPTalents (onlySelected, onlySelectedHash) if (onlySelected or onlySelectedHash) then local talentsSelected = C_SpecializationInfo.GetAllSelectedPvpTalentIDs() local talentList = {} - for _, talentID in ipairs (talentsSelected) do + for _, talentID in ipairs(talentsSelected) do local _, talentName, texture = GetPvpTalentInfoByID (talentID) if (onlySelectedHash) then talentList [talentID] = true @@ -4243,7 +4243,7 @@ function DF:GetCharacterPvPTalents (onlySelected, onlySelectedHash) for i = 1, 4 do --4 slots - get talents available in each one local slotInfo = C_SpecializationInfo.GetPvpTalentSlotInfo (i) if (slotInfo) then - for _, talentID in ipairs (slotInfo.availableTalentIDs) do + for _, talentID in ipairs(slotInfo.availableTalentIDs) do if (not alreadyAdded [talentID]) then local _, talentName, texture, selected = GetPvpTalentInfoByID (talentID) tinsert (talentList, {Name = talentName, ID = talentID, Texture = texture, IsSelected = selected}) @@ -4308,7 +4308,7 @@ function DF:AddRoleIconToText(text, role, size) if (role and type(role) == "string") then local coords = GetTexCoordsForRole(role) if (coords) then - if (type (text) == "string" and role ~= "NONE") then + if (type(text) == "string" and role ~= "NONE") then size = size or 14 text = "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. size .. ":" .. size .. ":0:0:256:256:" .. roleTexcoord[role] .. "|t " .. text return text @@ -4534,7 +4534,7 @@ function DF:GetBattlegroundSize(instanceInfoMapId) end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> execute range +--execute range function DF.GetExecuteRange(unitId) unitId = unitId or "player" @@ -4590,7 +4590,7 @@ end local specID = GetSpecializationInfo(spec) if (specID and specID ~= 0) then if (specID == 253) then --beast mastery - --> is using killer instinct? + --is using killer instinct? local _, _, _, using_KillerInstinct = GetTalentInfo(1, 1, 1) if (using_KillerInstinct) then return 0.35 @@ -4602,7 +4602,7 @@ end local specID = GetSpecializationInfo(spec) if (specID and specID ~= 0) then if (specID == 70) then --retribution paladin - --> is using hammer of wrath? + --is using hammer of wrath? local _, _, _, using_HammerOfWrath = GetTalentInfo(2, 3, 1) if (using_HammerOfWrath) then return 0.20 @@ -4615,14 +4615,14 @@ end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> delta seconds reader +--delta seconds reader if (not DetailsFrameworkDeltaTimeFrame) then - CreateFrame ("frame", "DetailsFrameworkDeltaTimeFrame", UIParent) + CreateFrame("frame", "DetailsFrameworkDeltaTimeFrame", UIParent) end local deltaTimeFrame = DetailsFrameworkDeltaTimeFrame -deltaTimeFrame:SetScript ("OnUpdate", function(self, deltaTime) +deltaTimeFrame:SetScript("OnUpdate", function(self, deltaTime) self.deltaTime = deltaTime end) @@ -4635,7 +4635,7 @@ function DF:GetWorldDeltaSeconds() end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> build the global script channel for scripts communication +--build the global script channel for scripts communication --send and retrieve data sent by othe users in scripts --Usage: --DetailsFramework:RegisterScriptComm (ID, function(sourcePlayerName, ...) end) @@ -4674,7 +4674,7 @@ end function DF:RegisterScriptComm (ID, func) if (ID) then - if (type (func) == "function") then + if (type(func) == "function") then DF.RegisteredScriptsComm [ID] = func else DF.RegisteredScriptsComm [ID] = nil @@ -4697,7 +4697,7 @@ end end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> debug +--debug DF.DebugMixin = { @@ -4729,14 +4729,14 @@ DF.DebugMixin = { ----------------------------------------------------------------------------------------------------------------------------------------------------------- ---> returns if the unit is tapped (gray health color when another player hit the unit first) +--returns if the unit is tapped (gray health color when another player hit the unit first) function DF:IsUnitTapDenied (unitId) return unitId and not UnitPlayerControlled (unitId) and UnitIsTapDenied (unitId) end ----------------------------------------------------------------------------------------------------------------------------------------------------------- ---> pool +--pool do local get = function(self) @@ -4858,7 +4858,7 @@ end ----------------------------------------------------------------------------------------------------------------------------------------------------------- ---> forbidden functions on scripts +--forbidden functions on scripts --these are functions which scripts cannot run due to security issues local forbiddenFunction = { diff --git a/Libs/DF/help.lua b/Libs/DF/help.lua index c8e545f9..a1ab154e 100644 --- a/Libs/DF/help.lua +++ b/Libs/DF/help.lua @@ -6,8 +6,8 @@ if (not DF or not DetailsFrameworkCanLoad) then end local _ -local _rawset = rawset --> lua local -local _rawget = rawget --> lua local +local _rawset = rawset --lua local +local _rawget = rawget --lua local local APIHelpFunctions = false local HelpMetaFunctions = {} @@ -49,13 +49,13 @@ function HelpMetaFunctions:AddHelp (width, height, x, y, buttonX, buttonY, text, } end -function HelpMetaFunctions:SetPoint (v1, v2, v3, v4, v5) +function HelpMetaFunctions:SetPoint(v1, v2, v3, v4, v5) v1, v2, v3, v4, v5 = DF:CheckPoints (v1, v2, v3, v4, v5, self) if (not v1) then print ("Invalid parameter for SetPoint") return end - return self.widget:SetPoint (v1, v2, v3, v4, v5) + return self.widget:SetPoint(v1, v2, v3, v4, v5) end function HelpMetaFunctions:ShowHelp() @@ -75,7 +75,7 @@ function DF:NewHelp (parent, width, height, x, y, buttonWidth, buttonHeight, nam parent = parent.widget end - local helpButton = CreateFrame ("button", name or "DetailsFrameworkHelpButton"..nameCounter, parent, "MainHelpPlateButton") + local helpButton = CreateFrame("button", name or "DetailsFrameworkHelpButton"..nameCounter, parent, "MainHelpPlateButton") nameCounter = nameCounter + 1 if (not APIHelpFunctions) then @@ -92,13 +92,13 @@ function DF:NewHelp (parent, width, height, x, y, buttonWidth, buttonHeight, nam end if (buttonWidth and buttonHeight) then - helpButton:SetWidth (buttonWidth) - helpButton:SetHeight (buttonHeight) - helpButton.I:SetWidth (buttonWidth*0.8) - helpButton.I:SetHeight (buttonHeight*0.8) - helpButton.Ring:SetWidth (buttonWidth) - helpButton.Ring:SetHeight (buttonHeight) - helpButton.Ring:SetPoint ("center", buttonWidth*.2, -buttonWidth*.2) + helpButton:SetWidth(buttonWidth) + helpButton:SetHeight(buttonHeight) + helpButton.I:SetWidth(buttonWidth*0.8) + helpButton.I:SetHeight(buttonHeight*0.8) + helpButton.Ring:SetWidth(buttonWidth) + helpButton.Ring:SetHeight(buttonHeight) + helpButton.Ring:SetPoint("center", buttonWidth*.2, -buttonWidth*.2) end help.helpTable = { @@ -112,7 +112,7 @@ function DF:NewHelp (parent, width, height, x, y, buttonWidth, buttonHeight, nam help.I = helpButton.I help.Ring = helpButton.Ring - helpButton:SetScript ("OnClick", function() + helpButton:SetScript("OnClick", function() help:ShowHelp() end) diff --git a/Libs/DF/label.lua b/Libs/DF/label.lua index 6e34e620..a0dd9de9 100644 --- a/Libs/DF/label.lua +++ b/Libs/DF/label.lua @@ -38,14 +38,14 @@ local LabelMetaFunctions = _G[detailsFramework.GlobalWidgetControlNames ["label" detailsFramework:Mixin(LabelMetaFunctions, detailsFramework.SetPointMixin) ------------------------------------------------------------------------------------------------------------ ---> metatables +--metatables LabelMetaFunctions.__call = function(object, value) return object.label:SetText(value) end ------------------------------------------------------------------------------------------------------------ ---> members +--members --get text local gmember_text = function(object) diff --git a/Libs/DF/normal_bar.lua b/Libs/DF/normal_bar.lua index 3825ee56..4ad7fdba 100644 --- a/Libs/DF/normal_bar.lua +++ b/Libs/DF/normal_bar.lua @@ -5,12 +5,12 @@ if (not DF or not DetailsFrameworkCanLoad) then end local _ -local _rawset = rawset --> lua locals -local _rawget = rawget --> lua locals -local _setmetatable = setmetatable --> lua locals -local _unpack = unpack --> lua locals -local _type = type --> lua locals -local _math_floor = math.floor --> lua locals +local _rawset = rawset --lua locals +local _rawget = rawget --lua locals +local _setmetatable = setmetatable --lua locals +local _unpack = unpack --lua locals +local _type = type --lua locals +local _math_floor = math.floor --lua locals local SharedMedia = LibStub:GetLibrary ("LibSharedMedia-3.0") @@ -47,99 +47,99 @@ end local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] ------------------------------------------------------------------------------------------------------------ ---> metatables +--metatables BarMetaFunctions.__call = function(_table, value) if (not value) then return _table.statusbar:GetValue() else - return _table.statusbar:SetValue (value) + return _table.statusbar:SetValue(value) end end BarMetaFunctions.__add = function(v1, v2) - if (_type (v1) == "table") then + if (_type(v1) == "table") then local v = v1.statusbar:GetValue() v = v + v2 - v1.statusbar:SetValue (v) + v1.statusbar:SetValue(v) else local v = v2.statusbar:GetValue() v = v + v1 - v2.statusbar:SetValue (v) + v2.statusbar:SetValue(v) end end BarMetaFunctions.__sub = function(v1, v2) - if (_type (v1) == "table") then + if (_type(v1) == "table") then local v = v1.statusbar:GetValue() v = v - v2 - v1.statusbar:SetValue (v) + v1.statusbar:SetValue(v) else local v = v2.statusbar:GetValue() v = v - v1 - v2.statusbar:SetValue (v) + v2.statusbar:SetValue(v) end end ------------------------------------------------------------------------------------------------------------ ---> members +--members - --> tooltip + --tooltip local function gmember_tooltip (_object) return _object:GetTooltip() end - --> shown + --shown local gmember_shown = function(_object) return _object.statusbar:IsShown() end - --> frame width + --frame width local gmember_width = function(_object) return _object.statusbar:GetWidth() end - --> frame height + --frame height local gmember_height = function(_object) return _object.statusbar:GetHeight() end - --> value + --value local gmember_value = function(_object) return _object.statusbar:GetValue() end - --> right text + --right text local gmember_rtext = function(_object) return _object.textright:GetText() end - --> left text + --left text local gmember_ltext = function(_object) return _object.textleft:GetText() end - --> left color + --left color local gmember_color = function(_object) local r, g, b, a = _object._texture:GetVertexColor() return r, g, b, a end - --> icon + --icon local gmember_icon = function(_object) return _object._icon:GetTexture() end - --> texture + --texture local gmember_texture = function(_object) return _object._texture:GetTexture() end - --> font size + --font size local gmember_textsize = function(_object) local _, fontsize = _object.textleft:GetFont() return fontsize end - --> font face + --font face local gmember_textfont = function(_object) local fontface = _object.textleft:GetFont() return fontface end - --> font color + --font color local gmember_textcolor = function(_object) return _object.textleft:GetTextColor() end - --> alpha + --alpha local gmember_alpha= function(_object) return _object:GetAlpha() end @@ -182,11 +182,11 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - --> tooltip + --tooltip local smember_tooltip = function(_object, _value) return _object:SetTooltip (_value) end - --> show + --show local smember_shown = function(_object, _value) if (_value) then return _object:Show() @@ -194,7 +194,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] return _object:Hide() end end - --> hide + --hide local smember_hide = function(_object, _value) if (_value) then return _object:Hide() @@ -202,30 +202,30 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] return _object:Show() end end - --> width + --width local smember_width = function(_object, _value) - return _object.statusbar:SetWidth (_value) + return _object.statusbar:SetWidth(_value) end - --> height + --height local smember_height = function(_object, _value) - return _object.statusbar:SetHeight (_value) + return _object.statusbar:SetHeight(_value) end - --> statusbar value + --statusbar 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) + _object.statusbar:SetValue(_value) + return _object.div:SetPoint("left", _object.statusbar, "left", _value * (_object.statusbar:GetWidth()/100) - 16, 0) end - --> right text + --right text local smember_rtext = function(_object, _value) - return _object.textright:SetText (_value) + return _object.textright:SetText(_value) end - --> left text + --left text local smember_ltext = function(_object, _value) - return _object.textleft:SetText (_value) + return _object.textleft:SetText(_value) end - --> color + --color local smember_color = function(_object, _value) - local _value1, _value2, _value3, _value4 = DF:ParseColors (_value) + local _value1, _value2, _value3, _value4 = DF:ParseColors(_value) _object.statusbar:SetStatusBarColor (_value1, _value2, _value3, _value4) _object._texture.original_colors = {_value1, _value2, _value3, _value4} @@ -235,31 +235,31 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] return _object._texture:SetVertexColor (_value1, _value2, _value3, _value4) end - --> background color + --background color local smember_backgroundcolor = function(_object, _value) - local _value1, _value2, _value3, _value4 = DF:ParseColors (_value) + local _value1, _value2, _value3, _value4 = DF:ParseColors(_value) return _object.background:SetVertexColor (_value1, _value2, _value3, _value4) end - --> icon + --icon local smember_icon = function(_object, _value) - if (type (_value) == "table") then + if (type(_value) == "table") then local _value1, _value2 = _unpack (_value) - _object._icon:SetTexture (_value1) + _object._icon:SetTexture(_value1) if (_value2) then _object._icon:SetTexCoord (_unpack (_value2)) end else - _object._icon:SetTexture (_value) + _object._icon:SetTexture(_value) end return end - --> texture + --texture local smember_texture = function(_object, _value) - if (type (_value) == "table") then + if (type(_value) == "table") then local _value1, _value2 = _unpack (_value) - _object._texture:SetTexture (_value1) - _object.timer_texture:SetTexture (_value1) - _object.timer_textureR:SetTexture (_value1) + _object._texture:SetTexture(_value1) + _object.timer_texture:SetTexture(_value1) + _object.timer_textureR:SetTexture(_value1) if (_value2) then _object._texture:SetTexCoord (_unpack (_value2)) _object.timer_texture:SetTexCoord (_unpack (_value2)) @@ -267,58 +267,58 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] end else if (_value:find ("\\")) then - _object._texture:SetTexture (_value) + _object._texture:SetTexture(_value) else local file = SharedMedia:Fetch ("statusbar", _value) if (file) then - _object._texture:SetTexture (file) - _object.timer_texture:SetTexture (file) - _object.timer_textureR:SetTexture (file) + _object._texture:SetTexture(file) + _object.timer_texture:SetTexture(file) + _object.timer_textureR:SetTexture(file) else - _object._texture:SetTexture (_value) - _object.timer_texture:SetTexture (_value) - _object.timer_textureR:SetTexture (_value) + _object._texture:SetTexture(_value) + _object.timer_texture:SetTexture(_value) + _object.timer_textureR:SetTexture(_value) end end end return end - --> background texture + --background texture local smember_backgroundtexture = function(_object, _value) if (_value:find ("\\")) then - _object.background:SetTexture (_value) + _object.background:SetTexture(_value) else local file = SharedMedia:Fetch ("statusbar", _value) if (file) then - _object.background:SetTexture (file) + _object.background:SetTexture(file) else - _object.background:SetTexture (_value) + _object.background:SetTexture(_value) end end return end - --> font face + --font face local smember_textfont = function(_object, _value) DF:SetFontFace (_object.textleft, _value) return DF:SetFontFace (_object.textright, _value) end - --> font size + --font size local smember_textsize = function(_object, _value) DF:SetFontSize (_object.textleft, _value) return DF:SetFontSize (_object.textright, _value) end - --> font color + --font color local smember_textcolor = function(_object, _value) - local _value1, _value2, _value3, _value4 = DF:ParseColors (_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) + --outline (shadow) local smember_outline = function(_object, _value) DF:SetFontOutline (_object.textleft, _value) return DF:SetFontOutline (_object.textright, _value) end - --> alpha + --alpha local smember_alpha= function(_object, _value) return _object:SetAlpha (_value) end @@ -357,9 +357,9 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] end ------------------------------------------------------------------------------------------------------------ ---> methods +--methods ---> show & hide +--show & hide function BarMetaFunctions:Show() self.statusbar:Show() end @@ -368,73 +368,73 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] end ---> return color +--return color function BarMetaFunctions:GetVertexColor() return self._texture:GetVertexColor() end ---> set value (status bar) +--set value (status bar) - function BarMetaFunctions:SetValue (value) + function BarMetaFunctions:SetValue(value) if (not value) then value = 0 end - self.statusbar:SetValue (value) - self.div:SetPoint ("left", self.statusbar, "left", value * (self.statusbar:GetWidth()/100) - 16, 0) + self.statusbar:SetValue(value) + self.div:SetPoint("left", self.statusbar, "left", value * (self.statusbar:GetWidth()/100) - 16, 0) end ---> set point - function BarMetaFunctions:SetPoint (v1, v2, v3, v4, v5) +--set point + function BarMetaFunctions:SetPoint(v1, v2, v3, v4, v5) v1, v2, v3, v4, v5 = DF:CheckPoints (v1, v2, v3, v4, v5, self) if (not v1) then print ("Invalid parameter for SetPoint") return end - return self.widget:SetPoint (v1, v2, v3, v4, v5) + return self.widget:SetPoint(v1, v2, v3, v4, v5) end ---> set sizes - function BarMetaFunctions:SetSize (w, h) +--set sizes + function BarMetaFunctions:SetSize(w, h) if (w) then - self.statusbar:SetWidth (w) + self.statusbar:SetWidth(w) end if (h) then - self.statusbar:SetHeight (h) + self.statusbar:SetHeight(h) end end ---> set texture - function BarMetaFunctions:SetTexture (texture) - self._texture:SetTexture (texture) +--set texture + function BarMetaFunctions:SetTexture(texture) + self._texture:SetTexture(texture) end ---> set texts +--set texts function BarMetaFunctions:SetLeftText (text) - self.textleft:SetText (text) + self.textleft:SetText(text) end function BarMetaFunctions:SetRightText (text) - self.textright:SetText (text) + self.textright:SetText(text) end ---> set color +--set color function BarMetaFunctions:SetColor (r, g, b, a) - r, g, b, a = DF:ParseColors (r, g, b, a) + r, g, b, a = DF:ParseColors(r, g, b, a) self._texture:SetVertexColor (r, g, b, a) self.statusbar:SetStatusBarColor (r, g, b, a) self._texture.original_colors = {r, g, b, a} end ---> set icons +--set icons function BarMetaFunctions:SetIcon (texture, ...) - self._icon:SetTexture (texture) + self._icon:SetTexture(texture) if (...) then local L, R, U, D = _unpack (...) self._icon:SetTexCoord (L, R, U, D) end end ---> show div +--show div function BarMetaFunctions:ShowDiv (bool) if (bool) then self.div:Show() @@ -473,20 +473,20 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] return self.statusbar:GetFrameStrata() end function BarMetaFunctions:SetFrameStrata (strata) - if (_type (strata) == "table") then + if (_type(strata) == "table") then self.statusbar:SetFrameStrata (strata:GetFrameStrata()) else self.statusbar:SetFrameStrata (strata) end end ---> container +--container function BarMetaFunctions:SetContainer (container) self.container = container end ------------------------------------------------------------------------------------------------------------ ---> scripts +--scripts local OnEnter = function(frame) local capsule = frame.MyObject @@ -564,7 +564,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] end ------------------------------------------------------------------------------------------------------------ ---> timer +--timer function BarMetaFunctions:OnTimerEnd() local capsule = self @@ -589,7 +589,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] self.TimerScheduled = nil else if (self.statusbar:GetScript ("OnUpdate")) then - self.statusbar:SetScript ("OnUpdate", nil) + self.statusbar:SetScript("OnUpdate", nil) end end @@ -603,26 +603,26 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] end local OnUpdate = function(self, elapsed) - --> percent of elapsed + --percent of elapsed local pct = abs (self.end_timer - GetTime() - self.tempo) / self.tempo if (self.inverse) then - self.t:SetWidth (self.total_size * pct) + self.t:SetWidth(self.total_size * pct) else - self.t:SetWidth (self.total_size * abs (pct-1)) + self.t:SetWidth(self.total_size * abs (pct-1)) end - --> right text + --right text self.remaining = self.remaining - elapsed if (self.MyObject.RightTextIsTimer) then - self.righttext:SetText (DF:IntegerToTimer (self.remaining)) + self.righttext:SetText(DF:IntegerToTimer (self.remaining)) else - self.righttext:SetText (_math_floor (self.remaining)) + self.righttext:SetText(_math_floor(self.remaining)) end if (pct >= 1) then - self.righttext:SetText ("") - self:SetScript ("OnUpdate", nil) + self.righttext:SetText("") + self:SetScript("OnUpdate", nil) self.MyObject.HasTimer = nil self.MyObject:OnTimerEnd() end @@ -653,21 +653,21 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] self.timer_textureR:Show() self.statusbar.t = self.timer_textureR self.timer_textureR:ClearAllPoints() - self.timer_textureR:SetPoint ("right", self.statusbar, "right") - self.div_timer:SetPoint ("left", self.timer_textureR, "left", -14, -1) + self.timer_textureR:SetPoint("right", self.statusbar, "right") + self.div_timer:SetPoint("left", self.timer_textureR, "left", -14, -1) else self.timer_texture:Show() self.timer_textureR:Hide() self.statusbar.t = self.timer_texture self.timer_texture:ClearAllPoints() - self.timer_texture:SetPoint ("left", self.statusbar, "left") - self.div_timer:SetPoint ("left", self.timer_texture, "right", -16, -1) + self.timer_texture:SetPoint("left", self.statusbar, "left") + self.div_timer:SetPoint("left", self.timer_texture, "right", -16, -1) end if (self.BarIsInverse) then - self.statusbar.t:SetWidth (1) + self.statusbar.t:SetWidth(1) else - self.statusbar.t:SetWidth (self.statusbar.total_size) + self.statusbar.t:SetWidth(self.statusbar.total_size) end self.timer = true @@ -678,11 +678,11 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] function DF:StartTimeBarAnimation (timebar) timebar.TimerScheduled = nil - timebar.statusbar:SetScript ("OnUpdate", OnUpdate) + timebar.statusbar:SetScript("OnUpdate", OnUpdate) end ------------------------------------------------------------------------------------------------------------ ---> object constructor +--object constructor function DetailsFrameworkNormalBar_OnCreate (self) self.texture.original_colors = {1, 1, 1, 1} @@ -693,60 +693,60 @@ end local build_statusbar = function(self) - self:SetSize (300, 14) + self:SetSize(300, 14) - self.background = self:CreateTexture ("$parent_background", "BACKGROUND") + self.background = self:CreateTexture("$parent_background", "BACKGROUND") self.background:Hide() self.background:SetAllPoints() - self.background:SetTexture ([[Interface\PaperDollInfoFrame\UI-Character-Skills-Bar]]) + self.background:SetTexture([[Interface\PaperDollInfoFrame\UI-Character-Skills-Bar]]) self.background:SetVertexColor (.3, .3, .3, .3) - self.timertexture = self:CreateTexture ("$parent_timerTexture", "ARTWORK") + self.timertexture = self:CreateTexture("$parent_timerTexture", "ARTWORK") self.timertexture:Hide() - self.timertexture:SetSize (300, 14) - self.timertexture:SetTexture ([[Interface\PaperDollInfoFrame\UI-Character-Skills-Bar]]) - self.timertexture:SetPoint ("LEFT", self, "LEFT") + self.timertexture:SetSize(300, 14) + self.timertexture:SetTexture([[Interface\PaperDollInfoFrame\UI-Character-Skills-Bar]]) + self.timertexture:SetPoint("LEFT", self, "LEFT") - self.timertextureR = self:CreateTexture ("$parent_timerTextureR", "ARTWORK") + self.timertextureR = self:CreateTexture("$parent_timerTextureR", "ARTWORK") self.timertextureR:Hide() - self.timertextureR:SetSize (300, 14) - self.timertextureR:SetTexture ([[Interface\PaperDollInfoFrame\UI-Character-Skills-Bar]]) - self.timertextureR:SetPoint ("TOPRIGHT", self, 0, 0) - self.timertextureR:SetPoint ("BOTTOMRIGHT", self, 0, 0) + self.timertextureR:SetSize(300, 14) + self.timertextureR:SetTexture([[Interface\PaperDollInfoFrame\UI-Character-Skills-Bar]]) + self.timertextureR:SetPoint("TOPRIGHT", self, 0, 0) + self.timertextureR:SetPoint("BOTTOMRIGHT", self, 0, 0) - self.texture = self:CreateTexture ("$parent_statusbarTexture", "ARTWORK") - self.texture:SetSize (300, 14) - self.texture:SetTexture ([[Interface\PaperDollInfoFrame\UI-Character-Skills-Bar]]) + self.texture = self:CreateTexture("$parent_statusbarTexture", "ARTWORK") + self.texture:SetSize(300, 14) + self.texture:SetTexture([[Interface\PaperDollInfoFrame\UI-Character-Skills-Bar]]) self:SetStatusBarTexture (self.texture) - self.icontexture = self:CreateTexture ("$parent_icon", "OVERLAY") - self.icontexture:SetSize (14, 14) - self.icontexture:SetPoint ("LEFT", self, "LEFT") + self.icontexture = self:CreateTexture("$parent_icon", "OVERLAY") + self.icontexture:SetSize(14, 14) + self.icontexture:SetPoint("LEFT", self, "LEFT") - self.sparkmouseover = self:CreateTexture ("$parent_sparkMouseover", "OVERLAY") - self.sparkmouseover:SetSize (32, 32) - self.sparkmouseover:SetTexture ([[Interface\CastingBar\UI-CastingBar-Spark]]) - self.sparkmouseover:SetBlendMode ("ADD") - self.sparkmouseover:SetPoint ("LEFT", self, "RIGHT", -16, -1) + self.sparkmouseover = self:CreateTexture("$parent_sparkMouseover", "OVERLAY") + self.sparkmouseover:SetSize(32, 32) + self.sparkmouseover:SetTexture([[Interface\CastingBar\UI-CastingBar-Spark]]) + self.sparkmouseover:SetBlendMode("ADD") + self.sparkmouseover:SetPoint("LEFT", self, "RIGHT", -16, -1) self.sparkmouseover:Hide() - self.sparktimer = self:CreateTexture ("$parent_sparkTimer", "OVERLAY") - self.sparktimer:SetSize (32, 32) - self.sparktimer:SetPoint ("LEFT", self.timertexture, "RIGHT", -16, -1) - self.sparktimer:SetTexture ([[Interface\CastingBar\UI-CastingBar-Spark]]) - self.sparktimer:SetBlendMode ("ADD") + self.sparktimer = self:CreateTexture("$parent_sparkTimer", "OVERLAY") + self.sparktimer:SetSize(32, 32) + self.sparktimer:SetPoint("LEFT", self.timertexture, "RIGHT", -16, -1) + self.sparktimer:SetTexture([[Interface\CastingBar\UI-CastingBar-Spark]]) + self.sparktimer:SetBlendMode("ADD") self.sparktimer:Hide() self.lefttext = self:CreateFontString ("$parent_TextLeft", "OVERLAY", "GameFontHighlight") - self.lefttext:SetJustifyH ("LEFT") - self.lefttext:SetPoint ("LEFT", self.icontexture, "RIGHT", 3, 0) + self.lefttext:SetJustifyH("LEFT") + self.lefttext:SetPoint("LEFT", self.icontexture, "RIGHT", 3, 0) DF:SetFontSize (self.lefttext, 10) self.righttext = self:CreateFontString ("$parent_TextRight", "OVERLAY", "GameFontHighlight") - self.righttext:SetJustifyH ("LEFT") + self.righttext:SetJustifyH("LEFT") DF:SetFontSize (self.righttext, 10) - self.righttext:SetPoint ("RIGHT", self, "RIGHT", -3, 0) + self.righttext:SetPoint("RIGHT", self, "RIGHT", -3, 0) DetailsFrameworkNormalBar_OnCreate (self) end @@ -789,14 +789,14 @@ function DF:NewBar (parent, container, name, member, w, h, value, texture_name) w = w or 150 h = h or 14 - --> default members: - --> misc + --default members: + --misc BarObject.locked = false BarObject.container = container - --> create widgets - BarObject.statusbar = CreateFrame ("statusbar", name, parent) + --create widgets + BarObject.statusbar = CreateFrame("statusbar", name, parent) DF:Mixin (BarObject.statusbar, DF.WidgetFunctions) build_statusbar (BarObject.statusbar) @@ -816,16 +816,16 @@ function DF:NewBar (parent, container, name, member, w, h, value, texture_name) end end - BarObject.statusbar:SetHeight (h) - BarObject.statusbar:SetWidth (w) + BarObject.statusbar:SetHeight(h) + BarObject.statusbar:SetWidth(w) BarObject.statusbar:SetFrameLevel (parent:GetFrameLevel()+1) BarObject.statusbar:SetMinMaxValues (0, 100) - BarObject.statusbar:SetValue (value or 50) + BarObject.statusbar:SetValue(value or 50) BarObject.statusbar.MyObject = BarObject BarObject.timer_texture = _G [name .. "_timerTexture"] - BarObject.timer_texture:SetWidth (w) - BarObject.timer_texture:SetHeight (h) + BarObject.timer_texture:SetWidth(w) + BarObject.timer_texture:SetHeight(h) BarObject.timer_textureR = _G [name .. "_timerTextureR"] BarObject.timer_textureR:Hide() @@ -838,7 +838,7 @@ function DF:NewBar (parent, container, name, member, w, h, value, texture_name) BarObject.div = _G [name .. "_sparkMouseover"] BarObject.div_timer = _G [name .. "_sparkTimer"] - --> hooks + --hooks BarObject.HookList = { OnEnter = {}, OnLeave = {}, @@ -849,17 +849,17 @@ function DF:NewBar (parent, container, name, member, w, h, value, texture_name) OnTimerEnd = {}, } - BarObject.statusbar:SetScript ("OnEnter", OnEnter) - BarObject.statusbar:SetScript ("OnLeave", OnLeave) - BarObject.statusbar:SetScript ("OnHide", OnHide) - BarObject.statusbar:SetScript ("OnShow", OnShow) - BarObject.statusbar:SetScript ("OnMouseDown", OnMouseDown) - BarObject.statusbar:SetScript ("OnMouseUp", OnMouseUp) + BarObject.statusbar:SetScript("OnEnter", OnEnter) + BarObject.statusbar:SetScript("OnLeave", OnLeave) + BarObject.statusbar:SetScript("OnHide", OnHide) + BarObject.statusbar:SetScript("OnShow", OnShow) + BarObject.statusbar:SetScript("OnMouseDown", OnMouseDown) + BarObject.statusbar:SetScript("OnMouseUp", OnMouseUp) - --> set class + --set class _setmetatable (BarObject, BarMetaFunctions) - --> set texture + --set texture if (texture_name) then smember_texture (BarObject, texture_name) end diff --git a/Libs/DF/panel.lua b/Libs/DF/panel.lua index 53292ffb..d96708b3 100644 --- a/Libs/DF/panel.lua +++ b/Libs/DF/panel.lua @@ -5,14 +5,14 @@ if (not DF or not DetailsFrameworkCanLoad) then end local _ ---> lua locals -local _rawset = rawset --> lua local -local _rawget = rawget --> lua local -local _setmetatable = setmetatable --> lua local -local _unpack = unpack --> lua local -local _type = type --> lua local -local _math_floor = math.floor --> lua local -local loadstring = loadstring --> lua local +--lua locals +local _rawset = rawset --lua local +local _rawget = rawget --lua local +local _setmetatable = setmetatable --lua local +local _unpack = unpack --lua local +local _type = type --lua local +local _math_floor = math.floor --lua local +local loadstring = loadstring --lua local local IS_WOW_PROJECT_MAINLINE = WOW_PROJECT_ID == WOW_PROJECT_MAINLINE local IS_WOW_PROJECT_NOT_MAINLINE = WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE @@ -62,7 +62,7 @@ end local PanelMetaFunctions = _G[DF.GlobalWidgetControlNames ["panel"]] ---> default options for the frame layout +--default options for the frame layout local default_framelayout_options = { amount_per_line = 4, start_x = 2, @@ -80,24 +80,24 @@ local default_framelayout_options = { break_if_hidden = true, --stop if encounters a hidden frame } ---> mixin for frame layout +--mixin for frame layout DF.LayoutFrame = { AnchorTo = function(self, anchor, point, x, y) if (point == "top") then self:ClearAllPoints() - self:SetPoint ("bottom", anchor, "top", x or 0, y or 0) + self:SetPoint("bottom", anchor, "top", x or 0, y or 0) elseif (point == "bottom") then self:ClearAllPoints() - self:SetPoint ("top", anchor, "bottom", x or 0, y or 0) + self:SetPoint("top", anchor, "bottom", x or 0, y or 0) elseif (point == "left") then self:ClearAllPoints() - self:SetPoint ("right", anchor, "left", x or 0, y or 0) + self:SetPoint("right", anchor, "left", x or 0, y or 0) elseif (point == "right") then self:ClearAllPoints() - self:SetPoint ("left", anchor, "right", x or 0, y or 0) + self:SetPoint("left", anchor, "right", x or 0, y or 0) end end, @@ -129,15 +129,15 @@ DF.LayoutFrame = { if (options.anchor_to_child) then if (i == breakLine) then if (options.grow_right) then - thisFrame:SetPoint ("topleft", firstRowFrame, "topright", offsetX, 0) + thisFrame:SetPoint("topleft", firstRowFrame, "topright", offsetX, 0) else - thisFrame:SetPoint ("topright", firstRowFrame, "topleft", -offsetX, 0) + thisFrame:SetPoint("topright", firstRowFrame, "topleft", -offsetX, 0) end firstRowFrame = thisFrame latestFrame = thisFrame breakLine = breakLine + options.amount_per_line else - thisFrame:SetPoint (anchorPoint, latestFrame, i == 1 and "topleft" or anchorAt, offsetX, i == 1 and 0 or offsetY) + thisFrame:SetPoint(anchorPoint, latestFrame, i == 1 and "topleft" or anchorAt, offsetX, i == 1 and 0 or offsetY) latestFrame = thisFrame end else @@ -153,7 +153,7 @@ DF.LayoutFrame = { breakLine = breakLine + options.amount_per_line end - thisFrame:SetPoint (anchorPoint, self, anchorAt, currentX, currentY) + thisFrame:SetPoint(anchorPoint, self, anchorAt, currentX, currentY) currentY = currentY - offsetY end end @@ -169,15 +169,15 @@ DF.LayoutFrame = { if (options.anchor_to_child) then if (i == breakLine) then if (options.grow_down) then - thisFrame:SetPoint ("topleft", firstRowFrame, "bottomleft", 0, -offsetY) + thisFrame:SetPoint("topleft", firstRowFrame, "bottomleft", 0, -offsetY) else - thisFrame:SetPoint ("bottomleft", firstRowFrame, "topleft", 0, offsetY) + thisFrame:SetPoint("bottomleft", firstRowFrame, "topleft", 0, offsetY) end firstRowFrame = thisFrame latestFrame = thisFrame breakLine = breakLine + options.amount_per_line else - thisFrame:SetPoint (anchorPoint, latestFrame, i == 1 and "topleft" or anchorAt, i == 1 and 0 or offsetX, offsetY) + thisFrame:SetPoint(anchorPoint, latestFrame, i == 1 and "topleft" or anchorAt, i == 1 and 0 or offsetX, offsetY) latestFrame = thisFrame end else @@ -193,7 +193,7 @@ DF.LayoutFrame = { breakLine = breakLine + options.amount_per_line end - thisFrame:SetPoint (anchorPoint, self, anchorAt, currentX, currentY) + thisFrame:SetPoint(anchorPoint, self, anchorAt, currentX, currentY) currentX = currentX + offsetX end end @@ -204,41 +204,41 @@ DF.LayoutFrame = { ------------------------------------------------------------------------------------------------------------ ---> metatables +--metatables PanelMetaFunctions.__call = function(_table, value) - --> nothing to do + --nothing to do return true end ------------------------------------------------------------------------------------------------------------ ---> members +--members - --> tooltip + --tooltip local gmember_tooltip = function(_object) return _object:GetTooltip() end - --> shown + --shown local gmember_shown = function(_object) return _object:IsShown() end - --> backdrop color + --backdrop color local gmember_color = function(_object) return _object.frame:GetBackdropColor() end - --> backdrop table + --backdrop table local gmember_backdrop = function(_object) return _object.frame:GetBackdrop() end - --> frame width + --frame width local gmember_width = function(_object) return _object.frame:GetWidth() end - --> frame height + --frame height local gmember_height = function(_object) return _object.frame:GetHeight() end - --> locked + --locked local gmember_locked = function(_object) return _rawget (_object, "is_locked") end @@ -268,11 +268,11 @@ DF.LayoutFrame = { end - --> tooltip + --tooltip local smember_tooltip = function(_object, _value) return _object:SetTooltip (_value) end - --> show + --show local smember_show = function(_object, _value) if (_value) then return _object:Show() @@ -280,7 +280,7 @@ DF.LayoutFrame = { return _object:Hide() end end - --> hide + --hide local smember_hide = function(_object, _value) if (not _value) then return _object:Show() @@ -288,21 +288,21 @@ DF.LayoutFrame = { return _object:Hide() end end - --> backdrop color + --backdrop color local smember_color = function(_object, _value) - local _value1, _value2, _value3, _value4 = DF:ParseColors (_value) - return _object:SetBackdropColor (_value1, _value2, _value3, _value4) + local _value1, _value2, _value3, _value4 = DF:ParseColors(_value) + return _object:SetBackdropColor(_value1, _value2, _value3, _value4) end - --> frame width + --frame width local smember_width = function(_object, _value) - return _object.frame:SetWidth (_value) + return _object.frame:SetWidth(_value) end - --> frame height + --frame height local smember_height = function(_object, _value) - return _object.frame:SetHeight (_value) + return _object.frame:SetHeight(_value) end - --> locked + --locked local smember_locked = function(_object, _value) if (_value) then _object.frame:SetMovable (false) @@ -314,12 +314,12 @@ DF.LayoutFrame = { end end - --> backdrop + --backdrop local smember_backdrop = function(_object, _value) - return _object.frame:SetBackdrop (_value) + return _object.frame:SetBackdrop(_value) end - --> close with right button + --close with right button local smember_right_close = function(_object, _value) return _rawset (_object, "rightButtonClose", _value) end @@ -345,9 +345,9 @@ DF.LayoutFrame = { end ------------------------------------------------------------------------------------------------------------ ---> methods +--methods ---> right click to close +--right click to close function PanelMetaFunctions:CreateRightClickLabel (textType, w, h, close_text) local text w = w or 20 @@ -370,10 +370,10 @@ DF.LayoutFrame = { end end - return DF:NewLabel (self, _, "$parentRightMouseToClose", nil, "|TInterface\\TUTORIALFRAME\\UI-TUTORIAL-FRAME:"..w..":"..h..":0:1:512:512:8:70:328:409|t " .. text) + return DF:NewLabel(self, _, "$parentRightMouseToClose", nil, "|TInterface\\TUTORIALFRAME\\UI-TUTORIAL-FRAME:"..w..":"..h..":0:1:512:512:8:70:328:409|t " .. text) end ---> show & hide +--show & hide function PanelMetaFunctions:Show() self.frame:Show() @@ -384,42 +384,42 @@ DF.LayoutFrame = { end -- setpoint - function PanelMetaFunctions:SetPoint (v1, v2, v3, v4, v5) + function PanelMetaFunctions:SetPoint(v1, v2, v3, v4, v5) v1, v2, v3, v4, v5 = DF:CheckPoints (v1, v2, v3, v4, v5, self) if (not v1) then print ("Invalid parameter for SetPoint") return end - return self.widget:SetPoint (v1, v2, v3, v4, v5) + return self.widget:SetPoint(v1, v2, v3, v4, v5) end -- sizes - function PanelMetaFunctions:SetSize (w, h) + function PanelMetaFunctions:SetSize(w, h) if (w) then - self.frame:SetWidth (w) + self.frame:SetWidth(w) end if (h) then - self.frame:SetHeight (h) + self.frame:SetHeight(h) end end -- clear function PanelMetaFunctions:HideWidgets() for widgetName, widgetSelf in pairs (self) do - if (type (widgetSelf) == "table" and widgetSelf.dframework) then + if (type(widgetSelf) == "table" and widgetSelf.dframework) then widgetSelf:Hide() end end end -- backdrop - function PanelMetaFunctions:SetBackdrop (background, edge, tilesize, edgesize, tile, left, right, top, bottom) + function PanelMetaFunctions:SetBackdrop(background, edge, tilesize, edgesize, tile, left, right, top, bottom) - if (_type (background) == "boolean" and not background) then - return self.frame:SetBackdrop (nil) + if (_type(background) == "boolean" and not background) then + return self.frame:SetBackdrop(nil) - elseif (_type (background) == "table") then - self.frame:SetBackdrop (background) + elseif (_type(background) == "table") then + self.frame:SetBackdrop(background) else local currentBackdrop = self.frame:GetBackdrop() or {edgeFile="Interface\\DialogFrame\\UI-DialogBox-Border", bgFile="Interface\\DialogFrame\\UI-DialogBox-Background", tile=true, tileSize=16, edgeSize=16, insets={left=1, right=0, top=0, bottom=0}} @@ -432,27 +432,27 @@ DF.LayoutFrame = { currentBackdrop.insets.right = left or currentBackdrop.insets.right currentBackdrop.insets.top = left or currentBackdrop.insets.top currentBackdrop.insets.bottom = left or currentBackdrop.insets.bottom - self.frame:SetBackdrop (currentBackdrop) + self.frame:SetBackdrop(currentBackdrop) end end -- backdropcolor - function PanelMetaFunctions:SetBackdropColor (color, arg2, arg3, arg4) + function PanelMetaFunctions:SetBackdropColor(color, arg2, arg3, arg4) if (arg2) then - self.frame:SetBackdropColor (color, arg2, arg3, arg4 or 1) + self.frame:SetBackdropColor(color, arg2, arg3, arg4 or 1) else - local _value1, _value2, _value3, _value4 = DF:ParseColors (color) - self.frame:SetBackdropColor (_value1, _value2, _value3, _value4) + local _value1, _value2, _value3, _value4 = DF:ParseColors(color) + self.frame:SetBackdropColor(_value1, _value2, _value3, _value4) end end -- border color - function PanelMetaFunctions:SetBackdropBorderColor (color, arg2, arg3, arg4) + function PanelMetaFunctions:SetBackdropBorderColor(color, arg2, arg3, arg4) if (arg2) then - return self.frame:SetBackdropBorderColor (color, arg2, arg3, arg4) + return self.frame:SetBackdropBorderColor(color, arg2, arg3, arg4) end - local _value1, _value2, _value3, _value4 = DF:ParseColors (color) - self.frame:SetBackdropBorderColor (_value1, _value2, _value3, _value4) + local _value1, _value2, _value3, _value4 = DF:ParseColors(color) + self.frame:SetBackdropBorderColor(_value1, _value2, _value3, _value4) end -- tooltip @@ -485,7 +485,7 @@ DF.LayoutFrame = { return self.widget:GetFrameStrata() end function PanelMetaFunctions:SetFrameStrata (strata) - if (_type (strata) == "table") then + if (_type(strata) == "table") then self.widget:SetFrameStrata (strata:GetFrameStrata()) else self.widget:SetFrameStrata (strata) @@ -493,7 +493,7 @@ DF.LayoutFrame = { end ------------------------------------------------------------------------------------------------------------ ---> scripts +--scripts local OnEnter = function(frame) local capsule = frame.MyObject @@ -589,7 +589,7 @@ DF.LayoutFrame = { end ------------------------------------------------------------------------------------------------------------ ---> object constructor +--object constructor function DF:CreatePanel (parent, w, h, backdrop, backdropcolor, bordercolor, member, name) return DF:NewPanel (parent, parent, name, member, w, h, backdrop, backdropcolor, bordercolor) end @@ -624,19 +624,19 @@ function DF:NewPanel (parent, container, name, member, w, h, backdrop, backdropc container = container.widget end - --> default members: - --> misc + --default members: + --misc PanelObject.is_locked = true PanelObject.container = container PanelObject.rightButtonClose = false - PanelObject.frame = CreateFrame ("frame", name, parent,"BackdropTemplate") - PanelObject.frame:SetSize (100, 100) + PanelObject.frame = CreateFrame("frame", name, parent,"BackdropTemplate") + PanelObject.frame:SetSize(100, 100) PanelObject.frame.Gradient = { ["OnEnter"] = {0.3, 0.3, 0.3, 0.5}, ["OnLeave"] = {0.9, 0.7, 0.7, 1} } - PanelObject.frame:SetBackdrop ({bgFile = [[Interface\DialogFrame\UI-DialogBox-Background]], edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border", edgeSize = 10, tileSize = 64, tile = true}) + PanelObject.frame:SetBackdrop({bgFile = [[Interface\DialogFrame\UI-DialogBox-Background]], edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border", edgeSize = 10, tileSize = 64, tile = true}) PanelObject.widget = PanelObject.frame @@ -653,8 +653,8 @@ function DF:NewPanel (parent, container, name, member, w, h, backdrop, backdropc end end - PanelObject.frame:SetWidth (w or 100) - PanelObject.frame:SetHeight (h or 100) + PanelObject.frame:SetWidth(w or 100) + PanelObject.frame:SetHeight(h or 100) PanelObject.frame.MyObject = PanelObject @@ -667,28 +667,28 @@ function DF:NewPanel (parent, container, name, member, w, h, backdrop, backdropc OnMouseUp = {}, } - --> hooks - PanelObject.frame:SetScript ("OnEnter", OnEnter) - PanelObject.frame:SetScript ("OnLeave", OnLeave) - PanelObject.frame:SetScript ("OnHide", OnHide) - PanelObject.frame:SetScript ("OnShow", OnShow) - PanelObject.frame:SetScript ("OnMouseDown", OnMouseDown) - PanelObject.frame:SetScript ("OnMouseUp", OnMouseUp) + --hooks + PanelObject.frame:SetScript("OnEnter", OnEnter) + PanelObject.frame:SetScript("OnLeave", OnLeave) + PanelObject.frame:SetScript("OnHide", OnHide) + PanelObject.frame:SetScript("OnShow", OnShow) + PanelObject.frame:SetScript("OnMouseDown", OnMouseDown) + PanelObject.frame:SetScript("OnMouseUp", OnMouseUp) _setmetatable (PanelObject, PanelMetaFunctions) if (backdrop) then - PanelObject:SetBackdrop (backdrop) - elseif (_type (backdrop) == "boolean") then - PanelObject.frame:SetBackdrop (nil) + PanelObject:SetBackdrop(backdrop) + elseif (_type(backdrop) == "boolean") then + PanelObject.frame:SetBackdrop(nil) end if (backdropcolor) then - PanelObject:SetBackdropColor (backdropcolor) + PanelObject:SetBackdropColor(backdropcolor) end if (bordercolor) then - PanelObject:SetBackdropBorderColor (bordercolor) + PanelObject:SetBackdropBorderColor(bordercolor) end return PanelObject @@ -697,13 +697,13 @@ end ------------fill panel local button_on_enter = function(self) - self.MyObject._icon:SetBlendMode ("ADD") + 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) - self.MyObject._icon:SetBlendMode ("BLEND") + self.MyObject._icon:SetBlendMode("BLEND") if (self.MyObject.onleave_func) then pcall (self.MyObject.onleave_func, self.MyObject) end @@ -727,9 +727,9 @@ local add_row = function(self, t, need_update) thisrow.onenter = t.onenter thisrow.onleave = t.onleave - local text = DF:NewLabel (thisrow, nil, self._name .. "$parentLabel" .. index, "text") - text:SetPoint ("left", thisrow, "left", 2, 0) - text:SetText (t.name) + local text = DF:NewLabel(thisrow, nil, self._name .. "$parentLabel" .. index, "text") + text:SetPoint("left", thisrow, "left", 2, 0) + text:SetText(t.name) tinsert (self._raw_rows, t) tinsert (self.rows, thisrow) @@ -742,7 +742,7 @@ end local align_rows = function(self) local rows_shown = 0 - for index, row in ipairs (self.rows) do + for index, row in ipairs(self.rows) do if (not row.hidden) then rows_shown = rows_shown + 1 end @@ -756,7 +756,7 @@ local align_rows = function(self) wipe (self._anchors) - for index, row in ipairs (self.rows) do + for index, row in ipairs(self.rows) do if (not row.hidden) then if (self._autowidth) then if (self._raw_rows [index].width) then @@ -764,11 +764,11 @@ local align_rows = function(self) else row.width = row_width end - row:SetPoint ("topleft", self, "topleft", cur_width, -1) + row:SetPoint("topleft", self, "topleft", cur_width, -1) tinsert (self._anchors, cur_width) cur_width = cur_width + row_width + 1 else - row:SetPoint ("topleft", self, "topleft", cur_width, -1) + row:SetPoint("topleft", self, "topleft", cur_width, -1) row.width = self._raw_rows [index].width tinsert (self._anchors, cur_width) cur_width = cur_width + self._raw_rows [index].width + 1 @@ -787,11 +787,11 @@ local align_rows = function(self) text = tremove (line.text_available) end tinsert (line.text_inuse, text) - text:SetPoint ("left", line, "left", self._anchors [#self._anchors], 0) - text:SetWidth (row.width) + text:SetPoint("left", line, "left", self._anchors [#self._anchors], 0) + text:SetWidth(row.width) DF:SetFontSize (text, row.textsize or 10) - text:SetJustifyH (row.textalign or "left") + text:SetJustifyH(row.textalign or "left") end elseif (type == "entry") then for i = 1, #self.scrollframe.lines do @@ -802,11 +802,11 @@ local align_rows = function(self) entry = tremove (line.entry_available) end tinsert (line.entry_inuse, entry) - entry:SetPoint ("left", line, "left", self._anchors [#self._anchors], 0) + entry:SetPoint("left", line, "left", self._anchors [#self._anchors], 0) if (sindex == rows_shown) then - entry:SetWidth (row.width - 25) + entry:SetWidth(row.width - 25) else - entry:SetWidth (row.width) + entry:SetWidth(row.width) end entry.func = row.func @@ -832,12 +832,12 @@ local align_rows = function(self) tinsert (line.checkbox_inuse, checkbox) - checkbox:SetPoint ("left", line, "left", self._anchors [#self._anchors] + ((row.width - 20) / 2), 0) + checkbox:SetPoint("left", line, "left", self._anchors [#self._anchors] + ((row.width - 20) / 2), 0) if (sindex == rows_shown) then - checkbox:SetWidth (20) - --checkbox:SetWidth (row.width - 25) + checkbox:SetWidth(20) + --checkbox:SetWidth(row.width - 25) else - checkbox:SetWidth (20) + checkbox:SetWidth(20) end checkbox.onenter_func = nil @@ -853,11 +853,11 @@ local align_rows = function(self) button = tremove (line.button_available) end tinsert (line.button_inuse, button) - button:SetPoint ("left", line, "left", self._anchors [#self._anchors], 0) + button:SetPoint("left", line, "left", self._anchors [#self._anchors], 0) if (sindex == rows_shown) then - button:SetWidth (row.width - 25) + button:SetWidth(row.width - 25) else - button:SetWidth (row.width) + button:SetWidth(row.width) end if (row.icon) then @@ -865,17 +865,17 @@ local align_rows = function(self) button._icon:ClearAllPoints() if (row.iconalign) then if (row.iconalign == "center") then - button._icon:SetPoint ("center", button, "center") + button._icon:SetPoint("center", button, "center") elseif (row.iconalign == "right") then - button._icon:SetPoint ("right", button, "right") + button._icon:SetPoint("right", button, "right") end else - button._icon:SetPoint ("left", button, "left") + button._icon:SetPoint("left", button, "left") end end if (row.name and not row.notext) then - button._text:SetPoint ("left", button._icon, "right", 2, 0) + button._text:SetPoint("left", button._icon, "right", 2, 0) button._text.text = row.name end @@ -899,7 +899,7 @@ local align_rows = function(self) icon = tremove (line.icon_available) end tinsert (line.icon_inuse, icon) - icon:SetPoint ("left", line, "left", self._anchors [#self._anchors] + ( ((row.width or 22) - 22) / 2), 0) + icon:SetPoint("left", line, "left", self._anchors [#self._anchors] + ( ((row.width or 22) - 22) / 2), 0) icon.func = row.func end @@ -912,7 +912,7 @@ local align_rows = function(self) texture = tremove (line.texture_available) end tinsert (line.texture_inuse, texture) - texture:SetPoint ("left", line, "left", self._anchors [#self._anchors] + ( ((row.width or 22) - 22) / 2), 0) + texture:SetPoint("left", line, "left", self._anchors [#self._anchors] + ( ((row.width or 22) - 22) / 2), 0) end end @@ -925,9 +925,9 @@ local align_rows = function(self) if (#self.rows > 0) then if (self._autowidth) then - self.rows [#self.rows]:SetWidth (row_width - rows_shown + 1) + self.rows [#self.rows]:SetWidth(row_width - rows_shown + 1) else - self.rows [#self.rows]:SetWidth (self._raw_rows [rows_shown].width - rows_shown + 1) + self.rows [#self.rows]:SetWidth(self._raw_rows [rows_shown].width - rows_shown + 1) end end @@ -959,9 +959,9 @@ local update_rows = function(self, updated_rows) widget.onleave = t.onleave -- - widget.text:SetText (t.name) + widget.text:SetText(t.name) DF:SetFontSize (widget.text, raw.textsize or 10) - widget.text:SetJustifyH (raw.textalign or "left") + widget.text:SetJustifyH(raw.textalign or "left") end end @@ -972,7 +972,7 @@ local update_rows = function(self, updated_rows) widget.hidden = true end - for index, row in ipairs (self.scrollframe.lines) do + for index, row in ipairs(self.scrollframe.lines) do for i = #row.text_inuse, 1, -1 do tinsert (row.text_available, tremove (row.text_inuse, i)) end @@ -1024,7 +1024,7 @@ end 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) + local text = DF:NewLabel(row, nil, self._name .. "$parentLabel" .. row.text_total, "text" .. row.text_total) tinsert (row.text_available, text) end @@ -1033,19 +1033,19 @@ local create_panel_entry = function(self, row) local editbox = DF:NewTextEntry (row, nil, "$parentEntry" .. row.entry_total, "entry", 120, 20) editbox.align = "left" - editbox:SetHook ("OnEnterPressed", function() + editbox:SetHook("OnEnterPressed", function() editbox.widget.focuslost = true editbox:ClearFocus() editbox.func (editbox.index, editbox.text) return true end) - editbox:SetHook ("OnEnter", function() + editbox:SetHook("OnEnter", function() if (editbox.onenter_func) then pcall (editbox.onenter_func, editbox) end end) - editbox:SetHook ("OnLeave", function() + editbox:SetHook("OnLeave", function() if (editbox.onleave_func) then pcall (editbox.onleave_func, editbox) end @@ -1054,7 +1054,7 @@ local create_panel_entry = function(self, row) editbox.editbox.current_bordercolor = {1, 1, 1, 0.1} editbox:SetTemplate (DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) - editbox:SetBackdropColor (.2, .2, .2, 0.7) + editbox:SetBackdropColor(.2, .2, .2, 0.7) tinsert (row.entry_available, editbox) end @@ -1074,15 +1074,15 @@ 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) - --> create icon and the text + --create icon and the text local icon = DF:NewImage (button, nil, 20, 20) - local text = DF:NewLabel (button) + local text = DF:NewLabel(button) button._icon = icon button._text = text - button:SetHook ("OnEnter", button_on_enter) - button:SetHook ("OnLeave", button_on_leave) + button:SetHook("OnEnter", button_on_enter) + button:SetHook("OnLeave", button_on_leave) tinsert (row.button_available, button) end @@ -1096,10 +1096,10 @@ 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) - iconbutton:SetHook ("OnEnter", button_on_enter) - iconbutton:SetHook ("OnLeave", button_on_leave) + iconbutton:SetHook("OnEnter", button_on_enter) + iconbutton:SetHook("OnLeave", button_on_leave) - iconbutton:SetHook ("OnMouseUp", function() + iconbutton:SetHook("OnMouseUp", function() DF:IconPick (icon_onclick, true, iconbutton) return true end) @@ -1107,7 +1107,7 @@ local create_panel_icon = function(self, row) local icon = DF:NewImage (iconbutton, nil, 20, 20, "artwork", nil, "_icon", "$parentIcon" .. row.icon_total) iconbutton._icon = icon - icon:SetPoint ("center", iconbutton, "center", 0, 0) + icon:SetPoint("center", iconbutton, "center", 0, 0) tinsert (row.icon_available, iconbutton) end @@ -1140,7 +1140,7 @@ local fillpanel_update_size = function(self, elapsed) end panel:Refresh() - self:SetScript ("OnUpdate", nil) + self:SetScript("OnUpdate", nil) end -- ~fillpanel @@ -1202,12 +1202,12 @@ function DF:NewFillPanel(parent, rows, name, member, w, h, total_lines, fill_row local text, entry, button, icon, texture, checkbox = 1, 1, 1, 1, 1, 1 - for index, t in ipairs (panel.rows) do + for index, t in ipairs(panel.rows) do if (not t.hidden) then if (t.type == "text") then local fontstring = row.text_inuse [text] text = text + 1 - fontstring:SetText (results [index]) + fontstring:SetText(results [index]) fontstring.index = real_index fontstring:Show() @@ -1216,13 +1216,13 @@ function DF:NewFillPanel(parent, rows, name, member, w, h, total_lines, fill_row entry = entry + 1 entrywidget.index = real_index - if (type (results [index]) == "table") then - entrywidget:SetText (results [index].text) + if (type(results [index]) == "table") then + entrywidget:SetText(results [index].text) entrywidget.id = results [index].id entrywidget.data1 = results [index].data1 entrywidget.data2 = results [index].data2 else - entrywidget:SetText (results [index]) + entrywidget:SetText(results [index]) end entrywidget:SetCursorPosition(0) @@ -1246,13 +1246,13 @@ function DF:NewFillPanel(parent, rows, name, member, w, h, total_lines, fill_row button = button + 1 buttonwidget.index = real_index - if (type (results [index]) == "table") then + if (type(results [index]) == "table") then if (results [index].text) then - buttonwidget:SetText (results [index].text) + buttonwidget:SetText(results [index].text) end if (results [index].icon) then - buttonwidget._icon:SetTexture (results [index].icon) + buttonwidget._icon:SetTexture(results [index].icon) end if (results [index].func) then @@ -1279,7 +1279,7 @@ function DF:NewFillPanel(parent, rows, name, member, w, h, total_lines, fill_row panel:Refresh() end buttonwidget:SetClickFunction (func) - buttonwidget:SetText (results [index]) + buttonwidget:SetText(results [index]) end buttonwidget:Show() @@ -1291,13 +1291,13 @@ function DF:NewFillPanel(parent, rows, name, member, w, h, total_lines, fill_row iconwidget.line = index iconwidget.index = real_index - if (type (results [index]) == "string") then + if (type(results [index]) == "string") then local result = results [index]:gsub (".-%\\", "") iconwidget._icon.texture = results [index] iconwidget._icon:SetTexCoord (0.1, .9, 0.1, .9) - elseif (type (results [index]) == "table") then - iconwidget._icon:SetTexture (results [index].texture) + elseif (type(results [index]) == "table") then + iconwidget._icon:SetTexture(results [index].texture) local textCoord = results [index].texcoord if (textCoord) then @@ -1314,7 +1314,7 @@ function DF:NewFillPanel(parent, rows, name, member, w, h, total_lines, fill_row iconwidget._icon:SetVertexColor(1, 1, 1, 1) end else - iconwidget._icon:SetTexture (results [index]) + iconwidget._icon:SetTexture(results [index]) iconwidget._icon:SetTexCoord (0.1, .9, 0.1, .9) end @@ -1327,12 +1327,12 @@ function DF:NewFillPanel(parent, rows, name, member, w, h, total_lines, fill_row texturewidget.line = index texturewidget.index = real_index - if (type (results [index]) == "string") then + if (type(results [index]) == "string") then local result = results [index]:gsub (".-%\\", "") texturewidget.texture = results [index] - elseif (type (results [index]) == "table") then - texturewidget:SetTexture (results [index].texture) + elseif (type(results [index]) == "table") then + texturewidget:SetTexture(results [index].texture) local textCoord = results [index].texcoord if (textCoord) then @@ -1350,7 +1350,7 @@ function DF:NewFillPanel(parent, rows, name, member, w, h, total_lines, fill_row end else - texturewidget:SetTexture (results [index]) + texturewidget:SetTexture(results [index]) end texturewidget:Show() @@ -1368,8 +1368,8 @@ function DF:NewFillPanel(parent, rows, name, member, w, h, total_lines, fill_row end function panel:Refresh() - if (type (panel._totalfunc) == "boolean") then - --> not yet initialized + if (type(panel._totalfunc) == "boolean") then + --not yet initialized return end local filled_lines = panel._totalfunc (panel) @@ -1380,13 +1380,13 @@ function DF:NewFillPanel(parent, rows, name, member, w, h, total_lines, fill_row panel.scrollframe:Show() 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:SetPoint ("topleft", panel.widget, "topleft", 0, -21) - scrollframe:SetPoint ("topright", panel.widget, "topright", -23, -21) - scrollframe:SetPoint ("bottomleft", panel.widget, "bottomleft") - scrollframe:SetPoint ("bottomright", panel.widget, "bottomright", -23, 0) - scrollframe:SetSize (w, h) + 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:SetPoint("topleft", panel.widget, "topleft", 0, -21) + scrollframe:SetPoint("topright", panel.widget, "topright", -23, -21) + scrollframe:SetPoint("bottomleft", panel.widget, "bottomleft") + scrollframe:SetPoint("bottomright", panel.widget, "bottomright", -23, 0) + scrollframe:SetSize(w, h) panel.scrollframe = scrollframe scrollframe.lines = {} @@ -1398,20 +1398,20 @@ function DF:NewFillPanel(parent, rows, name, member, w, h, total_lines, fill_row local amount = math.floor (((panel._height-21) / size)) for i = #scrollframe.lines+1, amount do - local row = CreateFrame ("frame", panel:GetName() .. "Row_" .. i, panel.widget,"BackdropTemplate") - row:SetSize (1, size) + local row = CreateFrame("frame", panel:GetName() .. "Row_" .. i, panel.widget,"BackdropTemplate") + row:SetSize(1, size) row.color = {1, 1, 1, .2} - row:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]]}) + row:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]]}) if (i%2 == 0) then - row:SetBackdropColor (.5, .5, .5, 0.2) + row:SetBackdropColor(.5, .5, .5, 0.2) else - row:SetBackdropColor (1, 1, 1, 0.00) + row:SetBackdropColor(1, 1, 1, 0.00) end - row:SetPoint ("topleft", scrollframe, "topleft", 0, (i-1) * size * -1) - row:SetPoint ("topright", scrollframe, "topright", 0, (i-1) * size * -1) + row:SetPoint("topleft", scrollframe, "topleft", 0, (i-1) * size * -1) + row:SetPoint("topright", scrollframe, "topright", 0, (i-1) * size * -1) tinsert (scrollframe.lines, row) row.text_available = {} @@ -1463,7 +1463,7 @@ end function DF:ColorPick (frame, r, g, b, alpha, callback) ColorPickerFrame:ClearAllPoints() - ColorPickerFrame:SetPoint ("bottomleft", frame, "topright", 0, 0) + ColorPickerFrame:SetPoint("bottomleft", frame, "topright", 0, 0) ColorPickerFrame.dcallback = callback ColorPickerFrame.dframe = frame @@ -1476,7 +1476,7 @@ function DF:ColorPick (frame, r, g, b, alpha, callback) ColorPickerFrame.hasOpacity = alpha and true ColorPickerFrame.previousValues = {r, g, b} - ColorPickerFrame:SetParent (UIParent) + ColorPickerFrame:SetParent(UIParent) ColorPickerFrame:SetFrameStrata ("tooltip") ColorPickerFrame:SetColorRGB (r, g, b) ColorPickerFrame:Show() @@ -1490,31 +1490,31 @@ function DF:IconPick (callback, close_when_select, param1, param2) local string_lower = string.lower - DF.IconPickFrame = CreateFrame ("frame", "DetailsFrameworkIconPickFrame", UIParent, "BackdropTemplate") + DF.IconPickFrame = CreateFrame("frame", "DetailsFrameworkIconPickFrame", UIParent, "BackdropTemplate") tinsert (UISpecialFrames, "DetailsFrameworkIconPickFrame") DF.IconPickFrame:SetFrameStrata ("FULLSCREEN") - DF.IconPickFrame:SetPoint ("center", UIParent, "center") - DF.IconPickFrame:SetWidth (416) - DF.IconPickFrame:SetHeight (350) + DF.IconPickFrame:SetPoint("center", UIParent, "center") + DF.IconPickFrame:SetWidth(416) + DF.IconPickFrame:SetHeight(350) DF.IconPickFrame:EnableMouse (true) DF.IconPickFrame:SetMovable (true) DF:CreateTitleBar (DF.IconPickFrame, "Details! Framework Icon Picker") - DF.IconPickFrame:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - DF.IconPickFrame:SetBackdropBorderColor (0, 0, 0) - DF.IconPickFrame:SetBackdropColor (24/255, 24/255, 24/255, .8) + DF.IconPickFrame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + DF.IconPickFrame:SetBackdropBorderColor(0, 0, 0) + 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 @@ -1524,33 +1524,33 @@ function DF:IconPick (callback, close_when_select, param1, param2) DF.IconPickFrame.emptyFunction = function() end DF.IconPickFrame.callback = DF.IconPickFrame.emptyFunction - DF.IconPickFrame.preview = CreateFrame ("frame", nil, UIParent, "BackdropTemplate") + DF.IconPickFrame.preview = CreateFrame("frame", nil, UIParent, "BackdropTemplate") DF.IconPickFrame.preview:SetFrameStrata ("tooltip") DF.IconPickFrame.preview:SetFrameLevel (6001) - DF.IconPickFrame.preview:SetSize (76, 76) + DF.IconPickFrame.preview:SetSize(76, 76) local preview_image_bg = DF:NewImage (DF.IconPickFrame.preview, nil, 76, 76) preview_image_bg:SetDrawLayer ("background", 0) - preview_image_bg:SetAllPoints (DF.IconPickFrame.preview) + preview_image_bg:SetAllPoints(DF.IconPickFrame.preview) preview_image_bg:SetColorTexture (0, 0, 0) local preview_image = DF:NewImage (DF.IconPickFrame.preview, nil, 76, 76) - preview_image:SetAllPoints (DF.IconPickFrame.preview) + preview_image:SetAllPoints(DF.IconPickFrame.preview) DF.IconPickFrame.preview.icon = preview_image DF.IconPickFrame.preview:Hide() --serach - DF.IconPickFrame.searchLabel = DF:NewLabel (DF.IconPickFrame, nil, "$parentSearchBoxLabel", nil, "Search:") - DF.IconPickFrame.searchLabel:SetPoint ("topleft", DF.IconPickFrame, "topleft", 12, -36) + DF.IconPickFrame.searchLabel = DF:NewLabel(DF.IconPickFrame, nil, "$parentSearchBoxLabel", nil, "Search:") + DF.IconPickFrame.searchLabel:SetPoint("topleft", DF.IconPickFrame, "topleft", 12, -36) DF.IconPickFrame.searchLabel:SetTemplate (DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")) DF.IconPickFrame.searchLabel.fontsize = 12 DF.IconPickFrame.search = DF:NewTextEntry (DF.IconPickFrame, nil, "$parentSearchBox", nil, 140, 20) - DF.IconPickFrame.search:SetPoint ("left", DF.IconPickFrame.searchLabel, "right", 2, 0) + DF.IconPickFrame.search:SetPoint("left", DF.IconPickFrame.searchLabel, "right", 2, 0) DF.IconPickFrame.search:SetTemplate (DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) - DF.IconPickFrame.search:SetHook ("OnTextChanged", function() + DF.IconPickFrame.search:SetHook("OnTextChanged", function() DF.IconPickFrame.searching = DF.IconPickFrame.search:GetText() if (DF.IconPickFrame.searching == "") then DF.IconPickFrameScroll:Show() @@ -1565,34 +1565,34 @@ function DF:IconPick (callback, close_when_select, param1, param2) end) --manually enter the icon path - DF.IconPickFrame.customIcon = DF:CreateLabel (DF.IconPickFrame, "Icon Path:", DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")) - DF.IconPickFrame.customIcon:SetPoint ("bottomleft", DF.IconPickFrame, "bottomleft", 12, 16) + DF.IconPickFrame.customIcon = DF:CreateLabel(DF.IconPickFrame, "Icon Path:", DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")) + DF.IconPickFrame.customIcon:SetPoint("bottomleft", DF.IconPickFrame, "bottomleft", 12, 16) DF.IconPickFrame.customIcon.fontsize = 12 DF.IconPickFrame.customIconEntry = DF:CreateTextEntry (DF.IconPickFrame, function()end, 200, 20, "CustomIconEntry", _, _, DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) - DF.IconPickFrame.customIconEntry:SetPoint ("left", DF.IconPickFrame.customIcon, "right", 2, 0) + DF.IconPickFrame.customIconEntry:SetPoint("left", DF.IconPickFrame.customIcon, "right", 2, 0) - DF.IconPickFrame.customIconEntry:SetHook ("OnTextChanged", function() - DF.IconPickFrame.preview:SetPoint ("bottom", DF.IconPickFrame.customIconEntry.widget, "top", 0, 2) - DF.IconPickFrame.preview.icon:SetTexture (DF.IconPickFrame.customIconEntry:GetText()) + DF.IconPickFrame.customIconEntry:SetHook("OnTextChanged", function() + DF.IconPickFrame.preview:SetPoint("bottom", DF.IconPickFrame.customIconEntry.widget, "top", 0, 2) + DF.IconPickFrame.preview.icon:SetTexture(DF.IconPickFrame.customIconEntry:GetText()) DF.IconPickFrame.preview:Show() end) - DF.IconPickFrame.customIconEntry:SetHook ("OnEnter", function() - DF.IconPickFrame.preview:SetPoint ("bottom", DF.IconPickFrame.customIconEntry.widget, "top", 0, 2) - DF.IconPickFrame.preview.icon:SetTexture (DF.IconPickFrame.customIconEntry:GetText()) + DF.IconPickFrame.customIconEntry:SetHook("OnEnter", function() + DF.IconPickFrame.preview:SetPoint("bottom", DF.IconPickFrame.customIconEntry.widget, "top", 0, 2) + DF.IconPickFrame.preview.icon:SetTexture(DF.IconPickFrame.customIconEntry:GetText()) DF.IconPickFrame.preview:Show() end) - --> close button - local close_button = CreateFrame ("button", nil, DF.IconPickFrame, "UIPanelCloseButton", "BackdropTemplate") - close_button:SetWidth (32) - close_button:SetHeight (32) - close_button:SetPoint ("TOPRIGHT", DF.IconPickFrame, "TOPRIGHT", -8, -7) + --close button + local close_button = CreateFrame("button", nil, DF.IconPickFrame, "UIPanelCloseButton", "BackdropTemplate") + close_button:SetWidth(32) + close_button:SetHeight(32) + close_button:SetPoint("TOPRIGHT", DF.IconPickFrame, "TOPRIGHT", -8, -7) close_button:SetFrameLevel (close_button:GetFrameLevel()+2) close_button:SetAlpha (0) --just hide, it is used below - --> accept custom icon button + --accept custom icon button local accept_custom_icon = function() local path = DF.IconPickFrame.customIconEntry:GetText() @@ -1604,7 +1604,7 @@ function DF:IconPick (callback, close_when_select, param1, param2) end DF.IconPickFrame.customIconAccept = DF:CreateButton (DF.IconPickFrame, accept_custom_icon, 82, 20, "Accept", nil, nil, nil, nil, nil, nil, DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE"), DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")) - DF.IconPickFrame.customIconAccept:SetPoint ("left", DF.IconPickFrame.customIconEntry, "right", 2, 0) + DF.IconPickFrame.customIconAccept:SetPoint("left", DF.IconPickFrame.customIconEntry, "right", 2, 0) --fill with icons local MACRO_ICON_FILENAMES = {} @@ -1649,9 +1649,9 @@ function DF:IconPick (callback, close_when_select, param1, param2) GetMacroItemIcons(MACRO_ICON_FILENAMES) --reset the custom icon text entry - DF.IconPickFrame.customIconEntry:SetText ("") + DF.IconPickFrame.customIconEntry:SetText("") --reset the search text entry - DF.IconPickFrame.search:SetText ("") + DF.IconPickFrame.search:SetText("") end) DF.IconPickFrame:SetScript("OnHide", function() @@ -1673,14 +1673,14 @@ function DF:IconPick (callback, close_when_select, param1, param2) end local onEnter = function(self) - DF.IconPickFrame.preview:SetPoint ("bottom", self, "top", 0, 2) + 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") + self.icon:SetBlendMode("ADD") end local onLeave = function(self) DF.IconPickFrame.preview:Hide() - self.icon:SetBlendMode ("BLEND") + self.icon:SetBlendMode("BLEND") end local backdrop = {bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16, @@ -1719,7 +1719,7 @@ function DF:IconPick (callback, close_when_select, param1, param2) local scroll = DF:CreateScrollBox(DF.IconPickFrame, "DetailsFrameworkIconPickFrameScroll", updateIconScroll, {}, width, height, linesAmount, lineHeight) DF:ReskinSlider(scroll) - scroll:SetPoint ("topleft", DF.IconPickFrame, "topleft", 2, -58) + scroll:SetPoint("topleft", DF.IconPickFrame, "topleft", 2, -58) function scroll.RefreshIcons() --build icon list @@ -1831,19 +1831,19 @@ end function DF:ShowPanicWarning (text) if (not DF.PanicWarningWindow) then - DF.PanicWarningWindow = CreateFrame ("frame", "DetailsFrameworkPanicWarningWindow", UIParent, "BackdropTemplate") - DF.PanicWarningWindow:SetHeight (80) - DF.PanicWarningWindow:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - DF.PanicWarningWindow:SetBackdropColor (1, 0, 0, 0.2) - DF.PanicWarningWindow:SetPoint ("topleft", UIParent, "topleft", 0, -250) - DF.PanicWarningWindow:SetPoint ("topright", UIParent, "topright", 0, -250) + DF.PanicWarningWindow = CreateFrame("frame", "DetailsFrameworkPanicWarningWindow", UIParent, "BackdropTemplate") + DF.PanicWarningWindow:SetHeight(80) + DF.PanicWarningWindow:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + DF.PanicWarningWindow:SetBackdropColor(1, 0, 0, 0.2) + DF.PanicWarningWindow:SetPoint("topleft", UIParent, "topleft", 0, -250) + DF.PanicWarningWindow:SetPoint("topright", UIParent, "topright", 0, -250) DF.PanicWarningWindow.text = DF.PanicWarningWindow:CreateFontString (nil, "overlay", "GameFontNormal") - DF.PanicWarningWindow.text:SetPoint ("center", DF.PanicWarningWindow, "center") + DF.PanicWarningWindow.text:SetPoint("center", DF.PanicWarningWindow, "center") DF.PanicWarningWindow.text:SetTextColor (1, 0.6, 0) end - DF.PanicWarningWindow.text:SetText (text) + DF.PanicWarningWindow.text:SetText(text) DF.PanicWarningWindow:Show() end @@ -1879,7 +1879,7 @@ local simple_panel_mouse_up = function(self, button) end end local simple_panel_settitle = function(self, title) - self.Title:SetText (title) + self.Title:SetText(title) end local simple_panel_close_click = function(self) @@ -1994,15 +1994,15 @@ function DF:CreateSimplePanel (parent, w, h, title, name, panel_options, db) panel_options = panel_options or no_options - local f = CreateFrame ("frame", name, UIParent,"BackdropTemplate") - f:SetSize (w or 400, h or 250) - f:SetPoint ("center", UIParent, "center", 0, 0) + local f = CreateFrame("frame", name, UIParent,"BackdropTemplate") + f:SetSize(w or 400, h or 250) + f:SetPoint("center", UIParent, "center", 0, 0) f:SetFrameStrata ("FULLSCREEN") f:EnableMouse() f:SetMovable (true) - f:SetBackdrop (SimplePanel_frame_backdrop) - f:SetBackdropColor (unpack (SimplePanel_frame_backdrop_color)) - f:SetBackdropBorderColor (unpack (SimplePanel_frame_backdrop_border_color)) + f:SetBackdrop(SimplePanel_frame_backdrop) + f:SetBackdropColor(unpack (SimplePanel_frame_backdrop_color)) + f:SetBackdropBorderColor(unpack (SimplePanel_frame_backdrop_border_color)) f.DontRightClickClose = panel_options.DontRightClickClose @@ -2010,49 +2010,49 @@ function DF:CreateSimplePanel (parent, w, h, title, name, panel_options, db) tinsert (UISpecialFrames, name) end - local title_bar = CreateFrame ("frame", name .. "TitleBar", f,"BackdropTemplate") - title_bar:SetPoint ("topleft", f, "topleft", 2, -3) - title_bar:SetPoint ("topright", f, "topright", -2, -3) - title_bar:SetHeight (20) - title_bar:SetBackdrop (SimplePanel_frame_backdrop) - title_bar:SetBackdropColor (.2, .2, .2, 1) - title_bar:SetBackdropBorderColor (0, 0, 0, 1) + local title_bar = CreateFrame("frame", name .. "TitleBar", f,"BackdropTemplate") + title_bar:SetPoint("topleft", f, "topleft", 2, -3) + title_bar:SetPoint("topright", f, "topright", -2, -3) + title_bar:SetHeight(20) + title_bar:SetBackdrop(SimplePanel_frame_backdrop) + title_bar:SetBackdropColor(.2, .2, .2, 1) + title_bar:SetBackdropBorderColor(0, 0, 0, 1) f.TitleBar = title_bar - local close = CreateFrame ("button", name and name .. "CloseButton", title_bar) + local close = CreateFrame("button", name and name .. "CloseButton", title_bar) close:SetFrameLevel (DF.FRAMELEVEL_OVERLAY) - close:SetSize (16, 16) + close:SetSize(16, 16) - close:SetNormalTexture ([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) - close:SetHighlightTexture ([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) - close:SetPushedTexture ([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) + close:SetNormalTexture([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) + close:SetHighlightTexture([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) + close:SetPushedTexture([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) close:GetNormalTexture():SetDesaturated(true) close:GetHighlightTexture():SetDesaturated(true) close:GetPushedTexture():SetDesaturated(true) close:SetAlpha (0.7) - close:SetScript ("OnClick", simple_panel_close_click) + close:SetScript("OnClick", simple_panel_close_click) f.Close = close local title_string = title_bar:CreateFontString (name and name .. "Title", "overlay", "GameFontNormal") title_string:SetTextColor (.8, .8, .8, 1) - title_string:SetText (title or "") + title_string:SetText(title or "") f.Title = title_string if (panel_options.UseScaleBar and db [name]) then DF:CreateScaleBar (f, db [name]) - f:SetScale (db [name].scale) + f:SetScale(db [name].scale) end - f.Title:SetPoint ("center", title_bar, "center") - f.Close:SetPoint ("right", title_bar, "right", -2, 0) + f.Title:SetPoint("center", title_bar, "center") + f.Close:SetPoint("right", title_bar, "right", -2, 0) if (panel_options.NoCloseButton) then f.Close:Hide() end - f:SetScript ("OnMouseDown", simple_panel_mouse_down) - f:SetScript ("OnMouseUp", simple_panel_mouse_up) + f:SetScript("OnMouseDown", simple_panel_mouse_down) + f:SetScript("OnMouseUp", simple_panel_mouse_up) f.SetTitle = simple_panel_settitle @@ -2099,11 +2099,11 @@ local Panel1PxOnClickLock = function(self) Panel1PxOnToggleLock (f) end local Panel1PxSetTitle = function(self, text) - self.Title:SetText (text or "") + self.Title:SetText(text or "") end local Panel1PxSetLocked= function(self, lock_state) - if (type (lock_state) ~= "boolean") then + if (type(lock_state) ~= "boolean") then return end if (lock_state) then @@ -2157,7 +2157,7 @@ function DF:RestoreFramePosition (frame) frame:ClearAllPoints() frame.db.position.x = frame.db.position.x or 0 frame.db.position.y = frame.db.position.y or 0 - frame:SetPoint ("center", UIParent, "center", frame.db.position.x * UIscale / scale, frame.db.position.y * UIscale / scale) + frame:SetPoint("center", UIParent, "center", frame.db.position.x * UIscale / scale, frame.db.position.y * UIscale / scale) end end @@ -2175,19 +2175,19 @@ local Panel1PxHasPosition = function(self) end function DF:Create1PxPanel (parent, w, h, title, name, config, title_anchor, no_special_frame) - local f = CreateFrame ("frame", name, parent or UIParent, "BackdropTemplate") - f:SetSize (w or 100, h or 75) - f:SetPoint ("center", UIParent, "center") + local f = CreateFrame("frame", name, parent or UIParent, "BackdropTemplate") + f:SetSize(w or 100, h or 75) + f:SetPoint("center", UIParent, "center") if (name and not no_special_frame) then tinsert (UISpecialFrames, name) end - f:SetScript ("OnMouseDown", simple_panel_mouse_down) - f:SetScript ("OnMouseUp", simple_panel_mouse_up) + f:SetScript("OnMouseDown", simple_panel_mouse_down) + f:SetScript("OnMouseUp", simple_panel_mouse_up) - f:SetBackdrop (Panel1PxBackdrop) - f:SetBackdropColor (0, 0, 0, 0.5) + f:SetBackdrop(Panel1PxBackdrop) + f:SetBackdropColor(0, 0, 0, 0.5) f.IsLocked = (config and config.IsLocked ~= nil and config.IsLocked) or false f:SetMovable (true) @@ -2198,21 +2198,21 @@ function DF:Create1PxPanel (parent, w, h, title, name, config, title_anchor, no_ --print (config.position.x, config.position.x) Panel1PxReadConfig (f) - local close = CreateFrame ("button", name and name .. "CloseButton", f, "BackdropTemplate") - close:SetSize (16, 16) - close:SetNormalTexture ([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) - close:SetHighlightTexture ([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) - close:SetPushedTexture ([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) + local close = CreateFrame("button", name and name .. "CloseButton", f, "BackdropTemplate") + close:SetSize(16, 16) + close:SetNormalTexture([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) + close:SetHighlightTexture([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) + close:SetPushedTexture([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) close:GetNormalTexture():SetDesaturated(true) close:GetHighlightTexture():SetDesaturated(true) close:GetPushedTexture():SetDesaturated(true) close:SetAlpha (0.7) - local lock = CreateFrame ("button", name and name .. "LockButton", f, "BackdropTemplate") - lock:SetSize (16, 16) - lock:SetNormalTexture ([[Interface\GLUES\CharacterSelect\Glues-AddOn-Icons]]) - lock:SetHighlightTexture ([[Interface\GLUES\CharacterSelect\Glues-AddOn-Icons]]) - lock:SetPushedTexture ([[Interface\GLUES\CharacterSelect\Glues-AddOn-Icons]]) + local lock = CreateFrame("button", name and name .. "LockButton", f, "BackdropTemplate") + lock:SetSize(16, 16) + lock:SetNormalTexture([[Interface\GLUES\CharacterSelect\Glues-AddOn-Icons]]) + lock:SetHighlightTexture([[Interface\GLUES\CharacterSelect\Glues-AddOn-Icons]]) + lock:SetPushedTexture([[Interface\GLUES\CharacterSelect\Glues-AddOn-Icons]]) lock:GetNormalTexture():SetDesaturated(true) lock:GetHighlightTexture():SetDesaturated(true) lock:GetPushedTexture():SetDesaturated(true) @@ -2224,22 +2224,22 @@ function DF:Create1PxPanel (parent, w, h, title, name, config, title_anchor, no_ --lock:GetPushedTexture():SetTexCoord(73/256, 105/256, 64/128, 110/) lock:SetAlpha (0.7) - close:SetPoint ("topright", f, "topright", -3, -3) - lock:SetPoint ("right", close, "left", 3, 0) + close:SetPoint("topright", f, "topright", -3, -3) + lock:SetPoint("right", close, "left", 3, 0) - close:SetScript ("OnClick", Panel1PxOnClickClose) - lock:SetScript ("OnClick", Panel1PxOnClickLock) + close:SetScript("OnClick", Panel1PxOnClickClose) + lock:SetScript("OnClick", Panel1PxOnClickLock) local title_string = f:CreateFontString (name and name .. "Title", "overlay", "GameFontNormal") - title_string:SetPoint ("topleft", f, "topleft", 5, -5) - title_string:SetText (title or "") + title_string:SetPoint("topleft", f, "topleft", 5, -5) + title_string:SetText(title or "") if (title_anchor) then if (title_anchor == "top") then title_string:ClearAllPoints() - title_string:SetPoint ("bottomleft", f, "topleft", 0, 0) + title_string:SetPoint("bottomleft", f, "topleft", 0, 0) close:ClearAllPoints() - close:SetPoint ("bottomright", f, "topright", 0, 0) + close:SetPoint("bottomright", f, "topright", 0, 0) end f.title_anchor = title_anchor end @@ -2263,32 +2263,32 @@ end function DF:ShowPromptPanel (message, func_true, func_false, no_repeated, width) if (not DetailsFrameworkPromptSimple) then - local f = CreateFrame ("frame", "DetailsFrameworkPromptSimple", UIParent, "BackdropTemplate") - f:SetSize (400, 80) + local f = CreateFrame("frame", "DetailsFrameworkPromptSimple", UIParent, "BackdropTemplate") + f:SetSize(400, 80) f:SetFrameStrata ("DIALOG") - f:SetPoint ("center", UIParent, "center", 0, 300) - f:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - f:SetBackdropColor (0, 0, 0, 0.8) - f:SetBackdropBorderColor (0, 0, 0, 1) + f:SetPoint("center", UIParent, "center", 0, 300) + f:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + f:SetBackdropColor(0, 0, 0, 0.8) + f:SetBackdropBorderColor(0, 0, 0, 1) tinsert (UISpecialFrames, "DetailsFrameworkPromptSimple") DF:CreateTitleBar (f, "Prompt!") DF:ApplyStandardBackdrop (f) local prompt = f:CreateFontString (nil, "overlay", "GameFontNormal") - prompt:SetPoint ("top", f, "top", 0, -28) - prompt:SetJustifyH ("center") + prompt:SetPoint("top", f, "top", 0, -28) + prompt:SetJustifyH("center") f.prompt = prompt local button_text_template = DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE") local options_dropdown_template = DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") local button_true = DF:CreateButton (f, nil, 60, 20, "Yes", nil, nil, nil, nil, nil, nil, options_dropdown_template) - button_true:SetPoint ("bottomright", f, "bottomright", -5, 5) + button_true:SetPoint("bottomright", f, "bottomright", -5, 5) f.button_true = button_true local button_false = DF:CreateButton (f, nil, 60, 20, "No", nil, nil, nil, nil, nil, nil, options_dropdown_template) - button_false:SetPoint ("bottomleft", f, "bottomleft", 5, 5) + button_false:SetPoint("bottomleft", f, "bottomleft", 5, 5) f.button_false = button_false button_true:SetClickFunction (function() @@ -2314,28 +2314,28 @@ function DF:ShowPromptPanel (message, func_true, func_false, no_repeated, width) end) f.ShowAnimation = DF:CreateAnimationHub (f, function() - f:SetBackdropBorderColor (0, 0, 0, 0) - f.TitleBar:SetBackdropBorderColor (0, 0, 0, 0) + f:SetBackdropBorderColor(0, 0, 0, 0) + f.TitleBar:SetBackdropBorderColor(0, 0, 0, 0) end, function() - f:SetBackdropBorderColor (0, 0, 0, 1) - f.TitleBar:SetBackdropBorderColor (0, 0, 0, 1) + f:SetBackdropBorderColor(0, 0, 0, 1) + f.TitleBar:SetBackdropBorderColor(0, 0, 0, 1) end) - DF:CreateAnimation (f.ShowAnimation, "scale", 1, .075, .2, .2, 1.1, 1.1, "center", 0, 0) - DF:CreateAnimation (f.ShowAnimation, "scale", 2, .075, 1, 1, .90, .90, "center", 0, 0) + DF:CreateAnimation(f.ShowAnimation, "scale", 1, .075, .2, .2, 1.1, 1.1, "center", 0, 0) + DF:CreateAnimation(f.ShowAnimation, "scale", 2, .075, 1, 1, .90, .90, "center", 0, 0) - f.FlashTexture = f:CreateTexture (nil, "overlay") + f.FlashTexture = f:CreateTexture(nil, "overlay") f.FlashTexture:SetColorTexture (1, 1, 1, 1) f.FlashTexture:SetAllPoints() f.FlashAnimation = DF:CreateAnimationHub (f.FlashTexture, function() f.FlashTexture:Show() end, function() f.FlashTexture:Hide() end) - DF:CreateAnimation (f.FlashAnimation, "alpha", 1, .075, 0, .25) - DF:CreateAnimation (f.FlashAnimation, "alpha", 2, .075, .35, 0) + DF:CreateAnimation(f.FlashAnimation, "alpha", 1, .075, 0, .25) + DF:CreateAnimation(f.FlashAnimation, "alpha", 2, .075, .35, 0) f:Hide() DF.promtp_panel = f end - assert (type (func_true) == "function" and type (func_false) == "function", "ShowPromptPanel expects two functions.") + assert (type(func_true) == "function" and type (func_false) == "function", "ShowPromptPanel expects two functions.") if (no_repeated) then if (DF.promtp_panel:IsShown()) then @@ -2344,12 +2344,12 @@ function DF:ShowPromptPanel (message, func_true, func_false, no_repeated, width) end if (width) then - DF.promtp_panel:SetWidth (width) + DF.promtp_panel:SetWidth(width) else - DF.promtp_panel:SetWidth (400) + DF.promtp_panel:SetWidth(400) end - DF.promtp_panel.prompt:SetText (message) + DF.promtp_panel.prompt:SetText(message) DF.promtp_panel.button_true.true_function = func_true DF.promtp_panel.button_false.false_function = func_false @@ -2364,40 +2364,40 @@ function DF:ShowTextPromptPanel (message, callback) if (not DF.text_prompt_panel) then - local f = CreateFrame ("frame", "DetailsFrameworkPrompt", UIParent, "BackdropTemplate") - f:SetSize (400, 120) + local f = CreateFrame("frame", "DetailsFrameworkPrompt", UIParent, "BackdropTemplate") + f:SetSize(400, 120) f:SetFrameStrata ("FULLSCREEN") - f:SetPoint ("center", UIParent, "center", 0, 100) + f:SetPoint("center", UIParent, "center", 0, 100) f:EnableMouse (true) f:SetMovable (true) 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("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) tinsert (UISpecialFrames, "DetailsFrameworkPrompt") DF:CreateTitleBar (f, "Prompt!") DF:ApplyStandardBackdrop (f) local prompt = f:CreateFontString (nil, "overlay", "GameFontNormal") - prompt:SetPoint ("top", f, "top", 0, -25) - prompt:SetJustifyH ("center") - prompt:SetSize (360, 36) + prompt:SetPoint("top", f, "top", 0, -25) + prompt:SetJustifyH("center") + prompt:SetSize(360, 36) f.prompt = prompt local button_text_template = DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE") local options_dropdown_template = DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") local textbox = DF:CreateTextEntry (f, function()end, 380, 20, "textbox", nil, nil, options_dropdown_template) - textbox:SetPoint ("topleft", f, "topleft", 10, -60) + textbox:SetPoint("topleft", f, "topleft", 10, -60) f.EntryBox = textbox local button_true = DF:CreateButton (f, nil, 60, 20, "Okey", nil, nil, nil, nil, nil, nil, options_dropdown_template) - button_true:SetPoint ("bottomright", f, "bottomright", -10, 5) + button_true:SetPoint("bottomright", f, "bottomright", -10, 5) f.button_true = button_true local button_false = DF:CreateButton (f, function() f.textbox:ClearFocus() f:Hide() end, 60, 20, "Cancel", nil, nil, nil, nil, nil, nil, options_dropdown_template) - button_false:SetPoint ("bottomleft", f, "bottomleft", 10, 5) + button_false:SetPoint("bottomleft", f, "bottomleft", 10, 5) f.button_false = button_false local executeCallback = function() @@ -2416,7 +2416,7 @@ function DF:ShowTextPromptPanel (message, callback) executeCallback() end) - textbox:SetHook ("OnEnterPressed", function() + textbox:SetHook("OnEnterPressed", function() executeCallback() end) @@ -2426,34 +2426,34 @@ function DF:ShowTextPromptPanel (message, callback) DF.text_prompt_panel:Show() - DetailsFrameworkPrompt.EntryBox:SetText ("") - DF.text_prompt_panel.prompt:SetText (message) + DetailsFrameworkPrompt.EntryBox:SetText("") + DF.text_prompt_panel.prompt:SetText(message) DF.text_prompt_panel.button_true.true_function = callback DF.text_prompt_panel.textbox:SetFocus (true) end ------------------------------------------------------------------------------------------------------------------------------------------------ ---> options button -- ~options +--options button -- ~options function DF:CreateOptionsButton (parent, callback, name) - local b = CreateFrame ("button", name, parent, "BackdropTemplate") - b:SetSize (14, 14) - b:SetNormalTexture ([[Interface\GossipFrame\BinderGossipIcon]]) - b:SetHighlightTexture ([[Interface\GossipFrame\BinderGossipIcon]]) - b:SetPushedTexture ([[Interface\GossipFrame\BinderGossipIcon]]) + local b = CreateFrame("button", name, parent, "BackdropTemplate") + b:SetSize(14, 14) + b:SetNormalTexture([[Interface\GossipFrame\BinderGossipIcon]]) + b:SetHighlightTexture([[Interface\GossipFrame\BinderGossipIcon]]) + b:SetPushedTexture([[Interface\GossipFrame\BinderGossipIcon]]) b:GetNormalTexture():SetDesaturated(true) b:GetHighlightTexture():SetDesaturated(true) b:GetPushedTexture():SetDesaturated(true) b:SetAlpha (0.7) - b:SetScript ("OnClick", callback) - b:SetScript ("OnEnter", function(self) + b:SetScript("OnClick", callback) + 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) @@ -2462,18 +2462,18 @@ function DF:CreateOptionsButton (parent, callback, name) end ------------------------------------------------------------------------------------------------------------------------------------------------ ---> feedback panel -- ~feedback +--feedback panel -- ~feedback 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) + local b = CreateFrame("button", name, parent, "BackdropTemplate") + b:SetSize(12, 13) + b:SetScript("OnClick", callback) + 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) @@ -2486,10 +2486,10 @@ local backdrop_fb_line = {bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 64, insets = {left = 2, right = 2, top = 2, bottom = 2}} local on_enter_feedback = function(self) - self:SetBackdropColor (1, 1, 0, 0.5) + self:SetBackdropColor(1, 1, 0, 0.5) end local on_leave_feedback = function(self) - self:SetBackdropColor (0, 0, 0, 0.3) + self:SetBackdropColor(0, 0, 0, 0.3) end local on_click_feedback = function(self) @@ -2499,14 +2499,14 @@ local on_click_feedback = function(self) if (not feedback_link_textbox) then local editbox = DF:CreateTextEntry (AddonFeedbackPanel, _, 275, 34) editbox:SetAutoFocus (false) - editbox:SetHook ("OnEditFocusGained", function() + editbox:SetHook("OnEditFocusGained", function() editbox.text = editbox.link editbox:HighlightText() end) - editbox:SetHook ("OnEditFocusLost", function() + editbox:SetHook("OnEditFocusLost", function() editbox:Hide() end) - editbox:SetHook ("OnChar", function() + editbox:SetHook("OnChar", function() editbox.text = editbox.link editbox:HighlightText() end) @@ -2520,7 +2520,7 @@ local on_click_feedback = function(self) feedback_link_textbox.text = self.link feedback_link_textbox:Show() - feedback_link_textbox:SetPoint ("topleft", self.icon, "topright", 3, 0) + feedback_link_textbox:SetPoint("topleft", self.icon, "topright", 3, 0) feedback_link_textbox:HighlightText() @@ -2532,27 +2532,27 @@ local feedback_get_fb_line = function(self) local line = self.feedback_lines [self.next_feedback] if (not line) then - line = CreateFrame ("frame", "AddonFeedbackPanelFB" .. self.next_feedback, self, "BackdropTemplate") - line:SetBackdrop (backdrop_fb_line) - line:SetBackdropColor (0, 0, 0, 0.3) - line:SetSize (390, 42) - line:SetPoint ("topleft", self.feedback_anchor, "bottomleft", 0, -5 + ((self.next_feedback-1) * 46 * -1)) - line:SetScript ("OnEnter", on_enter_feedback) - line:SetScript ("OnLeave", on_leave_feedback) - line:SetScript ("OnMouseUp", on_click_feedback) + line = CreateFrame("frame", "AddonFeedbackPanelFB" .. self.next_feedback, self, "BackdropTemplate") + line:SetBackdrop(backdrop_fb_line) + line:SetBackdropColor(0, 0, 0, 0.3) + line:SetSize(390, 42) + line:SetPoint("topleft", self.feedback_anchor, "bottomleft", 0, -5 + ((self.next_feedback-1) * 46 * -1)) + line:SetScript("OnEnter", on_enter_feedback) + line:SetScript("OnLeave", on_leave_feedback) + line:SetScript("OnMouseUp", on_click_feedback) - line.icon = line:CreateTexture (nil, "overlay") - line.icon:SetSize (90, 36) + line.icon = line:CreateTexture(nil, "overlay") + line.icon:SetSize(90, 36) line.desc = line:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - line.icon:SetPoint ("left", line, "left", 5, 0) - line.desc:SetPoint ("left", line.icon, "right", 5, 0) + line.icon:SetPoint("left", line, "left", 5, 0) + line.desc:SetPoint("left", line.icon, "right", 5, 0) - local arrow = line:CreateTexture (nil, "overlay") - arrow:SetTexture ([[Interface\Buttons\JumpUpArrow]]) + local arrow = line:CreateTexture(nil, "overlay") + arrow:SetTexture([[Interface\Buttons\JumpUpArrow]]) arrow:SetRotation (-1.55) - arrow:SetPoint ("right", line, "right", -5, 0) + arrow:SetPoint("right", line, "right", -5, 0) self.feedback_lines [self.next_feedback] = line end @@ -2569,14 +2569,14 @@ local on_click_feedback = function(self) if (not feedback_link_textbox) then local editbox = DF:CreateTextEntry (AddonFeedbackPanel, _, 275, 34) editbox:SetAutoFocus (false) - editbox:SetHook ("OnEditFocusGained", function() + editbox:SetHook("OnEditFocusGained", function() editbox.text = editbox.link editbox:HighlightText() end) - editbox:SetHook ("OnEditFocusLost", function() + editbox:SetHook("OnEditFocusLost", function() editbox:Hide() end) - editbox:SetHook ("OnChar", function() + editbox:SetHook("OnChar", function() editbox.text = editbox.link editbox:HighlightText() end) @@ -2590,7 +2590,7 @@ local on_click_feedback = function(self) feedback_link_textbox.text = self.link feedback_link_textbox:Show() - feedback_link_textbox:SetPoint ("topleft", self.icon, "topright", 3, 0) + feedback_link_textbox:SetPoint("topleft", self.icon, "topright", 3, 0) feedback_link_textbox:HighlightText() @@ -2606,13 +2606,13 @@ local on_enter_addon = function(self) GameCooltip2:AddLine (self.tooltip) GameCooltip2:ShowCooltip (self, "tooltip") end - self.icon:SetBlendMode ("ADD") + self.icon:SetBlendMode("ADD") end local on_leave_addon = function(self) if (self.tooltip) then GameCooltip2:Hide() end - self.icon:SetBlendMode ("BLEND") + self.icon:SetBlendMode("BLEND") end local on_click_addon = function(self) local addon_link_textbox = DF.addon_link_textbox @@ -2620,14 +2620,14 @@ local on_click_addon = function(self) if (not addon_link_textbox) then local editbox = DF:CreateTextEntry (AddonFeedbackPanel, _, 128, 64) editbox:SetAutoFocus (false) - editbox:SetHook ("OnEditFocusGained", function() + editbox:SetHook("OnEditFocusGained", function() editbox.text = editbox.link editbox:HighlightText() end) - editbox:SetHook ("OnEditFocusLost", function() + editbox:SetHook("OnEditFocusLost", function() editbox:Hide() end) - editbox:SetHook ("OnChar", function() + editbox:SetHook("OnChar", function() editbox.text = editbox.link editbox:HighlightText() end) @@ -2641,7 +2641,7 @@ local on_click_addon = function(self) addon_link_textbox.text = self.link addon_link_textbox:Show() - addon_link_textbox:SetPoint ("topleft", self.icon, "topleft", 0, 0) + addon_link_textbox:SetPoint("topleft", self.icon, "topleft", 0, 0) addon_link_textbox:HighlightText() @@ -2653,27 +2653,27 @@ local feedback_get_addons_line = function(self) local line = self.addons_lines [self.next_addons] if (not line) then - line = CreateFrame ("frame", "AddonFeedbackPanelSA" .. self.next_addons, self, "BackdropTemplate") - line:SetSize (128, 64) + line = CreateFrame("frame", "AddonFeedbackPanelSA" .. self.next_addons, self, "BackdropTemplate") + line:SetSize(128, 64) if (self.next_addons == 1) then - line:SetPoint ("topleft", self.addons_anchor, "bottomleft", 0, -5) + line:SetPoint("topleft", self.addons_anchor, "bottomleft", 0, -5) elseif (self.next_addons_line_break == self.next_addons) then - line:SetPoint ("topleft", self.addons_anchor, "bottomleft", 0, -5 + floor (self.next_addons_line_break/3) * 66 * -1) + line:SetPoint("topleft", self.addons_anchor, "bottomleft", 0, -5 + floor (self.next_addons_line_break/3) * 66 * -1) self.next_addons_line_break = self.next_addons_line_break + 3 else local previous = self.addons_lines [self.next_addons - 1] - line:SetPoint ("topleft", previous, "topright", 2, 0) + line:SetPoint("topleft", previous, "topright", 2, 0) end - line:SetScript ("OnEnter", on_enter_addon) - line:SetScript ("OnLeave", on_leave_addon) - line:SetScript ("OnMouseUp", on_click_addon) + line:SetScript("OnEnter", on_enter_addon) + line:SetScript("OnLeave", on_leave_addon) + line:SetScript("OnMouseUp", on_click_addon) - line.icon = line:CreateTexture (nil, "overlay") - line.icon:SetSize (128, 64) + line.icon = line:CreateTexture(nil, "overlay") + line.icon:SetSize(128, 64) - line.icon:SetPoint ("topleft", line, "topleft", 0, 0) + line.icon:SetPoint("topleft", line, "topleft", 0, 0) self.addons_lines [self.next_addons] = line end @@ -2686,16 +2686,16 @@ end local default_coords = {0, 1, 0, 1} local feedback_add_fb = function(self, table) local line = self:GetFeedbackLine() - line.icon:SetTexture (table.icon) + line.icon:SetTexture(table.icon) line.icon:SetTexCoord (unpack (table.coords or default_coords)) - line.desc:SetText (table.desc) + line.desc:SetText(table.desc) line.link = table.link line:Show() end local feedback_add_addon = function(self, table) local block = self:GetAddonsLine() - block.icon:SetTexture (table.icon) + block.icon:SetTexture(table.icon) block.icon:SetTexCoord (unpack (table.coords or default_coords)) block.link = table.link block.tooltip = table.desc @@ -2707,11 +2707,11 @@ local feedback_hide_all = function(self) self.next_feedback = 1 self.next_addons = 1 - for index, line in ipairs (self.feedback_lines) do + for index, line in ipairs(self.feedback_lines) do line:Hide() end - for index, line in ipairs (self.addons_lines) do + for index, line in ipairs(self.addons_lines) do line:Hide() end end @@ -2724,8 +2724,8 @@ function DF:ShowFeedbackPanel (addon_name, version, feedback_methods, more_addon if (not f) then f = DF:Create1PxPanel (UIParent, 400, 100, addon_name .. " Feedback", "AddonFeedbackPanel", nil) f:SetFrameStrata ("FULLSCREEN") - f:SetPoint ("center", UIParent, "center") - f:SetBackdropColor (0, 0, 0, 0.8) + f:SetPoint("center", UIParent, "center") + f:SetBackdropColor(0, 0, 0, 0.8) f.feedback_lines = {} f.addons_lines = {} f.next_feedback = 1 @@ -2733,19 +2733,19 @@ function DF:ShowFeedbackPanel (addon_name, version, feedback_methods, more_addon f.next_addons_line_break = 4 local feedback_anchor = f:CreateFontString (nil, "overlay", "GameFontNormal") - feedback_anchor:SetText ("Feedback:") - feedback_anchor:SetPoint ("topleft", f, "topleft", 5, -30) + feedback_anchor:SetText("Feedback:") + feedback_anchor:SetPoint("topleft", f, "topleft", 5, -30) f.feedback_anchor = feedback_anchor local excla_text = f:CreateFontString (nil, "overlay", "GameFontNormal") - excla_text:SetText ("click and copy the link") - excla_text:SetPoint ("topright", f, "topright", -5, -30) + excla_text:SetText("click and copy the link") + excla_text:SetPoint("topright", f, "topright", -5, -30) excla_text:SetTextColor (1, 0.8, 0.2, 0.6) local addons_anchor = f:CreateFontString (nil, "overlay", "GameFontNormal") - addons_anchor:SetText ("AddOns From the Same Author:") + addons_anchor:SetText("AddOns From the Same Author:") f.addons_anchor = addons_anchor local excla_text2 = f:CreateFontString (nil, "overlay", "GameFontNormal") - excla_text2:SetText ("click and copy the link") + excla_text2:SetText("click and copy the link") excla_text2:SetTextColor (1, 0.8, 0.2, 0.6) f.excla_text2 = excla_text2 @@ -2762,18 +2762,18 @@ function DF:ShowFeedbackPanel (addon_name, version, feedback_methods, more_addon f:HideAll() f:SetTitle (addon_name) - for index, feedback in ipairs (feedback_methods) do + for index, feedback in ipairs(feedback_methods) do f:AddFeedbackMethod (feedback) end - f.addons_anchor:SetPoint ("topleft", f, "topleft", 5, f.next_feedback * 50 * -1) - f.excla_text2:SetPoint ("topright", f, "topright", -5, f.next_feedback * 50 * -1) + f.addons_anchor:SetPoint("topleft", f, "topleft", 5, f.next_feedback * 50 * -1) + f.excla_text2:SetPoint("topright", f, "topright", -5, f.next_feedback * 50 * -1) - for index, addon in ipairs (more_addons) do + for index, addon in ipairs(more_addons) do f:AddOtherAddon (addon) end - f:SetHeight (80 + ((f.next_feedback-1) * 50) + (ceil ((f.next_addons-1)/3) * 66)) + f:SetHeight(80 + ((f.next_feedback-1) * 50) + (ceil ((f.next_addons-1)/3) * 66)) f:Show() @@ -2782,7 +2782,7 @@ end ------------------------------------------------------------------------------------------------------------------------------------------------ ---> chart panel -- ~chart +--chart panel -- ~chart 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}} @@ -2801,9 +2801,9 @@ local chart_panel_align_timelabels = function(self, elapsed_time) if (minutos < 10) then minutos = "0" .. minutos end - linha:SetText (minutos .. ":" .. segundos) + linha:SetText(minutos .. ":" .. segundos) else - linha:SetText ("00:" .. segundos) + linha:SetText("00:" .. segundos) end local time_div = elapsed_time / 16 --786 -- 49.125 @@ -2823,9 +2823,9 @@ local chart_panel_align_timelabels = function(self, elapsed_time) if (minutos < 10) then minutos = "0" .. minutos end - linha:SetText (minutos .. ":" .. segundos) + linha:SetText(minutos .. ":" .. segundos) else - linha:SetText ("00:" .. segundos) + linha:SetText("00:" .. segundos) end end @@ -2833,7 +2833,7 @@ local chart_panel_align_timelabels = function(self, elapsed_time) end local chart_panel_set_scale = function(self, amt, func, text) - if (type (amt) ~= "number") then + if (type(amt) ~= "number") then return end @@ -2842,12 +2842,12 @@ local chart_panel_set_scale = function(self, amt, func, text) for i = 1, 8 do if (func) then - self ["dpsamt" .. math.abs (i-9)]:SetText (func (piece*i)) + self ["dpsamt" .. math.abs (i-9)]:SetText(func (piece*i)) else if (piece*i > 1) then - self ["dpsamt" .. math.abs (i-9)]:SetText (DF.FormatNumber (piece*i)) + self ["dpsamt" .. math.abs (i-9)]:SetText(DF.FormatNumber (piece*i)) else - self ["dpsamt" .. math.abs (i-9)]:SetText (format ("%.3f", piece*i)) + self ["dpsamt" .. math.abs (i-9)]:SetText(format ("%.3f", piece*i)) end end end @@ -2859,8 +2859,8 @@ end 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 + for index, pack in ipairs(self.Overlays) do + for index2, texture in ipairs(pack) do texture:Hide() end end @@ -2876,7 +2876,7 @@ local chart_panel_reset = function(self) table.wipe (self.GData) table.wipe (self.OData) - for index, box in ipairs (self.BoxLabels) do + for index, box in ipairs(self.BoxLabels) do box.check:Hide() box.button:Hide() box.box:Hide() @@ -2911,7 +2911,7 @@ local chart_panel_enable_line = function(f, thisbox) local max = 0 local max_time = 0 - for index, box in ipairs (f.BoxLabels) do + for index, box in ipairs(f.BoxLabels) do if (box.type == type and box.showing and box.enabled) then local data = f.GData [index] @@ -2926,14 +2926,14 @@ local chart_panel_enable_line = function(f, thisbox) end end - f:SetScale (max) + f:SetScale(max) f:SetTime (max_time) elseif (type == "overlay") then chart_panel_overlay_reset (f) - for index, box in ipairs (f.BoxLabels) do + for index, box in ipairs(f.BoxLabels) do if (box.type == type and box.showing and box.enabled) then f:AddOverlay (box.index) @@ -2950,15 +2950,15 @@ local create_box = function(self, next_box) self.BoxLabels [next_box] = thisbox local box = DF:NewImage (self.Graphic, nil, 16, 16, "border") - local text = DF:NewLabel (self.Graphic) + local text = DF:NewLabel(self.Graphic) local border = DF:NewImage (self.Graphic, [[Interface\DialogFrame\UI-DialogBox-Gold-Corner]], 30, 30, "artwork") - border:SetPoint ("center", box, "center", -3, -4) - border:SetTexture ([[Interface\DialogFrame\UI-DialogBox-Gold-Corner]]) + border:SetPoint("center", box, "center", -3, -4) + border:SetTexture([[Interface\DialogFrame\UI-DialogBox-Gold-Corner]]) local checktexture = DF:NewImage (self.Graphic, [[Interface\Buttons\UI-CheckBox-Check]], 18, 18, "overlay") - checktexture:SetPoint ("center", box, "center", 0, -1) - checktexture:SetTexture ([[Interface\Buttons\UI-CheckBox-Check]]) + checktexture:SetPoint("center", box, "center", 0, -1) + checktexture:SetTexture([[Interface\Buttons\UI-CheckBox-Check]]) thisbox.box = box thisbox.text = text @@ -2966,26 +2966,26 @@ local create_box = function(self, next_box) thisbox.check = checktexture thisbox.enabled = true - local button = CreateFrame ("button", nil, self.Graphic, "BackdropTemplate") - button:SetSize (20, 20) - button:SetScript ("OnClick", function() + local button = CreateFrame("button", nil, self.Graphic, "BackdropTemplate") + button:SetSize(20, 20) + button:SetScript("OnClick", function() chart_panel_enable_line (self, thisbox) end) - button:SetPoint ("topleft", box.widget or box, "topleft", 0, 0) - button:SetPoint ("bottomright", box.widget or box, "bottomright", 0, 0) + button:SetPoint("topleft", box.widget or box, "topleft", 0, 0) + button:SetPoint("bottomright", box.widget or box, "bottomright", 0, 0) - button:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - button:SetBackdropColor (0, 0, 0, 0.0) - button:SetBackdropBorderColor (0, 0, 0, 1) + button:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + button:SetBackdropColor(0, 0, 0, 0.0) + button:SetBackdropBorderColor(0, 0, 0, 1) thisbox.button = button - thisbox.box:SetPoint ("right", text, "left", -4, 0) + thisbox.box:SetPoint("right", text, "left", -4, 0) if (next_box == 1) then - thisbox.text:SetPoint ("topright", self, "topright", -35, -16) + thisbox.text:SetPoint("topright", self, "topright", -35, -16) else - thisbox.text:SetPoint ("right", self.BoxLabels [next_box-1].box, "left", -17, 0) + thisbox.text:SetPoint("right", self.BoxLabels [next_box-1].box, "left", -17, 0) end return thisbox @@ -2995,7 +2995,7 @@ end local realign_labels = function(self) if (not self.ShowHeader) then - for _, box in ipairs (self.BoxLabels) do + for _, box in ipairs(self.BoxLabels) do box.check:Hide() box.button:Hide() box.border:Hide() @@ -3008,7 +3008,7 @@ local realign_labels = function(self) local width = self:GetWidth() - 108 local first_box = self.BoxLabels [1] - first_box.text:SetPoint ("topright", self, "topright", -35, -16) + first_box.text:SetPoint("topright", self, "topright", -35, -16) local line_width = first_box.text:GetStringWidth() + 26 @@ -3022,9 +3022,9 @@ local realign_labels = function(self) if (line_width > width) then line_width = box.text:GetStringWidth() + 26 - box.text:SetPoint ("topright", self, "topright", -35, -40) + box.text:SetPoint("topright", self, "topright", -35, -40) else - box.text:SetPoint ("right", self.BoxLabels [i-1].box, "left", -27, 0) + box.text:SetPoint("right", self.BoxLabels [i-1].box, "left", -27, 0) end else break @@ -3032,7 +3032,7 @@ local realign_labels = function(self) end if (self.HeaderOnlyIndicator) then - for _, box in ipairs (self.BoxLabels) do + for _, box in ipairs(self.BoxLabels) do box.check:Hide() box.button:Hide() end @@ -3056,7 +3056,7 @@ local chart_panel_add_label = function(self, color, name, type, number) thisbox.index = number thisbox.box:SetColorTexture (unpack (color)) - thisbox.text:SetText (name) + thisbox.text:SetText(name) thisbox.check:Show() thisbox.button:Show() @@ -3084,17 +3084,17 @@ local draw_overlay = function(self, this_overlay, overlayData, color) local this_block = this_overlay [index] if (not this_block) then - this_block = self.Graphic:CreateTexture (nil, "border") + this_block = self.Graphic:CreateTexture(nil, "border") tinsert (this_overlay, this_block) end - this_block:SetHeight (self.Graphic:GetHeight()) + this_block:SetHeight(self.Graphic:GetHeight()) - this_block:SetPoint ("left", self.Graphic, "left", pixel * aura_start, 0) + this_block:SetPoint("left", self.Graphic, "left", pixel * aura_start, 0) if (aura_end) then - this_block:SetWidth ((aura_end-aura_start)*pixel) + this_block:SetWidth((aura_end-aura_start)*pixel) else --malformed table - this_block:SetWidth (pixel*5) + this_block:SetWidth(pixel*5) end this_block:SetColorTexture (r, g, b, a or 0.25) @@ -3111,7 +3111,7 @@ local chart_panel_add_overlay = function(self, overlayData, color, name, icon) error ("Use SetTime (time) before adding an overlay.") end - if (type (overlayData) == "number") then + if (type(overlayData) == "number") then local overlay_index = overlayData draw_overlay (self, self.Overlays [self.OverlaysAmount], self.OData [overlay_index][1], self.OData [overlay_index][2]) else @@ -3248,18 +3248,18 @@ local chart_panel_onresize = function(self) for i = 1, 17 do local label = self.TimeLabels [i] - label:SetPoint ("bottomleft", self, "bottomleft", 78 + ((i-1)*spacement), self.TimeLabelsHeight) - label.line:SetHeight (height - 45) + label:SetPoint("bottomleft", self, "bottomleft", 78 + ((i-1)*spacement), self.TimeLabelsHeight) + label.line:SetHeight(height - 45) end local spacement = (self.Graphic:GetHeight()) / 8 for i = 1, 8 do - self ["dpsamt"..i]:SetPoint ("TOPLEFT", self, "TOPLEFT", 27, -25 + (-(spacement* (i-1))) ) - self ["dpsamt"..i].line:SetWidth (width-20) + self ["dpsamt"..i]:SetPoint("TOPLEFT", self, "TOPLEFT", 27, -25 + (-(spacement* (i-1))) ) + self ["dpsamt"..i].line:SetWidth(width-20) end - self.Graphic:SetSize (width - 135, height - 67) - self.Graphic:SetPoint ("topleft", self, "topleft", 108, -35) + self.Graphic:SetSize(width - 135, height - 67) + self.Graphic:SetPoint("topleft", self, "topleft", 108, -35) end local chart_panel_add_data = function(self, graphicData, color, name, elapsed_time, lineTexture, smoothLevel, firstIndex) @@ -3285,8 +3285,8 @@ local chart_panel_add_data = function(self, graphicData, color, name, elapsed_ti if (not smoothLevel) then while (_i <= #content-2) do - local v = (content[_i-2]+content[_i-1]+content[_i]+content[_i+1]+content[_i+2])/5 --> normalize - _data [#_data+1] = {scaleW*(_i-2), v/graphMaxDps} --> x and y coords + local v = (content[_i-2]+content[_i-1]+content[_i]+content[_i+1]+content[_i+2])/5 --normalize + _data [#_data+1] = {scaleW*(_i-2), v/graphMaxDps} --x and y coords _i = _i + 1 end @@ -3305,7 +3305,7 @@ local chart_panel_add_data = function(self, graphicData, color, name, elapsed_ti if (is_new_max_value) then max_value = is_new_max_value end - _data [#_data+1] = {scaleW*(_i-2), value} --> x and y coords + _data [#_data+1] = {scaleW*(_i-2), value} --x and y coords _i = _i + 1 end @@ -3318,24 +3318,24 @@ local chart_panel_add_data = function(self, graphicData, color, name, elapsed_ti local plus_1 = content[_i+1] * 0.8 local plus_2 = content[_i+2] * 0.6 - local v = (current + minus_2 + minus_1 + plus_1 + plus_2)/5 --> normalize - _data [#_data+1] = {scaleW*(_i-2), v/graphMaxDps} --> x and y coords + local v = (current + minus_2 + minus_1 + plus_1 + plus_2)/5 --normalize + _data [#_data+1] = {scaleW*(_i-2), v/graphMaxDps} --x and y coords _i = _i + 1 end elseif (smoothLevel == 1) then _i = 2 while (_i <= #content-1) do - local v = (content[_i-1]+content[_i]+content[_i+1])/3 --> normalize - _data [#_data+1] = {scaleW*(_i-1), v/graphMaxDps} --> x and y coords + local v = (content[_i-1]+content[_i]+content[_i+1])/3 --normalize + _data [#_data+1] = {scaleW*(_i-1), v/graphMaxDps} --x and y coords _i = _i + 1 end elseif (smoothLevel == 2) then _i = 1 while (_i <= #content) do - local v = content[_i] --> do not normalize - _data [#_data+1] = {scaleW*(_i), v/graphMaxDps} --> x and y coords + local v = content[_i] --do not normalize + _data [#_data+1] = {scaleW*(_i), v/graphMaxDps} --x and y coords _i = _i + 1 end @@ -3347,10 +3347,10 @@ local chart_panel_add_data = function(self, graphicData, color, name, elapsed_ti tremove (content, #graphicData) if (max_value > self.max_value) then - --> normalize previous data + --normalize previous data if (self.max_value > 0) then local normalizePercent = self.max_value / max_value - for dataIndex, Data in ipairs (self.Data) do + for dataIndex, Data in ipairs(self.Data) do local Points = Data.Points for i = 1, #Points do Points[i][2] = Points[i][2]*normalizePercent @@ -3359,7 +3359,7 @@ local chart_panel_add_data = function(self, graphicData, color, name, elapsed_ti end self.max_value = max_value - f:SetScale (max_value) + f:SetScale(max_value) end @@ -3388,7 +3388,7 @@ local chart_panel_add_data = function(self, graphicData, color, name, elapsed_ti end local max_time = 0 - for _, data in ipairs (self.Data) do + for _, data in ipairs(self.Data) do if (data.ElapsedTime > max_time) then max_time = data.ElapsedTime end @@ -3444,7 +3444,7 @@ local chart_panel_hide_close_button = function(self) end local chart_panel_right_click_close = function(self, value) - if (type (value) == "boolean") then + if (type(value) == "boolean") then if (value) then self.no_right_click_close = nil else @@ -3464,27 +3464,27 @@ function DF:CreateChartPanel (parent, w, h, name) w = w or 800 h = h or 500 - local f = CreateFrame ("frame", name, parent, "BackdropTemplate") - f:SetSize (w or 500, h or 400) + local f = CreateFrame("frame", name, parent, "BackdropTemplate") + f:SetSize(w or 500, h or 400) f:EnableMouse (true) f:SetMovable (true) - f:SetScript ("OnMouseDown", chart_panel_mousedown) - f:SetScript ("OnMouseUp", chart_panel_mouseup) + f:SetScript("OnMouseDown", chart_panel_mousedown) + f:SetScript("OnMouseUp", chart_panel_mouseup) - f:SetBackdrop (chart_panel_backdrop) - f:SetBackdropColor (.3, .3, .3, .3) + f:SetBackdrop(chart_panel_backdrop) + f:SetBackdropColor(.3, .3, .3, .3) - local c = CreateFrame ("Button", nil, f, "UIPanelCloseButton", "BackdropTemplate") - c:SetWidth (32) - c:SetHeight (32) - c:SetPoint ("TOPRIGHT", f, "TOPRIGHT", -3, -7) + local c = CreateFrame("Button", nil, f, "UIPanelCloseButton", "BackdropTemplate") + c:SetWidth(32) + c:SetHeight(32) + c:SetPoint("TOPRIGHT", f, "TOPRIGHT", -3, -7) c:SetFrameLevel (f:GetFrameLevel()+1) c:SetAlpha (0.9) f.CloseButton = c - local title = DF:NewLabel (f, nil, "$parentTitle", "chart_title", "Chart!", nil, 20, {1, 1, 0}) - title:SetPoint ("topleft", f, "topleft", 110, -13) + local title = DF:NewLabel(f, nil, "$parentTitle", "chart_title", "Chart!", nil, 20, {1, 1, 0}) + title:SetPoint("topleft", f, "topleft", 110, -13) f.Overlays = {} f.OverlaysAmount = 1 @@ -3522,18 +3522,18 @@ function DF:CreateChartPanel (parent, w, h, name) --div lines for i = 1, 8, 1 do - local line = g:CreateTexture (nil, "overlay") + local line = g:CreateTexture(nil, "overlay") line:SetColorTexture (1, 1, 1, .05) - line:SetWidth (670) - line:SetHeight (1.1) + line:SetWidth(670) + line:SetHeight(1.1) local s = f:CreateFontString (nil, "overlay", "GameFontHighlightSmall") f ["dpsamt"..i] = s - s:SetText ("100k") - s:SetPoint ("topleft", f, "topleft", 27, -61 + (-(24.6*i))) + s:SetText("100k") + s:SetPoint("topleft", f, "topleft", 27, -61 + (-(24.6*i))) - line:SetPoint ("topleft", s, "bottom", -27, 0) - line:SetPoint ("topright", g, "right", 0, 0) + line:SetPoint("topleft", s, "bottom", -27, 0) + line:SetPoint("topright", g, "right", 0, 0) s.line = line end @@ -3543,22 +3543,22 @@ function DF:CreateChartPanel (parent, w, h, name) for i = 1, 17 do local time = f:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - time:SetText ("00:00") - time:SetPoint ("bottomleft", f, "bottomleft", 78 + ((i-1)*36), f.TimeLabelsHeight) + time:SetText("00:00") + time:SetPoint("bottomleft", f, "bottomleft", 78 + ((i-1)*36), f.TimeLabelsHeight) f.TimeLabels [i] = time - local line = f:CreateTexture (nil, "border") - line:SetSize (1, h-45) + local line = f:CreateTexture(nil, "border") + line:SetSize(1, h-45) line:SetColorTexture (1, 1, 1, .1) - line:SetPoint ("bottomleft", time, "topright", 0, -10) + line:SetPoint("bottomleft", time, "topright", 0, -10) line:Hide() time.line = line end local bottom_texture = DF:NewImage (f, nil, 702, 25, "background", nil, nil, "$parentBottomTexture") bottom_texture:SetColorTexture (.1, .1, .1, .7) - bottom_texture:SetPoint ("topright", g, "bottomright", 0, 0) - bottom_texture:SetPoint ("bottomleft", f, "bottomleft", 8, 12) + bottom_texture:SetPoint("topright", g, "bottomright", 0, 0) + bottom_texture:SetPoint("bottomleft", f, "bottomleft", 8, 12) @@ -3577,7 +3577,7 @@ function DF:CreateChartPanel (parent, w, h, name) f.CalcStdDev = calc_stddev f.CalcLowessSmoothing = calc_lowess_smoothing - f:SetScript ("OnSizeChanged", chart_panel_onresize) + f:SetScript("OnSizeChanged", chart_panel_onresize) chart_panel_onresize (f) return f @@ -3586,11 +3586,11 @@ end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -- ~gframe local gframe_on_enter_line = function(self) - self:SetBackdropColor (0, 0, 0, 0) + self:SetBackdropColor(0, 0, 0, 0) local parent = self:GetParent() local ball = self.ball - ball:SetBlendMode ("ADD") + ball:SetBlendMode("ADD") local on_enter = parent._onenter_line if (on_enter) then @@ -3599,11 +3599,11 @@ local gframe_on_enter_line = function(self) end local gframe_on_leave_line = function(self) - self:SetBackdropColor (0, 0, 0, .6) + self:SetBackdropColor(0, 0, 0, .6) local parent = self:GetParent() local ball = self.ball - ball:SetBlendMode ("BLEND") + ball:SetBlendMode("BLEND") local on_leave = parent._onleave_line if (on_leave) then @@ -3614,55 +3614,55 @@ end local gframe_create_line = function(self) local index = #self._lines+1 - local f = CreateFrame ("frame", nil, self, "BackdropTemplate") + local f = CreateFrame("frame", nil, self, "BackdropTemplate") self._lines [index] = f f.id = index - f:SetScript ("OnEnter", gframe_on_enter_line) - f:SetScript ("OnLeave", gframe_on_leave_line) + f:SetScript("OnEnter", gframe_on_enter_line) + f:SetScript("OnLeave", gframe_on_leave_line) - f:SetWidth (self._linewidth) + f:SetWidth(self._linewidth) if (index == 1) then - f:SetPoint ("topleft", self, "topleft") - f:SetPoint ("bottomleft", self, "bottomleft") + f:SetPoint("topleft", self, "topleft") + f:SetPoint("bottomleft", self, "bottomleft") else local previous_line = self._lines [index-1] - f:SetPoint ("topleft", previous_line, "topright") - f:SetPoint ("bottomleft", previous_line, "bottomright") + f:SetPoint("topleft", previous_line, "topright") + f:SetPoint("bottomleft", previous_line, "bottomright") end - local t = f:CreateTexture (nil, "background") - t:SetWidth (1) - t:SetPoint ("topright", f, "topright") - t:SetPoint ("bottomright", f, "bottomright") + local t = f:CreateTexture(nil, "background") + t:SetWidth(1) + t:SetPoint("topright", f, "topright") + t:SetPoint("bottomright", f, "bottomright") t:SetColorTexture (1, 1, 1, .1) f.grid = t - local b = f:CreateTexture (nil, "overlay") - b:SetTexture ([[Interface\COMMON\Indicator-Yellow]]) - b:SetSize (16, 16) + local b = f:CreateTexture(nil, "overlay") + b:SetTexture([[Interface\COMMON\Indicator-Yellow]]) + b:SetSize(16, 16) f.ball = b - local anchor = CreateFrame ("frame", nil, f, "BackdropTemplate") - anchor:SetAllPoints (b) + local anchor = CreateFrame("frame", nil, f, "BackdropTemplate") + anchor:SetAllPoints(b) b.tooltip_anchor = anchor - local spellicon = f:CreateTexture (nil, "artwork") - spellicon:SetPoint ("bottom", b, "bottom", 0, 10) - spellicon:SetSize (16, 16) + local spellicon = f:CreateTexture(nil, "artwork") + spellicon:SetPoint("bottom", b, "bottom", 0, 10) + spellicon:SetSize(16, 16) f.spellicon = spellicon local text = f:CreateFontString (nil, "overlay", "GameFontNormal") - local textBackground = f:CreateTexture (nil, "artwork") - textBackground:SetSize (30, 16) + local textBackground = f:CreateTexture(nil, "artwork") + textBackground:SetSize(30, 16) textBackground:SetColorTexture (0, 0, 0, 0.5) - textBackground:SetPoint ("bottom", f.ball, "top", 0, -6) - text:SetPoint ("center", textBackground, "center") + textBackground:SetPoint("bottom", f.ball, "top", 0, -6) + text:SetPoint("center", textBackground, "center") DF:SetFontSize (text, 10) f.text = text f.textBackground = textBackground local timeline = f:CreateFontString (nil, "overlay", "GameFontNormal") - timeline:SetPoint ("bottomright", f, "bottomright", -2, 0) + timeline:SetPoint("bottomright", f, "bottomright", -2, 0) DF:SetFontSize (timeline, 8) f.timeline = timeline @@ -3678,7 +3678,7 @@ local gframe_getline = function(self, index) end local gframe_reset = function(self) - for i, line in ipairs (self._lines) do + for i, line in ipairs(self._lines) do line:Hide() end if (self.GraphLib_Lines_Used) then @@ -3727,15 +3727,15 @@ local gframe_update = function(self, lines) line:Show() line.ball:Show() - line.ball:SetPoint ("bottomleft", self, "bottomleft", (o*linewidth)-8, pvalue-8) - line.spellicon:SetTexture (nil) - line.timeline:SetText (data.text) + line.ball:SetPoint("bottomleft", self, "bottomleft", (o*linewidth)-8, pvalue-8) + line.spellicon:SetTexture(nil) + line.timeline:SetText(data.text) line.timeline:Show() if (data.utext) then line.text:Show() line.textBackground:Show() - line.text:SetText (data.utext) + line.text:SetText(data.utext) else line.text:Hide() line.textBackground:Hide() @@ -3749,8 +3749,8 @@ local gframe_update = function(self, lines) end function DF:CreateGFrame (parent, w, h, linewidth, onenter, onleave, member, name) - local f = CreateFrame ("frame", name, parent, "BackdropTemplate") - f:SetSize (w or 450, h or 150) + local f = CreateFrame("frame", name, parent, "BackdropTemplate") + f:SetSize(w or 450, h or 150) --f.CustomLine = [[Interface\AddOns\Details\Libs\LibGraph-2.0\line]] if (member) then @@ -3780,13 +3780,13 @@ end -- ~buttoncontainer function DF:CreateButtonContainer (parent, name) - local f = CreateFrame ("frame", name, parent, "BackdropTemplate") + local f = CreateFrame("frame", name, parent, "BackdropTemplate") -- f. end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> options tabs and buttons -dot +--options tabs and buttons -dot function DF:FindHighestParent (self) local f @@ -3814,20 +3814,20 @@ local button_tab_template = DF.table.copy ({}, DF:GetTemplate ("button", "OPTION button_tab_template.backdropbordercolor = nil 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) - selectedGlow:SetTexture ([[Interface\BUTTONS\UI-Panel-Button-Glow]]) + local selectedGlow = button:CreateTexture(nil, "background", nil, -4) + selectedGlow:SetPoint("topleft", button.widget, "bottomleft", -7, 0) + selectedGlow:SetPoint("topright", button.widget, "bottomright", 7, 0) + selectedGlow:SetTexture([[Interface\BUTTONS\UI-Panel-Button-Glow]]) selectedGlow:SetTexCoord (0, 95/128, 30/64, 38/64) - selectedGlow:SetBlendMode ("ADD") - selectedGlow:SetHeight (8) + selectedGlow:SetBlendMode("ADD") + selectedGlow:SetHeight(8) selectedGlow:SetAlpha (.75) selectedGlow:Hide() button.selectedUnderlineGlow = selectedGlow end DF.TabContainerFunctions.OnMouseDown = function(self, button) - --> search for UIParent + --search for UIParent local f = DF:FindHighestParent (self) local container = self:GetParent() @@ -3868,7 +3868,7 @@ DF.TabContainerFunctions.SelectIndex = function(self, fixedParam, menuIndex) for i = 1, #mainFrame.AllFrames do mainFrame.AllFrames[i]:Hide() if (mainFrame.ButtonNotSelectedBorderColor) then - mainFrame.AllButtons[i]:SetBackdropBorderColor (unpack (mainFrame.ButtonNotSelectedBorderColor)) + mainFrame.AllButtons[i]:SetBackdropBorderColor(unpack (mainFrame.ButtonNotSelectedBorderColor)) end if (mainFrame.AllButtons[i].selectedUnderlineGlow) then mainFrame.AllButtons[i].selectedUnderlineGlow:Hide() @@ -3880,7 +3880,7 @@ DF.TabContainerFunctions.SelectIndex = function(self, fixedParam, menuIndex) mainFrame.AllFrames[menuIndex]:RefreshOptions() end if (mainFrame.ButtonSelectedBorderColor) then - mainFrame.AllButtons[menuIndex]:SetBackdropBorderColor (unpack (mainFrame.ButtonSelectedBorderColor)) + mainFrame.AllButtons[menuIndex]:SetBackdropBorderColor(unpack (mainFrame.ButtonSelectedBorderColor)) end if (mainFrame.AllButtons[menuIndex].selectedUnderlineGlow) then mainFrame.AllButtons[menuIndex].selectedUnderlineGlow:Show() @@ -3918,13 +3918,13 @@ function DF:CreateTabContainer (parent, title, frame_name, frameList, options_ta local button_text_size = options_table.button_text_size or 10 local containerWidthOffset = options_table.container_width_offset or 0 - local mainFrame = CreateFrame ("frame", frame_name, parent.widget or parent, "BackdropTemplate") + local mainFrame = CreateFrame("frame", frame_name, parent.widget or parent, "BackdropTemplate") mainFrame:SetAllPoints() DF:Mixin (mainFrame, DF.TabContainerFunctions) mainFrame.hookList = hookList or {} - local mainTitle = DF:CreateLabel (mainFrame, title, 24, "white") - mainTitle:SetPoint ("topleft", mainFrame, "topleft", 10, -30 + y_offset) + local mainTitle = DF:CreateLabel(mainFrame, title, 24, "white") + mainTitle:SetPoint("topleft", mainFrame, "topleft", 10, -30 + y_offset) mainFrame:SetFrameLevel (200) @@ -3941,14 +3941,14 @@ function DF:CreateTabContainer (parent, title, frame_name, frameList, options_ta mainFrame.CanCloseWithRightClick = true end - for i, frame in ipairs (frameList) do - local f = CreateFrame ("frame", "$parent" .. frame.name, mainFrame, "BackdropTemplate") + for i, frame in ipairs(frameList) do + local f = CreateFrame("frame", "$parent" .. frame.name, mainFrame, "BackdropTemplate") f:SetAllPoints() f:SetFrameLevel (210) f:Hide() - local title = DF:CreateLabel (f, frame.title, 16, "silver") - title:SetPoint ("topleft", mainTitle, "bottomleft", 0, 0) + local title = DF:CreateLabel(f, frame.title, 16, "silver") + title:SetPoint("topleft", mainTitle, "bottomleft", 0, 0) f.titleText = title local tabButton = DF:CreateButton (mainFrame, DF.TabContainerFunctions.SelectIndex, buttonWidth, buttonHeight, frame.title, i, nil, nil, nil, "$parentTabButton" .. frame.name, false, button_tab_template) @@ -3960,15 +3960,15 @@ function DF:CreateTabContainer (parent, title, frame_name, frameList, options_ta local right_click_to_back if (i == 1 or options_table.rightbutton_always_close) then - right_click_to_back = DF:CreateLabel (f, "right click to close", 10, "gray") - right_click_to_back:SetPoint ("bottomright", f, "bottomright", -1, options_table.right_click_y or 0) + right_click_to_back = DF:CreateLabel(f, "right click to close", 10, "gray") + right_click_to_back:SetPoint("bottomright", f, "bottomright", -1, options_table.right_click_y or 0) if (options_table.close_text_alpha) then right_click_to_back:SetAlpha (options_table.close_text_alpha) end f.IsFrontPage = true else - right_click_to_back = DF:CreateLabel (f, "right click to go back to main menu", 10, "gray") - right_click_to_back:SetPoint ("bottomright", f, "bottomright", -1, options_table.right_click_y or 0) + right_click_to_back = DF:CreateLabel(f, "right click to go back to main menu", 10, "gray") + right_click_to_back:SetPoint("bottomright", f, "bottomright", -1, options_table.right_click_y or 0) if (options_table.close_text_alpha) then right_click_to_back:SetAlpha (options_table.close_text_alpha) end @@ -3978,8 +3978,8 @@ function DF:CreateTabContainer (parent, title, frame_name, frameList, options_ta right_click_to_back:Hide() end - f:SetScript ("OnMouseDown", DF.TabContainerFunctions.OnMouseDown) - f:SetScript ("OnMouseUp", DF.TabContainerFunctions.OnMouseUp) + f:SetScript("OnMouseDown", DF.TabContainerFunctions.OnMouseDown) + f:SetScript("OnMouseUp", DF.TabContainerFunctions.OnMouseUp) tinsert (mainFrame.AllFrames, f) tinsert (mainFrame.AllButtons, tabButton) @@ -4007,9 +4007,9 @@ function DF:CreateTabContainer (parent, title, frame_name, frameList, options_ta end end - --> when show the frame, reset to the current internal index - mainFrame:SetScript ("OnShow", tab_container_on_show) - --> select the first frame + --when show the frame, reset to the current internal index + mainFrame:SetScript("OnShow", tab_container_on_show) + --select the first frame mainFrame.SelectIndex (mainFrame.AllButtons[1], nil, 1) return mainFrame @@ -4036,7 +4036,7 @@ end -- ~listbox local simple_list_box_ResetWidgets = function(self) - for _, widget in ipairs (self.widgets) do + for _, widget in ipairs(self.widgets) do widget:Hide() end self.nextWidget = 1 @@ -4056,14 +4056,14 @@ local simple_list_box_GetOrCreateWidget = function(self) local widget = self.widgets [index] if (not widget) then widget = DF:CreateButton (self, function()end, self.options.width, self.options.row_height, "", nil, nil, nil, nil, nil, nil, DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) - widget:SetHook ("OnEnter", simple_list_box_onenter) - widget:SetHook ("OnLeave", simple_list_box_onleave) + widget:SetHook("OnEnter", simple_list_box_onenter) + widget:SetHook("OnLeave", simple_list_box_onleave) widget.textcolor = self.options.textcolor widget.textsize = self.options.text_size widget.onleave_backdrop = self.options.backdrop_color widget.XButton = DF:CreateButton (widget, function()end, 16, 16) - widget.XButton:SetPoint ("topright", widget.widget, "topright") + widget.XButton:SetPoint("topright", widget.widget, "topright") widget.XButton:SetIcon ([[Interface\BUTTONS\UI-Panel-MinimizeButton-Up]], 16, 16, "overlay", nil, nil, 0, -4, 0, false) widget.XButton.icon:SetDesaturated (true) @@ -4082,8 +4082,8 @@ local simple_list_box_RefreshWidgets = function(self) local amt = 0 for value, _ in pairs (self.list_table) do local widget = self:GetOrCreateWidget() - widget:SetPoint ("topleft", self, "topleft", 1, -self.options.row_height * (self.nextWidget-2) - 4) - widget:SetPoint ("topright", self, "topright", -1, -self.options.row_height * (self.nextWidget-2) - 4) + widget:SetPoint("topleft", self, "topleft", 1, -self.options.row_height * (self.nextWidget-2) - 4) + widget:SetPoint("topright", self, "topright", -1, -self.options.row_height * (self.nextWidget-2) - 4) widget:SetClickFunction (self.func, value) @@ -4098,11 +4098,11 @@ local simple_list_box_RefreshWidgets = function(self) widget.value = value if (self.options.icon) then - if (type (self.options.icon) == "string" or type (self.options.icon) == "number") then + if (type(self.options.icon) == "string" or type (self.options.icon) == "number") then local coords = type (self.options.iconcoords) == "table" and self.options.iconcoords or {0, 1, 0, 1} widget:SetIcon (self.options.icon, self.options.row_height - 2, self.options.row_height - 2, "overlay", coords) - elseif (type (self.options.icon) == "function") then + elseif (type(self.options.icon) == "function") then local icon = self.options.icon (value) if (icon) then local coords = type (self.options.iconcoords) == "table" and self.options.iconcoords or {0, 1, 0, 1} @@ -4114,24 +4114,24 @@ local simple_list_box_RefreshWidgets = function(self) end if (self.options.text) then - if (type (self.options.text) == "function") then + if (type(self.options.text) == "function") then local text = self.options.text (value) if (text) then - widget:SetText (text) + widget:SetText(text) else - widget:SetText ("") + widget:SetText("") end else - widget:SetText (self.options.text or "") + widget:SetText(self.options.text or "") end else - widget:SetText ("") + widget:SetText("") end widget.value = value - local r, g, b, a = DF:ParseColors (self.options.backdrop_color) - widget:SetBackdropColor (r, g, b, a) + local r, g, b, a = DF:ParseColors(self.options.backdrop_color) + widget:SetBackdropColor(r, g, b, a) widget:Show() amt = amt + 1 @@ -4174,7 +4174,7 @@ local simple_list_box_SetData = function(self, t) end function DF:CreateSimpleListBox (parent, name, title, empty_text, list_table, onclick, options) - local f = CreateFrame ("frame", name, parent, "BackdropTemplate") + local f = CreateFrame("frame", name, parent, "BackdropTemplate") f.ResetWidgets = simple_list_box_ResetWidgets f.GetOrCreateWidget = simple_list_box_GetOrCreateWidget @@ -4202,19 +4202,19 @@ function DF:CreateSimpleListBox (parent, name, title, empty_text, list_table, on end end - f:SetBackdropBorderColor (unpack (f.options.panel_border_color)) + f:SetBackdropBorderColor(unpack (f.options.panel_border_color)) - f:SetSize (f.options.width + 2, f.options.height) + f:SetSize(f.options.width + 2, f.options.height) - local name = DF:CreateLabel (f, title, 12, "silver") + local name = DF:CreateLabel(f, title, 12, "silver") name:SetTemplate (DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")) - name:SetPoint ("bottomleft", f, "topleft", 0, 2) + name:SetPoint("bottomleft", f, "topleft", 0, 2) f.Title = name - local emptyLabel = DF:CreateLabel (f, empty_text, 12, "gray") + local emptyLabel = DF:CreateLabel(f, empty_text, 12, "gray") emptyLabel:SetAlpha (.6) - emptyLabel:SetSize (f.options.width-10, f.options.height) - emptyLabel:SetPoint ("center", 0, 0) + emptyLabel:SetSize(f.options.width-10, f.options.height) + emptyLabel:SetPoint("center", 0, 0) emptyLabel:Hide() emptyLabel.align = "center" f.EmptyLabel = emptyLabel @@ -4231,7 +4231,7 @@ function DF:CreateScrollBox (parent, name, refreshFunc, data, width, height, lin DF:ApplyStandardBackdrop(scroll) - scroll:SetSize (width, height) + scroll:SetSize(width, height) scroll.LineAmount = lineAmount scroll.LineHeight = lineHeight scroll.IsFauxScroll = true @@ -4260,20 +4260,20 @@ function DF:CreateResizeGrips (parent) if (parent) then local parentName = parent:GetName() - local leftResizer = CreateFrame ("button", parentName and parentName .. "LeftResizer" or nil, parent, "BackdropTemplate") - local rightResizer = CreateFrame ("button", parentName and parentName .. "RightResizer" or nil, parent, "BackdropTemplate") + local leftResizer = CreateFrame("button", parentName and parentName .. "LeftResizer" or nil, parent, "BackdropTemplate") + local rightResizer = CreateFrame("button", parentName and parentName .. "RightResizer" or nil, parent, "BackdropTemplate") - leftResizer:SetPoint ("bottomleft", parent, "bottomleft") - rightResizer:SetPoint ("bottomright", parent, "bottomright") - leftResizer:SetSize (16, 16) - rightResizer:SetSize (16, 16) + leftResizer:SetPoint("bottomleft", parent, "bottomleft") + rightResizer:SetPoint("bottomright", parent, "bottomright") + leftResizer:SetSize(16, 16) + rightResizer:SetSize(16, 16) - rightResizer:SetNormalTexture ([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Up]]) - rightResizer:SetHighlightTexture ([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Highlight]]) - rightResizer:SetPushedTexture ([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Down]]) - leftResizer:SetNormalTexture ([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Up]]) - leftResizer:SetHighlightTexture ([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Highlight]]) - leftResizer:SetPushedTexture ([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Down]]) + rightResizer:SetNormalTexture([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Up]]) + rightResizer:SetHighlightTexture([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Highlight]]) + rightResizer:SetPushedTexture([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Down]]) + leftResizer:SetNormalTexture([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Up]]) + leftResizer:SetHighlightTexture([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Highlight]]) + leftResizer:SetPushedTexture([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Down]]) leftResizer:GetNormalTexture():SetTexCoord (1, 0, 0, 1) leftResizer:GetHighlightTexture():SetTexCoord (1, 0, 0, 1) @@ -4289,7 +4289,7 @@ end -------------------------------- ---> keybind frame ~key +--keybind frame ~key local ignoredKeys = { @@ -4356,12 +4356,12 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ local SCROLL_ROLL_AMOUNT = line_amount --keybind set frame - local new_keybind_frame = CreateFrame ("frame", name, parent, "BackdropTemplate") - new_keybind_frame:SetSize (width, height) + local new_keybind_frame = CreateFrame("frame", name, parent, "BackdropTemplate") + new_keybind_frame:SetSize(width, height) -- keybind scrollframe - local keybindScroll = CreateFrame ("scrollframe", "$parentScrollFrame", new_keybind_frame, "FauxScrollFrameTemplate, BackdropTemplate") - keybindScroll:SetSize (1019, 348) + local keybindScroll = CreateFrame("scrollframe", "$parentScrollFrame", new_keybind_frame, "FauxScrollFrameTemplate, BackdropTemplate") + keybindScroll:SetSize(1019, 348) keybindScroll.Frames = {} new_keybind_frame.keybindScroll = keybindScroll @@ -4369,18 +4369,18 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ new_keybind_frame.IsListening = false --check for valid data table - if (type (data) ~= "table") then + if (type(data) ~= "table") then print ("error: data must be a table. DF > CreateKeybindBox()") return end if (not next (data)) then - --> build data table for the character class + --build data table for the character class local _, unitClass = UnitClass ("player") if (unitClass) then local specIds = DF:GetClassSpecIDs (unitClass) if (specIds) then - for _, specId in ipairs (specIds) do + for _, specId in ipairs(specIds) do data [specId] = {} end end @@ -4398,7 +4398,7 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ new_keybind_frame.EditingSpec = specID new_keybind_frame.CurrentKeybindEditingSet = new_keybind_frame.Data [specID] - for _, button in ipairs (allSpecButtons) do + for _, button in ipairs(allSpecButtons) do button.selectedTexture:Hide() end self.MyObject.selectedTexture:Show() @@ -4422,7 +4422,7 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ local i = 1 local specIds = DF:GetClassSpecIDs (class) - for index, specId in ipairs (specIds) do + for index, specId in ipairs(specIds) do local button = new_keybind_frame ["SpecButton" .. index] local spec_id, spec_name, spec_description, spec_icon, spec_background, spec_role, spec_class = DetailsFramework.GetSpecializationInfoByID (specId) button.text = spec_name @@ -4430,7 +4430,7 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ button:SetIcon (spec_icon) button.specID = specId - local selectedTexture = button:CreateTexture (nil, "background") + local selectedTexture = button:CreateTexture(nil, "background") selectedTexture:SetAllPoints() selectedTexture:SetColorTexture (1, 1, 1, 0.5) if (specId ~= new_keybind_frame.EditingSpec) then @@ -4442,26 +4442,26 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ i = i + 1 end - local specsTitle = DF:CreateLabel (new_keybind_frame, "Config keys for spec:", 12, "silver") - specsTitle:SetPoint ("topleft", new_keybind_frame, "topleft", 10, mainStartY) + local specsTitle = DF:CreateLabel(new_keybind_frame, "Config keys for spec:", 12, "silver") + specsTitle:SetPoint("topleft", new_keybind_frame, "topleft", 10, mainStartY) - keybindScroll:SetPoint ("topleft", specsTitle.widget, "bottomleft", 0, -120) + keybindScroll:SetPoint("topleft", specsTitle.widget, "bottomleft", 0, -120) - spec1:SetPoint ("topleft", specsTitle, "bottomleft", 0, -10) - spec2:SetPoint ("topleft", specsTitle, "bottomleft", 0, -30) - spec3:SetPoint ("topleft", specsTitle, "bottomleft", 0, -50) + spec1:SetPoint("topleft", specsTitle, "bottomleft", 0, -10) + spec2:SetPoint("topleft", specsTitle, "bottomleft", 0, -30) + spec3:SetPoint("topleft", specsTitle, "bottomleft", 0, -50) if (class == "DRUID") then - spec4:SetPoint ("topleft", specsTitle, "bottomleft", 0, -70) + spec4:SetPoint("topleft", specsTitle, "bottomleft", 0, -70) end - local enter_the_key = CreateFrame ("frame", nil, new_keybind_frame, "BackdropTemplate") + local enter_the_key = CreateFrame("frame", nil, new_keybind_frame, "BackdropTemplate") enter_the_key:SetFrameStrata ("tooltip") - enter_the_key:SetSize (200, 60) - enter_the_key:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1}) - enter_the_key:SetBackdropColor (0, 0, 0, 1) - enter_the_key:SetBackdropBorderColor (1, 1, 1, 1) - enter_the_key.text = DF:CreateLabel (enter_the_key, "- Press a keyboard key to bind.\n- Click to bind a mouse button.\n- Press escape to cancel.", 11, "orange") - enter_the_key.text:SetPoint ("center", enter_the_key, "center") + enter_the_key:SetSize(200, 60) + enter_the_key:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1}) + enter_the_key:SetBackdropColor(0, 0, 0, 1) + enter_the_key:SetBackdropBorderColor(1, 1, 1, 1) + enter_the_key.text = DF:CreateLabel(enter_the_key, "- Press a keyboard key to bind.\n- Click to bind a mouse button.\n- Press escape to cancel.", 11, "orange") + enter_the_key.text:SetPoint("center", enter_the_key, "center") enter_the_key:Hide() local registerKeybind = function(self, key) @@ -4471,7 +4471,7 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ if (key == "ESCAPE") then enter_the_key:Hide() new_keybind_frame.IsListening = false - new_keybind_frame:SetScript ("OnKeyDown", nil) + new_keybind_frame:SetScript("OnKeyDown", nil) return end @@ -4483,7 +4483,7 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ keybind.key = bind new_keybind_frame.IsListening = false - new_keybind_frame:SetScript ("OnKeyDown", nil) + new_keybind_frame:SetScript("OnKeyDown", nil) enter_the_key:Hide() new_keybind_frame.keybindScroll:UpdateScroll() @@ -4498,10 +4498,10 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ end new_keybind_frame.IsListening = true new_keybind_frame.keybindIndex = keybindIndex - new_keybind_frame:SetScript ("OnKeyDown", registerKeybind) + new_keybind_frame:SetScript("OnKeyDown", registerKeybind) enter_the_key:Show() - enter_the_key:SetPoint ("bottom", self, "top") + enter_the_key:SetPoint("bottom", self, "top") end local new_key_bind = function(self, button, specID) @@ -4519,7 +4519,7 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ 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) + textentry:SetText(keybind.actiontext) DF:QuickDispatch (callback) end @@ -4546,7 +4546,7 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ local interrupt = "" local dispel = "" - if (type (dispel) == "table") then + if (type(dispel) == "table") then local dispelString = "\n" for specID, spellid in pairs (dispel) do local specid, specName = DetailsFramework.GetSpecializationInfoByID (specID) @@ -4587,10 +4587,10 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ DF:QuickDispatch (callback) end - local newTitle = DF:CreateLabel (new_keybind_frame, "Create a new Keybind:", 12, "silver") - newTitle:SetPoint ("topleft", new_keybind_frame, "topleft", 200, mainStartY) + local newTitle = DF:CreateLabel(new_keybind_frame, "Create a new Keybind:", 12, "silver") + newTitle:SetPoint("topleft", new_keybind_frame, "topleft", 200, mainStartY) local createNewKeybind = DF:CreateButton (new_keybind_frame, new_key_bind, 160, 20, "New Key Bind", 1, _, _, "NewKeybindButton", _, 0, options_button_template, options_text_template) - createNewKeybind:SetPoint ("topleft", newTitle, "bottomleft", 0, -10) + createNewKeybind:SetPoint("topleft", newTitle, "bottomleft", 0, -10) --createNewKeybind:SetIcon ([[Interface\Buttons\UI-GuildButton-PublicNote-Up]]) local update_keybind_list = function(self) @@ -4647,7 +4647,7 @@ 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 @@ -4655,37 +4655,37 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ local backdropColor = {.3, .3, .3, .3} local backdropColorOnEnter = {.6, .6, .6, .6} local on_enter = function(self) - self:SetBackdropColor (unpack (backdropColorOnEnter)) + self:SetBackdropColor(unpack (backdropColorOnEnter)) end local on_leave = function(self) - self:SetBackdropColor (unpack (backdropColor)) + self:SetBackdropColor(unpack (backdropColor)) end local font = "GameFontHighlightSmall" for i = 1, SCROLL_ROLL_AMOUNT do - local f = CreateFrame ("frame", "$KeyBindFrame" .. i, keybindScroll, "BackdropTemplate") - f:SetSize (1009, 20) - f:SetPoint ("topleft", keybindScroll, "topleft", 0, -(i-1)*29) - f:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - f:SetBackdropColor (unpack (backdropColor)) - f:SetScript ("OnEnter", on_enter) - f:SetScript ("OnLeave", on_leave) + local f = CreateFrame("frame", "$KeyBindFrame" .. i, keybindScroll, "BackdropTemplate") + f:SetSize(1009, 20) + f:SetPoint("topleft", keybindScroll, "topleft", 0, -(i-1)*29) + f:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + f:SetBackdropColor(unpack (backdropColor)) + f:SetScript("OnEnter", on_enter) + f:SetScript("OnLeave", on_leave) tinsert (keybindScroll.Frames, f) - f.Index = DF:CreateLabel (f, "1") + f.Index = DF:CreateLabel(f, "1") f.KeyBind = DF:CreateButton (f, set_key_bind, 100, 20, "", _, _, _, "SetNewKeybindButton", _, 0, options_button_template, options_text_template) f.ActionDrop = DF:CreateDropDown (f, fill_action_dropdown, 0, 120, 20, "ActionDropdown", _, options_dropdown_template) f.ActionText = DF:CreateTextEntry (f, function()end, 660, 20, "TextBox", _, _, options_dropdown_template) f.Copy = DF:CreateButton (f, copy_keybind, 20, 20, "", _, _, _, "CopyKeybindButton", _, 0, options_button_template, options_text_template) f.Delete = DF:CreateButton (f, delete_keybind, 16, 20, "", _, _, _, "DeleteKeybindButton", _, 2, options_button_template, options_text_template) - f.Index:SetPoint ("left", f, "left", 10, 0) - f.KeyBind:SetPoint ("left", f, "left", 43, 0) - f.ActionDrop:SetPoint ("left", f, "left", 150, 0) - f.ActionText:SetPoint ("left", f, "left", 276, 0) - f.Copy:SetPoint ("left", f, "left", 950, 0) - f.Delete:SetPoint ("left", f, "left", 990, 0) + f.Index:SetPoint("left", f, "left", 10, 0) + f.KeyBind:SetPoint("left", f, "left", 43, 0) + f.ActionDrop:SetPoint("left", f, "left", 150, 0) + f.ActionText:SetPoint("left", f, "left", 276, 0) + f.Copy:SetPoint("left", f, "left", 950, 0) + f.Delete:SetPoint("left", f, "left", 990, 0) f.Copy:SetIcon ([[Interface\Buttons\UI-GuildButton-PublicNote-Up]], nil, nil, nil, nil, nil, nil, 4) f.Delete:SetIcon ([[Interface\Buttons\UI-StopButton]], nil, nil, nil, nil, nil, nil, 4) @@ -4694,9 +4694,9 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ f.Delete.tooltip = "erase this keybind" --editbox - f.ActionText:SetJustifyH ("left") - f.ActionText:SetHook ("OnEscapePressed", set_action_on_espace_press) - f.ActionText:SetHook ("OnEditFocusGained", function() + f.ActionText:SetJustifyH("left") + f.ActionText:SetHook("OnEscapePressed", set_action_on_espace_press) + f.ActionText:SetHook("OnEditFocusGained", function() local playerSpells = {} local tab, tabTex, offset, numSpells = GetSpellTabInfo (2) for i = 1, numSpells do @@ -4713,10 +4713,10 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ f.ActionText:SetAsAutoComplete ("WordList") end - local header = CreateFrame ("frame", "$parentOptionsPanelFrameHeader", keybindScroll, "BackdropTemplate") - header:SetPoint ("bottomleft", keybindScroll, "topleft", 0, 2) - header:SetPoint ("bottomright", keybindScroll, "topright", 0, 2) - header:SetHeight (16) + local header = CreateFrame("frame", "$parentOptionsPanelFrameHeader", keybindScroll, "BackdropTemplate") + header:SetPoint("bottomleft", keybindScroll, "topleft", 0, 2) + header:SetPoint("bottomright", keybindScroll, "topright", 0, 2) + header:SetHeight(16) header.Index = DF:CreateLabel (header, "Index", DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")) header.Key = DF:CreateLabel (header, "Key", DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")) @@ -4725,19 +4725,19 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ header.Copy = DF:CreateLabel (header, "Copy", DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")) header.Delete = DF:CreateLabel (header, "Delete", DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")) - header.Index:SetPoint ("left", header, "left", 10, 0) - header.Key:SetPoint ("left", header, "left", 43, 0) - header.Action:SetPoint ("left", header, "left", 150, 0) - header.Macro:SetPoint ("left", header, "left", 276, 0) - header.Copy:SetPoint ("left", header, "left", 950, 0) - header.Delete:SetPoint ("left", header, "left", 990, 0) + header.Index:SetPoint("left", header, "left", 10, 0) + header.Key:SetPoint("left", header, "left", 43, 0) + header.Action:SetPoint("left", header, "left", 150, 0) + header.Macro:SetPoint("left", header, "left", 276, 0) + header.Copy:SetPoint("left", header, "left", 950, 0) + header.Delete:SetPoint("left", header, "left", 990, 0) - new_keybind_frame:SetScript ("OnShow", function() + new_keybind_frame:SetScript("OnShow", function() --new_keybind_frame.EditingSpec = EnemyGrid.CurrentSpec --new_keybind_frame.CurrentKeybindEditingSet = EnemyGrid.CurrentKeybindSet - for _, button in ipairs (allSpecButtons) do + for _, button in ipairs(allSpecButtons) do if (new_keybind_frame.EditingSpec ~= button.specID) then button.selectedTexture:Hide() else @@ -4748,10 +4748,10 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ keybindScroll:UpdateScroll() end) - new_keybind_frame:SetScript ("OnHide", function() + new_keybind_frame:SetScript("OnHide", function() if (new_keybind_frame.IsListening) then new_keybind_frame.IsListening = false - new_keybind_frame:SetScript ("OnKeyDown", nil) + new_keybind_frame:SetScript("OnKeyDown", nil) end end) @@ -4890,10 +4890,10 @@ end DF.TitleFunctions = { SetTitle = function(self, titleText, titleColor, font, size) - self.TitleLabel:SetText (titleText or self.TitleLabel:GetText()) + self.TitleLabel:SetText(titleText or self.TitleLabel:GetText()) if (titleColor) then - local r, g, b, a = DF:ParseColors (titleColor) + local r, g, b, a = DF:ParseColors(titleColor) self.TitleLabel:SetTextColor (r, g, b, a) end @@ -4911,34 +4911,34 @@ DF.TitleFunctions = { function DF:CreateTitleBar (f, titleText) - local titleBar = CreateFrame ("frame", f:GetName() and f:GetName() .. "TitleBar" or nil, f,"BackdropTemplate") - titleBar:SetPoint ("topleft", f, "topleft", 2, -3) - titleBar:SetPoint ("topright", f, "topright", -2, -3) - titleBar:SetHeight (20) - titleBar:SetBackdrop (SimplePanel_frame_backdrop) --it's an upload from this file - titleBar:SetBackdropColor (.2, .2, .2, 1) - titleBar:SetBackdropBorderColor (0, 0, 0, 1) + local titleBar = CreateFrame("frame", f:GetName() and f:GetName() .. "TitleBar" or nil, f,"BackdropTemplate") + titleBar:SetPoint("topleft", f, "topleft", 2, -3) + titleBar:SetPoint("topright", f, "topright", -2, -3) + titleBar:SetHeight(20) + titleBar:SetBackdrop(SimplePanel_frame_backdrop) --it's an upload from this file + titleBar:SetBackdropColor(.2, .2, .2, 1) + titleBar:SetBackdropBorderColor(0, 0, 0, 1) - local closeButton = CreateFrame ("button", titleBar:GetName() and titleBar:GetName() .. "CloseButton" or nil, titleBar, "BackdropTemplate") - closeButton:SetSize (16, 16) + local closeButton = CreateFrame("button", titleBar:GetName() and titleBar:GetName() .. "CloseButton" or nil, titleBar, "BackdropTemplate") + closeButton:SetSize(16, 16) - closeButton:SetNormalTexture ([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) - closeButton:SetHighlightTexture ([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) - closeButton:SetPushedTexture ([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) + closeButton:SetNormalTexture([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) + closeButton:SetHighlightTexture([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) + closeButton:SetPushedTexture([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) closeButton:GetNormalTexture():SetDesaturated(true) closeButton:GetHighlightTexture():SetDesaturated(true) closeButton:GetPushedTexture():SetDesaturated(true) closeButton:SetAlpha (0.7) - closeButton:SetScript ("OnClick", simple_panel_close_click) --upvalue from this file + closeButton:SetScript("OnClick", simple_panel_close_click) --upvalue from this file local titleLabel = titleBar:CreateFontString (titleBar:GetName() and titleBar:GetName() .. "TitleText" or nil, "overlay", "GameFontNormal") titleLabel:SetTextColor (.8, .8, .8, 1) - titleLabel:SetText (titleText or "") + titleLabel:SetText(titleText or "") --anchors - closeButton:SetPoint ("right", titleBar, "right", -2, 0) - titleLabel:SetPoint ("center", titleBar, "center") + closeButton:SetPoint("right", titleBar, "right", -2, 0) + titleLabel:SetPoint("center", titleBar, "center") --members f.TitleBar = titleBar @@ -4963,22 +4963,22 @@ DF.IconRowFunctions = { local iconFrame = self.IconPool [self.NextIcon] if (not iconFrame) then - local newIconFrame = CreateFrame ("frame", "$parentIcon" .. self.NextIcon, self, "BackdropTemplate") + local newIconFrame = CreateFrame("frame", "$parentIcon" .. self.NextIcon, self, "BackdropTemplate") newIconFrame.parentIconRow = self - newIconFrame.Texture = newIconFrame:CreateTexture (nil, "artwork") + newIconFrame.Texture = newIconFrame:CreateTexture(nil, "artwork") PixelUtil.SetPoint (newIconFrame.Texture, "topleft", newIconFrame, "topleft", 1, -1) PixelUtil.SetPoint (newIconFrame.Texture, "bottomright", newIconFrame, "bottomright", -1, 1) - newIconFrame.Border = newIconFrame:CreateTexture (nil, "background") + newIconFrame.Border = newIconFrame:CreateTexture(nil, "background") newIconFrame.Border:SetAllPoints() newIconFrame.Border:SetColorTexture (0, 0, 0) - newIconFrame:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1}) - newIconFrame:SetBackdropBorderColor (0, 0, 0, 0) + newIconFrame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1}) + newIconFrame:SetBackdropBorderColor(0, 0, 0, 0) newIconFrame:EnableMouse (false) - local cooldownFrame = CreateFrame ("cooldown", "$parentIconCooldown" .. self.NextIcon, newIconFrame, "CooldownFrameTemplate, BackdropTemplate") + local cooldownFrame = CreateFrame("cooldown", "$parentIconCooldown" .. self.NextIcon, newIconFrame, "CooldownFrameTemplate, BackdropTemplate") cooldownFrame:SetAllPoints() cooldownFrame:EnableMouse (false) cooldownFrame:SetFrameLevel (newIconFrame:GetFrameLevel()+1) @@ -4986,17 +4986,17 @@ DF.IconRowFunctions = { cooldownFrame.noCooldownCount = self.options.surpress_tulla_omni_cc newIconFrame.CountdownText = cooldownFrame:CreateFontString (nil, "overlay", "GameFontNormal") - --newIconFrame.CountdownText:SetPoint ("center") - newIconFrame.CountdownText:SetPoint (self.options.text_anchor or "center", newIconFrame, self.options.text_rel_anchor or "center", self.options.text_x_offset or 0, self.options.text_y_offset or 0) + --newIconFrame.CountdownText:SetPoint("center") + newIconFrame.CountdownText:SetPoint(self.options.text_anchor or "center", newIconFrame, self.options.text_rel_anchor or "center", self.options.text_x_offset or 0, self.options.text_y_offset or 0) newIconFrame.CountdownText:Hide() newIconFrame.StackText = newIconFrame:CreateFontString (nil, "overlay", "GameFontNormal") - --newIconFrame.StackText:SetPoint ("bottomright") - newIconFrame.StackText:SetPoint (self.options.stack_text_anchor or "center", newIconFrame, self.options.stack_text_rel_anchor or "bottomright", self.options.stack_text_x_offset or 0, self.options.stack_text_y_offset or 0) + --newIconFrame.StackText:SetPoint("bottomright") + newIconFrame.StackText:SetPoint(self.options.stack_text_anchor or "center", newIconFrame, self.options.stack_text_rel_anchor or "bottomright", self.options.stack_text_x_offset or 0, self.options.stack_text_y_offset or 0) newIconFrame.StackText:Hide() newIconFrame.Desc = newIconFrame:CreateFontString (nil, "overlay", "GameFontNormal") - --newIconFrame.Desc:SetPoint ("bottom", newIconFrame, "top", 0, 2) + --newIconFrame.Desc:SetPoint("bottom", newIconFrame, "top", 0, 2) newIconFrame.Desc:SetPoint(self.options.desc_text_anchor or "bottom", newIconFrame, self.options.desc_text_rel_anchor or "top", self.options.desc_text_x_offset or 0, self.options.desc_text_y_offset or 2) newIconFrame.Desc:Hide() @@ -5029,7 +5029,7 @@ DF.IconRowFunctions = { end - DF:SetFontColor (iconFrame.CountdownText, self.options.text_color) + DF:SetFontColor(iconFrame.CountdownText, self.options.text_color) self.NextIcon = self.NextIcon + 1 return iconFrame @@ -5061,13 +5061,13 @@ DF.IconRowFunctions = { if (spellIcon) then local iconFrame = self:GetIcon() - iconFrame.Texture:SetTexture (spellIcon) + iconFrame.Texture:SetTexture(spellIcon) iconFrame.Texture:SetTexCoord (unpack (self.options.texcoord)) if (borderColor) then - iconFrame:SetBackdropBorderColor (Plater:ParseColors (borderColor)) + iconFrame:SetBackdropBorderColor(Plater:ParseColors(borderColor)) else - iconFrame:SetBackdropBorderColor (0, 0, 0 ,0) + iconFrame:SetBackdropBorderColor(0, 0, 0 ,0) end if (startTime) then @@ -5082,9 +5082,9 @@ DF.IconRowFunctions = { iconFrame.expirationTime = startTime + duration local formattedTime = (iconFrame.timeRemaining > 0) and self.options.decimal_timer and iconFrame.parentIconRow.FormatCooldownTimeDecimal(iconFrame.timeRemaining) or iconFrame.parentIconRow.FormatCooldownTime(iconFrame.timeRemaining) or "" - iconFrame.CountdownText:SetText (formattedTime) + iconFrame.CountdownText:SetText(formattedTime) - iconFrame.CountdownText:SetPoint (self.options.text_anchor or "center", iconFrame, self.options.text_rel_anchor or "center", self.options.text_x_offset or 0, self.options.text_y_offset or 0) + iconFrame.CountdownText:SetPoint(self.options.text_anchor or "center", iconFrame, self.options.text_rel_anchor or "center", self.options.text_x_offset or 0, self.options.text_y_offset or 0) DF:SetFontSize (iconFrame.CountdownText, self.options.text_size) DF:SetFontFace (iconFrame.CountdownText, self.options.text_font) DF:SetFontOutline (iconFrame.CountdownText, self.options.text_outline) @@ -5114,8 +5114,8 @@ DF.IconRowFunctions = { if (descText and self.options.desc_text) then iconFrame.Desc:Show() - iconFrame.Desc:SetText (descText.text) - iconFrame.Desc:SetTextColor (DF:ParseColors (descText.text_color or self.options.desc_text_color)) + iconFrame.Desc:SetText(descText.text) + iconFrame.Desc:SetTextColor (DF:ParseColors(descText.text_color or self.options.desc_text_color)) iconFrame.Desc:SetPoint(self.options.desc_text_anchor or "bottom", iconFrame, self.options.desc_text_rel_anchor or "top", self.options.desc_text_x_offset or 0, self.options.desc_text_y_offset or 2) DF:SetFontSize (iconFrame.Desc, descText.text_size or self.options.desc_text_size) DF:SetFontFace (iconFrame.Desc, self.options.desc_text_font) @@ -5126,9 +5126,9 @@ DF.IconRowFunctions = { if (count and count > 1 and self.options.stack_text) then iconFrame.StackText:Show() - iconFrame.StackText:SetText (count) - iconFrame.StackText:SetTextColor (DF:ParseColors (self.options.desc_text_color)) - iconFrame.StackText:SetPoint (self.options.stack_text_anchor or "center", iconFrame, self.options.stack_text_rel_anchor or "bottomright", self.options.stack_text_x_offset or 0, self.options.stack_text_y_offset or 0) + iconFrame.StackText:SetText(count) + iconFrame.StackText:SetTextColor (DF:ParseColors(self.options.desc_text_color)) + iconFrame.StackText:SetPoint(self.options.stack_text_anchor or "center", iconFrame, self.options.stack_text_rel_anchor or "bottomright", self.options.stack_text_x_offset or 0, self.options.stack_text_y_offset or 0) DF:SetFontSize (iconFrame.StackText, self.options.stack_text_size) DF:SetFontFace (iconFrame.StackText, self.options.stack_text_font) DF:SetFontOutline (iconFrame.StackText, self.options.stack_text_outline) @@ -5139,11 +5139,11 @@ DF.IconRowFunctions = { PixelUtil.SetSize (iconFrame, self.options.icon_width, self.options.icon_height) iconFrame:Show() - --> update the size of the frame - self:SetWidth ((self.options.left_padding * 2) + (self.options.icon_padding * (self.NextIcon-2)) + (self.options.icon_width * (self.NextIcon - 1))) - self:SetHeight (self.options.icon_height + (self.options.top_padding * 2)) + --update the size of the frame + self:SetWidth((self.options.left_padding * 2) + (self.options.icon_padding * (self.NextIcon-2)) + (self.options.icon_width * (self.NextIcon - 1))) + self:SetHeight(self.options.icon_height + (self.options.top_padding * 2)) - --> make information available + --make information available iconFrame.spellId = spellId iconFrame.startTime = startTime iconFrame.duration = duration @@ -5162,7 +5162,7 @@ DF.IconRowFunctions = { self.AuraCache.canStealOrPurge = self.AuraCache.canStealOrPurge or canStealOrPurge self.AuraCache.hasEnrage = self.AuraCache.hasEnrage or debuffType == "" --yes, enrages are empty-string... - --> show the frame + --show the frame self:Show() return iconFrame @@ -5175,12 +5175,12 @@ DF.IconRowFunctions = { self.timeRemaining = self.expirationTime - now if self.timeRemaining > 0 then if self.parentIconRow.options.decimal_timer then - self.CountdownText:SetText (self.parentIconRow.FormatCooldownTimeDecimal(self.timeRemaining)) + self.CountdownText:SetText(self.parentIconRow.FormatCooldownTimeDecimal(self.timeRemaining)) else - self.CountdownText:SetText (self.parentIconRow.FormatCooldownTime(self.timeRemaining)) + self.CountdownText:SetText(self.parentIconRow.FormatCooldownTime(self.timeRemaining)) end else - self.CountdownText:SetText ("") + self.CountdownText:SetText("") end self.lastUpdateCooldown = now end @@ -5347,8 +5347,8 @@ DF.IconRowFunctions = { end, OnOptionChanged = function(self, optionName) - self:SetBackdropColor (unpack (self.options.backdrop_color)) - self:SetBackdropBorderColor (unpack (self.options.backdrop_border_color)) + self:SetBackdropColor(unpack (self.options.backdrop_color)) + self:SetBackdropBorderColor(unpack (self.options.backdrop_border_color)) end, } @@ -5411,18 +5411,18 @@ function DF:CreateIconRow (parent, name, options) f:BuildOptionsTable (default_icon_row_options, options) - f:SetSize (f.options.icon_width, f.options.icon_height + (f.options.top_padding * 2)) + f:SetSize(f.options.icon_width, f.options.icon_height + (f.options.top_padding * 2)) - f:SetBackdrop (f.options.backdrop) - f:SetBackdropColor (unpack (f.options.backdrop_color)) - f:SetBackdropBorderColor (unpack (f.options.backdrop_border_color)) + f:SetBackdrop(f.options.backdrop) + f:SetBackdropColor(unpack (f.options.backdrop_color)) + f:SetBackdropBorderColor(unpack (f.options.backdrop_border_color)) return f end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> ~header +--~header --mixed functions DF.HeaderFunctions = { @@ -5830,7 +5830,7 @@ function DF:CreateHeader(parent, headerTable, options, frameName) end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> radio group +--radio group local default_radiogroup_options = { width = 1, @@ -5998,7 +5998,7 @@ DF.RadioGroupCoreFunctions = { anchorOptions: override options for default_framelayout_options table --]=] function DF:CreateCheckboxGroup(parent, radioOptions, name, options, anchorOptions) - local f = CreateFrame ("frame", name, parent, "BackdropTemplate") + local f = CreateFrame("frame", name, parent, "BackdropTemplate") DF:Mixin (f, DF.OptionsFunctions) DF:Mixin (f, DF.RadioGroupCoreFunctions) @@ -6006,16 +6006,16 @@ function DF:CreateCheckboxGroup(parent, radioOptions, name, options, anchorOptio f:BuildOptionsTable (default_radiogroup_options, options) - f:SetSize (f.options.width, f.options.height) - f:SetBackdrop (f.options.backdrop) - f:SetBackdropColor (unpack (f.options.backdrop_color)) - f:SetBackdropBorderColor (unpack (f.options.backdrop_border_color)) + f:SetSize(f.options.width, f.options.height) + f:SetBackdrop(f.options.backdrop) + f:SetBackdropColor(unpack (f.options.backdrop_color)) + f:SetBackdropBorderColor(unpack (f.options.backdrop_border_color)) f.AnchorOptions = anchorOptions or {} if (f.options.title) then - local titleLabel = DF:CreateLabel (f, f.options.title, DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")) - titleLabel:SetPoint ("bottomleft", f, "topleft", 0, 2) + local titleLabel = DF:CreateLabel(f, f.options.title, DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")) + titleLabel:SetPoint("bottomleft", f, "topleft", 0, 2) f.Title = titleLabel end @@ -6036,7 +6036,7 @@ end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> load conditions panel +--load conditions panel --this is the table prototype to hold load conditions settings local default_load_conditions = { @@ -6058,7 +6058,7 @@ local default_load_conditions_frame_options = { } function DF:CreateLoadFilterParser (callback) - local f = CreateFrame ("frame") + local f = CreateFrame("frame") f:RegisterEvent ("PLAYER_ENTERING_WORLD") if IS_WOW_PROJECT_MAINLINE then f:RegisterEvent ("PLAYER_SPECIALIZATION_CHANGED") @@ -6072,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 @@ -6139,7 +6139,7 @@ function DF:PassLoadFilters (loadTable, encounterID) canCheckTalents = false - for _, specID in ipairs (specsForThisClass) do + for _, specID in ipairs(specsForThisClass) do if (loadTable.spec [specID] or loadTable.spec [specID..""]) then --theres a talent for this class canCheckTalents = true @@ -6230,7 +6230,7 @@ function DF:PassLoadFilters (loadTable, encounterID) local level, affixes, wasEnergized = C_ChallengeMode.GetActiveKeystoneInfo() local hasAffix = false - for _, affixID in ipairs (affixes) do + for _, affixID in ipairs(affixes) do if affixID and (loadTable.affix [affixID] or loadTable.affix [affixID .. ""]) then hasAffix = true break @@ -6298,7 +6298,7 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) if (not DetailsFrameworkLoadConditionsPanel) then local f = DF:CreateSimplePanel (UIParent, 970, 505, "Load Conditions", "DetailsFrameworkLoadConditionsPanel") - f:SetBackdropColor (0, 0, 0, 1) + f:SetBackdropColor(0, 0, 0, 1) f.AllRadioGroups = {} f.AllTextEntries = {} f.OptionsTable = optionsTable @@ -6320,10 +6320,10 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) map_ids = {x2StartAt, -460}, } - local editingLabel = DF:CreateLabel (f, "Load Conditions For:") - local editingWhatLabel = DF:CreateLabel (f, "") - editingLabel:SetPoint ("topleft", f, "topleft", 10, -35) - editingWhatLabel:SetPoint ("left", editingLabel, "right", 2, 0) + local editingLabel = DF:CreateLabel(f, "Load Conditions For:") + local editingWhatLabel = DF:CreateLabel(f, "") + editingLabel:SetPoint("topleft", f, "topleft", 10, -35) + editingWhatLabel:SetPoint("left", editingLabel, "right", 2, 0) --this label store the name of what is being edited f.EditingLabel = editingWhatLabel @@ -6367,14 +6367,14 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) end local classGroup = DF:CreateCheckboxGroup (f, classes, name, {width = 200, height = 200, title = "Character Class"}, {offset_x = 130, amount_per_line = 3}) - classGroup:SetPoint ("topleft", f, "topleft", anchorPositions.class [1], anchorPositions.class [2]) + classGroup:SetPoint("topleft", f, "topleft", anchorPositions.class [1], anchorPositions.class [2]) classGroup.DBKey = "class" tinsert (f.AllRadioGroups, classGroup) --create the radio group for character spec if IS_WOW_PROJECT_MAINLINE then local specs = {} - for _, specID in ipairs (DF:GetClassSpecIDs (select (2, UnitClass ("player")))) do + for _, specID in ipairs(DF:GetClassSpecIDs (select (2, UnitClass ("player")))) do local specID, specName, specDescription, specIcon, specBackground, specRole, specClass = DetailsFramework.GetSpecializationInfoByID (specID) tinsert (specs, { name = specName, @@ -6385,14 +6385,14 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) }) end local specGroup = DF:CreateCheckboxGroup (f, specs, name, {width = 200, height = 200, title = "Character Spec"}, {offset_x = 130, amount_per_line = 4}) - specGroup:SetPoint ("topleft", f, "topleft", anchorPositions.spec [1], anchorPositions.spec [2]) + specGroup:SetPoint("topleft", f, "topleft", anchorPositions.spec [1], anchorPositions.spec [2]) specGroup.DBKey = "spec" tinsert (f.AllRadioGroups, specGroup) end --create radio group for character races local raceList = {} - for _, raceTable in ipairs (DF:GetCharacterRaceList()) do + for _, raceTable in ipairs(DF:GetCharacterRaceList()) do tinsert (raceList, { name = raceTable.Name, set = f.OnRadioCheckboxClick, @@ -6401,14 +6401,14 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) }) end local raceGroup = DF:CreateCheckboxGroup (f, raceList, name, {width = 200, height = 200, title = "Character Race"}) - raceGroup:SetPoint ("topleft", f, "topleft", anchorPositions.race [1], anchorPositions.race [2]) + raceGroup:SetPoint("topleft", f, "topleft", anchorPositions.race [1], anchorPositions.race [2]) raceGroup.DBKey = "race" tinsert (f.AllRadioGroups, raceGroup) --create radio group for talents if IS_WOW_PROJECT_MAINLINE then local talentList = {} - for _, talentTable in ipairs (DF:GetCharacterTalents()) do + for _, talentTable in ipairs(DF:GetCharacterTalents()) do tinsert (talentList, { name = talentTable.Name, set = f.OnRadioCheckboxClick, @@ -6418,16 +6418,16 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) }) end local talentGroup = DF:CreateCheckboxGroup (f, talentList, name, {width = 200, height = 200, title = "Characer Talents"}, {offset_x = 150, amount_per_line = 3}) - talentGroup:SetPoint ("topleft", f, "topleft", anchorPositions.talent [1], anchorPositions.talent [2]) + talentGroup:SetPoint("topleft", f, "topleft", anchorPositions.talent [1], anchorPositions.talent [2]) talentGroup.DBKey = "talent" tinsert (f.AllRadioGroups, talentGroup) f.TalentGroup = talentGroup do --create a frame to show talents selected in other specs or characters - local otherTalents = CreateFrame ("frame", nil, f, "BackdropTemplate") - otherTalents:SetSize (26, 26) - otherTalents:SetPoint ("left", talentGroup.Title.widget, "right", 10, -2) + local otherTalents = CreateFrame("frame", nil, f, "BackdropTemplate") + otherTalents:SetSize(26, 26) + otherTalents:SetPoint("left", talentGroup.Title.widget, "right", 10, -2) otherTalents.Texture = DF:CreateImage (otherTalents, [[Interface\BUTTONS\AdventureGuideMicrobuttonAlert]], 24, 24) otherTalents.Texture:SetAllPoints() @@ -6441,7 +6441,7 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) local buildTalentMenu = function() local playerTalents = DF:GetCharacterTalents() local indexedTalents = {} - for _, talentTable in ipairs (playerTalents) do + for _, talentTable in ipairs(playerTalents) do tinsert (indexedTalents, talentTable.ID) end @@ -6450,7 +6450,7 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) GameCooltip2:AddLine ("$div", nil, nil, -1, -1) for talentID, _ in pairs (f.OptionsTable.talent) do - if (type (talentID) == "number" and not DF.table.find (indexedTalents, talentID)) then + if (type(talentID) == "number" and not DF.table.find (indexedTalents, talentID)) then local talentID, name, texture, selected, available = GetTalentInfoByID (talentID) if (name) then GameCooltip2:AddLine (name) @@ -6469,21 +6469,21 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) FixedValue = "none", ShowSpeed = 0.05, Options = function() - GameCooltip2:SetOption ("TextFont", "Friz Quadrata TT") - GameCooltip2:SetOption ("TextColor", "orange") - GameCooltip2:SetOption ("TextSize", 12) - GameCooltip2:SetOption ("FixedWidth", 220) - GameCooltip2:SetOption ("ButtonsYMod", -4) - GameCooltip2:SetOption ("YSpacingMod", -4) - GameCooltip2:SetOption ("IgnoreButtonAutoHeight", true) + GameCooltip2:SetOption("TextFont", "Friz Quadrata TT") + GameCooltip2:SetOption("TextColor", "orange") + GameCooltip2:SetOption("TextSize", 12) + GameCooltip2:SetOption("FixedWidth", 220) + GameCooltip2:SetOption("ButtonsYMod", -4) + GameCooltip2:SetOption("YSpacingMod", -4) + GameCooltip2:SetOption("IgnoreButtonAutoHeight", true) GameCooltip2:SetColor (1, 0.5, 0.5, 0.5, 0) local preset2_backdrop = {bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], edgeFile = [[Interface\Buttons\WHITE8X8]], tile = true, edgeSize = 1, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}} local gray_table = {0.37, 0.37, 0.37, 0.95} local black_table = {0.2, 0.2, 0.2, 1} - GameCooltip2:SetBackdrop (1, preset2_backdrop, gray_table, black_table) - GameCooltip2:SetBackdrop (2, preset2_backdrop, gray_table, black_table) + GameCooltip2:SetBackdrop(1, preset2_backdrop, gray_table, black_table) + GameCooltip2:SetBackdrop(2, preset2_backdrop, gray_table, black_table) end, } GameCooltip2:CoolTipInject (otherTalents) @@ -6491,11 +6491,11 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) function f.CanShowTalentWarning() local playerTalents = DF:GetCharacterTalents() local indexedTalents = {} - for _, talentTable in ipairs (playerTalents) do + for _, talentTable in ipairs(playerTalents) do tinsert (indexedTalents, talentTable.ID) end for talentID, _ in pairs (f.OptionsTable.talent) do - if (type (talentID) == "number" and not DF.table.find (indexedTalents, talentID)) then + if (type(talentID) == "number" and not DF.table.find (indexedTalents, talentID)) then otherTalents:Show() return end @@ -6508,7 +6508,7 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) --create radio group for pvp talents if IS_WOW_PROJECT_MAINLINE then local pvpTalentList = {} - for _, talentTable in ipairs (DF:GetCharacterPvPTalents()) do + for _, talentTable in ipairs(DF:GetCharacterPvPTalents()) do tinsert (pvpTalentList, { name = talentTable.Name, set = f.OnRadioCheckboxClick, @@ -6518,16 +6518,16 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) }) end local pvpTalentGroup = DF:CreateCheckboxGroup (f, pvpTalentList, name, {width = 200, height = 200, title = "Characer PvP Talents"}, {offset_x = 150, amount_per_line = 3}) - pvpTalentGroup:SetPoint ("topleft", f, "topleft", anchorPositions.pvptalent [1], anchorPositions.pvptalent [2]) + pvpTalentGroup:SetPoint("topleft", f, "topleft", anchorPositions.pvptalent [1], anchorPositions.pvptalent [2]) pvpTalentGroup.DBKey = "pvptalent" tinsert (f.AllRadioGroups, pvpTalentGroup) f.PvPTalentGroup = pvpTalentGroup do --create a frame to show talents selected in other specs or characters - local otherTalents = CreateFrame ("frame", nil, f, "BackdropTemplate") - otherTalents:SetSize (26, 26) - otherTalents:SetPoint ("left", pvpTalentGroup.Title.widget, "right", 10, -2) + local otherTalents = CreateFrame("frame", nil, f, "BackdropTemplate") + otherTalents:SetSize(26, 26) + otherTalents:SetPoint("left", pvpTalentGroup.Title.widget, "right", 10, -2) otherTalents.Texture = DF:CreateImage (otherTalents, [[Interface\BUTTONS\AdventureGuideMicrobuttonAlert]], 24, 24) otherTalents.Texture:SetAllPoints() @@ -6541,7 +6541,7 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) local buildTalentMenu = function() local playerTalents = DF:GetCharacterPvPTalents() local indexedTalents = {} - for _, talentTable in ipairs (playerTalents) do + for _, talentTable in ipairs(playerTalents) do tinsert (indexedTalents, talentTable.ID) end @@ -6550,7 +6550,7 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) GameCooltip2:AddLine ("$div", nil, nil, -1, -1) for talentID, _ in pairs (f.OptionsTable.pvptalent) do - if (type (talentID) == "number" and not DF.table.find (indexedTalents, talentID)) then + if (type(talentID) == "number" and not DF.table.find (indexedTalents, talentID)) then local _, name, texture = GetPvpTalentInfoByID (talentID) if (name) then GameCooltip2:AddLine (name) @@ -6569,21 +6569,21 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) FixedValue = "none", ShowSpeed = 0.05, Options = function() - GameCooltip2:SetOption ("TextFont", "Friz Quadrata TT") - GameCooltip2:SetOption ("TextColor", "orange") - GameCooltip2:SetOption ("TextSize", 12) - GameCooltip2:SetOption ("FixedWidth", 220) - GameCooltip2:SetOption ("ButtonsYMod", -4) - GameCooltip2:SetOption ("YSpacingMod", -4) - GameCooltip2:SetOption ("IgnoreButtonAutoHeight", true) + GameCooltip2:SetOption("TextFont", "Friz Quadrata TT") + GameCooltip2:SetOption("TextColor", "orange") + GameCooltip2:SetOption("TextSize", 12) + GameCooltip2:SetOption("FixedWidth", 220) + GameCooltip2:SetOption("ButtonsYMod", -4) + GameCooltip2:SetOption("YSpacingMod", -4) + GameCooltip2:SetOption("IgnoreButtonAutoHeight", true) GameCooltip2:SetColor (1, 0.5, 0.5, 0.5, 0) local preset2_backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeFile = [[Interface\Buttons\WHITE8X8]], tile = true, edgeSize = 1, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}} local gray_table = {0.37, 0.37, 0.37, 0.95} local black_table = {0.2, 0.2, 0.2, 1} - GameCooltip2:SetBackdrop (1, preset2_backdrop, gray_table, black_table) - GameCooltip2:SetBackdrop (2, preset2_backdrop, gray_table, black_table) + GameCooltip2:SetBackdrop(1, preset2_backdrop, gray_table, black_table) + GameCooltip2:SetBackdrop(2, preset2_backdrop, gray_table, black_table) end, } GameCooltip2:CoolTipInject (otherTalents) @@ -6591,11 +6591,11 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) function f.CanShowPvPTalentWarning() local playerTalents = DF:GetCharacterPvPTalents() local indexedTalents = {} - for _, talentTable in ipairs (playerTalents) do + for _, talentTable in ipairs(playerTalents) do tinsert (indexedTalents, talentTable.ID) end for talentID, _ in pairs (f.OptionsTable.pvptalent) do - if (type (talentID) == "number" and not DF.table.find (indexedTalents, talentID)) then + if (type(talentID) == "number" and not DF.table.find (indexedTalents, talentID)) then otherTalents:Show() return end @@ -6607,7 +6607,7 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) --create radio for group types local groupTypes = {} - for _, groupTable in ipairs (DF:GetGroupTypes()) do + for _, groupTable in ipairs(DF:GetGroupTypes()) do tinsert (groupTypes, { name = groupTable.Name, set = f.OnRadioCheckboxClick, @@ -6616,13 +6616,13 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) }) end local groupTypesGroup = DF:CreateCheckboxGroup (f, groupTypes, name, {width = 200, height = 200, title = "Group Types"}) - groupTypesGroup:SetPoint ("topleft", f, "topleft", anchorPositions.group [1], anchorPositions.group [2]) + groupTypesGroup:SetPoint("topleft", f, "topleft", anchorPositions.group [1], anchorPositions.group [2]) groupTypesGroup.DBKey = "group" tinsert (f.AllRadioGroups, groupTypesGroup) --create radio for character roles local roleTypes = {} - for _, roleTable in ipairs (DF:GetRoleTypes()) do + for _, roleTable in ipairs(DF:GetRoleTypes()) do tinsert (roleTypes, { name = roleTable.Texture .. " " .. roleTable.Name, set = f.OnRadioCheckboxClick, @@ -6631,7 +6631,7 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) }) end local roleTypesGroup = DF:CreateCheckboxGroup (f, roleTypes, name, {width = 200, height = 200, title = "Role Types"}) - roleTypesGroup:SetPoint ("topleft", f, "topleft", anchorPositions.role [1], anchorPositions.role [2]) + roleTypesGroup:SetPoint("topleft", f, "topleft", anchorPositions.role [1], anchorPositions.role [2]) roleTypesGroup.DBKey = "role" tinsert (f.AllRadioGroups, roleTypesGroup) @@ -6651,7 +6651,7 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) end end local affixTypesGroup = DF:CreateCheckboxGroup (f, affixes, name, {width = 200, height = 200, title = "M+ Affixes"}) - affixTypesGroup:SetPoint ("topleft", f, "topleft", anchorPositions.affix [1], anchorPositions.affix [2]) + affixTypesGroup:SetPoint("topleft", f, "topleft", anchorPositions.affix [1], anchorPositions.affix [2]) affixTypesGroup.DBKey = "affix" tinsert (f.AllRadioGroups, affixTypesGroup) end @@ -6659,20 +6659,20 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) --text entries functions local textEntryRefresh = function(self) local idList = f.OptionsTable [self.DBKey] - self:SetText ("") + self:SetText("") for _, id in pairs(idList) do if tonumber(id) then - self:SetText (self:GetText() .. " " .. id) + self:SetText(self:GetText() .. " " .. id) end end - self:SetText (self:GetText():gsub ("^ ", "")) + self:SetText(self:GetText():gsub ("^ ", "")) end local textEntryOnEnterPressed = function(_, self) wipe (f.OptionsTable [self.DBKey]) local text = self:GetText() - for _, ID in ipairs ({strsplit (" ", text)}) do + for _, ID in ipairs({strsplit (" ", text)}) do ID = DF:trim (ID) ID = tonumber (ID) if (ID) then @@ -6683,35 +6683,35 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) end --create the text entry to type the encounter ID - local encounterIDLabel = DF:CreateLabel (f, "Encounter ID", DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")) + local encounterIDLabel = DF:CreateLabel(f, "Encounter ID", DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")) local encounterIDEditbox = DF:CreateTextEntry (f, function()end, 200, 20, "EncounterEditbox", _, _, DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) - encounterIDLabel:SetPoint ("topleft", f, "topleft", anchorPositions.encounter_ids [1], anchorPositions.encounter_ids [2]) - encounterIDEditbox:SetPoint ("topleft", encounterIDLabel, "bottomleft", 0, -2) + encounterIDLabel:SetPoint("topleft", f, "topleft", anchorPositions.encounter_ids [1], anchorPositions.encounter_ids [2]) + encounterIDEditbox:SetPoint("topleft", encounterIDLabel, "bottomleft", 0, -2) encounterIDEditbox.DBKey = "encounter_ids" encounterIDEditbox.Refresh = textEntryRefresh encounterIDEditbox.tooltip = "Enter multiple IDs separating with a whitespace.\nExample: 35 45 95\n\nSanctum of Domination:\n" - for _, encounterTable in ipairs (DF:GetCLEncounterIDs()) do + for _, encounterTable in ipairs(DF:GetCLEncounterIDs()) do encounterIDEditbox.tooltip = encounterIDEditbox.tooltip .. encounterTable.ID .. " - " .. encounterTable.Name .. "\n" end - encounterIDEditbox:SetHook ("OnEnterPressed", textEntryOnEnterPressed) + encounterIDEditbox:SetHook("OnEnterPressed", textEntryOnEnterPressed) tinsert (f.AllTextEntries, encounterIDEditbox) --create the text entry for map ID - local mapIDLabel = DF:CreateLabel (f, "Map ID", DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")) + local mapIDLabel = DF:CreateLabel(f, "Map ID", DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")) local mapIDEditbox = DF:CreateTextEntry (f, function()end, 200, 20, "MapEditbox", _, _, DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) - mapIDLabel:SetPoint ("topleft", f, "topleft", anchorPositions.map_ids [1], anchorPositions.map_ids [2]) - mapIDEditbox:SetPoint ("topleft", mapIDLabel, "bottomleft", 0, -2) + mapIDLabel:SetPoint("topleft", f, "topleft", anchorPositions.map_ids [1], anchorPositions.map_ids [2]) + mapIDEditbox:SetPoint("topleft", mapIDLabel, "bottomleft", 0, -2) mapIDEditbox.DBKey = "map_ids" mapIDEditbox.Refresh = textEntryRefresh mapIDEditbox.tooltip = "Enter multiple IDs separating with a whitespace\nExample: 35 45 95" - mapIDEditbox:SetHook ("OnEnterPressed", textEntryOnEnterPressed) + mapIDEditbox:SetHook("OnEnterPressed", textEntryOnEnterPressed) tinsert (f.AllTextEntries, mapIDEditbox) function f.Refresh (self) if IS_WOW_PROJECT_MAINLINE then --update the talents (might have changed if the player changed its specialization) local talentList = {} - for _, talentTable in ipairs (DF:GetCharacterTalents()) do + for _, talentTable in ipairs(DF:GetCharacterTalents()) do tinsert (talentList, { name = talentTable.Name, set = DetailsFrameworkLoadConditionsPanel.OnRadioCheckboxClick, @@ -6725,7 +6725,7 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) if IS_WOW_PROJECT_MAINLINE then local pvpTalentList = {} - for _, talentTable in ipairs (DF:GetCharacterPvPTalents()) do + for _, talentTable in ipairs(DF:GetCharacterPvPTalents()) do tinsert (pvpTalentList, { name = talentTable.Name, set = DetailsFrameworkLoadConditionsPanel.OnRadioCheckboxClick, @@ -6738,13 +6738,13 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) end --refresh the radio group - for _, radioGroup in ipairs (DetailsFrameworkLoadConditionsPanel.AllRadioGroups) do + for _, radioGroup in ipairs(DetailsFrameworkLoadConditionsPanel.AllRadioGroups) do radioGroup:Refresh() DetailsFrameworkLoadConditionsPanel.OnRadioStateChanged (radioGroup, DetailsFrameworkLoadConditionsPanel.OptionsTable [radioGroup.DBKey]) end --refresh text entries - for _, textEntry in ipairs (DetailsFrameworkLoadConditionsPanel.AllTextEntries) do + for _, textEntry in ipairs(DetailsFrameworkLoadConditionsPanel.AllTextEntries) do textEntry:Refresh() end @@ -6764,8 +6764,8 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) DetailsFrameworkLoadConditionsPanel.OptionsTable = optionsTable --set title - DetailsFrameworkLoadConditionsPanel.EditingLabel:SetText (frameOptions.name) - DetailsFrameworkLoadConditionsPanel.Title:SetText (frameOptions.title) + DetailsFrameworkLoadConditionsPanel.EditingLabel:SetText(frameOptions.name) + DetailsFrameworkLoadConditionsPanel.Title:SetText(frameOptions.title) --show the panel to the user DetailsFrameworkLoadConditionsPanel:Show() @@ -6775,13 +6775,13 @@ end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> simple data scroll +--simple data scroll DF.DataScrollFunctions = { RefreshScroll = function(self, data, offset, totalLines) local filter = self.Filter local currentData = {} - if (type (filter) == "string" and filter ~= "") then + if (type(filter) == "string" and filter ~= "") then for i = 1, #data do for o = 1, #data[i] do if (data[i][o]:find (filter)) then @@ -6811,38 +6811,38 @@ DF.DataScrollFunctions = { CreateLine = function(self, index) --create a new line - local line = CreateFrame ("button", "$parentLine" .. index, self, "BackdropTemplate") + local line = CreateFrame("button", "$parentLine" .. index, self, "BackdropTemplate") line.Update = self.options.update_line_func --set its parameters - line:SetPoint ("topleft", self, "topleft", 1, -((index-1) * (self.options.line_height+1)) - 1) - line:SetSize (self.options.width - 2, self.options.line_height) + line:SetPoint("topleft", self, "topleft", 1, -((index-1) * (self.options.line_height+1)) - 1) + line:SetSize(self.options.width - 2, self.options.line_height) line:RegisterForClicks ("LeftButtonDown", "RightButtonDown") - line:SetScript ("OnEnter", self.options.on_enter) - line:SetScript ("OnLeave", self.options.on_leave) - line:SetScript ("OnClick", self.options.on_click) + line:SetScript("OnEnter", self.options.on_enter) + line:SetScript("OnLeave", self.options.on_leave) + line:SetScript("OnClick", self.options.on_click) - line:SetBackdrop (self.options.backdrop) - line:SetBackdropColor (unpack (self.options.backdrop_color)) - line:SetBackdropBorderColor (unpack (self.options.backdrop_border_color)) + line:SetBackdrop(self.options.backdrop) + line:SetBackdropColor(unpack (self.options.backdrop_color)) + line:SetBackdropBorderColor(unpack (self.options.backdrop_border_color)) - local title = DF:CreateLabel (line, "", DF:GetTemplate ("font", self.options.title_template)) - local date = DF:CreateLabel (line, "", DF:GetTemplate ("font", self.options.title_template)) - local text = DF:CreateLabel (line, "", DF:GetTemplate ("font", self.options.text_tempate)) + local title = DF:CreateLabel(line, "", DF:GetTemplate ("font", self.options.title_template)) + local date = DF:CreateLabel(line, "", DF:GetTemplate ("font", self.options.title_template)) + local text = DF:CreateLabel(line, "", DF:GetTemplate ("font", self.options.text_tempate)) title.textsize = 14 date.textsize = 14 - text:SetSize (self.options.width - 20, self.options.line_height) + text:SetSize(self.options.width - 20, self.options.line_height) text:SetJustifyV ("top") --setup anchors if (self.options.show_title) then - title:SetPoint ("topleft", line, "topleft", 2, 0) - date:SetPoint ("topright", line, "topright", -2, 0) - text:SetPoint ("topleft", title, "bottomleft", 0, -4) + title:SetPoint("topleft", line, "topleft", 2, 0) + date:SetPoint("topright", line, "topright", -2, 0) + text:SetPoint("topleft", title, "bottomleft", 0, -4) else - text:SetPoint ("topleft", line, "topleft", 2, 0) + text:SetPoint("topleft", line, "topleft", 2, 0) end line.Title = title @@ -6856,10 +6856,10 @@ DF.DataScrollFunctions = { end, LineOnEnter = function(self) - self:SetBackdropColor (unpack (self.backdrop_color_highlight)) + self:SetBackdropColor(unpack (self.backdrop_color_highlight)) end, LineOnLeave = function(self) - self:SetBackdropColor (unpack (self.backdrop_color)) + self:SetBackdropColor(unpack (self.backdrop_color)) end, OnClick = function(self) @@ -6943,7 +6943,7 @@ function DF:CreateDataScrollFrame (parent, name, options) end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> "WHAT's NEW" window +--"WHAT's NEW" window local default_newsframe_options = { width = 400, @@ -6973,7 +6973,7 @@ function DF:GetNumNews (newsTable, lastNewsTime) local now = time() local nonReadNews = 0 - for _, news in ipairs (newsTable) do + for _, news in ipairs(newsTable) do if (news[1] > lastNewsTime) then nonReadNews = nonReadNews + 1 end @@ -7001,10 +7001,10 @@ function DF:CreateNewsFrame (parent, name, options, newsTable, db) f:BuildOptionsTable (default_newsframe_options, options) - f:SetSize (f.options.width, f.options.height) - f:SetBackdrop (f.options.backdrop) - f:SetBackdropColor (unpack (f.options.backdrop_color)) - f:SetBackdropBorderColor (unpack (f.options.backdrop_border_color)) + f:SetSize(f.options.width, f.options.height) + f:SetBackdrop(f.options.backdrop) + f:SetBackdropColor(unpack (f.options.backdrop_color)) + f:SetBackdropBorderColor(unpack (f.options.backdrop_border_color)) local scrollOptions = { data = newsTable, @@ -7017,9 +7017,9 @@ function DF:CreateNewsFrame (parent, name, options, newsTable, db) if (not f.options.show_title) then f.TitleBar:Hide() - newsScroll:SetPoint ("topleft", f, "topleft", 5, -10) + newsScroll:SetPoint("topleft", f, "topleft", 5, -10) else - newsScroll:SetPoint ("topleft", f, "topleft", 5, -30) + newsScroll:SetPoint("topleft", f, "topleft", 5, -30) end f.NewsScroll = newsScroll @@ -7030,7 +7030,7 @@ end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> statusbar info +--statusbar info --[[ authorTable = { @@ -7042,27 +7042,27 @@ end ]] function DF:BuildStatusbarAuthorInfo (f, addonBy, authorsNameString) - local authorName = DF:CreateLabel (f, "" .. (addonBy or "An addon by ") .. "|cFFFFFFFF" .. (authorsNameString or "Terciob") .. "|r") + local authorName = DF:CreateLabel(f, "" .. (addonBy or "An addon by ") .. "|cFFFFFFFF" .. (authorsNameString or "Terciob") .. "|r") authorName.textcolor = "silver" - local discordLabel = DF:CreateLabel (f, "Discord: ") + local discordLabel = DF:CreateLabel(f, "Discord: ") discordLabel.textcolor = "silver" local options_dropdown_template = DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") local discordTextEntry = DF:CreateTextEntry (f, function()end, 200, 18, "DiscordTextBox", _, _, options_dropdown_template) - discordTextEntry:SetText ("https://discord.gg/AGSzAZX") + discordTextEntry:SetText("https://discord.gg/AGSzAZX") discordTextEntry:SetFrameLevel (5000) - authorName:SetPoint ("left", f, "left", 2, 0) - discordLabel:SetPoint ("left", authorName, "right", 20, 0) - discordTextEntry:SetPoint ("left", discordLabel, "right", 2, 0) + authorName:SetPoint("left", f, "left", 2, 0) + discordLabel:SetPoint("left", authorName, "right", 20, 0) + discordTextEntry:SetPoint("left", discordLabel, "right", 2, 0) --format authorName:SetAlpha (.6) discordLabel:SetAlpha (.6) discordTextEntry:SetAlpha (.6) - discordTextEntry:SetBackdropBorderColor (1, 1, 1, 0) + discordTextEntry:SetBackdropBorderColor(1, 1, 1, 0) - discordTextEntry:SetHook ("OnEditFocusGained", function() + discordTextEntry:SetHook("OnEditFocusGained", function() discordTextEntry:HighlightText() end) @@ -7076,7 +7076,7 @@ local statusbar_default_options = { } function DF:CreateStatusBar(f, options) - local statusBar = CreateFrame ("frame", nil, f, "BackdropTemplate") + local statusBar = CreateFrame("frame", nil, f, "BackdropTemplate") DF:Mixin (statusBar, DF.OptionsFunctions) DF:Mixin (statusBar, DF.LayoutFrame) @@ -7084,15 +7084,15 @@ function DF:CreateStatusBar(f, options) statusBar:BuildOptionsTable (statusbar_default_options, options) if (statusBar.options.attach == "bottom") then - statusBar:SetPoint ("bottomleft", f, "bottomleft") - statusBar:SetPoint ("bottomright", f, "bottomright") + statusBar:SetPoint("bottomleft", f, "bottomleft") + statusBar:SetPoint("bottomright", f, "bottomright") else - statusBar:SetPoint ("topleft", f, "bottomleft") - statusBar:SetPoint ("topright", f, "bottomright") + statusBar:SetPoint("topleft", f, "bottomleft") + statusBar:SetPoint("topright", f, "bottomright") end - statusBar:SetHeight (20) + statusBar:SetHeight(20) DF:ApplyStandardBackdrop (statusBar) statusBar:SetAlpha (0.8) @@ -7101,12 +7101,12 @@ end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> statusbar mixin +--statusbar mixin --[=[ collection of functions to embed into a statusbar statusBar:GetTexture() - statusBar:SetTexture (texture) + statusBar:SetTexture(texture) statusBar:SetColor (unparsed color) statusBar:GetColor() statusBar: @@ -7116,7 +7116,7 @@ end DF.StatusBarFunctions = { SetTexture = function(self, texture) - self.barTexture:SetTexture (texture) + self.barTexture:SetTexture(texture) end, GetTexture = function(self) @@ -7140,7 +7140,7 @@ DF.StatusBarFunctions = { end, SetColor = function(self, r, g, b, a) - r, g, b, a = DF:ParseColors (r, g, b, a) + r, g, b, a = DF:ParseColors(r, g, b, a) self:SetStatusBarColor (r, g, b, a) end, @@ -7295,7 +7295,7 @@ DF.StatusBarFunctions = { } ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> health bar frame +--health bar frame --[=[ DF:CreateHealthBar (parent, name, settingsOverride) @@ -7307,7 +7307,7 @@ DF.StatusBarFunctions = { methods: healthbar:SetUnit (unit) healthBar:GetTexture() - healthBar:SetTexture (texture) + healthBar:SetTexture(texture) --]=] --debug performance isn't placed anywhere @@ -7401,13 +7401,13 @@ DF.StatusBarFunctions = { --copy the non existing values from a new version to the already existing hook table DF.table.deploy (healthBarMetaFunctions.HookList, defaultHooksForHealthBar) ---> Health Bar Meta Functions +--Health Bar Meta Functions --health bar settings healthBarMetaFunctions.Settings = { - CanTick = false, --> if true calls the method 'OnTick' every tick, the function needs to be overloaded, it receives self and deltaTime as parameters - ShowHealingPrediction = true, --> when casting a healing pass, show the amount of health that spell will heal - ShowShields = true, --> indicator of the amount of damage absortion the unit has + CanTick = false, --if true calls the method 'OnTick' every tick, the function needs to be overloaded, it receives self and deltaTime as parameters + ShowHealingPrediction = true, --when casting a healing pass, show the amount of health that spell will heal + ShowShields = true, --indicator of the amount of damage absortion the unit has --appearance BackgroundColor = DF:CreateColorTable (.2, .2, .2, .8), @@ -7431,19 +7431,19 @@ DF.StatusBarFunctions = { {(IS_WOW_PROJECT_MAINLINE) and "UNIT_HEAL_ABSORB_AMOUNT_CHANGED", true}, } - --> setup the castbar to be used by another unit + --setup the castbar to be used by another unit healthBarMetaFunctions.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 - --> register events + --register events if (unit) then self.currentHealth = UnitHealth (unit) or 0 self.currentHealthMax = UnitHealthMax (unit) or 0 - for _, eventTable in ipairs (self.HealthBarEvents) do + for _, eventTable in ipairs(self.HealthBarEvents) do local event = eventTable [1] local isUnitEvent = eventTable [2] if event then @@ -7455,7 +7455,7 @@ DF.StatusBarFunctions = { end end - --> check for settings and update some events + --check for settings and update some events if (not self.Settings.ShowHealingPrediction) then self:UnregisterEvent ("UNIT_HEAL_PREDICTION") if IS_WOW_PROJECT_MAINLINE then @@ -7472,26 +7472,26 @@ DF.StatusBarFunctions = { self.shieldAbsorbGlow:Hide() end - --> set scripts - self:SetScript ("OnEvent", self.OnEvent) + --set scripts + self:SetScript("OnEvent", self.OnEvent) if (self.Settings.CanTick) then - self:SetScript ("OnUpdate", self.OnTick) + self:SetScript("OnUpdate", self.OnTick) end self:PLAYER_ENTERING_WORLD (self.unit, self.displayedUnit) else - --> remove all registered events - for _, eventTable in ipairs (self.HealthBarEvents) do + --remove all registered events + for _, eventTable in ipairs(self.HealthBarEvents) do local event = eventTable [1] if event then self:UnregisterEvent (event) end end - --> remove scripts - self:SetScript ("OnEvent", nil) - self:SetScript ("OnUpdate", nil) + --remove scripts + self:SetScript("OnEvent", nil) + self:SetScript("OnUpdate", nil) self:Hide() end end @@ -7501,22 +7501,22 @@ DF.StatusBarFunctions = { PixelUtil.SetWidth (self, self.Settings.Width, 1) PixelUtil.SetHeight (self, self.Settings.Height, 1) - self:SetTexture (self.Settings.Texture) + self:SetTexture(self.Settings.Texture) self.background:SetAllPoints() self.background:SetColorTexture (self.Settings.BackgroundColor:GetColor()) --setpoint of these widgets are set inside the function that updates the incoming heal - self.incomingHealIndicator:SetTexture (self:GetTexture()) - self.healAbsorbIndicator:SetTexture (self:GetTexture()) + self.incomingHealIndicator:SetTexture(self:GetTexture()) + self.healAbsorbIndicator:SetTexture(self:GetTexture()) self.healAbsorbIndicator:SetVertexColor (.1, .8, .8) - self.shieldAbsorbIndicator:SetTexture (self.Settings.ShieldIndicatorTexture, true, true) + self.shieldAbsorbIndicator:SetTexture(self.Settings.ShieldIndicatorTexture, true, true) - self.shieldAbsorbGlow:SetWidth (self.Settings.ShieldGlowWidth) - self.shieldAbsorbGlow:SetTexture (self.Settings.ShieldGlowTexture) - self.shieldAbsorbGlow:SetBlendMode ("ADD") - self.shieldAbsorbGlow:SetPoint ("topright", self, "topright", 8, 0) - self.shieldAbsorbGlow:SetPoint ("bottomright", self, "bottomright", 8, 0) + self.shieldAbsorbGlow:SetWidth(self.Settings.ShieldGlowWidth) + self.shieldAbsorbGlow:SetTexture(self.Settings.ShieldGlowTexture) + self.shieldAbsorbGlow:SetBlendMode("ADD") + self.shieldAbsorbGlow:SetPoint("topright", self, "topright", 8, 0) + self.shieldAbsorbGlow:SetPoint("bottomright", self, "bottomright", 8, 0) self.shieldAbsorbGlow:Hide() self:SetUnit (nil) @@ -7580,9 +7580,9 @@ DF.StatusBarFunctions = { --calculate what is the percent of health incoming based on the max health the player has local incomingPercent = unitHealIncoming / currentHealthMax self.incomingHealIndicator:Show() - self.incomingHealIndicator:SetWidth (max (1, min (width * incomingPercent, abs (healthPercent - 1) * width))) - self.incomingHealIndicator:SetPoint ("topleft", self, "topleft", width * healthPercent, 0) - self.incomingHealIndicator:SetPoint ("bottomleft", self, "bottomleft", width * healthPercent, 0) + self.incomingHealIndicator:SetWidth(max (1, min (width * incomingPercent, abs (healthPercent - 1) * width))) + self.incomingHealIndicator:SetPoint("topleft", self, "topleft", width * healthPercent, 0) + self.incomingHealIndicator:SetPoint("bottomleft", self, "bottomleft", width * healthPercent, 0) else self.incomingHealIndicator:Hide() end @@ -7590,9 +7590,9 @@ DF.StatusBarFunctions = { if (unitHealAbsorb > 0) then local healAbsorbPercent = unitHealAbsorb / currentHealthMax self.healAbsorbIndicator:Show() - self.healAbsorbIndicator:SetWidth (max (1, min (width * healAbsorbPercent, abs (healthPercent - 1) * width))) - self.healAbsorbIndicator:SetPoint ("topleft", self, "topleft", width * healthPercent, 0) - self.healAbsorbIndicator:SetPoint ("bottomleft", self, "bottomleft", width * healthPercent, 0) + self.healAbsorbIndicator:SetWidth(max (1, min (width * healAbsorbPercent, abs (healthPercent - 1) * width))) + self.healAbsorbIndicator:SetPoint("topleft", self, "topleft", width * healthPercent, 0) + self.healAbsorbIndicator:SetPoint("bottomleft", self, "bottomleft", width * healthPercent, 0) else self.healAbsorbIndicator:Hide() end @@ -7607,9 +7607,9 @@ DF.StatusBarFunctions = { self.shieldAbsorbIndicator:Show() --set the width where the max width size is what is lower: the absorb size or the missing amount of health in the health bar --/dump NamePlate1PlaterUnitFrameHealthBar.shieldAbsorbIndicator:GetSize() - self.shieldAbsorbIndicator:SetWidth (max (1, min (width * damageAbsorbPercent, abs (healthPercent - 1) * width))) - self.shieldAbsorbIndicator:SetPoint ("topleft", self, "topleft", width * healthPercent, 0) - self.shieldAbsorbIndicator:SetPoint ("bottomleft", self, "bottomleft", width * healthPercent, 0) + self.shieldAbsorbIndicator:SetWidth(max (1, min (width * damageAbsorbPercent, abs (healthPercent - 1) * width))) + self.shieldAbsorbIndicator:SetPoint("topleft", self, "topleft", width * healthPercent, 0) + self.shieldAbsorbIndicator:SetPoint("bottomleft", self, "bottomleft", width * healthPercent, 0) --if the absorb percent pass 100%, show the glow if ((healthPercent + damageAbsorbPercent) > 1) then @@ -7627,7 +7627,7 @@ DF.StatusBarFunctions = { end end - --> Health Events + --Health Events healthBarMetaFunctions.PLAYER_ENTERING_WORLD = function(self, ...) self:UpdateMaxHealth() self:UpdateHealth() @@ -7675,54 +7675,54 @@ function DF:CreateHealthBar (parent, name, settingsOverride) assert (name or parent:GetName(), "DetailsFramework:CreateHealthBar parameter 'name' omitted and parent has no name.") - local healthBar = CreateFrame ("StatusBar", name or (parent:GetName() .. "HealthBar"), parent, "BackdropTemplate") + local healthBar = CreateFrame("StatusBar", name or (parent:GetName() .. "HealthBar"), parent, "BackdropTemplate") do --layers --background - healthBar.background = healthBar:CreateTexture (nil, "background") + healthBar.background = healthBar:CreateTexture(nil, "background") healthBar.background:SetDrawLayer ("background", -6) --artwork --healing incoming - healthBar.incomingHealIndicator = healthBar:CreateTexture (nil, "artwork") + healthBar.incomingHealIndicator = healthBar:CreateTexture(nil, "artwork") healthBar.incomingHealIndicator:SetDrawLayer ("artwork", 4) --current shields on the unit - healthBar.shieldAbsorbIndicator = healthBar:CreateTexture (nil, "artwork") + healthBar.shieldAbsorbIndicator = healthBar:CreateTexture(nil, "artwork") healthBar.shieldAbsorbIndicator:SetDrawLayer ("artwork", 5) --debuff absorbing heal - healthBar.healAbsorbIndicator = healthBar:CreateTexture (nil, "artwork") + healthBar.healAbsorbIndicator = healthBar:CreateTexture(nil, "artwork") healthBar.healAbsorbIndicator:SetDrawLayer ("artwork", 6) --the shield fills all the bar, show that cool glow - healthBar.shieldAbsorbGlow = healthBar:CreateTexture (nil, "artwork") + healthBar.shieldAbsorbGlow = healthBar:CreateTexture(nil, "artwork") healthBar.shieldAbsorbGlow:SetDrawLayer ("artwork", 7) --statusbar texture - healthBar.barTexture = healthBar:CreateTexture (nil, "artwork") + healthBar.barTexture = healthBar:CreateTexture(nil, "artwork") healthBar:SetStatusBarTexture (healthBar.barTexture) end - --> mixins + --mixins DF:Mixin (healthBar, healthBarMetaFunctions) DF:Mixin (healthBar, DF.StatusBarFunctions) healthBar:CreateTextureMask() - --> settings and hooks + --settings and hooks local settings = DF.table.copy ({}, healthBarMetaFunctions.Settings) if (settingsOverride) then DF.table.copy (settings, settingsOverride) end healthBar.Settings = settings - --> hook list + --hook list healthBar.HookList = DF.table.copy ({}, healthBarMetaFunctions.HookList) - --> initialize the cast bar + --initialize the cast bar healthBar:Initialize() return healthBar end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> power bar frame +--power bar frame --[=[ DF:CreatePowerBar (parent, name, settingsOverride) @@ -7744,17 +7744,17 @@ DF.PowerFrameFunctions = { }, Settings = { - --> misc - ShowAlternatePower = true, --> if true it'll show alternate power over the regular power the unit uses - ShowPercentText = true, --> if true show a text with the current energy percent - HideIfNoPower = true, --> if true and the UnitMaxPower returns zero, it'll hide the power bar with self:Hide() - CanTick = false, --> if it calls the OnTick function every tick + --misc + ShowAlternatePower = true, --if true it'll show alternate power over the regular power the unit uses + ShowPercentText = true, --if true show a text with the current energy percent + HideIfNoPower = true, --if true and the UnitMaxPower returns zero, it'll hide the power bar with self:Hide() + CanTick = false, --if it calls the OnTick function every tick --appearance BackgroundColor = DF:CreateColorTable (.2, .2, .2, .8), Texture = [[Interface\RaidFrame\Raid-Bar-Resource-Fill]], - --> default size + --default size Width = 100, Height = 20, }, @@ -7769,15 +7769,15 @@ DF.PowerFrameFunctions = { {"UNIT_POWER_FREQUENT", true}, }, - --> setup the castbar to be used by another unit + --setup the castbar to be used by another unit 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 - --> register events + --register events if (unit) then - for _, eventTable in ipairs (self.PowerBarEvents) do + for _, eventTable in ipairs(self.PowerBarEvents) do local event = eventTable [1] local isUnitEvent = eventTable [2] @@ -7788,25 +7788,25 @@ DF.PowerFrameFunctions = { end end - --> set scripts - self:SetScript ("OnEvent", self.OnEvent) + --set scripts + self:SetScript("OnEvent", self.OnEvent) if (self.Settings.CanTick) then - self:SetScript ("OnUpdate", self.OnTick) + self:SetScript("OnUpdate", self.OnTick) end self:Show() self:UpdatePowerBar() else - --> remove all registered events - for _, eventTable in ipairs (self.PowerBarEvents) do + --remove all registered events + for _, eventTable in ipairs(self.PowerBarEvents) do local event = eventTable [1] self:UnregisterEvent (event) end - --> remove scripts - self:SetScript ("OnEvent", nil) - self:SetScript ("OnUpdate", nil) + --remove scripts + self:SetScript("OnEvent", nil) + self:SetScript("OnUpdate", nil) self:Hide() end end @@ -7816,7 +7816,7 @@ DF.PowerFrameFunctions = { PixelUtil.SetWidth (self, self.Settings.Width) PixelUtil.SetHeight (self, self.Settings.Height) - self:SetTexture (self.Settings.Texture) + self:SetTexture(self.Settings.Texture) self.background:SetAllPoints() self.background:SetColorTexture (self.Settings.BackgroundColor:GetColor()) @@ -7826,7 +7826,7 @@ DF.PowerFrameFunctions = { PixelUtil.SetPoint (self.percentText, "center", self, "center", 0, 0) DF:SetFontSize (self.percentText, 9) - DF:SetFontColor (self.percentText, "white") + DF:SetFontColor(self.percentText, "white") DF:SetFontOutline (self.percentText, "OUTLINE") else self.percentText:Hide() @@ -7835,10 +7835,10 @@ DF.PowerFrameFunctions = { self:SetUnit (nil) end, - --> call every tick + --call every tick 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 + --when an event happen for this unit, send it to the apropriate function OnEvent = function(self, event, ...) local eventFunc = self [event] if (eventFunc) then @@ -7854,7 +7854,7 @@ DF.PowerFrameFunctions = { self:UpdatePowerColor() end, - --> power update + --power update UpdateMaxPower = function(self) self.currentPowerMax = UnitPowerMax (self.displayedUnit, self.powerType) self:SetMinMaxValues (self.minPower, self.currentPowerMax) @@ -7868,11 +7868,11 @@ DF.PowerFrameFunctions = { PixelUtil.SetStatusBarValue (self, self.currentPower) if (self.Settings.ShowPercentText) then - self.percentText:SetText (floor (self.currentPower / self.currentPowerMax * 100) .. "%") + self.percentText:SetText(floor (self.currentPower / self.currentPowerMax * 100) .. "%") end end, - --> when a event different from unit_power_update is triggered, update which type of power the unit should show + --when a event different from unit_power_update is triggered, update which type of power the unit should show UpdatePowerInfo = function(self) if (IS_WOW_PROJECT_MAINLINE and self.Settings.ShowAlternatePower) then -- not available in classic local barID = UnitPowerBarID(self.displayedUnit) @@ -7890,7 +7890,7 @@ DF.PowerFrameFunctions = { self.minPower = 0 end, - --> tint the bar with the color of the power, e.g. blue for a mana bar + --tint the bar with the color of the power, e.g. blue for a mana bar UpdatePowerColor = function(self) if (not UnitIsConnected (self.unit)) then self:SetStatusBarColor (.5, .5, .5) @@ -7898,12 +7898,12 @@ DF.PowerFrameFunctions = { end if (self.powerType == ALTERNATE_POWER_INDEX) then - --> don't change this, keep the same color as the game tints on CompactUnitFrame.lua + --don't change this, keep the same color as the game tints on CompactUnitFrame.lua self:SetStatusBarColor (0.7, 0.7, 0.6) return end - local powerColor = PowerBarColor [self.powerType] --> don't appear to be, but PowerBarColor is a global table with all power colors /run Details:Dump (PowerBarColor) + local powerColor = PowerBarColor [self.powerType] --don't appear to be, but PowerBarColor is a global table with all power colors /run Details:Dump (PowerBarColor) if (powerColor) then self:SetStatusBarColor (powerColor.r, powerColor.g, powerColor.b) return @@ -7915,12 +7915,12 @@ DF.PowerFrameFunctions = { return end - --> if everything else fails, tint as rogue energy + --if everything else fails, tint as rogue energy powerColor = PowerBarColor ["ENERGY"] self:SetStatusBarColor (powerColor.r, powerColor.g, powerColor.b) end, - --> events + --events PLAYER_ENTERING_WORLD = function(self, ...) self:UpdatePowerBar() end, @@ -7951,27 +7951,27 @@ function DF:CreatePowerBar (parent, name, settingsOverride) assert (name or parent:GetName(), "DetailsFramework:CreatePowerBar parameter 'name' omitted and parent has no name.") - local powerBar = CreateFrame ("StatusBar", name or (parent:GetName() .. "PowerBar"), parent, "BackdropTemplate") + local powerBar = CreateFrame("StatusBar", name or (parent:GetName() .. "PowerBar"), parent, "BackdropTemplate") do --layers --background - powerBar.background = powerBar:CreateTexture (nil, "background") + powerBar.background = powerBar:CreateTexture(nil, "background") powerBar.background:SetDrawLayer ("background", -6) --artwork - powerBar.barTexture = powerBar:CreateTexture (nil, "artwork") + powerBar.barTexture = powerBar:CreateTexture(nil, "artwork") powerBar:SetStatusBarTexture (powerBar.barTexture) --overlay powerBar.percentText = powerBar:CreateFontString (nil, "overlay", "GameFontNormal") end - --> mixins + --mixins DF:Mixin (powerBar, DF.PowerFrameFunctions) DF:Mixin (powerBar, DF.StatusBarFunctions) powerBar:CreateTextureMask() - --> settings and hooks + --settings and hooks local settings = DF.table.copy ({}, DF.PowerFrameFunctions.Settings) if (settingsOverride) then DF.table.copy (settings, settingsOverride) @@ -7981,14 +7981,14 @@ function DF:CreatePowerBar (parent, name, settingsOverride) local hookList = DF.table.copy ({}, DF.PowerFrameFunctions.HookList) powerBar.HookList = hookList - --> initialize the cast bar + --initialize the cast bar powerBar:Initialize() return powerBar end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> cast bar frame +--cast bar frame --[=[ DF:CreateCastBar (parent, name, settingsOverride) @@ -8083,32 +8083,32 @@ DF.CastFrameFunctions = { self.extraBackground:SetVertexColor (self.Settings.BackgroundColor:GetColor()) self.extraBackground:SetAllPoints() - self:SetTexture (self.Settings.Texture) + self:SetTexture(self.Settings.Texture) - self.BorderShield:SetPoint ("center", self, "left", 0, 0) - self.BorderShield:SetTexture (self.Settings.BorderShieldTexture) + self.BorderShield:SetPoint("center", self, "left", 0, 0) + self.BorderShield:SetTexture(self.Settings.BorderShieldTexture) self.BorderShield:SetTexCoord (unpack (self.Settings.BorderShieldCoords)) - self.BorderShield:SetSize (self.Settings.BorderShieldWidth, self.Settings.BorderShieldHeight) + self.BorderShield:SetSize(self.Settings.BorderShieldWidth, self.Settings.BorderShieldHeight) - self.Icon:SetPoint ("center", self, "left", 2, 0) - self.Icon:SetSize (self.Settings.SpellIconWidth, self.Settings.SpellIconHeight) + self.Icon:SetPoint("center", self, "left", 2, 0) + self.Icon:SetSize(self.Settings.SpellIconWidth, self.Settings.SpellIconHeight) - self.Spark:SetTexture (self.Settings.SparkTexture) - self.Spark:SetSize (self.Settings.SparkWidth, self.Settings.SparkHeight) + self.Spark:SetTexture(self.Settings.SparkTexture) + self.Spark:SetSize(self.Settings.SparkWidth, self.Settings.SparkHeight) - self.percentText:SetPoint ("right", self, "right", -2, 0) - self.percentText:SetJustifyH ("right") + self.percentText:SetPoint("right", self, "right", -2, 0) + self.percentText:SetJustifyH("right") - self.fadeOutAnimation.alpha1:SetDuration (self.Settings.FadeOutTime) - self.fadeInAnimation.alpha1:SetDuration (self.Settings.FadeInTime) + self.fadeOutAnimation.alpha1:SetDuration(self.Settings.FadeOutTime) + self.fadeInAnimation.alpha1:SetDuration(self.Settings.FadeInTime) end, SetDefaultColor = function(self, colorType, r, g, b, a) - assert (type (colorType) == "string", "DetailsFramework: CastBar:SetDefaultColor require a string in the first argument.") + 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 + --this get a color suggestion based on the type of cast being shown in the cast bar GetCastColor = function(self) if (not self.canInterrupt) then return self.Colors.NonInterruptible @@ -8130,13 +8130,13 @@ DF.CastFrameFunctions = { end end, - --> update all colors of the cast bar + --update all colors of the cast bar 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 + --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) if (not ignoreVisibility and not self:IsShown()) then return false @@ -8155,8 +8155,8 @@ DF.CastFrameFunctions = { return true end, - --> 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 + --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) if (self.Settings.ShowShield and not self.canInterrupt) then self.BorderShield:Show() @@ -8165,10 +8165,10 @@ DF.CastFrameFunctions = { end end, - --> this check if the cast did reach 100% in the statusbar, mostly called from OnTick + --this check if the cast did reach 100% in the statusbar, mostly called from OnTick CheckCastIsDone = function(self, event, isFinished) - --> check max value + --check max value if (not isFinished and not self.finished) then if (self.casting) then if (self.value >= self.maxValue) then @@ -8181,7 +8181,7 @@ DF.CastFrameFunctions = { end end - --> check if passed an event (not begin used at the moment) + --check if passed an event (not begin used at the moment) if (event) then if (event == UNIT_SPELLCAST_STOP or event == UNIT_SPELLCAST_CHANNEL_STOP) then isFinished = true @@ -8189,7 +8189,7 @@ DF.CastFrameFunctions = { end end - --> the cast is finished + --the cast is finished if (isFinished) then if (self.casting) then self.UNIT_SPELLCAST_STOP (self, self.unit, self.unit, self.castID, self.spellID) @@ -8202,20 +8202,20 @@ DF.CastFrameFunctions = { end end, - --> setup the castbar to be used by another unit + --setup the castbar to be used by another unit 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 - --> reset the cast bar + --reset the cast bar self.casting = nil self.channeling = nil self.caninterrupt = nil - --> register events + --register events if (unit) then - for _, eventTable in ipairs (self.CastBarEvents) do + for _, eventTable in ipairs(self.CastBarEvents) do local event = eventTable [1] local isUnitEvent = eventTable [2] @@ -8228,48 +8228,48 @@ DF.CastFrameFunctions = { end end - --> set scripts - self:SetScript ("OnEvent", self.OnEvent) - self:SetScript ("OnShow", self.OnShow) - self:SetScript ("OnHide", self.OnHide) + --set scripts + self:SetScript("OnEvent", self.OnEvent) + self:SetScript("OnShow", self.OnShow) + self:SetScript("OnHide", self.OnHide) if (self.Settings.CanTick) then - self:SetScript ("OnUpdate", self.OnTick) + self:SetScript("OnUpdate", self.OnTick) end - --> check is can show the cast time text + --check is can show the cast time text if (self.Settings.ShowCastTime and self.Settings.CanLazyTick) then self.percentText:Show() else self.percentText:Hide() end - --> setup animtions + --setup animtions self:CancelScheduleToHide() --self:PLAYER_ENTERING_WORLD (unit, unit) self:OnEvent ("PLAYER_ENTERING_WORLD", unit, unit) else - for _, eventTable in ipairs (self.CastBarEvents) do + for _, eventTable in ipairs(self.CastBarEvents) do local event = eventTable [1] if event then self:UnregisterEvent (event) end end - --> register main events - self:SetScript ("OnUpdate", nil) - self:SetScript ("OnEvent", nil) - self:SetScript ("OnShow", nil) - self:SetScript ("OnHide", nil) + --register main events + self:SetScript("OnUpdate", nil) + self:SetScript("OnEvent", nil) + self:SetScript("OnShow", nil) + self:SetScript("OnHide", nil) self:Hide() end end end, - --> executed after a scheduled to hide timer is done + --executed after a scheduled to hide timer is done DoScheduledHide = function(timerObject) timerObject.castBar.scheduledHideTime = nil @@ -8293,7 +8293,7 @@ DF.CastFrameFunctions = { 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 + --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) if (not delay) then if (self.scheduledHideTime and not self.scheduledHideTime:IsCancelled()) then @@ -8304,7 +8304,7 @@ DF.CastFrameFunctions = { return end - --> already have a scheduled timer? + --already have a scheduled timer? if (self.scheduledHideTime and not self.scheduledHideTime:IsCancelled()) then self.scheduledHideTime:Cancel() end @@ -8314,14 +8314,14 @@ DF.CastFrameFunctions = { end, 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. + --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 + --cancel any timer to hide scheduled self:CancelScheduleToHide() end, - --> 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 + --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) self.flashTexture:Hide() @@ -8374,22 +8374,22 @@ DF.CastFrameFunctions = { end, OnTick_LazyTick = function(self) - --> run the lazy tick if allowed + --run the lazy tick if allowed if (self.Settings.CanLazyTick) then - --> update the cast time + --update the cast time if (self.Settings.ShowCastTime) then if (self.casting) then - self.percentText:SetText (format ("%.1f", abs (self.value - self.maxValue))) + self.percentText:SetText(format ("%.1f", abs (self.value - self.maxValue))) elseif (self.channeling) then local remainingTime = abs (self.value) if (remainingTime > 999) then - self.percentText:SetText ("") + self.percentText:SetText("") else - self.percentText:SetText (format ("%.1f", remainingTime)) + self.percentText:SetText(format ("%.1f", remainingTime)) end else - self.percentText:SetText ("") + self.percentText:SetText("") end end @@ -8399,37 +8399,37 @@ DF.CastFrameFunctions = { end end, - --> tick function for regular casts + --tick function for regular casts OnTick_Casting = function(self, deltaTime) self.value = self.value + deltaTime if (self:CheckCastIsDone()) then return else - self:SetValue (self.value) + self:SetValue(self.value) end --update spark position local sparkPosition = self.value / self.maxValue * self:GetWidth() - self.Spark:SetPoint ("center", self, "left", sparkPosition + self.Settings.SparkOffset, 0) + self.Spark:SetPoint("center", self, "left", sparkPosition + self.Settings.SparkOffset, 0) --in order to allow the lazy tick run, it must return true, it tell that the cast didn't finished return true end, - --> tick function for channeling casts + --tick function for channeling casts OnTick_Channeling = function(self, deltaTime) self.value = self.value - deltaTime if (self:CheckCastIsDone()) then return else - self:SetValue (self.value) + self:SetValue(self.value) end --update spark position local sparkPosition = self.value / self.maxValue * self:GetWidth() - self.Spark:SetPoint ("center", self, "left", sparkPosition + self.Settings.SparkOffset, 0) + self.Spark:SetPoint("center", self, "left", sparkPosition + self.Settings.SparkOffset, 0) return true end, @@ -8461,31 +8461,31 @@ DF.CastFrameFunctions = { end end, - --> animation start script + --animation start script Animation_FadeOutStarted = function(self) end, - --> animation finished script + --animation finished script Animation_FadeOutFinished = function(self) local castBar = self:GetParent() castBar:SetAlpha (1) castBar:Hide() end, - --> animation start script + --animation start script Animation_FadeInStarted = function(self) end, - --> animation finished script + --animation finished script Animation_FadeInFinished = function(self) local castBar = self:GetParent() castBar:Show() castBar:SetAlpha (1) end, - --> animation calls + --animation calls Animation_FadeOut = function(self) self:ScheduleToHide (false) @@ -8558,12 +8558,12 @@ DF.CastFrameFunctions = { UpdateCastingInfo = function(self, unit) local name, text, texture, startTime, endTime, isTradeSkill, castID, notInterruptible, spellID = UnitCastingInfo (unit) - --> is valid? + --is valid? if (not self:IsValid (unit, name, isTradeSkill, true)) then return end - --> setup cast + --setup cast self.casting = true self.channeling = nil self.interrupted = nil @@ -8580,11 +8580,11 @@ DF.CastFrameFunctions = { self.maxValue = self.spellEndTime - self.spellStartTime self:SetMinMaxValues (0, self.maxValue) - self:SetValue (self.value) + self:SetValue(self.value) self:SetAlpha (1) - self.Icon:SetTexture (texture) + self.Icon:SetTexture(texture) self.Icon:Show() - self.Text:SetText (text or name) + self.Text:SetText(text or name) if (self.Settings.ShowCastTime and self.Settings.CanLazyTick) then self.percentText:Show() @@ -8595,7 +8595,7 @@ DF.CastFrameFunctions = { self:SetAlpha (1) - --> set the statusbar color + --set the statusbar color self:UpdateCastColor() if (not self:IsShown()) then @@ -8605,7 +8605,7 @@ DF.CastFrameFunctions = { self.Spark:Show() self:Show() - --> update the interrupt cast border + --update the interrupt cast border self:UpdateInterruptState() end, @@ -8620,12 +8620,12 @@ DF.CastFrameFunctions = { UpdateChannelInfo = function(self, unit, ...) local name, text, texture, startTime, endTime, isTradeSkill, notInterruptible, spellID = UnitChannelInfo (unit) - --> is valid? + --is valid? if (not self:IsValid (unit, name, isTradeSkill, true)) then return end - --> setup cast + --setup cast self.casting = nil self.channeling = true self.interrupted = nil @@ -8642,12 +8642,12 @@ DF.CastFrameFunctions = { self.maxValue = self.spellEndTime - self.spellStartTime self:SetMinMaxValues (0, self.maxValue) - self:SetValue (self.value) + self:SetValue(self.value) self:SetAlpha (1) - self.Icon:SetTexture (texture) + self.Icon:SetTexture(texture) self.Icon:Show() - self.Text:SetText (text) + self.Text:SetText(text) if (self.Settings.ShowCastTime and self.Settings.CanLazyTick) then self.percentText:Show() @@ -8658,7 +8658,7 @@ DF.CastFrameFunctions = { self:SetAlpha (1) - --> set the statusbar color + --set the statusbar color self:UpdateCastColor() if (not self:IsShown()) then @@ -8668,7 +8668,7 @@ DF.CastFrameFunctions = { self.Spark:Show() self:Show() - --> update the interrupt cast border + --update the interrupt cast border self:UpdateInterruptState() end, @@ -8688,13 +8688,13 @@ DF.CastFrameFunctions = { local value = self:GetValue() local _, maxValue = self:GetMinMaxValues() - self:SetValue (self.maxValue or maxValue or 1) + self:SetValue(self.maxValue or maxValue or 1) self.casting = nil self.finished = true if (not self:HasScheduledHide()) then - --> check if settings has no fade option or if its parents are not visible + --check if settings has no fade option or if its parents are not visible if (not self:IsVisible()) then self:Hide() @@ -8720,13 +8720,13 @@ DF.CastFrameFunctions = { local value = self:GetValue() local _, maxValue = self:GetMinMaxValues() - self:SetValue (self.maxValue or maxValue or 1) + self:SetValue(self.maxValue or maxValue or 1) self.channeling = nil self.finished = true if (not self:HasScheduledHide()) then - --> check if settings has no fade option or if its parents are not visible + --check if settings has no fade option or if its parents are not visible if (not self:IsVisible()) then self:Hide() @@ -8751,14 +8751,14 @@ DF.CastFrameFunctions = { self.channeling = nil self.failed = true self.finished = true - self:SetValue (self.maxValue or select (2, self:GetMinMaxValues()) or 1) + self:SetValue(self.maxValue or select (2, self:GetMinMaxValues()) or 1) - --> set the statusbar color + --set the statusbar color self:UpdateCastColor() self.Spark:Hide() self.percentText:Hide() - self.Text:SetText (FAILED) --> auto locale within the global namespace + self.Text:SetText(FAILED) --auto locale within the global namespace self:ScheduleToHide (1) end @@ -8772,14 +8772,14 @@ DF.CastFrameFunctions = { self.channeling = nil self.interrupted = true self.finished = true - self:SetValue (self.maxValue or select (2, self:GetMinMaxValues()) or 1) + self:SetValue(self.maxValue or select (2, self:GetMinMaxValues()) or 1) local castColor = self:GetCastColor() self:SetColor (castColor) --SetColor handles with ParseColors() self.Spark:Hide() self.percentText:Hide() - self.Text:SetText (INTERRUPTED) --> auto locale within the global namespace + self.Text:SetText(INTERRUPTED) --auto locale within the global namespace self:ScheduleToHide (1) end @@ -8792,7 +8792,7 @@ DF.CastFrameFunctions = { return end - --> update the cast time + --update the cast time self.spellStartTime = startTime / 1000 self.spellEndTime = endTime / 1000 self.value = GetTime() - self.spellStartTime @@ -8807,7 +8807,7 @@ DF.CastFrameFunctions = { return end - --> update the cast time + --update the cast time self.spellStartTime = startTime / 1000 self.spellEndTime = endTime / 1000 self.value = self.spellEndTime - GetTime() @@ -8818,17 +8818,17 @@ DF.CastFrameFunctions = { self.maxValue = self.spellEndTime - self.spellStartTime self:SetMinMaxValues (0, self.maxValue) - self:SetValue (self.value) + self:SetValue(self.value) end, - --> cast changed its state to interruptable + --cast changed its state to interruptable UNIT_SPELLCAST_INTERRUPTIBLE = function(self, unit, ...) self.canInterrupt = true self:UpdateCastColor() self:UpdateInterruptState() end, - --> cast changed its state to non interruptable + --cast changed its state to non interruptable UNIT_SPELLCAST_NOT_INTERRUPTIBLE = function(self, unit, ...) self.canInterrupt = false self:UpdateCastColor() @@ -8927,7 +8927,7 @@ function DF:CreateCastBar (parent, name, settingsOverride) assert (name or parent:GetName(), "DetailsFramework:CreateCastBar parameter 'name' omitted and parent has no name.") - local castBar = CreateFrame ("StatusBar", name or (parent:GetName() .. "CastBar"), parent, "BackdropTemplate") + local castBar = CreateFrame("StatusBar", name or (parent:GetName() .. "CastBar"), parent, "BackdropTemplate") do --layers @@ -8936,56 +8936,56 @@ function DF:CreateCastBar (parent, name, settingsOverride) --this should make Plater core and Plater scripts made by users compatible with the new unit frame made on the framework --background - castBar.background = castBar:CreateTexture (nil, "background", nil, -6) - castBar.extraBackground = castBar:CreateTexture (nil, "background", nil, -5) + castBar.background = castBar:CreateTexture(nil, "background", nil, -6) + castBar.extraBackground = castBar:CreateTexture(nil, "background", nil, -5) --overlay castBar.Text = castBar:CreateFontString (nil, "overlay", "SystemFont_Shadow_Small") castBar.Text:SetDrawLayer ("overlay", 1) - castBar.Text:SetPoint ("center", 0, 0) + castBar.Text:SetPoint("center", 0, 0) - castBar.BorderShield = castBar:CreateTexture (nil, "overlay", nil, 5) + castBar.BorderShield = castBar:CreateTexture(nil, "overlay", nil, 5) castBar.BorderShield:Hide() - castBar.Icon = castBar:CreateTexture (nil, "overlay", nil, 4) + castBar.Icon = castBar:CreateTexture(nil, "overlay", nil, 4) castBar.Icon:Hide() - castBar.Spark = castBar:CreateTexture (nil, "overlay", nil, 3) - castBar.Spark:SetBlendMode ("ADD") + castBar.Spark = castBar:CreateTexture(nil, "overlay", nil, 3) + castBar.Spark:SetBlendMode("ADD") --time left on the cast castBar.percentText = castBar:CreateFontString (nil, "overlay", "SystemFont_Shadow_Small") castBar.percentText:SetDrawLayer ("overlay", 7) --statusbar texture - castBar.barTexture = castBar:CreateTexture (nil, "artwork", nil, -6) + castBar.barTexture = castBar:CreateTexture(nil, "artwork", nil, -6) castBar:SetStatusBarTexture (castBar.barTexture) --animations fade in and out local fadeOutAnimationHub = DF:CreateAnimationHub (castBar, DF.CastFrameFunctions.Animation_FadeOutStarted, DF.CastFrameFunctions.Animation_FadeOutFinished) - fadeOutAnimationHub.alpha1 = DF:CreateAnimation (fadeOutAnimationHub, "ALPHA", 1, 1, 1, 0) + fadeOutAnimationHub.alpha1 = DF:CreateAnimation(fadeOutAnimationHub, "ALPHA", 1, 1, 1, 0) castBar.fadeOutAnimation = fadeOutAnimationHub local fadeInAnimationHub = DF:CreateAnimationHub (castBar, DF.CastFrameFunctions.Animation_FadeInStarted, DF.CastFrameFunctions.Animation_FadeInFinished) - fadeInAnimationHub.alpha1 = DF:CreateAnimation (fadeInAnimationHub, "ALPHA", 1, 0.150, 0, 1) + fadeInAnimationHub.alpha1 = DF:CreateAnimation(fadeInAnimationHub, "ALPHA", 1, 0.150, 0, 1) castBar.fadeInAnimation = fadeInAnimationHub --animatios flash - local flashTexture = castBar:CreateTexture (nil, "overlay", nil, 7) + local flashTexture = castBar:CreateTexture(nil, "overlay", nil, 7) flashTexture:SetColorTexture (1, 1, 1, 1) flashTexture:SetAllPoints() flashTexture:SetAlpha (0) flashTexture:Hide() - flashTexture:SetBlendMode ("ADD") + flashTexture:SetBlendMode("ADD") castBar.flashTexture = flashTexture local flashAnimationHub = DF:CreateAnimationHub (flashTexture, function() flashTexture:Show() end, function() flashTexture:Hide() end) - DF:CreateAnimation (flashAnimationHub, "ALPHA", 1, 0.2, 0, 0.8) - DF:CreateAnimation (flashAnimationHub, "ALPHA", 2, 0.2, 1, 0) + DF:CreateAnimation(flashAnimationHub, "ALPHA", 1, 0.2, 0, 0.8) + DF:CreateAnimation(flashAnimationHub, "ALPHA", 2, 0.2, 1, 0) castBar.flashAnimation = flashAnimationHub end - --> mixins + --mixins DF:Mixin (castBar, DF.CastFrameFunctions) DF:Mixin (castBar, DF.StatusBarFunctions) @@ -8994,7 +8994,7 @@ function DF:CreateCastBar (parent, name, settingsOverride) castBar:AddMaskTexture(castBar.background) castBar:AddMaskTexture(castBar.extraBackground) - --> settings and hooks + --settings and hooks local settings = DF.table.copy ({}, DF.CastFrameFunctions.Settings) if (settingsOverride) then DF.table.copy (settings, settingsOverride) @@ -9004,14 +9004,14 @@ function DF:CreateCastBar (parent, name, settingsOverride) local hookList = DF.table.copy ({}, DF.CastFrameFunctions.HookList) castBar.HookList = hookList - --> initialize the cast bar + --initialize the cast bar castBar:Initialize() return castBar end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> border frame +--border frame --[=[ DF:CreateBorderFrame (parent, name) @@ -9022,8 +9022,8 @@ end DF.BorderFunctions = { SetBorderColor = function(self, r, g, b, a) - r, g, b, a = DF:ParseColors (r, g, b, a) - for _, texture in ipairs (self.allTextures) do + 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, @@ -9043,7 +9043,7 @@ function DF:CreateBorderFrame (parent, name) local parentName = name or "DetailsFrameworkBorderFrame" .. tostring (math.random (1, 100000000)) - local f = CreateFrame ("frame", parentName, parent, "BackdropTemplate") + local f = CreateFrame("frame", parentName, parent, "BackdropTemplate") f:SetFrameLevel (f:GetFrameLevel()+1) f:SetAllPoints() @@ -9051,8 +9051,8 @@ function DF:CreateBorderFrame (parent, name) f.allTextures = {} - --> create left border - local leftBorder = f:CreateTexture (nil, "overlay") + --create left border + local leftBorder = f:CreateTexture(nil, "overlay") leftBorder:SetDrawLayer ("overlay", 7) leftBorder:SetColorTexture (1, 1, 1, 1) tinsert (f.allTextures, leftBorder) @@ -9061,8 +9061,8 @@ function DF:CreateBorderFrame (parent, name) PixelUtil.SetPoint (leftBorder, "bottomright", f, "bottomleft", 0, -1, 0, -1) PixelUtil.SetWidth (leftBorder, 1, 1) - --> create right border - local rightBorder = f:CreateTexture (nil, "overlay") + --create right border + local rightBorder = f:CreateTexture(nil, "overlay") rightBorder:SetDrawLayer ("overlay", 7) rightBorder:SetColorTexture (1, 1, 1, 1) tinsert (f.allTextures, rightBorder) @@ -9071,8 +9071,8 @@ function DF:CreateBorderFrame (parent, name) PixelUtil.SetPoint (rightBorder, "bottomleft", f, "bottomright", 0, -1, 0, -1) PixelUtil.SetWidth (rightBorder, 1, 1) - --> create top border - local topBorder = f:CreateTexture (nil, "overlay") + --create top border + local topBorder = f:CreateTexture(nil, "overlay") topBorder:SetDrawLayer ("overlay", 7) topBorder:SetColorTexture (1, 1, 1, 1) tinsert (f.allTextures, topBorder) @@ -9081,8 +9081,8 @@ function DF:CreateBorderFrame (parent, name) PixelUtil.SetPoint (topBorder, "bottomright", f, "topright", 0, 0, 0, 0) PixelUtil.SetHeight (topBorder, 1, 1) - --> create border - local bottomBorder = f:CreateTexture (nil, "overlay") + --create border + local bottomBorder = f:CreateTexture(nil, "overlay") bottomBorder:SetDrawLayer ("overlay", 7) bottomBorder:SetColorTexture (1, 1, 1, 1) tinsert (f.allTextures, bottomBorder) @@ -9097,7 +9097,7 @@ end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> unit frame +--unit frame --[=[ DF:CreateUnitFrame (parent, name, settingsOverride) @@ -9112,9 +9112,9 @@ end --]=] ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> unit frame +--unit frame - --> return true if the unit has been claimed by another player (health bar is gray) + --return true if the unit has been claimed by another player (health bar is gray) local unit_is_tap_denied = function(unit) return unit and not UnitPlayerControlled (unit) and UnitIsTapDenied (unit) end @@ -9124,26 +9124,26 @@ end WidgetType = "unitFrame", Settings = { - --> unit frames - ClearUnitOnHide = true, --> if tue it'll set the unit to nil when the unit frame is set to hide + --unit frames + ClearUnitOnHide = true, --if tue it'll set the unit to nil when the unit frame is set to hide ShowCastBar = true, --if this is false, the cast bar for the unit won't be shown ShowPowerBar = true, --if true it'll show the power bar for the unit, e.g. the mana bar ShowUnitName = true, --if false, the unit name won't show ShowBorder = true, --if false won't show the border frame - --> health bar color - CanModifyHealhBarColor = true, --> if false it won't change the color of the health bar + --health bar color + CanModifyHealhBarColor = true, --if false it won't change the color of the health bar ColorByAggro = false, --if true it'll color the healthbar with red color when the unit has aggro on player FixedHealthColor = false, --color override with a table {r=1, g=1, b=1} UseFriendlyClassColor = true, --make the healthbar class color for friendly players UseEnemyClassColor = true, --make the healthbar class color for enemy players - --> misc + --misc ShowTargetOverlay = true, --shows a highlighht for the player current target BorderColor = DF:CreateColorTable (0, 0, 0, 1), --border color, set to alpha zero for no border CanTick = false, --if true it'll run the OnTick event - --> size + --size Width = 100, Height = 20, PowerBarHeight = 4, @@ -9151,13 +9151,13 @@ end }, UnitFrameEvents = { - --> run for all units + --run for all units {"PLAYER_ENTERING_WORLD"}, {"PARTY_MEMBER_DISABLE"}, {"PARTY_MEMBER_ENABLE"}, {"PLAYER_TARGET_CHANGED"}, - --> run for one unit + --run for one unit {"UNIT_NAME_UPDATE", true}, {"UNIT_CONNECTION", true}, {"UNIT_ENTERED_VEHICLE", true}, @@ -9166,7 +9166,7 @@ end {"UNIT_THREAT_LIST_UPDATE", true}, }, - --> used when a event is triggered to quickly check if is a unit event + --used when a event is triggered to quickly check if is a unit event IsUnitEvent = { ["UNIT_NAME_UPDATE"] = true, ["UNIT_CONNECTION"] = true, @@ -9196,10 +9196,10 @@ end self.healthBar:SetColor (r, g, b, a) end, - --> register all events which will be used by the unit frame + --register all events which will be used by the unit frame RegisterEvents = function(self) - --> register events - for index, eventTable in ipairs (self.UnitFrameEvents) do + --register events + for index, eventTable in ipairs(self.UnitFrameEvents) do local event, isUnitEvent = unpack (eventTable) if (not isUnitEvent) then self:RegisterEvent (event) @@ -9208,44 +9208,44 @@ end end end - --> check settings and unregister events for disabled features + --check settings and unregister events for disabled features if (not self.Settings.ColorByAggro) then self:UnregisterEvent ("UNIT_THREAT_LIST_UPDATE") end - --> set scripts - self:SetScript ("OnEvent", self.OnEvent) - self:SetScript ("OnHide", self.OnHide) + --set scripts + self:SetScript("OnEvent", self.OnEvent) + self:SetScript("OnHide", self.OnHide) if (self.Settings.CanTick) then - self:SetScript ("OnUpdate", self.OnTick) + self:SetScript("OnUpdate", self.OnTick) end end, - --> unregister events, called when this unit frame losses its unit + --unregister events, called when this unit frame losses its unit UnregisterEvents = function(self) - for index, eventTable in ipairs (self.UnitFrameEvents) do + for index, eventTable in ipairs(self.UnitFrameEvents) do local event, firstUnit, secondUnit = unpack (eventTable) self:UnregisterEvent (event) end - self:SetScript ("OnEvent", nil) - self:SetScript ("OnUpdate", nil) - self:SetScript ("OnHide", nil) + self:SetScript("OnEvent", nil) + self:SetScript("OnUpdate", nil) + self:SetScript("OnHide", nil) end, - --> call every tick + --call every tick 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 + --when an event happen for this unit, send it to the apropriate function OnEvent = function(self, event, ...) - --> run the function for this event + --run the function for this event local eventFunc = self [event] if (eventFunc) then - --> is this event an unit event? + --is this event an unit event? if (self.IsUnitEvent [event]) then local unit = ... - --> check if is for this unit (even if the event is registered only for the unit) + --check if is for this unit (even if the event is registered only for the unit) if (unit == self.unit or unit == self.displayedUnit) then eventFunc (self, ...) end @@ -9261,7 +9261,7 @@ end end end, - --> run if the unit currently shown is different than the new one + --run if the unit currently shown is different than the new one SetUnit = function(self, unit) if (unit ~= self.unit or unit == nil) then self.unit = unit --absolute unit @@ -9273,21 +9273,21 @@ end self.healthBar:SetUnit (unit, self.displayedUnit) - --> is using castbars? + --is using castbars? if (self.Settings.ShowCastBar) then self.castBar:SetUnit (unit, self.displayedUnit) else self.castBar:SetUnit (nil) end - --> is using powerbars? + --is using powerbars? if (self.Settings.ShowPowerBar) then self.powerBar:SetUnit (unit, self.displayedUnit) else self.powerBar:SetUnit (nil) end - --> is using the border? + --is using the border? if (self.Settings.ShowBorder) then self.border:Show() else @@ -9308,11 +9308,11 @@ end end 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 + --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) - --> this unit is possessing a vehicle? + --this unit is possessing a vehicle? local unitPossessVehicle = (IS_WOW_PROJECT_MAINLINE) and UnitHasVehicleUI (self.unit) or false if (unitPossessVehicle) then if (not self.unitInVehicle) then @@ -9344,28 +9344,28 @@ end 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 + --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) - --> check if color changes is disabled + --check if color changes is disabled if (not self.Settings.CanModifyHealhBarColor) then return end local unit = self.displayedUnit - --> check if a color has been passed within the parameters + --check if a color has been passed within the parameters if (r) then - --> check if passed a special color - if (type (r) ~= "number") then - r, g, b = DF:ParseColors (r) + --check if passed a special color + if (type(r) ~= "number") then + r, g, b = DF:ParseColors(r) end self:SetHealthBarColor (r, g, b) return end - --> check if there is a color override in the settings + --check if there is a color override in the settings if (self.Settings.FixedHealthColor) then local FixedHealthColor = self.Settings.FixedHealthColor r, g, b = FixedHealthColor.r, FixedHealthColor.g, FixedHealthColor.b @@ -9373,10 +9373,10 @@ end return end - --> check if the unit is a player + --check if the unit is a player if (UnitIsPlayer (unit)) then - --> check if the unit is disconnected (in case it is a player + --check if the unit is disconnected (in case it is a player if (not UnitIsConnected (unit)) then self:SetHealthBarColor (.5, .5, .5) return @@ -9414,13 +9414,13 @@ end end end - --> is tapped? + --is tapped? if (unit_is_tap_denied (unit)) then self:SetHealthBarColor (.6, .6, .6) return end - --> is this is a npc attacking the player? + --is this is a npc attacking the player? if (self.Settings.ColorByAggro) then local _, threatStatus = UnitDetailedThreatSituation ("player", unit) if (threatStatus) then @@ -9429,12 +9429,12 @@ end end end - --> get the regular color by selection + -- get the regular color by selection r, g, b = UnitSelectionColor (unit) self:SetHealthBarColor (r, g, b) end, - --> misc + --misc UpdateName = function(self) if (not self.Settings.ShowUnitName) then return @@ -9442,12 +9442,12 @@ end --unit name without realm names by default local name = UnitName (self.unit) - self.unitName:SetText (name) + self.unitName:SetText(name) self.unitName:Show() end, - --> this runs when the player it self changes its target, need to update the current target overlay - --> todo: add focus overlay + --this runs when the player it self changes its target, need to update the current target overlay + --todo: add focus overlay UpdateTargetOverlay = function(self) if (not self.Settings.ShowTargetOverlay) then self.targetOverlay:Hide() @@ -9468,12 +9468,12 @@ end self:SetUnit (unit, displayedUnit) - --> is using castbars? + --is using castbars? if (self.Settings.ShowCastBar) then self.castBar:SetUnit (unit, displayedUnit) end - --> is using powerbars? + --is using powerbars? if (self.Settings.ShowPowerBar) then self.powerBar:SetUnit (unit, displayedUnit) end @@ -9484,39 +9484,39 @@ end end end, - --> update the unit frame and its widgets + --update the unit frame and its widgets 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 + --if the unit is inside a vehicle, the vehicle possession function will call an update on all widgets if (not unitInVehicle) then self:UpdateAllWidgets() end end, - --> event handles + --event handles PLAYER_ENTERING_WORLD = function(self, ...) self:UpdateUnitFrame() end, - --> update overlays when the player changes its target + --update overlays when the player changes its target PLAYER_TARGET_CHANGED = function(self, ...) self:UpdateTargetOverlay() end, - --> unit received a name update + --unit received a name update UNIT_NAME_UPDATE = function(self, ...) self:UpdateName() end, - --> this is registered only if .settings.ColorByAggro is true + --this is registered only if .settings.ColorByAggro is true UNIT_THREAT_LIST_UPDATE = function(self, ...) if (self.Settings.ColorByAggro) then self:UpdateHealthColor() end end, - --> vehicle + --vehicle UNIT_ENTERED_VEHICLE = function(self, ...) self:UpdateUnitFrame() end, @@ -9524,12 +9524,12 @@ end self:UpdateUnitFrame() end, - --> pet + --pet UNIT_PET = function(self, ...) self:UpdateUnitFrame() end, - --> player connection + --player connection UNIT_CONNECTION = function(self, ...) if (UnitIsConnected (self.unit)) then self:UpdateUnitFrame() @@ -9548,56 +9548,56 @@ function DF:CreateUnitFrame (parent, name, unitFrameSettingsOverride, healthBarS local parentName = name or ("DetailsFrameworkUnitFrame" .. tostring (math.random (1, 100000000))) - --> create the main unit frame - local f = CreateFrame ("button", parentName, parent, "BackdropTemplate") + --create the main unit frame + local f = CreateFrame("button", parentName, parent, "BackdropTemplate") - --> base level + --base level --local baseFrameLevel = f:GetFrameLevel() local baseFrameLevel = globalBaseFrameLevel globalBaseFrameLevel = globalBaseFrameLevel + 50 f:SetFrameLevel (baseFrameLevel) - --> create the healthBar + --create the healthBar local healthBar = DF:CreateHealthBar (f, false, healthBarSettingsOverride) healthBar:SetFrameLevel (baseFrameLevel + 1) f.healthBar = healthBar - --> create the power bar + --create the power bar local powerBar = DF:CreatePowerBar (f, false, powerBarSettingsOverride) powerBar:SetFrameLevel (baseFrameLevel + 2) f.powerBar = powerBar - --> create the castBar + --create the castBar local castBar = DF:CreateCastBar (f, false, castBarSettingsOverride) castBar:SetFrameLevel (baseFrameLevel + 3) f.castBar = castBar - --> border frame + --border frame local borderFrame = DF:CreateBorderFrame (f, f:GetName() .. "Border") borderFrame:SetFrameLevel (f:GetFrameLevel() + 5) f.border = borderFrame - --> overlay frame (widgets that need to stay above the unit frame) - local overlayFrame = CreateFrame ("frame", "$parentOverlayFrame", f, "BackdropTemplate") + --overlay frame (widgets that need to stay above the unit frame) + local overlayFrame = CreateFrame("frame", "$parentOverlayFrame", f, "BackdropTemplate") overlayFrame:SetFrameLevel (f:GetFrameLevel() + 6) f.overlayFrame = overlayFrame - --> unit frame layers + --unit frame layers do --artwork f.unitName = f:CreateFontString (nil, "artwork", "GameFontHighlightSmall") PixelUtil.SetPoint (f.unitName, "topleft", healthBar, "topleft", 2, -2, 1, 1) --target overlay - it's parented in the healthbar so other widgets won't get the overlay - f.targetOverlay = overlayFrame:CreateTexture (nil, "artwork") - f.targetOverlay:SetTexture (healthBar:GetTexture()) - f.targetOverlay:SetBlendMode ("ADD") + f.targetOverlay = overlayFrame:CreateTexture(nil, "artwork") + f.targetOverlay:SetTexture(healthBar:GetTexture()) + f.targetOverlay:SetBlendMode("ADD") f.targetOverlay:SetAlpha (.5) - f.targetOverlay:SetAllPoints (healthBar) + f.targetOverlay:SetAllPoints(healthBar) end - --> mixins + --mixins --inject mixins DF:Mixin (f, DF.UnitFrameFunctions) @@ -9608,7 +9608,7 @@ function DF:CreateUnitFrame (parent, name, unitFrameSettingsOverride, healthBarS end f.Settings = unitFrameSettings - --> initialize scripts + --initialize scripts --unitframe f:Initialize() @@ -9617,7 +9617,7 @@ end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> horizontal scroll frame +--horizontal scroll frame local timeline_options = { width = 400, @@ -9650,10 +9650,10 @@ local timeline_options = { text_tempate = "OPTIONS_FONT_TEMPLATE", on_enter = function(self) - self:SetBackdropColor (unpack (self.backdrop_color_highlight)) + self:SetBackdropColor(unpack (self.backdrop_color_highlight)) end, on_leave = function(self) - self:SetBackdropColor (unpack (self.backdrop_color)) + self:SetBackdropColor(unpack (self.backdrop_color)) end, block_on_enter = function(self) @@ -9689,20 +9689,20 @@ DF.TimeLineElapsedTimeFunctions = { if (not label) then label = self:CreateFontString (nil, "artwork", "GameFontNormal") - label.line = self:CreateTexture (nil, "artwork") + label.line = self:CreateTexture(nil, "artwork") label.line:SetColorTexture (1, 1, 1) - label.line:SetPoint ("topleft", label, "bottomleft", 0, -2) + label.line:SetPoint("topleft", label, "bottomleft", 0, -2) self.labels [index] = label end - DF:SetFontColor (label, self.options.text_color) + DF:SetFontColor(label, self.options.text_color) DF:SetFontSize (label, self.options.text_size) DF:SetFontFace (label, self.options.text_font) DF:SetFontOutline (label, self.options.text_outline) if (self.options.draw_line) then label.line:SetVertexColor (unpack (self.options.draw_line_color)) - label.line:SetWidth (self.options.draw_line_thickness) + label.line:SetWidth(self.options.draw_line_thickness) label.line:Show() else label.line:Hide() @@ -9720,7 +9720,7 @@ DF.TimeLineElapsedTimeFunctions = { Refresh = function(self, elapsedTime, scale) local parent = self:GetParent() - self:SetHeight (self.options.height) + self:SetHeight(self.options.height) local effectiveArea = self:GetWidth() --already scaled down width local pixelPerSecond = elapsedTime / effectiveArea --how much 1 pixels correlate to time @@ -9736,14 +9736,14 @@ DF.TimeLineElapsedTimeFunctions = { for i = 1, amountSegments do local label = self:GetLabel (i) local xOffset = distance * (i - 1) - label:SetPoint ("left", self, "left", xOffset, 0) + label:SetPoint("left", self, "left", xOffset, 0) local secondsOfTime = pixelPerSecond * xOffset - label:SetText (DF:IntegerToTimer (floor (secondsOfTime))) + label:SetText(DF:IntegerToTimer (floor (secondsOfTime))) if (label.line:IsShown()) then - label.line:SetHeight (parent:GetParent():GetHeight()) + label.line:SetHeight(parent:GetParent():GetHeight()) end label:Show() @@ -9814,21 +9814,21 @@ DF.TimeLineBlockFunctions = { --if there's an icon, anchor the text at the right side of the icon --this is the title and icon of the title if (lineData.icon) then - self.icon:SetTexture (lineData.icon) + self.icon:SetTexture(lineData.icon) self.icon:SetTexCoord (.1, .9, .1, .9) - self.text:SetText (lineData.text or "") - self.text:SetPoint ("left", self.icon.widget, "right", 2, 0) + self.text:SetText(lineData.text or "") + self.text:SetPoint("left", self.icon.widget, "right", 2, 0) else - self.icon:SetTexture (nil) - self.text:SetText (lineData.text or "") - self.text:SetPoint ("left", self, "left", 2, 0) + self.icon:SetTexture(nil) + self.text:SetText(lineData.text or "") + self.text:SetPoint("left", self, "left", 2, 0) end if (self.dataIndex % 2 == 1) then - self:SetBackdropColor (0, 0, 0, 0) + self:SetBackdropColor(0, 0, 0, 0) else local r, g, b, a = unpack (self.backdrop_color) - self:SetBackdropColor (r, g, b, a) + self:SetBackdropColor(r, g, b, a) end self:SetWidth(5000) @@ -9868,10 +9868,10 @@ DF.TimeLineBlockFunctions = { block.info.payload = payload if (useIconOnBlock) then - block.icon:SetTexture (lineData.icon) + block.icon:SetTexture(lineData.icon) block.icon:SetTexCoord (.1, .9, .1, .9) block.icon:SetAlpha (.834) - block.icon:SetSize (self:GetHeight(), self:GetHeight()) + block.icon:SetSize(self:GetHeight(), self:GetHeight()) if (time < -0.2) then block.icon:SetDesaturated (true) @@ -9883,8 +9883,8 @@ DF.TimeLineBlockFunctions = { if (isAura) then block.auraLength:Show() - block.auraLength:SetWidth (pixelPerSecond * isAura) - block:SetWidth (max (pixelPerSecond * isAura, 16)) + block.auraLength:SetWidth(pixelPerSecond * isAura) + block:SetWidth(max (pixelPerSecond * isAura, 16)) else block.auraLength:Hide() end @@ -9901,20 +9901,20 @@ DF.TimeLineBlockFunctions = { GetBlock = function(self, index) local block = self.blocks [index] if (not block) then - block = CreateFrame ("frame", nil, self, "BackdropTemplate") + block = CreateFrame("frame", nil, self, "BackdropTemplate") self.blocks [index] = block - local background = block:CreateTexture (nil, "background") + local background = block:CreateTexture(nil, "background") background:SetColorTexture (1, 1, 1, 1) - local icon = block:CreateTexture (nil, "artwork") + local icon = block:CreateTexture(nil, "artwork") local text = block:CreateFontString (nil, "artwork") - local auraLength = block:CreateTexture (nil, "border") + local auraLength = block:CreateTexture(nil, "border") background:SetAllPoints() - icon:SetPoint ("left") - text:SetPoint ("left", icon, "left", 2, 0) - auraLength:SetPoint ("topleft", icon, "topleft", 0, 0) - auraLength:SetPoint ("bottomleft", icon, "bottomleft", 0, 0) + icon:SetPoint("left") + text:SetPoint("left", icon, "left", 2, 0) + auraLength:SetPoint("topleft", icon, "topleft", 0, 0) + auraLength:SetPoint("bottomleft", icon, "bottomleft", 0, 0) auraLength:SetColorTexture (1, 1, 1, 1) auraLength:SetVertexColor (1, 1, 1, 0.1) @@ -9923,8 +9923,8 @@ DF.TimeLineBlockFunctions = { block.background = background block.auraLength = auraLength - block:SetScript ("OnEnter", self:GetParent():GetParent().options.block_on_enter) - block:SetScript ("OnLeave", self:GetParent():GetParent().options.block_on_leave) + block:SetScript("OnEnter", self:GetParent():GetParent().options.block_on_enter) + block:SetScript("OnLeave", self:GetParent():GetParent().options.block_on_leave) block:SetMouseClickEnabled (false) block.info = {} @@ -9947,7 +9947,7 @@ DF.TimeLineFunctions = { local line = self.lines [index] if (not line) then --create a new line - line = CreateFrame ("frame", "$parentLine" .. index, self.body, "BackdropTemplate") + line = CreateFrame("frame", "$parentLine" .. index, self.body, "BackdropTemplate") DF:Mixin (line, DF.TimeLineBlockFunctions) self.lines [index] = line @@ -9967,26 +9967,26 @@ DF.TimeLineFunctions = { --set its parameters if (self.options.show_elapsed_timeline) then - line:SetPoint ("topleft", self.body, "topleft", 1, -((index-1) * (self.options.line_height + 1)) - 2 - self.options.elapsed_timeline_height) + line:SetPoint("topleft", self.body, "topleft", 1, -((index-1) * (self.options.line_height + 1)) - 2 - self.options.elapsed_timeline_height) else - line:SetPoint ("topleft", self.body, "topleft", 1, -((index-1) * (self.options.line_height + 1)) - 1) + line:SetPoint("topleft", self.body, "topleft", 1, -((index-1) * (self.options.line_height + 1)) - 1) end - line:SetSize (1, self.options.line_height) --width is set when updating the frame + line:SetSize(1, self.options.line_height) --width is set when updating the frame - line:SetScript ("OnEnter", self.options.on_enter) - line:SetScript ("OnLeave", self.options.on_leave) + line:SetScript("OnEnter", self.options.on_enter) + line:SetScript("OnLeave", self.options.on_leave) line:SetMouseClickEnabled (false) - line:SetBackdrop (self.options.backdrop) - line:SetBackdropColor (unpack (self.options.backdrop_color)) - line:SetBackdropBorderColor (unpack (self.options.backdrop_border_color)) + line:SetBackdrop(self.options.backdrop) + line:SetBackdropColor(unpack (self.options.backdrop_color)) + line:SetBackdropBorderColor(unpack (self.options.backdrop_border_color)) local icon = DF:CreateImage (line, "", self.options.line_height, self.options.line_height) - icon:SetPoint ("left", line, "left", 2, 0) + icon:SetPoint("left", line, "left", 2, 0) line.icon = icon - local text = DF:CreateLabel (line, "", DF:GetTemplate ("font", self.options.title_template)) - text:SetPoint ("left", icon.widget, "right", 2, 0) + local text = DF:CreateLabel(line, "", DF:GetTemplate ("font", self.options.title_template)) + text:SetPoint("left", icon.widget, "right", 2, 0) line.text = text line.backdrop_color = self.options.backdrop_color or {.1, .1, .1, .3} @@ -10024,7 +10024,7 @@ DF.TimeLineFunctions = { --how many pixels represent 1 second local bodyWidth = totalLength * pixelPerSecond * currentScale - self.body:SetWidth (bodyWidth + self.options.header_width) + self.body:SetWidth(bodyWidth + self.options.header_width) self.body.effectiveWidth = bodyWidth --reduce the default canvas size from the body with and don't allow the max value be negative @@ -10033,7 +10033,7 @@ DF.TimeLineFunctions = { --adjust the scale slider range local oldMin, oldMax = self.horizontalSlider:GetMinMaxValues() self.horizontalSlider:SetMinMaxValues (0, newMaxValue) - self.horizontalSlider:SetValue (DF:MapRangeClamped (oldMin, oldMax, 0, newMaxValue, self.horizontalSlider:GetValue())) + self.horizontalSlider:SetValue(DF:MapRangeClamped (oldMin, oldMax, 0, newMaxValue, self.horizontalSlider:GetValue())) local defaultColor = self.data.defaultColor or {1, 1, 1, 1} @@ -10048,9 +10048,9 @@ DF.TimeLineFunctions = { local linePadding = self.options.line_padding local bodyHeight = (lineHeight + linePadding) * #self.data.lines - self.body:SetHeight (bodyHeight) + self.body:SetHeight(bodyHeight) self.verticalSlider:SetMinMaxValues (0, max (bodyHeight - self:GetHeight(), 0)) - self.verticalSlider:SetValue (0) + self.verticalSlider:SetValue(0) --refresh lines self:ResetAllLines() @@ -10064,8 +10064,8 @@ DF.TimeLineFunctions = { --refresh elapsed time frame --the elapsed frame must have a width before the refresh function is called self.elapsedTimeFrame:ClearAllPoints() - self.elapsedTimeFrame:SetPoint ("topleft", self.body, "topleft", self.options.header_width, 0) - self.elapsedTimeFrame:SetPoint ("topright", self.body, "topright", 0, 0) + self.elapsedTimeFrame:SetPoint("topleft", self.body, "topleft", self.options.header_width, 0) + self.elapsedTimeFrame:SetPoint("topright", self.body, "topright", 0, 0) self.elapsedTimeFrame:Reset() self.elapsedTimeFrame:Refresh (self.data.length, self.currentScale) @@ -10252,13 +10252,13 @@ end --[=[ -local f = CreateFrame ("frame", "TestFrame", UIParent) -f:SetPoint ("center") -f:SetSize (900, 420) +local f = CreateFrame("frame", "TestFrame", UIParent) +f:SetPoint("center") +f:SetSize(900, 420) f:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, insets = {left = 1, right = 1, top = 0, bottom = 1}}) local scroll = DF:CreateTimeLineFrame (f, "$parentTimeLine", {width = 880, height = 400}) -scroll:SetPoint ("topleft", f, "topleft", 0, 0) +scroll:SetPoint("topleft", f, "topleft", 0, 0) --need fake data to test fills scroll:SetData ({ @@ -10277,26 +10277,26 @@ scroll:SetData ({ f:Hide() ---scroll.body:SetScale (0.5) +--scroll.body:SetScale(0.5) --]=] ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> error message box +--error message box function DF:ShowErrorMessage (errorMessage, titleText) if (not DF.ErrorMessagePanel) then - local f = CreateFrame ("frame", "DetailsFrameworkErrorMessagePanel", UIParent, "BackdropTemplate") - f:SetSize (400, 120) + local f = CreateFrame("frame", "DetailsFrameworkErrorMessagePanel", UIParent, "BackdropTemplate") + f:SetSize(400, 120) f:SetFrameStrata ("FULLSCREEN") - f:SetPoint ("center", UIParent, "center", 0, 100) + f:SetPoint("center", UIParent, "center", 0, 100) f:EnableMouse (true) f:SetMovable (true) 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("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) tinsert (UISpecialFrames, "DetailsFrameworkErrorMessagePanel") DF.ErrorMessagePanel = f @@ -10304,16 +10304,16 @@ function DF:ShowErrorMessage (errorMessage, titleText) DF:ApplyStandardBackdrop (f) local errorLabel = f:CreateFontString (nil, "overlay", "GameFontNormal") - errorLabel:SetPoint ("top", f, "top", 0, -25) - errorLabel:SetJustifyH ("center") - errorLabel:SetSize (360, 66) + errorLabel:SetPoint("top", f, "top", 0, -25) + errorLabel:SetJustifyH("center") + errorLabel:SetSize(360, 66) f.errorLabel = errorLabel local button_text_template = DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE") local options_dropdown_template = DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") local closeButton = DF:CreateButton (f, nil, 60, 20, "close", nil, nil, nil, nil, nil, nil, options_dropdown_template) - closeButton:SetPoint ("bottom", f, "bottom", 0, 5) + closeButton:SetPoint("bottom", f, "bottom", 0, 5) f.closeButton = closeButton closeButton:SetClickFunction (function() @@ -10321,29 +10321,29 @@ function DF:ShowErrorMessage (errorMessage, titleText) end) f.ShowAnimation = DF:CreateAnimationHub (f, function() - f:SetBackdropBorderColor (0, 0, 0, 0) - f.TitleBar:SetBackdropBorderColor (0, 0, 0, 0) + f:SetBackdropBorderColor(0, 0, 0, 0) + f.TitleBar:SetBackdropBorderColor(0, 0, 0, 0) end, function() - f:SetBackdropBorderColor (0, 0, 0, 1) - f.TitleBar:SetBackdropBorderColor (0, 0, 0, 1) + f:SetBackdropBorderColor(0, 0, 0, 1) + f.TitleBar:SetBackdropBorderColor(0, 0, 0, 1) end) - DF:CreateAnimation (f.ShowAnimation, "scale", 1, .075, .2, .2, 1.1, 1.1, "center", 0, 0) - DF:CreateAnimation (f.ShowAnimation, "scale", 2, .075, 1, 1, .90, .90, "center", 0, 0) + DF:CreateAnimation(f.ShowAnimation, "scale", 1, .075, .2, .2, 1.1, 1.1, "center", 0, 0) + DF:CreateAnimation(f.ShowAnimation, "scale", 2, .075, 1, 1, .90, .90, "center", 0, 0) - f.FlashTexture = f:CreateTexture (nil, "overlay") + f.FlashTexture = f:CreateTexture(nil, "overlay") f.FlashTexture:SetColorTexture (1, 1, 1, 1) f.FlashTexture:SetAllPoints() f.FlashAnimation = DF:CreateAnimationHub (f.FlashTexture, function() f.FlashTexture:Show() end, function() f.FlashTexture:Hide() end) - DF:CreateAnimation (f.FlashAnimation, "alpha", 1, .075, 0, .05) - DF:CreateAnimation (f.FlashAnimation, "alpha", 2, .075, .1, 0) + DF:CreateAnimation(f.FlashAnimation, "alpha", 1, .075, 0, .05) + DF:CreateAnimation(f.FlashAnimation, "alpha", 2, .075, .1, 0) f:Hide() end DF.ErrorMessagePanel:Show() - DF.ErrorMessagePanel.errorLabel:SetText (errorMessage) - DF.ErrorMessagePanel.TitleLabel:SetText (titleText) + DF.ErrorMessagePanel.errorLabel:SetText(errorMessage) + DF.ErrorMessagePanel.TitleLabel:SetText(titleText) DF.ErrorMessagePanel.ShowAnimation:Play() DF.ErrorMessagePanel.FlashAnimation:Play() end @@ -10384,7 +10384,7 @@ function DF:SetPointOffsets(frame, xOffset, yOffset) end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> list box +--list box DF.ListboxFunctions = { scrollRefresh = function(self, data, offset, totalLines) @@ -10528,7 +10528,7 @@ function DF:CreateListBox(parent, name, data, options, headerTable, headerOption DF:ApplyStandardBackdrop(frameCanvas) frameCanvas:BuildOptionsTable(listbox_options, options) - --> header + --header --check for default values in the header headerTable = headerTable or { {text = "Spell Id", width = 70}, @@ -10550,7 +10550,7 @@ function DF:CreateListBox(parent, name, data, options, headerTable, headerOption header:SetPoint("topleft", frameCanvas, "topleft", 5, -5) frameCanvas.header = header - --> auto size + --auto size if (frameCanvas.options.auto_width) then local width = 10 --padding 5 on each side width = width + 20 --scrollbar reserved space @@ -10571,7 +10571,7 @@ function DF:CreateListBox(parent, name, data, options, headerTable, headerOption frameCanvas:SetSize(frameCanvas.options.width, height) - --> scroll frame + --scroll frame local lineHeight = frameCanvas.options.line_height --calc the size of the space occupied by the add button, header etc local lineAmount = floor((height - 60) / lineHeight) @@ -10591,7 +10591,7 @@ function DF:CreateListBox(parent, name, data, options, headerTable, headerOption scrollBox:Refresh() - --> add line button + --add line button local addLineButton = DF:CreateButton(frameCanvas, DF.ListboxFunctions.addEntry, 80, 20, "Add", nil, nil, nil, nil, nil, nil, DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"), DF:GetTemplate("font", "ORANGE_FONT_TEMPLATE")) addLineButton:SetPoint("topleft", scrollBox, "bottomleft", 0, -4) diff --git a/Libs/DF/pictureedit.lua b/Libs/DF/pictureedit.lua index 532967a1..3c0ce753 100644 --- a/Libs/DF/pictureedit.lua +++ b/Libs/DF/pictureedit.lua @@ -10,7 +10,7 @@ local texCoordinates local CreateImageEditorFrame = function() local editorWindow = DF:NewPanel (UIParent, nil, "DetailsFrameworkImageEdit", nil, 650, 500, false) editorWindow:SetPoint("center", UIParent, "center") - editorWindow:SetResizable (true) + editorWindow:SetResizable(true) editorWindow:SetMovable (true) editorWindow:SetClampedToScreen (true) tinsert (UISpecialFrames, "DetailsFrameworkImageEdit") @@ -34,13 +34,13 @@ local CreateImageEditorFrame = function() edit_texture:SetAllPoints() _G.DetailsFrameworkImageEdit_EditTexture = edit_texture - local background_frame = CreateFrame ("frame", "DetailsFrameworkImageEditBackground", DetailsFrameworkImageEdit, "BackdropTemplate") + local background_frame = CreateFrame("frame", "DetailsFrameworkImageEditBackground", DetailsFrameworkImageEdit, "BackdropTemplate") background_frame:SetPoint("topleft", DetailsFrameworkImageEdit, "topleft", -10, 30) background_frame:SetFrameStrata("TOOLTIP") background_frame:SetFrameLevel (editorWindow:GetFrameLevel()) - background_frame:SetSize (790, 560) + background_frame:SetSize(790, 560) - background_frame:SetResizable (true) + background_frame:SetResizable(true) background_frame:SetMovable (true) background_frame:SetScript("OnMouseDown", function() @@ -56,12 +56,12 @@ local CreateImageEditorFrame = function() background_frame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) background_frame:SetBackdropColor(0, 0, 0, 0.9) - background_frame:SetBackdropBorderColor (0, 0, 0, 1) + background_frame:SetBackdropBorderColor(0, 0, 0, 1) local haveHFlip = false local haveVFlip = false ---> Top Slider +--Top Slider local topCoordTexture = DF:NewImage (editorWindow, nil, nil, nil, "overlay", nil, nil, "$parentImageTopCoord") topCoordTexture:SetPoint("topleft", editorWindow, "topleft") @@ -71,12 +71,12 @@ local CreateImageEditorFrame = function() topCoordTexture.alpha = .2 local topSlider = DF:NewSlider (editorWindow, nil, "$parentTopSlider", "topSlider", 100, 100, 0.1, 100, 0.1, 0) - topSlider:SetAllPoints (editorWindow.widget) + topSlider:SetAllPoints(editorWindow.widget) topSlider:SetOrientation ("VERTICAL") topSlider.backdrop = nil topSlider.fractional = true - topSlider:SetHook ("OnEnter", function() return true end) - topSlider:SetHook ("OnLeave", function() return true end) + topSlider:SetHook("OnEnter", function() return true end) + topSlider:SetHook("OnLeave", function() return true end) local topSliderThumpTexture = topSlider:CreateTexture(nil, "overlay") topSliderThumpTexture:SetColorTexture(1, 1, 1) @@ -84,7 +84,7 @@ local CreateImageEditorFrame = function() topSliderThumpTexture:SetHeight(1) topSlider:SetThumbTexture (topSliderThumpTexture) - topSlider:SetHook ("OnValueChange", function(_, _, value) + topSlider:SetHook("OnValueChange", function(_, _, value) topCoordTexture.image:SetHeight(editorWindow.frame:GetHeight()/100*value) if (editorWindow.callback_func) then editorWindow.accept(nil, nil, true) @@ -93,7 +93,7 @@ local CreateImageEditorFrame = function() topSlider:Hide() ---> Bottom Slider +--Bottom Slider local bottomCoordTexture = DF:NewImage (editorWindow, nil, nil, nil, "overlay", nil, nil, "$parentImageBottomCoord") bottomCoordTexture:SetPoint("bottomleft", editorWindow, "bottomleft", 0, 0) @@ -103,12 +103,12 @@ local CreateImageEditorFrame = function() bottomCoordTexture.alpha = .2 local bottomSlider= DF:NewSlider (editorWindow, nil, "$parentBottomSlider", "bottomSlider", 100, 100, 0.1, 100, 0.1, 100) - bottomSlider:SetAllPoints (editorWindow.widget) + bottomSlider:SetAllPoints(editorWindow.widget) bottomSlider:SetOrientation ("VERTICAL") bottomSlider.backdrop = nil bottomSlider.fractional = true - bottomSlider:SetHook ("OnEnter", function() return true end) - bottomSlider:SetHook ("OnLeave", function() return true end) + bottomSlider:SetHook("OnEnter", function() return true end) + bottomSlider:SetHook("OnLeave", function() return true end) local bottomSliderThumpTexture = bottomSlider:CreateTexture(nil, "overlay") bottomSliderThumpTexture:SetColorTexture(1, 1, 1) @@ -116,7 +116,7 @@ local CreateImageEditorFrame = function() bottomSliderThumpTexture:SetHeight(1) bottomSlider:SetThumbTexture (bottomSliderThumpTexture) - bottomSlider:SetHook ("OnValueChange", function(_, _, value) + bottomSlider:SetHook("OnValueChange", function(_, _, value) value = math.abs (value-100) bottomCoordTexture.image:SetHeight(math.max (editorWindow.frame:GetHeight()/100*value, 1)) if (editorWindow.callback_func) then @@ -126,7 +126,7 @@ local CreateImageEditorFrame = function() bottomSlider:Hide() ---> Left Slider +--Left Slider local leftCoordTexture = DF:NewImage (editorWindow, nil, nil, nil, "overlay", nil, nil, "$parentImageLeftCoord") leftCoordTexture:SetPoint("topleft", editorWindow, "topleft", 0, 0) @@ -136,11 +136,11 @@ local CreateImageEditorFrame = function() leftCoordTexture.alpha = .2 local leftSlider = DF:NewSlider (editorWindow, nil, "$parentLeftSlider", "leftSlider", 100, 100, 0.1, 100, 0.1, 0.1) - leftSlider:SetAllPoints (editorWindow.widget) + leftSlider:SetAllPoints(editorWindow.widget) leftSlider.backdrop = nil leftSlider.fractional = true - leftSlider:SetHook ("OnEnter", function() return true end) - leftSlider:SetHook ("OnLeave", function() return true end) + leftSlider:SetHook("OnEnter", function() return true end) + leftSlider:SetHook("OnLeave", function() return true end) local leftSliderThumpTexture = leftSlider:CreateTexture(nil, "overlay") leftSliderThumpTexture:SetColorTexture(1, 1, 1) @@ -148,7 +148,7 @@ local CreateImageEditorFrame = function() leftSliderThumpTexture:SetHeight(512) leftSlider:SetThumbTexture (leftSliderThumpTexture) - leftSlider:SetHook ("OnValueChange", function(_, _, value) + leftSlider:SetHook("OnValueChange", function(_, _, value) leftCoordTexture.image:SetWidth(editorWindow.frame:GetWidth()/100*value) if (editorWindow.callback_func) then editorWindow.accept(nil, nil, true) @@ -157,7 +157,7 @@ local CreateImageEditorFrame = function() leftSlider:Hide() ---> Right Slider +--Right Slider local rightCoordTexture = DF:NewImage (editorWindow, nil, nil, nil, "overlay", nil, nil, "$parentImageRightCoord") rightCoordTexture:SetPoint("topright", editorWindow, "topright", 0, 0) @@ -167,11 +167,11 @@ local CreateImageEditorFrame = function() rightCoordTexture.alpha = .2 local rightSlider = DF:NewSlider (editorWindow, nil, "$parentRightSlider", "rightSlider", 100, 100, 0.1, 100, 0.1, 100) - rightSlider:SetAllPoints (editorWindow.widget) + rightSlider:SetAllPoints(editorWindow.widget) rightSlider.backdrop = nil rightSlider.fractional = true - rightSlider:SetHook ("OnEnter", function() return true end) - rightSlider:SetHook ("OnLeave", function() return true end) + rightSlider:SetHook("OnEnter", function() return true end) + rightSlider:SetHook("OnLeave", function() return true end) --[ local rightSliderThumpTexture = rightSlider:CreateTexture(nil, "overlay") rightSliderThumpTexture:SetColorTexture(1, 1, 1) @@ -179,7 +179,7 @@ local CreateImageEditorFrame = function() rightSliderThumpTexture:SetHeight(512) rightSlider:SetThumbTexture (rightSliderThumpTexture) --]] - rightSlider:SetHook ("OnValueChange", function(_, _, value) + rightSlider:SetHook("OnValueChange", function(_, _, value) value = math.abs (value-100) rightCoordTexture.image:SetWidth(math.max (editorWindow.frame:GetWidth()/100*value, 1)) if (editorWindow.callback_func) then @@ -189,7 +189,7 @@ local CreateImageEditorFrame = function() rightSlider:Hide() ---> Edit Buttons +--Edit Buttons local buttonsBackground = DF:NewPanel (UIParent, nil, "DetailsFrameworkImageEditButtonsBg", nil, 115, 230) --buttonsBackground:SetPoint("topleft", window, "topright", 2, 0) @@ -260,7 +260,7 @@ local CreateImageEditorFrame = function() Alpha:SetPoint("topright", buttonsBackground, "topright", -8, -115 + yMod) Alpha:SetTemplate(DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) - --> overlay color + --overlay color local selectedColor = function(default) if (default) then edit_texture:SetVertexColor(unpack(default)) @@ -284,7 +284,7 @@ local CreateImageEditorFrame = function() local right, g, bottom = edit_texture:GetVertexColor() ColorPickerFrame:SetColorRGB (right, g, bottom) - ColorPickerFrame:SetParent (buttonsBackground.widget) + ColorPickerFrame:SetParent(buttonsBackground.widget) ColorPickerFrame.hasOpacity = false ColorPickerFrame.previousValues = {right, g, bottom} ColorPickerFrame.func = selectedColor @@ -317,7 +317,7 @@ local CreateImageEditorFrame = function() local alphaSlider = DF:NewSlider (alphaFrame, nil, "$parentAlphaSlider", "alphaSlider", 30, 220, 1, 100, 1, edit_texture:GetAlpha()*100) alphaSlider:SetPoint("top", alphaFrame, "top", 0, -5) alphaSlider:SetOrientation ("VERTICAL") - alphaSlider.thumb:SetSize (40, 30) + alphaSlider.thumb:SetSize(40, 30) --leftSlider.backdrop = nil --leftSlider.fractional = true @@ -348,16 +348,16 @@ local CreateImageEditorFrame = function() Alpha.clickfunction = alpha - alphaSlider:SetHook ("OnValueChange", function(_, _, value) + alphaSlider:SetHook("OnValueChange", function(_, _, value) edit_texture:SetAlpha(value/100) if (editorWindow.callback_func) then editorWindow.accept(nil, nil, true) end end) - local resizer = CreateFrame ("Button", nil, editorWindow.widget, "BackdropTemplate") - resizer:SetNormalTexture ([[Interface\AddOns\Details\images\skins\default_skin]]) - resizer:SetHighlightTexture ([[Interface\AddOns\Details\images\skins\default_skin]]) + local resizer = CreateFrame("Button", nil, editorWindow.widget, "BackdropTemplate") + resizer:SetNormalTexture([[Interface\AddOns\Details\images\skins\default_skin]]) + resizer:SetHighlightTexture([[Interface\AddOns\Details\images\skins\default_skin]]) resizer:GetNormalTexture():SetTexCoord (0.00146484375, 0.01513671875, 0.24560546875, 0.25927734375) resizer:GetHighlightTexture():SetTexCoord (0.00146484375, 0.01513671875, 0.24560546875, 0.25927734375) resizer:SetWidth(16) diff --git a/Libs/DF/slider.lua b/Libs/DF/slider.lua index ae22dce3..f600eae6 100644 --- a/Libs/DF/slider.lua +++ b/Libs/DF/slider.lua @@ -311,7 +311,7 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) end ------------------------------------------------------------------------------------------------------------ ---> scripts +--scripts local OnEnter = function(slider) if (rawget (slider.MyObject, "lockdown")) then @@ -329,7 +329,7 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) slider.thumb:SetAlpha (1) if (slider.MyObject.onenter_backdrop_border_color) then - slider:SetBackdropBorderColor (unpack (slider.MyObject.onenter_backdrop_border_color)) + slider:SetBackdropBorderColor(unpack (slider.MyObject.onenter_backdrop_border_color)) end if (slider.MyObject.have_tooltip and slider.MyObject.have_tooltip ~= "Right Click to Type the Value") then @@ -361,7 +361,7 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) slider.thumb:SetAlpha (.7) if (slider.MyObject.onleave_backdrop_border_color) then - slider:SetBackdropBorderColor (unpack (slider.MyObject.onleave_backdrop_border_color)) + slider:SetBackdropBorderColor(unpack (slider.MyObject.onleave_backdrop_border_color)) end GameCooltip2:ShowMe (false) @@ -379,7 +379,7 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) t = t + elapsed if (t > 0.3) then f:Hide() - f:SetScript ("OnUpdate", nil) + f:SetScript("OnUpdate", nil) f.isGoingToHide = false end end @@ -387,14 +387,14 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) function f:ShowMe(host) f:SetParent(host) f:ClearAllPoints() - f:SetPoint ("bottomleft", host, "topleft", -5, -5) - f:SetPoint ("bottomright", host, "topright", 5, -5) + f:SetPoint("bottomleft", host, "topleft", -5, -5) + f:SetPoint("bottomright", host, "topright", 5, -5) f:SetFrameStrata ("FULLSCREEN") f:SetFrameLevel (host:GetFrameLevel() + 1000) f:Show() if (f.isGoingToHide) then - f:SetScript ("OnUpdate", nil) + f:SetScript("OnUpdate", nil) f.isGoingToHide = false end @@ -404,45 +404,45 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) function f:PrepareToHide() f.isGoingToHide = true t = 0 - f:SetScript ("OnUpdate", goingHide) + f:SetScript("OnUpdate", goingHide) end - local buttonPlus = CreateFrame ("button", "DetailsFrameworkSliderButtonsPlusButton", f, "BackdropTemplate") - local buttonMinor = CreateFrame ("button", "DetailsFrameworkSliderButtonsMinorButton", f, "BackdropTemplate") + local buttonPlus = CreateFrame("button", "DetailsFrameworkSliderButtonsPlusButton", f, "BackdropTemplate") + local buttonMinor = CreateFrame("button", "DetailsFrameworkSliderButtonsMinorButton", f, "BackdropTemplate") 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: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: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) - buttonPlus:SetNormalTexture ([[Interface\Buttons\UI-PlusButton-Up]]) - buttonMinor:SetNormalTexture ([[Interface\Buttons\UI-MinusButton-Up]]) + buttonPlus:SetNormalTexture([[Interface\Buttons\UI-PlusButton-Up]]) + buttonMinor:SetNormalTexture([[Interface\Buttons\UI-MinusButton-Up]]) - buttonPlus:SetPushedTexture ([[Interface\Buttons\UI-PlusButton-Down]]) - buttonMinor:SetPushedTexture ([[Interface\Buttons\UI-MinusButton-Down]]) + buttonPlus:SetPushedTexture([[Interface\Buttons\UI-PlusButton-Down]]) + buttonMinor:SetPushedTexture([[Interface\Buttons\UI-MinusButton-Down]]) buttonPlus:SetDisabledTexture ([[Interface\Buttons\UI-PlusButton-Disabled]]) buttonMinor:SetDisabledTexture ([[Interface\Buttons\UI-MinusButton-Disabled]]) - buttonPlus:SetHighlightTexture ([[Interface\Buttons\UI-PlusButton-Hilight]]) - buttonMinor:SetHighlightTexture ([[Interface\Buttons\UI-PlusButton-Hilight]]) + buttonPlus:SetHighlightTexture([[Interface\Buttons\UI-PlusButton-Hilight]]) + buttonMinor:SetHighlightTexture([[Interface\Buttons\UI-PlusButton-Hilight]]) local plusNormalTexture = buttonPlus:GetNormalTexture() plusNormalTexture:SetDesaturated(true) @@ -451,11 +451,11 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) buttonMinor:ClearAllPoints() buttonPlus:ClearAllPoints() - buttonMinor:SetPoint ("bottomright", f, "bottomright", 13, -13) - buttonPlus:SetPoint ("left", buttonMinor, "right", -2, 0) + buttonMinor:SetPoint("bottomright", f, "bottomright", 13, -13) + buttonPlus:SetPoint("left", buttonMinor, "right", -2, 0) - buttonPlus:SetSize (16, 16) - buttonMinor:SetSize (16, 16) + buttonPlus:SetSize(16, 16) + buttonMinor:SetSize(16, 16) local timer = 0 local change_timer = 0 @@ -468,32 +468,32 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) local editbox = DFSliderMetaFunctions.editbox_typevalue if (f.host.fine_tuning) then - f.host:SetValue (current + f.host.fine_tuning) + f.host:SetValue(current + f.host.fine_tuning) if (editbox and DFSliderMetaFunctions.editbox_typevalue:IsShown()) then - DFSliderMetaFunctions.editbox_typevalue:SetText (tostring (string.format ("%.2f", current + f.host.fine_tuning))) + DFSliderMetaFunctions.editbox_typevalue:SetText(tostring (string.format ("%.2f", current + f.host.fine_tuning))) end else if (f.host.useDecimals) then - f.host:SetValue (current + 0.1) + f.host:SetValue(current + 0.1) if (editbox and DFSliderMetaFunctions.editbox_typevalue:IsShown()) then - DFSliderMetaFunctions.editbox_typevalue:SetText (string.format ("%.2f", current + 0.1)) + DFSliderMetaFunctions.editbox_typevalue:SetText(string.format ("%.2f", current + 0.1)) end else - f.host:SetValue (current + 1) + f.host:SetValue(current + 1) if (editbox and DFSliderMetaFunctions.editbox_typevalue:IsShown()) then - DFSliderMetaFunctions.editbox_typevalue:SetText (tostring (math.floor (current + 1))) + DFSliderMetaFunctions.editbox_typevalue:SetText(tostring (math.floor (current + 1))) end end end end - buttonPlus:SetScript ("OnMouseUp", function(self) + buttonPlus:SetScript("OnMouseUp", function(self) if (not buttonPlus.got_click) then plus_button_script() end buttonPlus.got_click = false - self:SetScript ("OnUpdate", nil) + self:SetScript("OnUpdate", nil) end) local on_update = function(self, elapsed) @@ -507,10 +507,10 @@ 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) + self:SetScript("OnUpdate", on_update) end) -- -- -- @@ -520,31 +520,31 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) local editbox = DFSliderMetaFunctions.editbox_typevalue if (f.host.fine_tuning) then - f.host:SetValue (current - f.host.fine_tuning) + f.host:SetValue(current - f.host.fine_tuning) if (editbox and DFSliderMetaFunctions.editbox_typevalue:IsShown()) then - DFSliderMetaFunctions.editbox_typevalue:SetText (tostring (string.format ("%.2f", current - f.host.fine_tuning))) + DFSliderMetaFunctions.editbox_typevalue:SetText(tostring (string.format ("%.2f", current - f.host.fine_tuning))) end else if (f.host.useDecimals) then - f.host:SetValue (current - 0.1) + f.host:SetValue(current - 0.1) if (editbox and DFSliderMetaFunctions.editbox_typevalue:IsShown()) then - DFSliderMetaFunctions.editbox_typevalue:SetText (string.format ("%.2f", current - 0.1)) + DFSliderMetaFunctions.editbox_typevalue:SetText(string.format ("%.2f", current - 0.1)) end else - f.host:SetValue (current - 1) + f.host:SetValue(current - 1) if (editbox and DFSliderMetaFunctions.editbox_typevalue:IsShown()) then - DFSliderMetaFunctions.editbox_typevalue:SetText (tostring (math.floor (current - 1))) + DFSliderMetaFunctions.editbox_typevalue:SetText(tostring (math.floor (current - 1))) end end end end - buttonMinor:SetScript ("OnMouseUp", function(self) + buttonMinor:SetScript("OnMouseUp", function(self) if (not buttonMinor.got_click) then minor_button_script() end buttonMinor.got_click = false - self:SetScript ("OnUpdate", nil) + self:SetScript("OnUpdate", nil) end) local on_update = function(self, elapsed) @@ -558,14 +558,14 @@ 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) + self:SetScript("OnUpdate", on_update) end) local do_precision = function(text) - if (type (text) == "string" and text:find ("%.")) then + if (type(text) == "string" and text:find ("%.")) then local left, right = strsplit (".", text) left = tonumber (left) right = tonumber (right) @@ -589,30 +589,30 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) if (not DFSliderMetaFunctions.editbox_typevalue) then - local editbox = CreateFrame ("EditBox", "DetailsFrameworkSliderEditBox", UIParent, "BackdropTemplate") + local editbox = CreateFrame("EditBox", "DetailsFrameworkSliderEditBox", UIParent, "BackdropTemplate") - editbox:SetSize (40, 20) - editbox:SetJustifyH ("center") - editbox:SetBackdrop ({bgFile = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]], + editbox:SetSize(40, 20) + editbox:SetJustifyH("center") + editbox:SetBackdrop({bgFile = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]], edgeFile = "Interface\\Buttons\\UI-SliderBar-Border", --edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]], tile = true, edgeSize = 8, tileSize = 5}) editbox:SetFontObject ("GameFontHighlightSmall") - editbox:SetScript ("OnEnterPressed", function() + editbox:SetScript("OnEnterPressed", function() editbox:ClearFocus() editbox:Hide() editbox:GetParent().MyObject.typing_value = false editbox:GetParent().MyObject.value = tonumber (editbox:GetText()) --do_precision (editbox:GetText()) end) - editbox:SetScript ("OnEscapePressed", function() + editbox:SetScript("OnEscapePressed", function() editbox:ClearFocus() editbox:Hide() editbox:GetParent().MyObject.typing_value = false editbox:GetParent().MyObject.value = self.typing_value_started --do_precision (self.typing_value_started) end) - editbox:SetScript ("OnTextChanged", function() + editbox:SetScript("OnTextChanged", function() editbox:GetParent().MyObject.typing_can_change = true editbox:GetParent().MyObject.value = tonumber (editbox:GetText()) --do_precision editbox:GetParent().MyObject.typing_can_change = false @@ -622,21 +622,21 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) end local pvalue = self.previous_value [2] - self:SetValue (pvalue) + self:SetValue(pvalue) self.typing_value = true self.typing_value_started = pvalue - DFSliderMetaFunctions.editbox_typevalue:SetSize (self.width, self.height) - DFSliderMetaFunctions.editbox_typevalue:SetPoint ("center", self.widget, "center") + DFSliderMetaFunctions.editbox_typevalue:SetSize(self.width, self.height) + DFSliderMetaFunctions.editbox_typevalue:SetPoint("center", self.widget, "center") DFSliderMetaFunctions.editbox_typevalue:SetFocus() - DFSliderMetaFunctions.editbox_typevalue:SetParent (self.widget) + DFSliderMetaFunctions.editbox_typevalue:SetParent(self.widget) DFSliderMetaFunctions.editbox_typevalue:SetFrameLevel (self.widget:GetFrameLevel()+1) if (self.useDecimals) then - DFSliderMetaFunctions.editbox_typevalue:SetText (tostring (string.format ("%.1f", self.value))) + DFSliderMetaFunctions.editbox_typevalue:SetText(tostring (string.format ("%.1f", self.value))) else - DFSliderMetaFunctions.editbox_typevalue:SetText (tostring (math.floor (self.value))) + DFSliderMetaFunctions.editbox_typevalue:SetText(tostring (math.floor (self.value))) end DFSliderMetaFunctions.editbox_typevalue:HighlightText() @@ -678,7 +678,7 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) if (slider.MyObject.typing_value) then DFSliderMetaFunctions.editbox_typevalue:ClearFocus() - DFSliderMetaFunctions.editbox_typevalue:SetText ("") + DFSliderMetaFunctions.editbox_typevalue:SetText("") slider.MyObject.typing_valu = false end end @@ -704,7 +704,7 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) end if (slider.MyObject.typing_value and not slider.MyObject.typing_can_change) then - slider.MyObject:SetValue (slider.MyObject.typing_value_started) + slider.MyObject:SetValue(slider.MyObject.typing_value_started) return end @@ -732,16 +732,16 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) end if (slider.MyObject.useDecimals) then - slider.amt:SetText (string.format ("%.2f", amt)) + slider.amt:SetText(string.format ("%.2f", amt)) else - slider.amt:SetText (math.floor (amt)) + slider.amt:SetText(math.floor (amt)) end slider.MyObject.ivalue = amt end ------------------------------------------------------------------------------------------------------------ ---> object constructor +--object constructor local SwitchOnClick = function(self, button, forced_value, value) @@ -759,31 +759,31 @@ local SwitchOnClick = function(self, button, forced_value, value) rawset (slider, "value", false) if (slider.backdrop_disabledcolor) then - slider:SetBackdropColor (unpack (slider.backdrop_disabledcolor)) + slider:SetBackdropColor(unpack (slider.backdrop_disabledcolor)) else - slider:SetBackdropColor (1, 0, 0, 0.4) + slider:SetBackdropColor(1, 0, 0, 0.4) end if (slider.is_checkbox) then slider.checked_texture:Hide() else - slider._text:SetText (slider._ltext) + slider._text:SetText(slider._ltext) slider._thumb:ClearAllPoints() - slider._thumb:SetPoint ("left", slider.widget, "left") + slider._thumb:SetPoint("left", slider.widget, "left") end else rawset (slider, "value", true) if (slider.backdrop_enabledcolor) then - slider:SetBackdropColor (unpack (slider.backdrop_enabledcolor)) + slider:SetBackdropColor(unpack (slider.backdrop_enabledcolor)) else - slider:SetBackdropColor (0, 0, 1, 0.4) + slider:SetBackdropColor(0, 0, 1, 0.4) end if (slider.is_checkbox) then slider.checked_texture:Show() else - slider._text:SetText (slider._rtext) + slider._text:SetText(slider._rtext) slider._thumb:ClearAllPoints() - slider._thumb:SetPoint ("right", slider.widget, "right") + slider._thumb:SetPoint("right", slider.widget, "right") end end @@ -798,7 +798,7 @@ local SwitchOnClick = function(self, button, forced_value, value) return end - --> trigger hooks + --trigger hooks slider:RunHooksForWidget ("OnSwitch", slider, slider.FixedValue, value) end @@ -837,7 +837,7 @@ local switch_disable = function(self) if (not self.lock_texture) then DF:NewImage (self, [[Interface\PetBattles\PetBattle-LockIcon]], 12, 12, "overlay", {0.0546875, 0.9453125, 0.0703125, 0.9453125}, "lock_texture", "$parentLockTexture") self.lock_texture:SetDesaturated (true) - self.lock_texture:SetPoint ("center", self._thumb, "center") + self.lock_texture:SetPoint("center", self._thumb, "center") end self.lock_texture:Show() end @@ -856,7 +856,7 @@ local switch_enable = function(self) if (not self.lock_texture) then DF:NewImage (self, [[Interface\PetBattles\PetBattle-LockIcon]], 12, 12, "overlay", {0.0546875, 0.9453125, 0.0703125, 0.9453125}, "lock_texture", "$parentLockTexture") self.lock_texture:SetDesaturated (true) - self.lock_texture:SetPoint ("center", self._thumb, "center") + self.lock_texture:SetPoint("center", self._thumb, "center") end self.lock_texture:Hide() self._text:Show() @@ -872,11 +872,11 @@ end 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]]) - checked:SetPoint ("center", self.button, "center", -1, -1) + local checked = self:CreateTexture(self:GetName() .. "CheckTexture", "overlay") + checked:SetTexture([[Interface\Buttons\UI-CheckBox-Check]]) + checked:SetPoint("center", self.button, "center", -1, -1) local size_pct = self:GetWidth()/32 - checked:SetSize (32*size_pct, 32*size_pct) + checked:SetSize(32*size_pct, 32*size_pct) self.checked_texture = checked self._thumb:Hide() @@ -887,16 +887,16 @@ local set_as_checkbok = function(self) if (rawget (self, "value")) then self.checked_texture:Show() if (self.backdrop_enabledcolor) then - self:SetBackdropColor (unpack (self.backdrop_enabledcolor)) + self:SetBackdropColor(unpack (self.backdrop_enabledcolor)) else - self:SetBackdropColor (0, 0, 1, 0.4) + self:SetBackdropColor(0, 0, 1, 0.4) end else self.checked_texture:Hide() if (self.backdrop_disabledcolor) then - self:SetBackdropColor (unpack (self.backdrop_disabledcolor)) + self:SetBackdropColor(unpack (self.backdrop_disabledcolor)) else - self:SetBackdropColor (0, 0, 1, 0.4) + self:SetBackdropColor(0, 0, 1, 0.4) end end @@ -912,7 +912,7 @@ end function DF:NewSwitch (parent, container, name, member, w, h, ltext, rtext, default_value, color_inverted, switch_func, return_func, with_label, switch_template, label_template) ---> early checks +--early checks if (not name) then name = "DetailsFrameWorkSlider" .. DF.SwitchCounter DF.SwitchCounter = DF.SwitchCounter + 1 @@ -923,11 +923,11 @@ function DF:NewSwitch (parent, container, name, member, w, h, ltext, rtext, defa container = parent end ---> defaults +--defaults ltext = ltext or "OFF" rtext = rtext or "ON" ---> build frames +--build frames w = w or 60 h = h or 20 @@ -949,18 +949,18 @@ function DF:NewSwitch (parent, container, name, member, w, h, ltext, rtext, defa parent [member] = slider end - slider:SetBackdrop ({edgeFile = [[Interface\Buttons\UI-SliderBar-Border]], edgeSize = 8, + slider:SetBackdrop({edgeFile = [[Interface\Buttons\UI-SliderBar-Border]], edgeSize = 8, bgFile = [[Interface\AddOns\Details\images\background]], insets = {left = 3, right = 3, top = 5, bottom = 5}}) - local thumb = slider:CreateTexture (nil, "artwork") - thumb:SetTexture ("Interface\\Buttons\\UI-ScrollBar-Knob") - thumb:SetSize (34+(h*0.2), h*1.2) + local thumb = slider:CreateTexture(nil, "artwork") + thumb:SetTexture("Interface\\Buttons\\UI-ScrollBar-Knob") + thumb:SetSize(34+(h*0.2), h*1.2) thumb:SetAlpha (0.7) - thumb:SetPoint ("left", slider.widget, "left") + thumb:SetPoint("left", slider.widget, "left") local text = slider:CreateFontString (nil, "overlay", "GameFontHighlightSmall") text:SetTextColor (.8, .8, .8, 1) - text:SetPoint ("center", thumb, "center") + text:SetPoint("center", thumb, "center") slider._text = text slider._thumb = thumb @@ -970,9 +970,9 @@ function DF:NewSwitch (parent, container, name, member, w, h, ltext, rtext, defa slider.invert_colors = color_inverted - slider:SetScript ("OnClick", SwitchOnClick) + slider:SetScript("OnClick", SwitchOnClick) - slider:SetValue (default_value) + slider:SetValue(default_value) slider.isSwitch = true @@ -981,9 +981,9 @@ function DF:NewSwitch (parent, container, name, member, w, h, ltext, rtext, defa end if (with_label) then - local label = DF:CreateLabel (slider.widget, with_label, nil, nil, nil, "label", nil, "overlay") + local label = DF:CreateLabel(slider.widget, with_label, nil, nil, nil, "label", nil, "overlay") label.text = with_label - slider.widget:SetPoint ("left", label.widget, "right", 2, 0) + slider.widget:SetPoint("left", label.widget, "right", 2, 0) with_label = label if (label_template) then @@ -998,64 +998,64 @@ function DFSliderMetaFunctions:SetTemplate (template) --slider e switch if (template.width) then - self:SetWidth (template.width) + self:SetWidth(template.width) end if (template.height) then - self:SetHeight (template.height) + self:SetHeight(template.height) end if (template.backdrop) then - self:SetBackdrop (template.backdrop) + self:SetBackdrop(template.backdrop) end if (template.backdropcolor) then - local r, g, b, a = DF:ParseColors (template.backdropcolor) - self:SetBackdropColor (r, g, b, a) + local r, g, b, a = DF:ParseColors(template.backdropcolor) + self:SetBackdropColor(r, g, b, a) end if (template.backdropbordercolor) then - local r, g, b, a = DF:ParseColors (template.backdropbordercolor) - self:SetBackdropBorderColor (r, g, b, a) + local r, g, b, a = DF:ParseColors(template.backdropbordercolor) + self:SetBackdropBorderColor(r, g, b, a) self.onleave_backdrop_border_color = {r, g, b, a} end if (template.onenterbordercolor) then - local r, g, b, a = DF:ParseColors (template.onenterbordercolor) + local r, g, b, a = DF:ParseColors(template.onenterbordercolor) self.onenter_backdrop_border_color = {r, g, b, a} end if (template.onleavebordercolor) then - local r, g, b, a = DF:ParseColors (template.onleavebordercolor) + local r, g, b, a = DF:ParseColors(template.onleavebordercolor) self.onleave_backdrop_border_color = {r, g, b, a} end if (template.thumbtexture) then if (self.thumb) then - self.thumb:SetTexture (template.thumbtexture) + self.thumb:SetTexture(template.thumbtexture) end end if (template.thumbwidth) then if (self.thumb) then - self.thumb:SetWidth (template.thumbwidth) + self.thumb:SetWidth(template.thumbwidth) end end if (template.thumbheight) then if (self.thumb) then - self.thumb:SetHeight (template.thumbheight) + self.thumb:SetHeight(template.thumbheight) end end if (template.thumbcolor) then if (self.thumb) then - local r, g, b, a = DF:ParseColors (template.thumbcolor) + local r, g, b, a = DF:ParseColors(template.thumbcolor) self.thumb:SetVertexColor (r, g, b, a) end end --switch only if (template.enabled_backdropcolor) then - local r, g, b, a = DF:ParseColors (template.enabled_backdropcolor) + local r, g, b, a = DF:ParseColors(template.enabled_backdropcolor) self.backdrop_enabledcolor = {r, g, b, a} end if (template.disabled_backdropcolor) then - local r, g, b, a = DF:ParseColors (template.disabled_backdropcolor) + local r, g, b, a = DF:ParseColors(template.disabled_backdropcolor) self.backdrop_disabledcolor = {r, g, b, a} end end @@ -1067,7 +1067,7 @@ end function DF:NewSlider (parent, container, name, member, w, h, min, max, step, defaultv, isDecemal, isSwitch, with_label, slider_template, label_template) ---> early checks +--early checks if (not name) then name = "DetailsFrameworkSlider" .. DF.SliderCounter DF.SliderCounter = DF.SliderCounter + 1 @@ -1097,7 +1097,7 @@ function DF:NewSlider (parent, container, name, member, w, h, min, max, step, de container = container.widget end ---> defaults +--defaults min = min or 1 max = max or 2 step = step or 1 @@ -1106,11 +1106,11 @@ function DF:NewSlider (parent, container, name, member, w, h, min, max, step, de w = w or 130 h = h or 19 - --> default members: + --default members: SliderObject.lockdown = false SliderObject.container = container - SliderObject.slider = CreateFrame ("slider", name, parent,"BackdropTemplate") + SliderObject.slider = CreateFrame("slider", name, parent,"BackdropTemplate") SliderObject.widget = SliderObject.slider SliderObject.useDecimals = isDecemal or false @@ -1135,19 +1135,19 @@ function DF:NewSlider (parent, container, name, member, w, h, min, max, step, de end SliderObject.slider.MyObject = SliderObject - SliderObject.slider:SetWidth (w) - SliderObject.slider:SetHeight (h) + SliderObject.slider:SetWidth(w) + SliderObject.slider:SetHeight(h) SliderObject.slider:SetOrientation ("horizontal") SliderObject.slider:SetMinMaxValues (min, max) - SliderObject.slider:SetValue (defaultv) + SliderObject.slider:SetValue(defaultv) SliderObject.ivalue = defaultv - SliderObject.slider:SetBackdrop ({edgeFile = "Interface\\Buttons\\UI-SliderBar-Border", edgeSize = 8}) - SliderObject.slider:SetBackdropColor (0.9, 0.7, 0.7, 1.0) + SliderObject.slider:SetBackdrop({edgeFile = "Interface\\Buttons\\UI-SliderBar-Border", edgeSize = 8}) + SliderObject.slider:SetBackdropColor(0.9, 0.7, 0.7, 1.0) - SliderObject.thumb = SliderObject.slider:CreateTexture (nil, "artwork") - SliderObject.thumb:SetTexture ("Interface\\Buttons\\UI-ScrollBar-Knob") - SliderObject.thumb:SetSize (30+(h*0.2), h*1.2) + SliderObject.thumb = SliderObject.slider:CreateTexture(nil, "artwork") + SliderObject.thumb:SetTexture("Interface\\Buttons\\UI-ScrollBar-Knob") + SliderObject.thumb:SetSize(30+(h*0.2), h*1.2) SliderObject.thumb.originalWidth = SliderObject.thumb:GetWidth() SliderObject.thumb.originalHeight =SliderObject.thumb:GetHeight() SliderObject.thumb:SetAlpha (0.7) @@ -1166,18 +1166,18 @@ function DF:NewSlider (parent, container, name, member, w, h, min, max, step, de end if (SliderObject.useDecimals) then - SliderObject.amt:SetText (string.format ("%.2f", amt)) + SliderObject.amt:SetText(string.format ("%.2f", amt)) else - SliderObject.amt:SetText (math.floor (amt)) + SliderObject.amt:SetText(math.floor (amt)) end SliderObject.amt:SetTextColor (.8, .8, .8, 1) - SliderObject.amt:SetPoint ("center", SliderObject.thumb, "center") + SliderObject.amt:SetPoint("center", SliderObject.thumb, "center") SliderObject.slider.amt = SliderObject.amt SliderObject.previous_value = {defaultv or 0, 0, 0} - --> hooks + --hooks SliderObject.HookList = { OnEnter = {}, OnLeave = {}, @@ -1190,20 +1190,20 @@ function DF:NewSlider (parent, container, name, member, w, h, min, max, step, de OnValueChanged = {}, } - SliderObject.slider:SetScript ("OnEnter", OnEnter) - SliderObject.slider:SetScript ("OnLeave", OnLeave) - SliderObject.slider:SetScript ("OnHide", OnHide) - SliderObject.slider:SetScript ("OnShow", OnShow) - SliderObject.slider:SetScript ("OnValueChanged", OnValueChanged) - SliderObject.slider:SetScript ("OnMouseDown", OnMouseDown) - SliderObject.slider:SetScript ("OnMouseUp", OnMouseUp) + SliderObject.slider:SetScript("OnEnter", OnEnter) + SliderObject.slider:SetScript("OnLeave", OnLeave) + SliderObject.slider:SetScript("OnHide", OnHide) + SliderObject.slider:SetScript("OnShow", OnShow) + SliderObject.slider:SetScript("OnValueChanged", OnValueChanged) + SliderObject.slider:SetScript("OnMouseDown", OnMouseDown) + SliderObject.slider:SetScript("OnMouseUp", OnMouseUp) setmetatable (SliderObject, DFSliderMetaFunctions) if (with_label) then - local label = DF:CreateLabel (SliderObject.slider, with_label, nil, nil, nil, "label", nil, "overlay") + local label = DF:CreateLabel(SliderObject.slider, with_label, nil, nil, nil, "label", nil, "overlay") label.text = with_label - SliderObject.slider:SetPoint ("left", label.widget, "right", 2, 0) + SliderObject.slider:SetPoint("left", label.widget, "right", 2, 0) with_label = label if (label_template) then diff --git a/Libs/DF/spells.lua b/Libs/DF/spells.lua index e368e1df..b1f07a6f 100644 --- a/Libs/DF/spells.lua +++ b/Libs/DF/spells.lua @@ -688,9 +688,9 @@ if (IS_WOW_PROJECT_NOT_MAINLINE) then end ---> tells the duration, requirements and cooldown of a cooldown +-- tells the duration, requirements and cooldown of a cooldown DF.CooldownsInfo = { - --> paladin + --paladin [31884] = {cooldown = 120, duration = 20, talent = false, charges = 1, class = "PALADIN", type = 1}, --Avenging Wrath [216331] = {cooldown = 120, duration = 20, talent = 22190, charges = 1, class = "PALADIN", type = 1}, --Avenging Crusader (talent) [498] = {cooldown = 60, duration = 8, talent = false, charges = 1, class = "PALADIN", type = 2}, --Divine Protection @@ -712,7 +712,7 @@ DF.CooldownsInfo = { [205191] = {cooldown = 60, duration = 10, talent = 22183, charges = 1, class = "PALADIN", type = 2}, --Eye for an Eye (talent) [184662] = {cooldown = 120, duration = 15, talent = false, charges = 1, class = "PALADIN", type = 2}, --Shield of Vengeance - --> warrior + --warrior [107574] = {cooldown = 90, duration = 20, talent = 22397, charges = 1, class = "WARRIOR", type = 1}, --Avatar [227847] = {cooldown = 90, duration = 5, talent = false, charges = 1, class = "WARRIOR", type = 1}, --Bladestorm [152277] = {cooldown = 60, duration = 6, talent = 21667, charges = 1, class = "WARRIOR", type = 1}, --Ravager (talent) @@ -728,7 +728,7 @@ DF.CooldownsInfo = { [5246] = {cooldown = 90, duration = 8, talent = false, charges = 1, class = "WARRIOR", type = 5}, --Intimidating Shout - --> warlock + --warlock [205180] = {cooldown = 180, duration = 20, talent = false, charges = 1, class = "WARLOCK", type = 1}, --Summon Darkglare [342601] = {cooldown = 3600, duration = false, talent = false, charges = 1, class = "WARLOCK", type = 1}, --Ritual of Doom [113860] = {cooldown = 120, duration = 20, talent = 19293, charges = 1, class = "WARLOCK", type = 1}, --Dark Soul: Misery (talent) @@ -744,7 +744,7 @@ DF.CooldownsInfo = { [333889] = {cooldown = 180, duration = 15, talent = false, charges = 1, class = "WARLOCK", type = 5}, --Fel Domination [5484] = {cooldown = 40, duration = 20, talent = true, charges = 1, class = "WARLOCK", type = 5}, --Howl of Terror (talent) - --> shaman + --shaman [198067] = {cooldown = 150, duration = 30, talent = false, charges = 1, class = "SHAMAN", type = 1}, --Fire Elemental [192249] = {cooldown = 150, duration = 30, talent = 19272, charges = 1, class = "SHAMAN", type = 1}, --Storm Elemental (talent) [108271] = {cooldown = 90, duration = 8, talent = false, charges = 1, class = "SHAMAN", type = 2}, --Astral Shift @@ -762,7 +762,7 @@ DF.CooldownsInfo = { [65992] = {cooldown = 60, duration = 10, talent = false, charges = 1, class = "SHAMAN", type = 5}, --Tremor Totem [192077] = {cooldown = 120, duration = 15, talent = 21966, charges = 1, class = "SHAMAN", type = 5}, --Wind Rush Totem (talent) - --> monk + --monk [132578] = {cooldown = 180, duration = 25, talent = false, charges = 1, class = "MONK", type = 1}, --Invoke Niuzao, the Black Ox [115080] = {cooldown = 180, duration = false, talent = false, charges = 1, class = "MONK", type = 1}, --Touch of Death [115203] = {cooldown = 420, duration = 15, talent = false, charges = 1, class = "MONK", type = 2}, --Fortifying Brew @@ -783,7 +783,7 @@ DF.CooldownsInfo = { [116844] = {cooldown = 45, duration = 5, talent = 19995, charges = 1, class = "MONK", type = 5}, --Ring of peace (talent) [119381] = {cooldown = 50, duration = 3, talent = false, charges = 1, class = "MONK", type = 5}, --Leg Sweep - --> hunter + --hunter [193530] = {cooldown = 120, duration = 20, talent = false, charges = 1, class = "HUNTER", type = 1}, --Aspect of the Wild [19574] = {cooldown = 90, duration = 12, talent = false, charges = 1, class = "HUNTER", type = 1}, --Bestial Wrath [201430] = {cooldown = 180, duration = 12, talent = 23044, charges = 1, class = "HUNTER", type = 1}, --Stampede (talent) @@ -799,7 +799,7 @@ DF.CooldownsInfo = { [187650] = {cooldown = 25, duration = 60, talent = false, charges = 1, class = "HUNTER", type = 5}, --Freezing Trap [186289] = {cooldown = 72, duration = 15, talent = false, charges = 1, class = "HUNTER", type = 5}, --Aspect of the eagle - --> druid + --druid [194223] = {cooldown = 180, duration = 20, talent = false, charges = 1, class = "DRUID", type = 1}, --Celestial Alignment [102560] = {cooldown = 180, duration = 30, talent = 21702, charges = 1, class = "DRUID", type = 1}, --Incarnation: Chosen of Elune (talent) [22812] = {cooldown = 60, duration = 12, talent = false, charges = 1, class = "DRUID", type = 2}, --Barkskin @@ -819,7 +819,7 @@ DF.CooldownsInfo = { [132469] = {cooldown = 30, duration = false, talent = false, charges = 1, class = "DRUID", type = 5}, --Typhoon [319454] = {cooldown = 300, duration = 45, talent = 18577, charges = 1, class = "DRUID", type = 5}, --Heart of the Wild (talent) - --> death knight + --death knight [275699] = {cooldown = 90, duration = 15, talent = false, charges = 1, class = "DEATHKNIGHT", type = 1}, --Apocalypse [42650] = {cooldown = 480, duration = 30, talent = false, charges = 1, class = "DEATHKNIGHT", type = 1}, --Army of the Dead [49206] = {cooldown = 180, duration = 30, talent = 22110, charges = 1, class = "DEATHKNIGHT", type = 1}, --Summon Gargoyle (talent) @@ -839,7 +839,7 @@ DF.CooldownsInfo = { [108194] = {cooldown = 45, duration = 4, talent = 22520, charges = 1, class = "DEATHKNIGHT", type = 5}, --Asphyxiate (talent) [221562] = {cooldown = 45, duration = 5, talent = false, charges = 1, class = "DEATHKNIGHT", type = 5}, --Asphyxiate - --> demon hunter + --demon hunter [200166] = {cooldown = 240, duration = 30, talent = false, charges = 1, class = "DEMONHUNTER", type = 1}, --Metamorphosis [198589] = {cooldown = 60, duration = 10, talent = false, charges = 1, class = "DEMONHUNTER", type = 2}, --Blur @@ -858,7 +858,7 @@ DF.CooldownsInfo = { [202137] = {cooldown = 60, duration = 8, talent = false, charges = 1, class = "DEMONHUNTER", type = 5}, --Sigil of Silence [202138] = {cooldown = 90, duration = 6, talent = 22511, charges = 1, class = "DEMONHUNTER", type = 5}, --Sigil of Chains (talent) - --> mage + --mage [12042] = {cooldown = 90, duration = 10, talent = false, charges = 1, class = "MAGE", type = 1}, --Arcane Power [12051] = {cooldown = 90, duration = 6, talent = false, charges = 1, class = "MAGE", type = 1}, --Evocation [110960] = {cooldown = 120, duration = 20, talent = false, charges = 1, class = "MAGE", type = 2}, --Greater Invisibility @@ -874,7 +874,7 @@ DF.CooldownsInfo = { [235219] = {cooldown = 300, duration = false, talent = false, charges = 1, class = "MAGE", type = 5}, --Cold Snap [113724] = {cooldown = 45, duration = 10, talent = 22471, charges = 1, class = "MAGE", type = 5}, --Ring of Frost (talent) - --> priest + --priest [10060] = {cooldown = 120, duration = 20, talent = false, charges = 1, class = "PRIEST", type = 1}, --Power Infusion [34433] = {cooldown = 180, duration = 15, talent = false, charges = 1, class = "PRIEST", type = 1}, --Shadowfiend [123040] = {cooldown = 60, duration = 12, talent = 22094, charges = 1, class = "PRIEST", type = 1}, --Mindbender (talent) @@ -895,7 +895,7 @@ DF.CooldownsInfo = { [47585] = {cooldown = 120, duration = 6, talent = false, charges = 1, class = "PRIEST", type = 2}, --Dispersion [15286] = {cooldown = 120, duration = 15, talent = false, charges = 1, class = "PRIEST", type = 4}, --Vampiric Embrace - --> rogue + --rogue [79140] = {cooldown = 120, duration = 20, talent = false, charges = 1, class = "ROGUE", type = 1}, --Vendetta [1856] = {cooldown = 120, duration = 3, talent = false, charges = 1, class = "ROGUE", type = 2}, --Vanish [5277] = {cooldown = 120, duration = 10, talent = false, charges = 1, class = "ROGUE", type = 2}, --Evasion @@ -1435,7 +1435,7 @@ function DF:GetSpellsForEncounterFromJournal (instanceEJID, encounterEJID) local nextID = {sectionInfo.siblingSectionID} while (nextID [1]) do - --> get the deepest section in the hierarchy + --get the deepest section in the hierarchy local ID = tremove (nextID) local sectionInfo = C_EncounterJournal.GetSectionInfo (ID) @@ -1462,51 +1462,51 @@ end --default spells to use in the range check DF.SpellRangeCheckListBySpec = { -- 185245 spellID for Torment, it is always failing to check range with IsSpellInRange() - [577] = 278326, --> havoc demon hunter - Consume Magic - [581] = 278326, --> vengeance demon hunter - Consume Magic + [577] = 278326, --havoc demon hunter - Consume Magic + [581] = 278326, --vengeance demon hunter - Consume Magic - [250] = 56222, --> blood dk - dark command - [251] = 56222, --> frost dk - dark command - [252] = 56222, --> unholy dk - dark command + [250] = 56222, --blood dk - dark command + [251] = 56222, --frost dk - dark command + [252] = 56222, --unholy dk - dark command - [102] = 8921, --> druid balance - Moonfire (45 yards) - [103] = 8921, --> druid feral - Moonfire (40 yards) - [104] = 6795, --> druid guardian - Growl - [105] = 8921, --> druid resto - Moonfire (40 yards) + [102] = 8921, -- druid balance - Moonfire (45 yards) + [103] = 8921, -- druid feral - Moonfire (40 yards) + [104] = 6795, -- druid guardian - Growl + [105] = 8921, -- druid resto - Moonfire (40 yards) - [253] = 193455, --> hunter bm - Cobra Shot - [254] = 19434, --> hunter marks - Aimed Shot - [255] = 271788, --> hunter survivor - Serpent Sting + [253] = 193455, -- hunter bm - Cobra Shot + [254] = 19434, --hunter marks - Aimed Shot + [255] = 271788, --hunter survivor - Serpent Sting - [62] = 227170, --> mage arcane - arcane blast - [63] = 133, --> mage fire - fireball - [64] = 228597, --> mage frost - frostbolt + [62] = 227170, --mage arcane - arcane blast + [63] = 133, --mage fire - fireball + [64] = 228597, --mage frost - frostbolt - [268] = 115546 , --> monk bm - Provoke - [269] = 117952, --> monk ww - Crackling Jade Lightning (40 yards) - [270] = 117952, --> monk mw - Crackling Jade Lightning (40 yards) + [268] = 115546 , --monk bm - Provoke + [269] = 117952, --monk ww - Crackling Jade Lightning (40 yards) + [270] = 117952, --monk mw - Crackling Jade Lightning (40 yards) - [65] = 20473, --> paladin holy - Holy Shock (40 yards) - [66] = 62124, --> paladin protect - Hand of Reckoning - [70] = 62124, --> paladin ret - Hand of Reckoning + [65] = 20473, --paladin holy - Holy Shock (40 yards) + [66] = 62124, --paladin protect - Hand of Reckoning + [70] = 62124, --paladin ret - Hand of Reckoning - [256] = 585, --> priest disc - Smite - [257] = 585, --> priest holy - Smite - [258] = 8092, --> priest shadow - Mind Blast + [256] = 585, --priest disc - Smite + [257] = 585, --priest holy - Smite + [258] = 8092, --priest shadow - Mind Blast - [259] = 185565, --> rogue assassination - Poisoned Knife (30 yards) - [260] = 185763, --> rogue outlaw - Pistol Shot (20 yards) - [261] = 114014, --> rogue sub - Shuriken Toss (30 yards) + [259] = 185565, --rogue assassination - Poisoned Knife (30 yards) + [260] = 185763, --rogue outlaw - Pistol Shot (20 yards) + [261] = 114014, --rogue sub - Shuriken Toss (30 yards) - [262] = 188196, --> shaman elemental - Lightning Bolt - [263] = 187837, --> shaman enhancement - Lightning Bolt (instance cast) - [264] = 403, --> shaman resto - Lightning Bolt + [262] = 188196, --shaman elemental - Lightning Bolt + [263] = 187837, --shaman enhancement - Lightning Bolt (instance cast) + [264] = 403, --shaman resto - Lightning Bolt - [265] = 686, --> warlock aff - Shadow Bolt - [266] = 686, --> warlock demo - Shadow Bolt - [267] = 116858, --> warlock destro - Chaos Bolt + [265] = 686, --warlock aff - Shadow Bolt + [266] = 686, --warlock demo - Shadow Bolt + [267] = 116858, --warlock destro - Chaos Bolt - [71] = 355, --> warrior arms - Taunt - [72] = 355, --> warrior fury - Taunt - [73] = 355, --> warrior protect - Taunt + [71] = 355, --warrior arms - Taunt + [72] = 355, --warrior fury - Taunt + [73] = 355, --warrior protect - Taunt } diff --git a/Libs/DF/split_bar.lua b/Libs/DF/split_bar.lua index e261611d..8df1b4d8 100644 --- a/Libs/DF/split_bar.lua +++ b/Libs/DF/split_bar.lua @@ -5,12 +5,12 @@ if (not DF or not DetailsFrameworkCanLoad) then end local _ -local _rawset = rawset --> lua local -local _rawget = rawget --> lua local -local _setmetatable = setmetatable --> lua local -local _unpack = unpack --> lua local -local _type = type --> lua local -local _math_floor = math.floor --> lua local +local _rawset = rawset --lua local +local _rawget = rawget --lua local +local _setmetatable = setmetatable --lua local +local _unpack = unpack --lua local +local _type = type --lua local +local _math_floor = math.floor --lua local local cleanfunction = function() end local APISplitBarFunctions @@ -45,107 +45,107 @@ end local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] ------------------------------------------------------------------------------------------------------------ ---> metatables +--metatables SplitBarMetaFunctions.__call = function(_table, value) if (not value) then return _table.statusbar:GetValue() else - _table.spark:SetPoint ("left", _table.statusbar, "left", value * (_table.statusbar:GetWidth()/100) - 18, 0) - return _table.statusbar:SetValue (value) + _table.spark:SetPoint("left", _table.statusbar, "left", value * (_table.statusbar:GetWidth()/100) - 18, 0) + return _table.statusbar:SetValue(value) end end SplitBarMetaFunctions.__add = function(v1, v2) - if (_type (v1) == "table") then + if (_type(v1) == "table") then local v = v1.statusbar:GetValue() v = v + v2 - v1.spark:SetPoint ("left", v1.statusbar, "left", value * (v1.statusbar:GetWidth()/100) - 18, 0) - v1.statusbar:SetValue (v) + v1.spark:SetPoint("left", v1.statusbar, "left", value * (v1.statusbar:GetWidth()/100) - 18, 0) + v1.statusbar:SetValue(v) else local v = v2.statusbar:GetValue() v = v + v1 - v2.spark:SetPoint ("left", v2.statusbar, "left", value * (v2.statusbar:GetWidth()/100) - 18, 0) - v2.statusbar:SetValue (v) + v2.spark:SetPoint("left", v2.statusbar, "left", value * (v2.statusbar:GetWidth()/100) - 18, 0) + v2.statusbar:SetValue(v) end end SplitBarMetaFunctions.__sub = function(v1, v2) - if (_type (v1) == "table") then + if (_type(v1) == "table") then local v = v1.statusbar:GetValue() v = v - v2 - v1.spark:SetPoint ("left", v1.statusbar, "left", value * (v1.statusbar:GetWidth()/100) - 18, 0) - v1.statusbar:SetValue (v) + v1.spark:SetPoint("left", v1.statusbar, "left", value * (v1.statusbar:GetWidth()/100) - 18, 0) + v1.statusbar:SetValue(v) else local v = v2.statusbar:GetValue() v = v - v1 - v2.spark:SetPoint ("left", v2.statusbar, "left", value * (v2.statusbar:GetWidth()/100) - 18, 0) - v2.statusbar:SetValue (v) + v2.spark:SetPoint("left", v2.statusbar, "left", value * (v2.statusbar:GetWidth()/100) - 18, 0) + v2.statusbar:SetValue(v) end end ------------------------------------------------------------------------------------------------------------ ---> members +--members - --> tooltip + --tooltip local function gmember_tooltip (_object) return _object:GetTooltip() end - --> shown + --shown local gmember_shown = function(_object) return _object.statusbar:IsShown() end - --> frame width + --frame width local gmember_width = function(_object) return _object.statusbar:GetWidth() end - --> frame height + --frame height local gmember_height = function(_object) return _object.statusbar:GetHeight() end - --> value + --value local gmember_value = function(_object) return _object.statusbar:GetValue() end - --> right text + --right text local gmember_rtext = function(_object) return _object.textright:GetText() end - --> left text + --left text local gmember_ltext = function(_object) return _object.textleft:GetText() end - --> right color + --right color local gmember_rcolor = function(_object) return _object.rightTexture.original_colors end - --> left color + --left color local gmember_lcolor = function(_object) return _object.texture.original_colors end - --> right icon + --right icon local gmember_ricon = function(_object) return _object.iconright:GetTexture() end - --> left icon + --left icon local gmember_licon = function(_object) return _object.iconleft:GetTexture() end - --> texture + --texture local gmember_texture = function(_object) return _object.texture:GetTexture() end - --> font size + --font size local gmember_textsize = function(_object) local _, fontsize = _object.textleft:GetFont() return fontsize end - --> font face + --font face local gmember_textfont = function(_object) local fontface = _object.textleft:GetFont() return fontface end - --> font color + --font color local gmember_textcolor = function(_object) return _object.textleft:GetTextColor() end @@ -187,11 +187,11 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - --> tooltip + --tooltip local smember_tooltip = function(_object, _value) return _object:SetTooltip (_value) end - --> show + --show local smember_shown = function(_object, _value) if (_value) then return _object:Show() @@ -199,7 +199,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] return _object:Hide() end end - --> hide + --hide local smember_hide = function(_object, _value) if (_value) then return _object:Hide() @@ -207,96 +207,96 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] return _object:Show() end end - --> width + --width local smember_width = function(_object, _value) - return _object.statusbar:SetWidth (_value) + return _object.statusbar:SetWidth(_value) end - --> height + --height local smember_height = function(_object, _value) - return _object.statusbar:SetHeight (_value) + return _object.statusbar:SetHeight(_value) end - --> statusbar value + --statusbar 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) + _object.statusbar:SetValue(_value) + return _object.spark:SetPoint("left", _object.statusbar, "left", _value * (_object.statusbar:GetWidth()/100) - 18, 0) end - --> right text + --right text local smember_rtext = function(_object, _value) - return _object.textright:SetText (_value) + return _object.textright:SetText(_value) end - --> left text + --left text local smember_ltext = function(_object, _value) - return _object.textleft:SetText (_value) + return _object.textleft:SetText(_value) end - --> right color + --right color local smember_rcolor = function(_object, _value) - local _value1, _value2, _value3, _value4 = DF:ParseColors (_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 + --left color local smember_lcolor = function(_object, _value) - local _value1, _value2, _value3, _value4 = DF:ParseColors (_value) + local _value1, _value2, _value3, _value4 = DF:ParseColors(_value) _object.statusbar:SetStatusBarColor (_value1, _value2, _value3, _value4) _object.texture.original_colors = {_value1, _value2, _value3, _value4} return _object.texture:SetVertexColor (_value1, _value2, _value3, _value4) end - --> right icon + --right icon local smember_ricon = function(_object, _value) - if (type (_value) == "table") then + if (type(_value) == "table") then local _value1, _value2 = _unpack (_value) - _object.iconright:SetTexture (_value1) + _object.iconright:SetTexture(_value1) if (_value2) then _object.iconright:SetTexCoord (_unpack (_value2)) end else - _object.iconright:SetTexture (_value) + _object.iconright:SetTexture(_value) end return end - --> left icon + --left icon local smember_licon = function(_object, _value) - if (type (_value) == "table") then + if (type(_value) == "table") then local _value1, _value2 = _unpack (_value) - _object.iconleft:SetTexture (_value1) + _object.iconleft:SetTexture(_value1) if (_value2) then _object.iconleft:SetTexCoord (_unpack (_value2)) end else - _object.iconleft:SetTexture (_value) + _object.iconleft:SetTexture(_value) end return end - --> texture + --texture local smember_texture = function(_object, _value) - if (type (_value) == "table") then + if (type(_value) == "table") then local _value1, _value2 = _unpack (_value) - _object.texture:SetTexture (_value1) - _object.rightTexture:SetTexture (_value1) + _object.texture:SetTexture(_value1) + _object.rightTexture:SetTexture(_value1) if (_value2) then _object.texture:SetTexCoord (_unpack (_value2)) _object.rightTexture:SetTexCoord (_unpack (_value2)) end else - _object.texture:SetTexture (_value) - _object.rightTexture:SetTexture (_value) + _object.texture:SetTexture(_value) + _object.rightTexture:SetTexture(_value) end return end - --> font face + --font face local smember_textfont = function(_object, _value) DF:SetFontFace (_object.textleft, _value) return DF:SetFontFace (_object.textright, _value) end - --> font size + --font size local smember_textsize = function(_object, _value) DF:SetFontSize (_object.textleft, _value) return DF:SetFontSize (_object.textright, _value) end - --> font color + --font color local smember_textcolor = function(_object, _value) - local _value1, _value2, _value3, _value4 = DF:ParseColors (_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 @@ -331,9 +331,9 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] end ------------------------------------------------------------------------------------------------------------ ---> methods +--methods ---> show & hide +--show & hide function SplitBarMetaFunctions:Show() return self.statusbar:Show() end @@ -348,34 +348,34 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] elseif (value < 0 or value > 100) then return end - self.statusbar:SetValue (value) - self.spark:SetPoint ("left", self.statusbar, "left", value * (self.statusbar:GetWidth()/100) - 18, 0) + self.statusbar:SetValue(value) + self.spark:SetPoint("left", self.statusbar, "left", value * (self.statusbar:GetWidth()/100) - 18, 0) end -- setpoint - function SplitBarMetaFunctions:SetPoint (v1, v2, v3, v4, v5) + function SplitBarMetaFunctions:SetPoint(v1, v2, v3, v4, v5) v1, v2, v3, v4, v5 = DF:CheckPoints (v1, v2, v3, v4, v5, self) if (not v1) then print ("Invalid parameter for SetPoint") return end - return self.widget:SetPoint (v1, v2, v3, v4, v5) + return self.widget:SetPoint(v1, v2, v3, v4, v5) end -- sizes - function SplitBarMetaFunctions:SetSize (w, h) + function SplitBarMetaFunctions:SetSize(w, h) if (w) then - self.statusbar:SetWidth (w) + self.statusbar:SetWidth(w) end if (h) then - self.statusbar:SetHeight (h) + self.statusbar:SetHeight(h) end end -- texture - function SplitBarMetaFunctions:SetTexture (texture) - self.rightTexture:SetTexture (texture) - self.texture:SetTexture (texture) + function SplitBarMetaFunctions:SetTexture(texture) + self.rightTexture:SetTexture(texture) + self.texture:SetTexture(texture) end function SplitBarMetaFunctions:SetBackgroundTexture(texture) @@ -384,26 +384,26 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] -- texts function SplitBarMetaFunctions:SetLeftText (text) - self.textleft:SetText (text) + self.textleft:SetText(text) end function SplitBarMetaFunctions:SetRightText (text) - self.textright:SetText (text) + self.textright:SetText(text) end -- colors function SplitBarMetaFunctions:SetLeftColor (r, g, b, a) - r, g, b, a = DF:ParseColors (r, g, b, a) + r, g, b, a = DF:ParseColors(r, g, b, a) self.texture:SetVertexColor (r, g, b, a) self.texture.original_colors = {r, g, b, a} end function SplitBarMetaFunctions:SetRightColor (r, g, b, a) - r, g, b, a = DF:ParseColors (r, g, b, a) + r, g, b, a = DF:ParseColors(r, g, b, a) self.rightTexture:SetVertexColor (r, g, b, a) self.rightTexture.original_colors = {r, g, b, a} end function SplitBarMetaFunctions:SetBackgroundColor (r, g, b, a) - r, g, b, a = DF:ParseColors (r, g, b, a) + r, g, b, a = DF:ParseColors(r, g, b, a) self.background:SetVertexColor (r, g, b, a) self.background.original_colors = {r, g, b, a} end @@ -418,14 +418,14 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] -- icons function SplitBarMetaFunctions:SetLeftIcon (texture, ...) - self.iconleft:SetTexture (texture) + self.iconleft:SetTexture(texture) if (...) then local L, R, U, D = unpack (...) self.iconleft:SetTexCoord (L, R, U, D) end end function SplitBarMetaFunctions:SetRightIcon (texture, ...) - self.iconright:SetTexture (texture) + self.iconright:SetTexture(texture) if (...) then local L, R, U, D = unpack (...) self.iconright:SetTexCoord (L, R, U, D) @@ -459,7 +459,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] -- frame stratas function SplitBarMetaFunctions:SetFrameStrata (strata) - if (_type (strata) == "table") then + if (_type(strata) == "table") then self.statusbar:SetFrameStrata (strata:GetFrameStrata()) else self.statusbar:SetFrameStrata (strata) @@ -467,7 +467,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] end -- animation - --> animation with acceleration ~animation ~healthbaranimation + --animation with acceleration ~animation ~healthbaranimation local animateLeftWithAccel = function(self, deltaTime) local currentPercent = DetailsFramework:GetRangePercent(self.targetValue, self.startValue, self.currentValue) currentPercent = abs(currentPercent - 1) @@ -560,7 +560,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] end ------------------------------------------------------------------------------------------------------------ ---> scripts +--scripts local OnEnter = function(frame) local capsule = frame.MyObject @@ -633,17 +633,17 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] end local OnSizeChanged = function(statusbar) - statusbar.MyObject.spark:SetPoint ("left", statusbar, "left", statusbar:GetValue() * (statusbar:GetWidth()/100) - 18, 0) + 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 ------------------------------------------------------------------------------------------------------------ ---> object constructor +--object constructor function DetailsFrameworkSplitlBar_OnCreate (self) self.texture.original_colors = {1, 1, 1, 1} self.rightTexture.original_colors = {.5, .5, .5, 1} - self.spark:SetPoint ("left", self, "left", self:GetValue() * (self:GetWidth()/100) - 18, 0) + self.spark:SetPoint("left", self, "left", self:GetValue() * (self:GetWidth()/100) - 18, 0) return true end @@ -653,58 +653,58 @@ end local build_statusbar = function(self) - self:SetSize (300, 14) + self:SetSize(300, 14) - self.background = self:CreateTexture ("$parent_StatusBarBackground", "BACKGROUND") + self.background = self:CreateTexture("$parent_StatusBarBackground", "BACKGROUND") self.background:SetPoint("topright", self, "topright") self.background:SetPoint("bottomright", self, "bottomright") self.background:SetPoint("topleft", self, "topleft") self.background:SetPoint("bottomleft", self, "bottomleft") - self.background:SetTexture ([[Interface\PaperDollInfoFrame\UI-Character-Skills-Bar]]) + self.background:SetTexture([[Interface\PaperDollInfoFrame\UI-Character-Skills-Bar]]) self.background:SetVertexColor (.3, .3, .3, 1) --this is the left texture and it grows to the right, it is embed within the bar by SetStatusBarTexture - self.texture = self:CreateTexture ("$parent_StatusBarTexture", "ARTWORK", nil, 1) + self.texture = self:CreateTexture("$parent_StatusBarTexture", "ARTWORK", nil, 1) self.texture:Hide() - self.texture:SetSize (300, 14) - self.texture:SetTexture ([[Interface\PaperDollInfoFrame\UI-Character-Skills-Bar]]) + self.texture:SetSize(300, 14) + self.texture:SetTexture([[Interface\PaperDollInfoFrame\UI-Character-Skills-Bar]]) --this is the right texture and its size is the bar:GetWidth() - self.texture:GetWidth() - self.rightTexture = self:CreateTexture ("$parent_StatusBarTextureRight", "ARTWORK", nil, 2) + self.rightTexture = self:CreateTexture("$parent_StatusBarTextureRight", "ARTWORK", nil, 2) self.rightTexture:Hide() - self.rightTexture:SetSize (300, 14) - self.rightTexture:SetTexture ([[Interface\PaperDollInfoFrame\UI-Character-Skills-Bar]]) + self.rightTexture:SetSize(300, 14) + self.rightTexture:SetTexture([[Interface\PaperDollInfoFrame\UI-Character-Skills-Bar]]) self.rightTexture:SetPoint("topright", self, "topright") self.rightTexture:SetPoint("bottomright", self, "bottomright") self.rightTexture:SetVertexColor(1, 0, 0) - self.lefticon = self:CreateTexture ("$parent_IconLeft", "OVERLAY") - self.lefticon:SetSize (14, 14) - self.lefticon:SetPoint ("LEFT", self, "LEFT") + self.lefticon = self:CreateTexture("$parent_IconLeft", "OVERLAY") + self.lefticon:SetSize(14, 14) + self.lefticon:SetPoint("LEFT", self, "LEFT") - self.righticon = self:CreateTexture ("$parent_IconRight", "OVERLAY") - self.righticon:SetSize (14, 14) - self.righticon:SetPoint ("RIGHT", self, "RIGHT") + self.righticon = self:CreateTexture("$parent_IconRight", "OVERLAY") + self.righticon:SetSize(14, 14) + self.righticon:SetPoint("RIGHT", self, "RIGHT") - self.spark = self:CreateTexture ("$parent_Spark", "OVERLAY") - self.spark:SetTexture ([[Interface\CastingBar\UI-CastingBar-Spark]]) - self.spark:SetBlendMode ("ADD") - self.spark:SetSize (32, 32) - self.spark:SetPoint ("LEFT", self, "RIGHT", -17, -1) + self.spark = self:CreateTexture("$parent_Spark", "OVERLAY") + self.spark:SetTexture([[Interface\CastingBar\UI-CastingBar-Spark]]) + self.spark:SetBlendMode("ADD") + self.spark:SetSize(32, 32) + self.spark:SetPoint("LEFT", self, "RIGHT", -17, -1) self.lefttext = self:CreateFontString ("$parent_TextLeft", "OVERLAY", "GameFontHighlight") DF:SetFontSize (self.lefttext, 10) - self.lefttext:SetJustifyH ("left") - self.lefttext:SetPoint ("LEFT", self.lefticon, "RIGHT", 3, 0) + self.lefttext:SetJustifyH("left") + self.lefttext:SetPoint("LEFT", self.lefticon, "RIGHT", 3, 0) self.righttext = self:CreateFontString ("$parent_TextRight", "OVERLAY", "GameFontHighlight") DF:SetFontSize (self.righttext, 10) - self.righttext:SetJustifyH ("right") - self.righttext:SetPoint ("RIGHT", self.righticon, "LEFT", -3, 0) + self.righttext:SetJustifyH("right") + self.righttext:SetPoint("RIGHT", self.righticon, "LEFT", -3, 0) self:SetStatusBarTexture (self.texture) self:SetMinMaxValues (1, 100) - self:SetValue (50) + self:SetValue(50) DetailsFrameworkSplitlBar_OnCreate (self) end @@ -740,14 +740,14 @@ function DF:NewSplitBar (parent, container, name, member, w, h) container = container.widget end - --> default members: - --> misc + --default members: + --misc SplitBarObject.locked = false SplitBarObject.container = container SplitBarObject.currentValue = 0.5 - --> create widgets - SplitBarObject.statusbar = CreateFrame ("statusbar", name, parent, "BackdropTemplate") + --create widgets + SplitBarObject.statusbar = CreateFrame("statusbar", name, parent, "BackdropTemplate") build_statusbar (SplitBarObject.statusbar) SplitBarObject.spark = SplitBarObject.statusbar.spark SplitBarObject.widget = SplitBarObject.statusbar @@ -781,7 +781,7 @@ function DF:NewSplitBar (parent, container, name, member, w, h) SplitBarObject.texture = _G [name .. "_StatusBarTexture"] SplitBarObject.rightTexture = _G [name .. "_StatusBarTextureRight"] - --> hooks + --hooks SplitBarObject.HookList = { OnEnter = {}, OnLeave = {}, @@ -792,13 +792,13 @@ function DF:NewSplitBar (parent, container, name, member, w, h) OnSizeChanged = {}, } - SplitBarObject.statusbar:SetScript ("OnEnter", OnEnter) - SplitBarObject.statusbar:SetScript ("OnLeave", OnLeave) - SplitBarObject.statusbar:SetScript ("OnHide", OnHide) - SplitBarObject.statusbar:SetScript ("OnShow", OnShow) - SplitBarObject.statusbar:SetScript ("OnMouseDown", OnMouseDown) - SplitBarObject.statusbar:SetScript ("OnMouseUp", OnMouseUp) - SplitBarObject.statusbar:SetScript ("OnSizeChanged", OnSizeChanged) + SplitBarObject.statusbar:SetScript("OnEnter", OnEnter) + SplitBarObject.statusbar:SetScript("OnLeave", OnLeave) + SplitBarObject.statusbar:SetScript("OnHide", OnHide) + SplitBarObject.statusbar:SetScript("OnShow", OnShow) + SplitBarObject.statusbar:SetScript("OnMouseDown", OnMouseDown) + SplitBarObject.statusbar:SetScript("OnMouseUp", OnMouseUp) + SplitBarObject.statusbar:SetScript("OnSizeChanged", OnSizeChanged) _setmetatable (SplitBarObject, SplitBarMetaFunctions) diff --git a/Libs/DF/textentry.lua b/Libs/DF/textentry.lua index c486a181..8fe52016 100644 --- a/Libs/DF/textentry.lua +++ b/Libs/DF/textentry.lua @@ -5,7 +5,7 @@ if (not DF or not DetailsFrameworkCanLoad) then end local _ -local loadstring = loadstring --> lua local +local loadstring = loadstring --lua local local APITextEntryFunctions = false do @@ -154,7 +154,7 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1 --text horizontal pos local smember_horizontalpos = function(object, value) - return object.editbox:SetJustifyH (string.lower(value)) + return object.editbox:SetJustifyH(string.lower(value)) end TextEntryMetaFunctions.SetMembers = TextEntryMetaFunctions.SetMembers or {} @@ -244,8 +244,8 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1 function TextEntryMetaFunctions:Enable() if (not self.editbox:IsEnabled()) then self.editbox:Enable() - self.editbox:SetBackdropBorderColor (unpack (self.enabled_border_color)) - self.editbox:SetBackdropColor (unpack (self.enabled_backdrop_color)) + self.editbox:SetBackdropBorderColor(unpack (self.enabled_border_color)) + self.editbox:SetBackdropColor(unpack (self.enabled_backdrop_color)) self.editbox:SetTextColor (unpack (self.enabled_text_color)) if (self.editbox.borderframe) then local r, g, b, a = DF:ParseColors(unpack(self.editbox.borderframe.onleave_backdrop)) @@ -283,7 +283,7 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1 end ------------------------------------------------------------------------------------------------------------ ---> scripts and hooks +--scripts and hooks local OnEnter = function(textentry) local capsule = textentry.MyObject @@ -303,7 +303,7 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1 if (textentry:IsEnabled()) then textentry.current_bordercolor = textentry.current_bordercolor or {textentry:GetBackdropBorderColor()} - textentry:SetBackdropBorderColor (1, 1, 1, 1) + textentry:SetBackdropBorderColor(1, 1, 1, 1) end end @@ -322,7 +322,7 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1 textentry.mouse_over = false if (textentry:IsEnabled()) then - textentry:SetBackdropBorderColor (unpack (textentry.current_bordercolor)) + textentry:SetBackdropBorderColor(unpack (textentry.current_bordercolor)) end end @@ -364,12 +364,12 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1 textentry.MyObject.func(textentry.MyObject.param1, textentry.MyObject.param2, text, textentry, byScript or textentry) end else - textentry:SetText ("") + textentry:SetText("") textentry.MyObject.currenttext = "" end if (not object.NoClearFocusOnEnterPressed) then - textentry.focuslost = true --> quando estiver editando e clicar em outra caixa + textentry.focuslost = true --quando estiver editando e clicar em outra caixa textentry:ClearFocus() if (textentry.MyObject.tab_on_enter and textentry.MyObject.next) then textentry.MyObject.next:SetFocus() @@ -483,23 +483,23 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1 function TextEntryMetaFunctions:SetTemplate (template) if (template.width) then - self.editbox:SetWidth (template.width) + self.editbox:SetWidth(template.width) end if (template.height) then - self.editbox:SetHeight (template.height) + self.editbox:SetHeight(template.height) end if (template.backdrop) then - self.editbox:SetBackdrop (template.backdrop) + self.editbox:SetBackdrop(template.backdrop) end if (template.backdropcolor) then - local r, g, b, a = DF:ParseColors (template.backdropcolor) - self.editbox:SetBackdropColor (r, g, b, a) + local r, g, b, a = DF:ParseColors(template.backdropcolor) + self.editbox:SetBackdropColor(r, g, b, a) self.onleave_backdrop = {r, g, b, a} end if (template.backdropbordercolor) then - local r, g, b, a = DF:ParseColors (template.backdropbordercolor) - self.editbox:SetBackdropBorderColor (r, g, b, a) + local r, g, b, a = DF:ParseColors(template.backdropbordercolor) + self.editbox:SetBackdropBorderColor(r, g, b, a) self.editbox.current_bordercolor[1] = r self.editbox.current_bordercolor[2] = g self.editbox.current_bordercolor[3] = b @@ -509,7 +509,7 @@ function TextEntryMetaFunctions:SetTemplate (template) end ------------------------------------------------------------------------------------------------------------ ---> object constructor +--object constructor function DF:CreateTextEntry (parent, func, w, h, member, name, with_label, entry_template, label_template) return DF:NewTextEntry (parent, parent, name, member, w, h, func, nil, nil, nil, with_label, entry_template, label_template) @@ -547,8 +547,8 @@ function DF:NewTextEntry (parent, container, name, member, w, h, func, param1, p container = container.widget end - --> default members: - --> hooks + --default members: + --hooks TextEntryObject.OnEnterHook = nil TextEntryObject.OnLeaveHook = nil TextEntryObject.OnHideHook = nil @@ -561,17 +561,17 @@ function DF:NewTextEntry (parent, container, name, member, w, h, func, param1, p TextEntryObject.OnTextChangedHook = nil TextEntryObject.OnTabPressedHook = nil - --> misc + --misc TextEntryObject.container = container TextEntryObject.have_tooltip = nil - TextEntryObject.editbox = CreateFrame ("EditBox", name, parent,"BackdropTemplate") - TextEntryObject.editbox:SetSize (232, 20) - TextEntryObject.editbox:SetBackdrop ({bgFile = [["Interface\DialogFrame\UI-DialogBox-Background"]], tileSize = 64, tile = true, edgeFile = [[Interface\DialogFrame\UI-DialogBox-Border]], edgeSize = 10, insets = {left = 1, right = 1, top = 0, bottom = 0}}) + TextEntryObject.editbox = CreateFrame("EditBox", name, parent,"BackdropTemplate") + TextEntryObject.editbox:SetSize(232, 20) + TextEntryObject.editbox:SetBackdrop({bgFile = [["Interface\DialogFrame\UI-DialogBox-Background"]], tileSize = 64, tile = true, edgeFile = [[Interface\DialogFrame\UI-DialogBox-Border]], edgeSize = 10, insets = {left = 1, right = 1, top = 0, bottom = 0}}) TextEntryObject.editbox.label = TextEntryObject.editbox:CreateFontString ("$parent_Desc", "OVERLAY", "GameFontHighlightSmall") - TextEntryObject.editbox.label:SetJustifyH ("left") - TextEntryObject.editbox.label:SetPoint ("RIGHT", TextEntryObject.editbox, "LEFT", -2, 0) + TextEntryObject.editbox.label:SetJustifyH("left") + TextEntryObject.editbox.label:SetPoint("RIGHT", TextEntryObject.editbox, "LEFT", -2, 0) TextEntryObject.widget = TextEntryObject.editbox @@ -600,18 +600,18 @@ function DF:NewTextEntry (parent, container, name, member, w, h, func, param1, p end end - TextEntryObject.editbox:SetWidth (w) - TextEntryObject.editbox:SetHeight (h) + TextEntryObject.editbox:SetWidth(w) + TextEntryObject.editbox:SetHeight(h) - TextEntryObject.editbox:SetJustifyH ("center") + TextEntryObject.editbox:SetJustifyH("center") TextEntryObject.editbox:EnableMouse (true) - TextEntryObject.editbox:SetText ("") + TextEntryObject.editbox:SetText("") TextEntryObject.editbox:SetAutoFocus (false) TextEntryObject.editbox:SetFontObject ("GameFontHighlightSmall") TextEntryObject.editbox.current_bordercolor = {1, 1, 1, 0.7} - TextEntryObject.editbox:SetBackdropBorderColor (1, 1, 1, 0.7) + TextEntryObject.editbox:SetBackdropBorderColor(1, 1, 1, 0.7) TextEntryObject.enabled_border_color = {TextEntryObject.editbox:GetBackdropBorderColor()} TextEntryObject.enabled_backdrop_color = {TextEntryObject.editbox:GetBackdropColor()} TextEntryObject.enabled_text_color = {TextEntryObject.editbox:GetTextColor()} @@ -626,10 +626,10 @@ function DF:NewTextEntry (parent, container, name, member, w, h, func, param1, p TextEntryObject.tab_on_enter = false TextEntryObject.label = _G [name .. "_Desc"] - TextEntryObject.editbox:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, insets = {left = 1, right = 1, top = 1, bottom = 1}}) - TextEntryObject.editbox:SetBackdropColor (.2, .2, .2, 1) + TextEntryObject.editbox:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, insets = {left = 1, right = 1, top = 1, bottom = 1}}) + TextEntryObject.editbox:SetBackdropColor(.2, .2, .2, 1) - --> hooks + --hooks TextEntryObject.HookList = { OnEnter = {}, OnLeave = {}, @@ -645,26 +645,26 @@ function DF:NewTextEntry (parent, container, name, member, w, h, func, param1, p OnTabPressed = {}, } - TextEntryObject.editbox:SetScript ("OnEnter", OnEnter) - TextEntryObject.editbox:SetScript ("OnLeave", OnLeave) - TextEntryObject.editbox:SetScript ("OnHide", OnHide) - TextEntryObject.editbox:SetScript ("OnShow", OnShow) + TextEntryObject.editbox:SetScript("OnEnter", OnEnter) + TextEntryObject.editbox:SetScript("OnLeave", OnLeave) + TextEntryObject.editbox:SetScript("OnHide", OnHide) + TextEntryObject.editbox:SetScript("OnShow", OnShow) - TextEntryObject.editbox:SetScript ("OnEnterPressed", OnEnterPressed) - TextEntryObject.editbox:SetScript ("OnEscapePressed", OnEscapePressed) - TextEntryObject.editbox:SetScript ("OnSpacePressed", OnSpacePressed) - TextEntryObject.editbox:SetScript ("OnEditFocusLost", OnEditFocusLost) - TextEntryObject.editbox:SetScript ("OnEditFocusGained", OnEditFocusGained) - TextEntryObject.editbox:SetScript ("OnChar", OnChar) - TextEntryObject.editbox:SetScript ("OnTextChanged", OnTextChanged) - TextEntryObject.editbox:SetScript ("OnTabPressed", OnTabPressed) + TextEntryObject.editbox:SetScript("OnEnterPressed", OnEnterPressed) + TextEntryObject.editbox:SetScript("OnEscapePressed", OnEscapePressed) + TextEntryObject.editbox:SetScript("OnSpacePressed", OnSpacePressed) + TextEntryObject.editbox:SetScript("OnEditFocusLost", OnEditFocusLost) + TextEntryObject.editbox:SetScript("OnEditFocusGained", OnEditFocusGained) + TextEntryObject.editbox:SetScript("OnChar", OnChar) + TextEntryObject.editbox:SetScript("OnTextChanged", OnTextChanged) + TextEntryObject.editbox:SetScript("OnTabPressed", OnTabPressed) setmetatable (TextEntryObject, TextEntryMetaFunctions) if (with_label) then - local label = DF:CreateLabel (TextEntryObject.editbox, with_label, nil, nil, nil, "label", nil, "overlay") + local label = DF:CreateLabel(TextEntryObject.editbox, with_label, nil, nil, nil, "label", nil, "overlay") label.text = with_label - TextEntryObject.editbox:SetPoint ("left", label.widget, "right", 2, 0) + TextEntryObject.editbox:SetPoint("left", label.widget, "right", 2, 0) if (label_template) then label:SetTemplate (label_template) end @@ -682,8 +682,8 @@ end function DF:NewSpellEntry (parent, func, w, h, param1, param2, member, name) local editbox = DF:NewTextEntry (parent, parent, name, member, w, h, func, param1, param2) --- editbox:SetHook ("OnEditFocusGained", SpellEntryOnEditFocusGained) --- editbox:SetHook ("OnTextChanged", SpellEntryOnTextChanged) +-- editbox:SetHook("OnEditFocusGained", SpellEntryOnEditFocusGained) +-- editbox:SetHook("OnTextChanged", SpellEntryOnTextChanged) return editbox end @@ -692,7 +692,7 @@ local function_gettext = function(self) return self.editbox:GetText() end local function_settext = function(self, text) - return self.editbox:SetText (text) + return self.editbox:SetText(text) end local function_clearfocus = function(self) return self.editbox:ClearFocus() @@ -833,10 +833,10 @@ local AutoComplete_OnTextChanged = function(editboxWidget, byUser, capsule) local chars_now = editboxWidget:GetText():len() if (not editboxWidget.ignore_textchange) then - --> backspace + --backspace if (chars_now == capsule.characters_count -1) then capsule.lastword = capsule.lastword:sub (1, capsule.lastword:len()-1) - --> delete lots of text + --delete lots of text elseif (chars_now < capsule.characters_count) then --o auto complete selecionou outra palavra bem menor e caiu nesse filtro editboxWidget.end_selection = nil @@ -1043,12 +1043,12 @@ function TextEntryMetaFunctions:SetAsAutoComplete (poolName, poolTable, shouldOp self.NoClearFocusOnEnterPressed = true --avoid auto clear focus self.ShouldOptimizeAutoComplete = shouldOptimize - self:SetHook ("OnEditFocusGained", AutoComplete_OnEditFocusGained) - self:SetHook ("OnEnterPressed", AutoComplete_OnEnterPressed) + self:SetHook("OnEditFocusGained", AutoComplete_OnEditFocusGained) + self:SetHook("OnEnterPressed", AutoComplete_OnEnterPressed) self.editbox:HookScript ("OnEscapePressed", AutoComplete_OnEscapePressed) - self.editbox:SetScript ("OnTextChanged", AutoComplete_OnTextChanged) - self.editbox:SetScript ("OnChar", AutoComplete_OnChar) - self.editbox:SetScript ("OnSpacePressed", AutoComplete_OnSpacePressed) + self.editbox:SetScript("OnTextChanged", AutoComplete_OnTextChanged) + self.editbox:SetScript("OnChar", AutoComplete_OnChar) + self.editbox:SetScript("OnSpacePressed", AutoComplete_OnSpacePressed) end end @@ -1067,36 +1067,36 @@ function DF:NewSpecialLuaEditorEntry (parent, w, h, member, name, nointent, show name = name:gsub ("$parent", parentName) end - local borderframe = CreateFrame ("Frame", name, parent,"BackdropTemplate") - borderframe:SetSize (w, h) + local borderframe = CreateFrame("Frame", name, parent,"BackdropTemplate") + borderframe:SetSize(w, h) if (member) then parent [member] = borderframe end - local scrollframe = CreateFrame ("ScrollFrame", name, borderframe, "UIPanelScrollFrameTemplate, BackdropTemplate") - local scrollframeNumberLines = CreateFrame ("ScrollFrame", name .. "NumberLines", borderframe, "UIPanelScrollFrameTemplate, BackdropTemplate") + local scrollframe = CreateFrame("ScrollFrame", name, borderframe, "UIPanelScrollFrameTemplate, BackdropTemplate") + local scrollframeNumberLines = CreateFrame("ScrollFrame", name .. "NumberLines", borderframe, "UIPanelScrollFrameTemplate, BackdropTemplate") - scrollframe.editbox = CreateFrame ("editbox", "$parentEditBox", scrollframe,"BackdropTemplate") + scrollframe.editbox = CreateFrame("editbox", "$parentEditBox", scrollframe,"BackdropTemplate") scrollframe.editbox:SetMultiLine (true) scrollframe.editbox:SetAutoFocus (false) - scrollframe.editbox:SetScript ("OnCursorChanged", _G.ScrollingEdit_OnCursorChanged) - scrollframe.editbox:SetScript ("OnEscapePressed", _G.EditBox_ClearFocus) + scrollframe.editbox:SetScript("OnCursorChanged", _G.ScrollingEdit_OnCursorChanged) + scrollframe.editbox:SetScript("OnEscapePressed", _G.EditBox_ClearFocus) scrollframe.editbox:SetFontObject ("GameFontHighlightSmall") scrollframe:SetScrollChild (scrollframe.editbox) --line number if (showLineNumbers) then - scrollframeNumberLines.editbox = CreateFrame ("editbox", "$parentLineNumbers", scrollframeNumberLines, "BackdropTemplate") + scrollframeNumberLines.editbox = CreateFrame("editbox", "$parentLineNumbers", scrollframeNumberLines, "BackdropTemplate") scrollframeNumberLines.editbox:SetMultiLine (true) scrollframeNumberLines.editbox:SetAutoFocus (false) scrollframeNumberLines.editbox:SetEnabled (false) scrollframeNumberLines.editbox:SetFontObject ("GameFontHighlightSmall") - scrollframeNumberLines.editbox:SetJustifyH ("left") + scrollframeNumberLines.editbox:SetJustifyH("left") scrollframeNumberLines.editbox:SetJustifyV ("top") scrollframeNumberLines.editbox:SetTextColor(.3, .3, .3, .5) - scrollframeNumberLines.editbox:SetPoint ("topleft", borderframe, "topleft", 10, -10) - scrollframeNumberLines.editbox:SetPoint ("bottomright", borderframe, "bottomright", -30, 10) + scrollframeNumberLines.editbox:SetPoint("topleft", borderframe, "topleft", 10, -10) + scrollframeNumberLines.editbox:SetPoint("bottomright", borderframe, "bottomright", -30, 10) scrollframeNumberLines:SetScrollChild (scrollframeNumberLines.editbox) scrollframeNumberLines:EnableMouseWheel (false) @@ -1106,24 +1106,24 @@ function DF:NewSpecialLuaEditorEntry (parent, w, h, member, name, nointent, show end --place the lua code field 20 pixels to the right to make run to the lines scroll - scrollframe:SetPoint ("topleft", borderframe, "topleft", 30, -10) - scrollframe:SetPoint ("bottomright", borderframe, "bottomright", -10, 10) + scrollframe:SetPoint("topleft", borderframe, "topleft", 30, -10) + 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) --place the number lines scroll in the begining of the editing code space - scrollframeNumberLines:SetPoint ("topleft", borderframe, "topleft", 10, -10) - scrollframeNumberLines:SetPoint ("bottomright", borderframe, "bottomright", -10, 10) + scrollframeNumberLines:SetPoint("topleft", borderframe, "topleft", 10, -10) + scrollframeNumberLines:SetPoint("bottomright", borderframe, "bottomright", -10, 10) - scrollframeNumberLines.editbox:SetJustifyH ("left") + scrollframeNumberLines.editbox:SetJustifyH("left") scrollframeNumberLines.editbox:SetJustifyV ("top") - scrollframeNumberLines:SetScript ("OnSizeChanged", function(self) - scrollframeNumberLines.editbox:SetSize (self:GetSize()) + scrollframeNumberLines:SetScript("OnSizeChanged", function(self) + scrollframeNumberLines.editbox:SetSize(self:GetSize()) scrollframeNumberLines.ScrollBar:Hide() end) @@ -1140,20 +1140,20 @@ function DF:NewSpecialLuaEditorEntry (parent, w, h, member, name, nointent, show scrollframeNumberLines.editbox:SetBackdrop(nil) else - scrollframe:SetPoint ("topleft", borderframe, "topleft", 10, -10) - scrollframe:SetPoint ("bottomright", borderframe, "bottomright", -10, 10) - scrollframeNumberLines:SetPoint ("topleft", borderframe, "topleft", 10, -10) - scrollframeNumberLines:SetPoint ("bottomright", borderframe, "bottomright", -10, 10) + scrollframe:SetPoint("topleft", borderframe, "topleft", 10, -10) + scrollframe:SetPoint("bottomright", borderframe, "bottomright", -10, 10) + scrollframeNumberLines:SetPoint("topleft", borderframe, "topleft", 10, -10) + scrollframeNumberLines:SetPoint("bottomright", borderframe, "bottomright", -10, 10) scrollframeNumberLines:Hide() end borderframe.SetAsAutoComplete = TextEntryMetaFunctions.SetAsAutoComplete - scrollframe:SetScript ("OnSizeChanged", function(self) - scrollframe.editbox:SetSize (self:GetSize()) + scrollframe:SetScript("OnSizeChanged", function(self) + scrollframe.editbox:SetSize(self:GetSize()) end) - scrollframe.editbox:SetJustifyH ("left") + scrollframe.editbox:SetJustifyH("left") scrollframe.editbox:SetJustifyV ("top") scrollframe.editbox:SetMaxBytes (1024000) scrollframe.editbox:SetMaxLetters (128000) @@ -1173,12 +1173,12 @@ function DF:NewSpecialLuaEditorEntry (parent, w, h, member, name, nointent, show IndentationLib.enable (scrollframe.editbox, nil, 4) end - borderframe:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]], + borderframe:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]], tile = 1, tileSize = 16, edgeSize = 16, insets = {left = 5, right = 5, top = 5, bottom = 5}}) scrollframe.editbox.current_bordercolor = {1, 1, 1, 0.7} - borderframe:SetBackdropBorderColor (1, 1, 1, 0.7) - borderframe:SetBackdropColor (0.090195, 0.090195, 0.188234, 1) + borderframe:SetBackdropBorderColor(1, 1, 1, 0.7) + borderframe:SetBackdropColor(0.090195, 0.090195, 0.188234, 1) borderframe.enabled_border_color = {borderframe:GetBackdropBorderColor()} borderframe.enabled_backdrop_color = {borderframe:GetBackdropColor()} diff --git a/Libs/DF/timebar.lua b/Libs/DF/timebar.lua index c9ff4899..0de9ff20 100644 --- a/Libs/DF/timebar.lua +++ b/Libs/DF/timebar.lua @@ -414,7 +414,7 @@ function DF:CreateTimeBar(parent, texture, width, height, value, member, name) end end - --> create widgets + --create widgets timeBar.statusBar:SetWidth(width) timeBar.statusBar:SetHeight(height) timeBar.statusBar:SetFrameLevel(parent:GetFrameLevel()+1) @@ -445,7 +445,7 @@ function DF:CreateTimeBar(parent, texture, width, height, value, member, name) timeBar.statusBar.rightText:SetPoint("right", timeBar.statusBar, "right", -2, 0) timeBar.statusBar.rightText:SetJustifyH("left") - --> hooks + --hooks timeBar.HookList = { OnEnter = {}, OnLeave = {}, diff --git a/Libs/LibGraph-2.0/LibGraph-2.0.lua b/Libs/LibGraph-2.0/LibGraph-2.0.lua index 20620942..fe8a6e6b 100644 --- a/Libs/LibGraph-2.0/LibGraph-2.0.lua +++ b/Libs/LibGraph-2.0/LibGraph-2.0.lua @@ -1292,14 +1292,14 @@ function GraphFunctions:SetYLabels(Left, Right) end function GraphFunctions:SetLineTexture(texture) - if (type (texture) ~= "string") then + if (type(texture) ~= "string") then return assert (false, "Parameter 1 for SetLineTexture must be a string") end - --> full path + --full path if (texture:find ("\\") or texture:find ("//")) then self.CustomLine = texture - --> using an image inside lib-graph folder + --using an image inside lib-graph folder else self.CustomLine = TextureDirectory..texture end @@ -1308,7 +1308,7 @@ end function GraphFunctions:SetBorderSize(border, size) border = string.lower (border) - if (type (size) ~= "number") then + if (type(size) ~= "number") then return assert (false, "Parameter 2 for SetBorderSize must be a number") end @@ -1711,7 +1711,7 @@ function GraphFunctions:RefreshLineGraph() if not self.LockOnXMin then if (self.CustomLeftBorder) then - self.XMin = MinX + self.CustomLeftBorder --> custom size of left border + self.XMin = MinX + self.CustomLeftBorder --custom size of left border else self.XMin = MinX - XBorder end @@ -1719,7 +1719,7 @@ function GraphFunctions:RefreshLineGraph() if not self.LockOnXMax then if (self.CustomRightBorder) then - self.XMax = MaxX + self.CustomRightBorder --> custom size of right border + self.XMax = MaxX + self.CustomRightBorder --custom size of right border else self.XMax = MaxX + XBorder end @@ -1727,7 +1727,7 @@ function GraphFunctions:RefreshLineGraph() if not self.LockOnYMin then if (self.CustomBottomBorder) then - self.YMin = MinY + self.CustomBottomBorder --> custom size of bottom border + self.YMin = MinY + self.CustomBottomBorder --custom size of bottom border else self.YMin = MinY - YBorder end @@ -1735,7 +1735,7 @@ function GraphFunctions:RefreshLineGraph() if not self.LockOnYMax then if (self.CustomTopBorder) then - self.YMax = MaxY + self.CustomTopBorder --> custom size of top border + self.YMax = MaxY + self.CustomTopBorder --custom size of top border else self.YMax = MaxY + YBorder end @@ -1905,11 +1905,11 @@ function lib:DrawLine(C, sx, sy, ex, ey, w, color, layer, linetexture) local T = tremove(C.GraphLib_Lines) or C:CreateTexture(nil, "ARTWORK") - if linetexture then --> this data series texture + if linetexture then --this data series texture T:SetTexture(linetexture) - elseif C.CustomLine then --> overall chart texture + elseif C.CustomLine then --overall chart texture T:SetTexture(C.CustomLine) - else --> no texture assigned, use default + else --no texture assigned, use default T:SetTexture(TextureDirectory.."line") end diff --git a/Libs/LibOpenRaid/Deprecated.lua b/Libs/LibOpenRaid/Deprecated.lua index cb5c7835..913d6c73 100644 --- a/Libs/LibOpenRaid/Deprecated.lua +++ b/Libs/LibOpenRaid/Deprecated.lua @@ -6,7 +6,7 @@ end local openRaidLib = LibStub:GetLibrary("LibOpenRaid-1.0") ---> comm prefix deprecated +--comm prefix deprecated openRaidLib.commPrefixDeprecated = { } @@ -25,7 +25,7 @@ local spamLimit = {} end end ---> deprecated: 'RequestAllPlayersInfo' has been replaced by 'RequestAllData' +--deprecated: 'RequestAllPlayersInfo' has been replaced by 'RequestAllData' function openRaidLib.RequestAllPlayersInfo() if (not spamLimit["openRaidLib.RequestAllData"]) then spamLimit["openRaidLib.RequestAllData"] = true @@ -33,7 +33,7 @@ local spamLimit = {} end end ---> deprecated: 'playerInfoManager' has been replaced by 'UnitInfoManager' +--deprecated: 'playerInfoManager' has been replaced by 'UnitInfoManager' openRaidLib.playerInfoManager = {} local deprecatedMetatable = { __newindex = function() @@ -63,7 +63,7 @@ local spamLimit = {} end setmetatable(openRaidLib.playerInfoManager, deprecatedMetatable) ---> deprecated: 'gearManager' has been replaced by 'GearManager' +--deprecated: 'gearManager' has been replaced by 'GearManager' openRaidLib.gearManager = {} local deprecatedMetatable = { __newindex = function() @@ -91,7 +91,7 @@ local spamLimit = {} end setmetatable(openRaidLib.gearManager, deprecatedMetatable) ---> deprecated: 'cooldownManager' has been replaced by 'CooldownManager' +--deprecated: 'cooldownManager' has been replaced by 'CooldownManager' openRaidLib.cooldownManager = {} local deprecatedMetatable = { __newindex = function() diff --git a/Libs/LibOpenRaid/GetPlayerInformation.lua b/Libs/LibOpenRaid/GetPlayerInformation.lua index 33750d8f..7fa73e67 100644 --- a/Libs/LibOpenRaid/GetPlayerInformation.lua +++ b/Libs/LibOpenRaid/GetPlayerInformation.lua @@ -268,7 +268,7 @@ function openRaidLib.GearManager.GetPlayerGemsAndEnchantInfo() local _, itemId, enchantId, gemId1, gemId2, gemId3, gemId4, suffixId, uniqueId, levelOfTheItem, specId, upgradeInfo, instanceDifficultyId, numBonusIds, restLink = strsplit(":", itemLink) local gemsIds = {gemId1, gemId2, gemId3, gemId4} - --> enchant + --enchant --check if the slot can receive enchat and if the equipment has an enchant local enchantAttribute = LIB_OPEN_RAID_ENCHANT_SLOTS[equipmentSlotId] if (enchantAttribute) then --this slot can receive an enchat @@ -276,7 +276,7 @@ function openRaidLib.GearManager.GetPlayerGemsAndEnchantInfo() --check if this slot is relevant for the class, some slots can have enchants only for Agility which won't matter for Priests as an example --if the value is an integer it points to an attribute (int, dex, str), otherwise it's true (boolean) local slotIsRelevant = true - if (type (enchantAttribute) == "number") then + if (type(enchantAttribute) == "number") then if (specMainAttribute ~= enchantAttribute) then slotIsRelevant = false end @@ -302,7 +302,7 @@ function openRaidLib.GearManager.GetPlayerGemsAndEnchantInfo() end end - --> gems + --gems local itemStatsTable = {} --fill the table above with information about the item GetItemStats(itemLink, itemStatsTable) diff --git a/Libs/LibOpenRaid/LibOpenRaid.lua b/Libs/LibOpenRaid/LibOpenRaid.lua index c1083f83..f5466a0b 100644 --- a/Libs/LibOpenRaid/LibOpenRaid.lua +++ b/Libs/LibOpenRaid/LibOpenRaid.lua @@ -174,7 +174,7 @@ LIB_OPEN_RAID_CAN_LOAD = false end -------------------------------------------------------------------------------------------------------------------------------- ---> ~comms +--~comms openRaidLib.commHandler = {} function openRaidLib.commHandler.OnReceiveComm(self, event, prefix, text, channel, sender, target, zoneChannelID, localID, name, instanceID) @@ -317,7 +317,7 @@ LIB_OPEN_RAID_CAN_LOAD = false -------------------------------------------------------------------------------------------------------------------------------- ---> ~schedule ~timers +--~schedule ~timers openRaidLib.Schedules = { registeredUniqueTimers = {} @@ -396,7 +396,7 @@ LIB_OPEN_RAID_CAN_LOAD = false -------------------------------------------------------------------------------------------------------------------------------- ---> ~public ~callbacks +--~public ~callbacks --these are the events where other addons can register and receive calls local allPublicCallbacks = { "CooldownListUpdate", @@ -494,7 +494,7 @@ LIB_OPEN_RAID_CAN_LOAD = false -------------------------------------------------------------------------------------------------------------------------------- ---> ~internal ~callbacks +--~internal ~callbacks --internally, each module can register events through the internal callback to be notified when something happens in the game openRaidLib.internalCallback = {} @@ -590,7 +590,7 @@ LIB_OPEN_RAID_CAN_LOAD = false openRaidLib.RequestAllData() end - --> this part is under development + --this part is under development if (Details) then local detailsEventListener = Details:CreateEventListener() @@ -733,7 +733,7 @@ LIB_OPEN_RAID_CAN_LOAD = false -------------------------------------------------------------------------------------------------------------------------------- ---> ~main ~control +--~main ~control openRaidLib.mainControl = { playerAliveStatus = {}, @@ -765,15 +765,15 @@ LIB_OPEN_RAID_CAN_LOAD = false --called on every player_entering_world event openRaidLib.mainControl.UpdatePlayerData = function() local unitName = UnitName("player") - --> player data + --player data local playerFullInfo = openRaidLib.UnitInfoManager.GetPlayerFullInfo() openRaidLib.UnitInfoManager.AddUnitInfo(unitName, unpack(playerFullInfo)) - --> gear info + --gear info local playerGearInfo = openRaidLib.GearManager.GetPlayerFullGearInfo() openRaidLib.GearManager.AddUnitGearList(unitName, unpack(playerGearInfo)) - --> cooldowns + --cooldowns openRaidLib.CooldownManager.UpdatePlayerCooldownsLocally() end @@ -871,7 +871,7 @@ LIB_OPEN_RAID_CAN_LOAD = false -------------------------------------------------------------------------------------------------------------------------------- ---> ~all, request data from all players +--~all, request data from all players --send a request to all players in the group to send their data function openRaidLib.RequestAllData() @@ -906,9 +906,9 @@ LIB_OPEN_RAID_CAN_LOAD = false -------------------------------------------------------------------------------------------------------------------------------- ---> ~player general ~info ~unit +--~player general ~info ~unit - --> API calls + --API calls --return a table containing all information of units --format: [playerName-realm] = {information} function openRaidLib.GetAllUnitsInfo() @@ -921,7 +921,7 @@ LIB_OPEN_RAID_CAN_LOAD = false return openRaidLib.UnitInfoManager.GetUnitInfo(unitName) end - --> manager constructor + --manager constructor openRaidLib.UnitInfoManager = { --structure: --[playerName] = {ilevel = 100, durability = 100, weaponEnchant = 0, noGems = {}, noEnchants = {}} @@ -1199,7 +1199,7 @@ openRaidLib.internalCallback.RegisterCallback("onLeaveCombat", openRaidLib.UnitI -------------------------------------------------------------------------------------------------------------------------------- ---> ~equipment +--~equipment openRaidLib.GearManager = { --structure: [playerName] = {ilevel = 100, durability = 100, weaponEnchant = 0, noGems = {}, noEnchants = {}} UnitData = {}, @@ -1397,7 +1397,7 @@ openRaidLib.internalCallback.RegisterCallback("onLeaveCombat", openRaidLib.UnitI -------------------------------------------------------------------------------------------------------------------------------- ---> ~cooldowns +--~cooldowns openRaidLib.CooldownManager = { UnitData = {}, --stores the list of cooldowns each player has sent UnitDataFilterCache = {}, --same as the table above but cooldowns are separated has offensive, defensive, etc. FilterCooldowns in functions.lua @@ -1527,7 +1527,7 @@ function openRaidLib.CooldownManager.CooldownSpellUpdate(unitName, spellId, newT unitCooldownTable[spellId] = spellIdTable end ---> API Calls +--API Calls --return a table with unit names as key and a table with unit cooldowns as the value --table format: [playerName] = {[spellId] = cooldownInfo} function openRaidLib.GetAllUnitsCooldown() @@ -1641,7 +1641,7 @@ end return calculatePercent(timeOffset, duration, updateTime, charges) end ---> internals +--internals function openRaidLib.CooldownManager.OnPlayerCast(event, spellId, isPlayerPet) --~cast --player casted a spell, check if the spell is registered as cooldown local playerSpec = openRaidLib.GetPlayerSpecId() @@ -2005,10 +2005,10 @@ end openRaidLib.commHandler.RegisterComm(CONST_COMM_COOLDOWNREQUEST_PREFIX, openRaidLib.CooldownManager.OnReceiveRequestForCooldownInfoUpdate) -------------------------------------------------------------------------------------------------------------------------------- ---> ~keystones +--~keystones --public callback does not check if the keystone has changed from the previous callback - --> API calls + --API calls --return a table containing all information of units --format: [playerName-realm] = {information} function openRaidLib.GetAllKeystonesInfo() @@ -2073,7 +2073,7 @@ openRaidLib.commHandler.RegisterComm(CONST_COMM_COOLDOWNREQUEST_PREFIX, openRaid return true end - --> manager constructor + --manager constructor openRaidLib.KeystoneInfoManager = { --structure: --[playerName] = {level = 2, mapID = 222} @@ -2278,7 +2278,7 @@ end) -------------------------------------------------------------------------------------------------------------------------------- ---> data +--data --vintage cooldown tracker and interrupt tracker C_Timer.After(0.1, function() diff --git a/Libs/LibOpenRaid/ThingsToMantain.lua b/Libs/LibOpenRaid/ThingsToMantain.lua index 70d19c80..7fef0ef1 100644 --- a/Libs/LibOpenRaid/ThingsToMantain.lua +++ b/Libs/LibOpenRaid/ThingsToMantain.lua @@ -3,6 +3,11 @@ if (not LIB_OPEN_RAID_CAN_LOAD) then + if (not LIB_OPEN_RAID_COOLDOWNS_INFO) then + --the lib isn't loading in WotLK, some addons break due to this table not being initialized + LIB_OPEN_RAID_COOLDOWNS_INFO = {} + LIB_OPEN_RAID_COOLDOWNS_BY_SPEC = {} + end return end @@ -472,6 +477,11 @@ elseif (isExpansion_Dragonflight()) then } end + +--end of per expansion content +-------------------------------------------------------------------------------------------- + + LIB_OPEN_RAID_MELEE_SPECS = { [251] = "DEATHKNIGHT", [252] = "DEATHKNIGHT", @@ -493,6 +503,7 @@ LIB_OPEN_RAID_MELEE_SPECS = { --if talent is required, use the command: --/dump GetTalentInfo (talentTier, talentColumn, 1) --example: to get the second talent of the last talent line, use: /dump GetTalentInfo (7, 2, 1) + LIB_OPEN_RAID_COOLDOWNS_INFO = { -- Filter Types: diff --git a/Libs/LibOpenRaid/docs.txt b/Libs/LibOpenRaid/docs.txt index 6d3f66ef..1bf671cf 100644 --- a/Libs/LibOpenRaid/docs.txt +++ b/Libs/LibOpenRaid/docs.txt @@ -303,10 +303,10 @@ function MyAddonObject.OnGearUpdate(unitId, unitGear, allUnitsGear) local noEnchantTable = unitGear.noEnchants local noGemsTable = unitGear.noGems - for index, slotIdWithoutEnchant in ipairs (noEnchantTable) do + for index, slotIdWithoutEnchant in ipairs(noEnchantTable) do end - for index, slotIdWithEmptyGemSocket in ipairs (noGemsTable) do + for index, slotIdWithEmptyGemSocket in ipairs(noGemsTable) do end end diff --git a/Libs/NickTag-1.0/NickTag-1.0.lua b/Libs/NickTag-1.0/NickTag-1.0.lua index 6b336625..e14d4c3b 100644 --- a/Libs/NickTag-1.0/NickTag-1.0.lua +++ b/Libs/NickTag-1.0/NickTag-1.0.lua @@ -1,6 +1,6 @@ ---> Library NickTag is a small library for share individual nicknames and avatars. +--Library NickTag is a small library for share individual nicknames and avatars. ---> Basic Functions: +--Basic Functions: -- NickTag:SetNickname (name) -> set the player nick name, after set nicktag will broadcast the nick over addon guild channel. -- @@ -13,7 +13,7 @@ if (not NickTag) then return end ---> fix for old nicktag version +--fix for old nicktag version if (_G.NickTag) then if (_G.NickTag.OnEvent) then _G.NickTag:UnregisterComm ("NickTag") @@ -22,7 +22,7 @@ if (_G.NickTag) then end ------------------------------------------------------------------------------------------------------------------------------------------------------ ---> constants +--constants local CONST_INDEX_NICKNAME = 1 local CONST_INDEX_AVATAR_PATH = 2 @@ -39,12 +39,12 @@ end --[[global]] NICKTAG_DEFAULT_BACKGROUND_CORDS = {0.129609375, 1, 1, 0} ------------------------------------------------------------------------------------------------------------------------------------------------------ ---> library stuff +--library stuff - _G.NickTag = NickTag --> nicktag object over global container + _G.NickTag = NickTag --nicktag object over global container - local pool = {default = true} --> pointer to the cache pool and the default pool if no cache - local siblingsPools = {} --> pools registered by other addons + local pool = {default = true} --pointer to the cache pool and the default pool if no cache + local siblingsPools = {} --pools registered by other addons --when this instance was the first to load local isMaster = false @@ -211,7 +211,7 @@ end {[[Interface\EncounterJournal\UI-EJ-BOSS-Witch Doctor Zumrah]], "Witch Doctor Zumrah"}, } ------------------------------------------------------------------------------------------------------------------------------------------------------ ---> send and receive functions +--send and receive functions function NickTag:OnReceiveComm (prefix, data, channel, source) @@ -221,7 +221,7 @@ end local _type, serial, arg3, name, realm, version = select (2, NickTag:Deserialize (data)) - --> 0x1: received a full persona + --0x1: received a full persona if (_type == CONST_COMM_FULLPERSONA) then local receivedPersona = arg3 version = name @@ -240,7 +240,7 @@ end storedPersona [CONST_INDEX_REVISION] = receivedPersona [CONST_INDEX_REVISION] - --> we need to check if the received nickname fit in our rules. + --we need to check if the received nickname fit in our rules. local allowNickName = NickTag:CheckName (receivedPersona [CONST_INDEX_NICKNAME]) if (allowNickName) then storedPersona [CONST_INDEX_NICKNAME] = receivedPersona [CONST_INDEX_NICKNAME] @@ -250,15 +250,15 @@ end storedPersona [CONST_INDEX_NICKNAME] = receivedPersona [CONST_INDEX_NICKNAME] - --> update the rest + --update the rest --avatar path storedPersona [CONST_INDEX_AVATAR_PATH] = type (receivedPersona [CONST_INDEX_AVATAR_PATH]) == "string" and receivedPersona [CONST_INDEX_AVATAR_PATH] or "" --avatar texcoord - if (type (receivedPersona [CONST_INDEX_AVATAR_TEXCOORD]) == "boolean") then + if (type(receivedPersona [CONST_INDEX_AVATAR_TEXCOORD]) == "boolean") then storedPersona [CONST_INDEX_AVATAR_TEXCOORD] = {0, 1, 0, 1} - elseif (type (receivedPersona [CONST_INDEX_AVATAR_TEXCOORD]) == "table") then + elseif (type(receivedPersona [CONST_INDEX_AVATAR_TEXCOORD]) == "table") then storedPersona [CONST_INDEX_AVATAR_TEXCOORD] = storedPersona [CONST_INDEX_AVATAR_TEXCOORD] or {} storedPersona [CONST_INDEX_AVATAR_TEXCOORD][1] = type (receivedPersona [CONST_INDEX_AVATAR_TEXCOORD][1]) == "number" and receivedPersona [CONST_INDEX_AVATAR_TEXCOORD][1] or 0 storedPersona [CONST_INDEX_AVATAR_TEXCOORD][2] = type (receivedPersona [CONST_INDEX_AVATAR_TEXCOORD][2]) == "number" and receivedPersona [CONST_INDEX_AVATAR_TEXCOORD][2] or 1 @@ -269,10 +269,10 @@ end end --background texcoord - if (type (receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD]) == "boolean") then + if (type(receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD]) == "boolean") then storedPersona [CONST_INDEX_BACKGROUND_TEXCOORD] = {0, 1, 0, 1} - elseif (type (receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD]) == "table") then + elseif (type(receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD]) == "table") then storedPersona [CONST_INDEX_BACKGROUND_TEXCOORD] = storedPersona [CONST_INDEX_BACKGROUND_TEXCOORD] or {} storedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][1] = type (receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][1]) == "number" and receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][1] or 0 storedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][2] = type (receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][2]) == "number" and receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][2] or 1 @@ -286,7 +286,7 @@ end storedPersona [CONST_INDEX_BACKGROUND_PATH] = type (receivedPersona [CONST_INDEX_BACKGROUND_PATH]) == "string" and receivedPersona [CONST_INDEX_BACKGROUND_PATH] or "" --background color - if (type (receivedPersona [CONST_INDEX_BACKGROUND_COLOR]) == "table") then + if (type(receivedPersona [CONST_INDEX_BACKGROUND_COLOR]) == "table") then storedPersona [CONST_INDEX_BACKGROUND_COLOR] = storedPersona [CONST_INDEX_BACKGROUND_COLOR] or {} storedPersona [CONST_INDEX_BACKGROUND_COLOR][1] = type (receivedPersona [CONST_INDEX_BACKGROUND_COLOR][1]) == "number" and receivedPersona [CONST_INDEX_BACKGROUND_COLOR][1] or 1 storedPersona [CONST_INDEX_BACKGROUND_COLOR][2] = type (receivedPersona [CONST_INDEX_BACKGROUND_COLOR][2]) == "number" and receivedPersona [CONST_INDEX_BACKGROUND_COLOR][2] or 1 @@ -306,7 +306,7 @@ end NickTag:RegisterComm ("NickTag", "OnReceiveComm") --frame for listening to event - NickTag.EventFrame = NickTag.EventFrame or CreateFrame ("frame") + NickTag.EventFrame = NickTag.EventFrame or CreateFrame("frame") NickTag.EventFrame.InfoSendCooldown = 0 function NickTag.OnEvent (self, event, ...) @@ -324,7 +324,7 @@ end NickTag.EventFrame:RegisterEvent ("GROUP_ROSTER_UPDATE") NickTag.EventFrame:RegisterEvent ("PLAYER_LOGIN") - NickTag.EventFrame:SetScript ("OnEvent", NickTag.OnEvent) + NickTag.EventFrame:SetScript("OnEvent", NickTag.OnEvent) --send the persona in the guild comm chanel function NickTag:SendPersona() @@ -342,15 +342,15 @@ end NickTag.EventFrame.ScheduledSend = nil NickTag.EventFrame.InfoSendCooldown = time() + 29 - --> updating my own persona + --updating my own persona NickTag.send_scheduled = false - --> auto change nickname if we have an invalid nickname + --auto change nickname if we have an invalid nickname if (NickTag:GetNickname (UnitName ("player")) == LibStub ("AceLocale-3.0"):GetLocale ("NickTag-1.0")["STRING_INVALID_NAME"]) then nickTable [CONST_INDEX_NICKNAME] = UnitName ("player") end - --> broadcast over guild channel + --broadcast over guild channel if (IsInGuild()) then if (isMaster) then NickTag:SyncSiblings() @@ -361,9 +361,9 @@ end end ------------------------------------------------------------------------------------------------------------------------------------------------------ ---> cache stuff +--cache stuff - --> this will clear the information about the player within nicktag cache + --this will clear the information about the player within nicktag cache function NickTag:ResetPlayerPersona() local playerName = UnitName ("player") @@ -383,7 +383,7 @@ end end end - --> reset cache + --reset cache function NickTag:ResetCache() local playerName = UnitName ("player") @@ -401,10 +401,10 @@ end table.wipe (pool) end - pool.nextreset = time() + (60*60*24*15) --> 15 days or 1296000 seconds + pool.nextreset = time() + (60*60*24*15) --15 days or 1296000 seconds pool.last_version = minor else - --> sometimes player guid isn't available right after logon, so, just schedule until it become available. + --sometimes player guid isn't available right after logon, so, just schedule until it become available. NickTag:ScheduleTimer ("ResetCache", 0.3) end end @@ -426,7 +426,7 @@ end end pool = _table - isMaster = true --> this instance of nicktag will save data + isMaster = true --this instance of nicktag will save data if (not pool.nextreset) then pool.nextreset = time() + (60*60*24*15) @@ -444,7 +444,7 @@ end function NickTag:SyncSiblings() --copy all data into siblings table - for _, syblingTable in ipairs (siblingsPools) do + for _, syblingTable in ipairs(siblingsPools) do for key, value in pairs (pool) do syblingTable [key] = value end @@ -452,7 +452,7 @@ end end ------------------------------------------------------------------------------------------------------------------------------------------------------ ---> basic functions +--basic functions local cyrillic = "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯЁЂЃЄЅІЇЈЉЊЋЌЎЏҐабвгдежзийклмнопрстуфхцчшщъыьэюяёђѓєѕіїјљњћќўџґАаБбВвГгДдЕеЁёЖжЗзИиЙйКкЛлМмНнОоПпРрСсТтУуФфХхЦцЧчШшЩщЪъЫыЬьЭэЮюЯя" local latin = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" @@ -474,7 +474,7 @@ end alphabet["chinese"][letter] = true end - --> trim from from http://lua-users.org/wiki/StringTrim + --trim from from http://lua-users.org/wiki/StringTrim local function trim (s) local from = s:match"^%s*()" return from > #s and "" or s:match(".*%S", from) @@ -496,13 +496,13 @@ end end end - --> we need to keep game smooth checking and formating nicknames. - --> SetNickname and names comming from other player need to be check. + --we need to keep game smooth checking and formating nicknames. + --SetNickname and names comming from other player need to be check. function NickTag:CheckName (name) - --> as nicktag only work internally in the guild, we think that is not necessary a work filter to avoid people using bad language. + --as nicktag only work internally in the guild, we think that is not necessary a work filter to avoid people using bad language. - if (type (name) ~= "string") then - return false, LibStub ("AceLocale-3.0"):GetLocale ("NickTag-1.0")["STRING_ERROR_4"] --> error 4 = name isn't a valid string + if (type(name) ~= "string") then + return false, LibStub ("AceLocale-3.0"):GetLocale ("NickTag-1.0")["STRING_ERROR_4"] --error 4 = name isn't a valid string end name = trim (name) @@ -530,32 +530,32 @@ end end end - --> limit nickname to 12 characters, same as wow. + --limit nickname to 12 characters, same as wow. --cyrillic seems to double the len using 2 bytes local len = string.len (name) if (len > maxLength) then - return false, LibStub ("AceLocale-3.0"):GetLocale ("NickTag-1.0")["STRING_ERROR_1"] --> error 1 = nickname is too long, max of 12 characters. + return false, LibStub ("AceLocale-3.0"):GetLocale ("NickTag-1.0")["STRING_ERROR_1"] --error 1 = nickname is too long, max of 12 characters. end - --> check if contain any non allowed characters, by now only accpet letters, numbers and spaces. - --> by default wow do not accetp spaces, but here will allow. - --> tested over lua 5.2 and this capture was okey with accents, not sure why inside wow this doesn't work. + --check if contain any non allowed characters, by now only accpet letters, numbers and spaces. + --by default wow do not accetp spaces, but here will allow. + --tested over lua 5.2 and this capture was okey with accents, not sure why inside wow this doesn't work. -- local notallow = string.find (name, "[^a-zA-Z�������%s]") -- if (notallow) then --- return false, LibStub ("AceLocale-3.0"):GetLocale ("NickTag-1.0")["STRING_ERROR_2"] --> error 2 = nickname only support letters, numbers and spaces. +-- return false, LibStub ("AceLocale-3.0"):GetLocale ("NickTag-1.0")["STRING_ERROR_2"] --error 2 = nickname only support letters, numbers and spaces. -- end --[=[ for letter in name:gmatch(".") do if (not allowedLetters[letter]) then - return false, LibStub ("AceLocale-3.0"):GetLocale ("NickTag-1.0")["STRING_ERROR_2"] --> error 2 = nickname only support letters, numbers and spaces. + return false, LibStub ("AceLocale-3.0"):GetLocale ("NickTag-1.0")["STRING_ERROR_2"] --error 2 = nickname only support letters, numbers and spaces. end end --]=] - --> check if there is sequencial repeated characters, like "Jasooon" were repeats 3 times the "o" character. - --> got this from http://stackoverflow.com/questions/15608299/lua-pattern-matching-repeating-character + --check if there is sequencial repeated characters, like "Jasooon" were repeats 3 times the "o" character. + --got this from http://stackoverflow.com/questions/15608299/lua-pattern-matching-repeating-character have_repeated = false count_spaces = 0 string.gsub (name, '.', '\0%0%0'):gsub ('(.)%z%1','%1'):gsub ('%z.([^%z]+)', check_repeated) @@ -563,48 +563,48 @@ end have_repeated = true end if (have_repeated) then - return false, LibStub ("AceLocale-3.0"):GetLocale ("NickTag-1.0")["STRING_ERROR_3"] --> error 3 = cant use the same letter three times consecutively, 2 spaces consecutively or 3 or more spaces. + return false, LibStub ("AceLocale-3.0"):GetLocale ("NickTag-1.0")["STRING_ERROR_3"] --error 3 = cant use the same letter three times consecutively, 2 spaces consecutively or 3 or more spaces. end return true end - --> set the "player" nickname and schedule for send updated persona + --set the "player" nickname and schedule for send updated persona function NickTag:SetNickname (name) - --> check data before - assert (type (name) == "string", "NickTag 'SetNickname' expects a string on #1 argument.") + --check data before + assert (type(name) == "string", "NickTag 'SetNickname' expects a string on #1 argument.") - --> check if the nickname is okey to allowed to use. + --check if the nickname is okey to allowed to use. local okey, errortype = NickTag:CheckName (name) if (not okey) then NickTag:Msg ("SetNickname() invalid name ", name) return false, errortype end - --> here we format the text to match titles, e.g converts name like "JASON NICKSHOW" into "Jason Nickshow". + --here we format the text to match titles, e.g converts name like "JASON NICKSHOW" into "Jason Nickshow". name = name:gsub ("(%a)([%w_']*)", titlecase) local playerName = UnitName ("player") - --> get the full nick table. + --get the full nick table. local nickTable = NickTag:GetNicknameTable (playerName) if (not nickTable) then nickTable = NickTag:Create (playerName, true) end - --> change the nickname for the player nick table. + --change the nickname for the player nick table. if (nickTable [CONST_INDEX_NICKNAME] ~= name) then nickTable [CONST_INDEX_NICKNAME] = name --increase the table revision NickTag:IncRevision() - --> send the update for script which need it. + --send the update for script which need it. NickTag.callbacks:Fire ("NickTag_Update", CONST_INDEX_NICKNAME) - --> schedule a update for revision and broadcast full persona. - --> this is a kind of protection for scripts which call SetNickname, SetColor and SetAvatar one after other, so scheduling here avoid three revisions upgrades and 3 broadcasts to the guild. + --schedule a update for revision and broadcast full persona. + --this is a kind of protection for scripts which call SetNickname, SetColor and SetAvatar one after other, so scheduling here avoid three revisions upgrades and 3 broadcasts to the guild. if (not NickTag.send_scheduled) then NickTag.send_scheduled = true NickTag:ScheduleTimer ("SendPersona", 1) @@ -621,11 +621,11 @@ end if (l == nil) then l, r, t, b = 0, 1, 0, 1 - elseif (type (l) == "table") then + elseif (type(l) == "table") then l, r, t, b = unpack (l) end - --> check data before + --check data before assert (texture and l and r and t and b, "NickTag 'SetNicknameAvatar' bad format. Usage NickTag:SetAvatar (texturepath [, L, R, T, B] or texturepath [, {L, R, T, B}])") local playerName = UnitName ("player") @@ -641,8 +641,8 @@ end --increase the table revision NickTag:IncRevision() - --> by default, CONST_INDEX_AVATAR_TEXCOORD comes as boolean false - if (type (nickTable [CONST_INDEX_AVATAR_TEXCOORD]) == "boolean") then + --by default, CONST_INDEX_AVATAR_TEXCOORD comes as boolean false + if (type(nickTable [CONST_INDEX_AVATAR_TEXCOORD]) == "boolean") then nickTable [CONST_INDEX_AVATAR_TEXCOORD] = {} end @@ -662,13 +662,13 @@ end return true end - --> set the background + --set the background function NickTag:SetNicknameBackground (path, texcoord, color, silent) if (not silent) then - assert (type (path) == "string", "NickTag 'SetNicknameBackground' expects a string on #1 argument.") + assert (type(path) == "string", "NickTag 'SetNicknameBackground' expects a string on #1 argument.") else - if (type (path) ~= "string") then + if (type(path) ~= "string") then return end end @@ -722,7 +722,7 @@ end function NickTag:GetNickname (playerName, default, silent) if (not silent) then - assert (type (playerName) == "string", "NickTag 'GetNickname' expects a string or string on #1 argument.") + assert (type(playerName) == "string", "NickTag 'GetNickname' expects a string or string on #1 argument.") end local _table = pool [playerName] @@ -732,10 +732,10 @@ end return _table [CONST_INDEX_NICKNAME] or default or nil end - --> return the avatar and the texcoord. + --return the avatar and the texcoord. function NickTag:GetNicknameAvatar (playerName, default, silent) if (not silent) then - assert (type (playerName) == "string", "NickTag 'GetNicknameAvatar' expects a string or string on #1 argument.") + assert (type(playerName) == "string", "NickTag 'GetNicknameAvatar' expects a string or string on #1 argument.") end local _table = pool [playerName] @@ -750,7 +750,7 @@ end function NickTag:GetNicknameBackground (playerName, default_path, default_texcoord, default_color, silent) if (not silent) then - assert (type (playerName) == "string", "NickTag 'GetNicknameBackground' expects a string or string on #1 argument.") + assert (type(playerName) == "string", "NickTag 'GetNicknameBackground' expects a string or string on #1 argument.") end local _table = pool [playerName] @@ -760,11 +760,11 @@ end return _table [CONST_INDEX_BACKGROUND_PATH] or default_path, _table [CONST_INDEX_BACKGROUND_TEXCOORD] or default_texcoord, _table [CONST_INDEX_BACKGROUND_COLOR] or default_color end - --> get the full nicktag table + --get the full nicktag table function NickTag:GetNicknameTable (playerName, silent) - --> check data before + --check data before if (not silent) then - assert (type (playerName) == "string", "NickTag 'GetNicknameTable' expects a string on #1 argument.") + assert (type(playerName) == "string", "NickTag 'GetNicknameTable' expects a string on #1 argument.") else if (not playerName or type (playerName) ~= "string") then return @@ -775,20 +775,20 @@ end end ------------------------------------------------------------------------------------------------------------------------------------------------------ ---> internal functions +--internal functions - --> create a empty nick table for the player + --create a empty nick table for the player function NickTag:Create (playerName, isSelf) - --> check data before - assert (type (playerName) == "string", "NickTag 'Create' expects a string on #1 argument.") + --check data before + assert (type(playerName) == "string", "NickTag 'Create' expects a string on #1 argument.") - --> check if alredy exists + --check if alredy exists local alredyHave = pool [playerName] if (alredyHave) then return alredyHave end - --> create the table: + --create the table: local newTable = { UnitName ("player"), --[1] player nickname false, --[2] avatar texture path @@ -799,7 +799,7 @@ end 1 --[7] revision } - --> if not my persona, set revision to 0, this make always get update after creation + --if not my persona, set revision to 0, this make always get update after creation if (not isSelf) then newTable [CONST_INDEX_REVISION] = 0 end @@ -808,7 +808,7 @@ end return newTable end - --> inc the revision of the player persona after update nick or avatar + --inc the revision of the player persona after update nick or avatar function NickTag:IncRevision() local playerName = UnitName ("player") local nickTable = NickTag:GetNicknameTable (playerName) @@ -821,51 +821,51 @@ end return true end - --> convert GUID into serial number (deprecated, it uses player name - realm name) + --convert GUID into serial number (deprecated, it uses player name - realm name) function NickTag:GetSerial (serial, silent) return 0 end - --> choose avatar window + --choose avatar window do - local avatar_pick_frame = CreateFrame ("frame", "AvatarPickFrame", UIParent,"BackdropTemplate") + local avatar_pick_frame = CreateFrame("frame", "AvatarPickFrame", UIParent,"BackdropTemplate") avatar_pick_frame:SetFrameStrata ("DIALOG") - avatar_pick_frame:SetBackdrop ({bgFile = [[Interface\FrameGeneral\UI-Background-Marble]], edgeFile = [[Interface\DialogFrame\UI-DialogBox-Border]], tile = true, tileSize = 256, edgeSize = 32, insets = {left = 11, right = 12, top = 12, bottom = 11}}) - avatar_pick_frame:SetBackdropColor (.3, .3, .3, .9) - avatar_pick_frame:SetWidth (460) - avatar_pick_frame:SetHeight (240) + avatar_pick_frame:SetBackdrop({bgFile = [[Interface\FrameGeneral\UI-Background-Marble]], edgeFile = [[Interface\DialogFrame\UI-DialogBox-Border]], tile = true, tileSize = 256, edgeSize = 32, insets = {left = 11, right = 12, top = 12, bottom = 11}}) + avatar_pick_frame:SetBackdropColor(.3, .3, .3, .9) + avatar_pick_frame:SetWidth(460) + avatar_pick_frame:SetHeight(240) avatar_pick_frame.selected_avatar = 1 avatar_pick_frame.selected_background = 1 avatar_pick_frame.selected_color = {1, 1, 1} avatar_pick_frame.selected_texcoord = {0, 1, 0, 1} - avatar_pick_frame:SetPoint ("center", UIParent, "center", 200, 0) + avatar_pick_frame:SetPoint("center", UIParent, "center", 200, 0) --- - local avatar_texture = avatar_pick_frame:CreateTexture ("AvatarPickFrameAvatarPreview", "overlay") - avatar_texture:SetPoint ("topleft", avatar_pick_frame, "topleft", 167, -10) - avatar_texture:SetTexture ([[Interface\EncounterJournal\UI-EJ-BOSS-Default]]) + local avatar_texture = avatar_pick_frame:CreateTexture("AvatarPickFrameAvatarPreview", "overlay") + avatar_texture:SetPoint("topleft", avatar_pick_frame, "topleft", 167, -10) + avatar_texture:SetTexture([[Interface\EncounterJournal\UI-EJ-BOSS-Default]]) -- - local background_texture = avatar_pick_frame:CreateTexture ("AvatarPickFrameBackgroundPreview", "artwork") - background_texture:SetPoint ("topleft", avatar_pick_frame, "topleft", 167, 2) - background_texture:SetWidth (290) - background_texture:SetHeight (75) - background_texture:SetTexture (NickTag.background_pool[1][1]) + local background_texture = avatar_pick_frame:CreateTexture("AvatarPickFrameBackgroundPreview", "artwork") + background_texture:SetPoint("topleft", avatar_pick_frame, "topleft", 167, 2) + background_texture:SetWidth(290) + background_texture:SetHeight(75) + background_texture:SetTexture(NickTag.background_pool[1][1]) background_texture:SetTexCoord (unpack (NickTag.background_pool[1][3])) -- local name = avatar_pick_frame:CreateFontString ("AvatarPickFrameName", "overlay", "GameFontHighlightHuge") - name:SetPoint ("left", avatar_texture, "right", -11, -17) - name:SetText (UnitName ("player")) + name:SetPoint("left", avatar_texture, "right", -11, -17) + name:SetText(UnitName ("player")) --- local OnClickFunction = function(button) if (button.isAvatar) then local avatar = NickTag.avatar_pool [button.IconID] - _G.AvatarPickFrameAvatarPreview:SetTexture ( avatar [1] ) + _G.AvatarPickFrameAvatarPreview:SetTexture( avatar [1] ) avatar_pick_frame.selected_avatar = avatar [1] elseif (button.isBackground) then local background = NickTag.background_pool [button.IconID] - _G.AvatarPickFrameBackgroundPreview:SetTexture ( background [1] ) + _G.AvatarPickFrameBackgroundPreview:SetTexture( background [1] ) _G.AvatarPickFrameBackgroundPreview:SetTexCoord (unpack (background [3])) avatar_pick_frame.selected_background = background [1] avatar_pick_frame.selected_texcoord = background [3] @@ -880,38 +880,38 @@ do avatar_pick_frame.selected_color[3] = b end - local okey = CreateFrame ("button", "AvatarPickFrameAccept", avatar_pick_frame) - okey:SetPoint ("bottomright", avatar_pick_frame, "bottomright", -37, 12) - okey:SetText ("Accept") + local okey = CreateFrame("button", "AvatarPickFrameAccept", avatar_pick_frame) + 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) end end) - local change_color = CreateFrame ("button", "AvatarPickFrameColor", avatar_pick_frame) - change_color:SetPoint ("bottomright", avatar_pick_frame, "bottomright", -205, 12) - change_color:SetText ("Color") + local change_color = CreateFrame("button", "AvatarPickFrameColor", avatar_pick_frame) + change_color:SetPoint("bottomright", avatar_pick_frame, "bottomright", -205, 12) + 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) + ColorPickerFrame:SetParent(avatar_pick_frame) ColorPickerFrame:SetColorRGB (_G.AvatarPickFrameBackgroundPreview:GetVertexColor()) ColorPickerFrame:ClearAllPoints() - ColorPickerFrame:SetPoint ("left", avatar_pick_frame, "right", 0, -10) + ColorPickerFrame:SetPoint("left", avatar_pick_frame, "right", 0, -10) ColorPickerFrame:Show() end) local buttons = {} for i = 0, 2 do - local newbutton = CreateFrame ("button", "AvatarPickFrameAvatarScrollButton"..i+1, avatar_pick_frame) - newbutton:SetScript ("OnClick", OnClickFunction) - newbutton:SetWidth (128) - newbutton:SetHeight (64) - newbutton:SetPoint ("topleft", avatar_pick_frame, "topleft", 15, (i*70*-1) - 20) + local newbutton = CreateFrame("button", "AvatarPickFrameAvatarScrollButton"..i+1, avatar_pick_frame) + newbutton:SetScript("OnClick", OnClickFunction) + newbutton:SetWidth(128) + newbutton:SetHeight(64) + newbutton:SetPoint("topleft", avatar_pick_frame, "topleft", 15, (i*70*-1) - 20) newbutton:SetID (i+1) newbutton.isAvatar = true buttons [#buttons+1] = newbutton @@ -919,26 +919,26 @@ do local buttonsbg = {} for i = 0, 2 do - local newbutton = CreateFrame ("button", "AvatarPickFrameBackgroundScrollButton"..i+1, avatar_pick_frame) - newbutton:SetScript ("OnClick", OnClickFunction) - newbutton:SetWidth (275) - newbutton:SetHeight (60) - newbutton:SetPoint ("topleft", avatar_pick_frame, "topleft", 157, (i*50*-1) - 80) + local newbutton = CreateFrame("button", "AvatarPickFrameBackgroundScrollButton"..i+1, avatar_pick_frame) + newbutton:SetScript("OnClick", OnClickFunction) + newbutton:SetWidth(275) + newbutton:SetHeight(60) + newbutton:SetPoint("topleft", avatar_pick_frame, "topleft", 157, (i*50*-1) - 80) newbutton:SetID (i+1) newbutton.isBackground = true buttonsbg [#buttonsbg+1] = newbutton end --[=[ - local avatar_list = CreateFrame ("ScrollFrame", "AvatarPickFrameAvatarScroll", avatar_pick_frame, "ListScrollFrameTemplate") - avatar_list:SetPoint ("topleft", avatar_pick_frame, "topleft", 10, -10) - local background_list = CreateFrame ("ScrollFrame", "AvatarPickFrameBackgroundScroll", avatar_pick_frame, "ListScrollFrameTemplate") - background_list:SetPoint ("topleft", avatar_pick_frame, "topleft", 147, -85) + local avatar_list = CreateFrame("ScrollFrame", "AvatarPickFrameAvatarScroll", avatar_pick_frame, "ListScrollFrameTemplate") + avatar_list:SetPoint("topleft", avatar_pick_frame, "topleft", 10, -10) + local background_list = CreateFrame("ScrollFrame", "AvatarPickFrameBackgroundScroll", avatar_pick_frame, "ListScrollFrameTemplate") + background_list:SetPoint("topleft", avatar_pick_frame, "topleft", 147, -85) - avatar_list:SetWidth (128) - avatar_list:SetHeight (220) - background_list:SetWidth (275) - background_list:SetHeight (140) + avatar_list:SetWidth(128) + avatar_list:SetHeight(220) + background_list:SetWidth(275) + background_list:SetHeight(140) local avatar_scroll_update = function(self) local numMacroIcons = #NickTag.avatar_pool @@ -952,10 +952,10 @@ do texture = NickTag.avatar_pool [index][1] if ( index <= numMacroIcons and texture ) then - macroPopupButton:SetNormalTexture (texture) - macroPopupButton:SetPushedTexture (texture) + macroPopupButton:SetNormalTexture(texture) + macroPopupButton:SetPushedTexture(texture) macroPopupButton:SetDisabledTexture (texture) - macroPopupButton:SetHighlightTexture (texture, "ADD") + macroPopupButton:SetHighlightTexture(texture, "ADD") macroPopupButton.IconID = index macroPopupButton:Show() else @@ -976,10 +976,10 @@ do texture = NickTag.background_pool [index][1] if ( index <= numMacroIcons and texture ) then - macroPopupButton:SetNormalTexture (texture) - macroPopupButton:SetPushedTexture (texture) + macroPopupButton:SetNormalTexture(texture) + macroPopupButton:SetPushedTexture(texture) macroPopupButton:SetDisabledTexture (texture) - macroPopupButton:SetHighlightTexture (texture, "ADD") + macroPopupButton:SetHighlightTexture(texture, "ADD") macroPopupButton.IconID = index macroPopupButton:Show() else @@ -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) @@ -1000,37 +1000,37 @@ do background_scroll_update (background_list) function avatar_pick_frame:SetAvatar (n) - if (type (n) ~= "number") then + if (type(n) ~= "number") then n = 1 end if (n > #NickTag.avatar_pool) then n = 1 end local avatar = NickTag.avatar_pool [n] - _G.AvatarPickFrameAvatarPreview:SetTexture ( avatar [1] ) + _G.AvatarPickFrameAvatarPreview:SetTexture( avatar [1] ) avatar_pick_frame.selected_avatar = avatar [1] end function avatar_pick_frame:SetBackground (n) - if (type (n) ~= "number") then + if (type(n) ~= "number") then n = 1 end if (n > #NickTag.background_pool) then n = 1 end local background = NickTag.background_pool [n] - _G.AvatarPickFrameBackgroundPreview:SetTexture ( background [1] ) + _G.AvatarPickFrameBackgroundPreview:SetTexture( background [1] ) _G.AvatarPickFrameBackgroundPreview:SetTexCoord (unpack (background [3])) _G.AvatarPickFrameBackgroundPreview:SetVertexColor (unpack (avatar_pick_frame.selected_color)) avatar_pick_frame.selected_background = background [1] end function avatar_pick_frame:SetColor (r, g, b) - if (type (r) ~= "number" or r > 1) then + if (type(r) ~= "number" or r > 1) then r = 1 end - if (type (g) ~= "number" or g > 1) then + if (type(g) ~= "number" or g > 1) then g = 1 end - if (type (b) ~= "number" or b > 1) then + if (type(b) ~= "number" or b > 1) then b = 1 end _G.AvatarPickFrameBackgroundPreview:SetVertexColor (r, g, b) @@ -1046,18 +1046,18 @@ do local CONST_INDEX_BACKGROUND_TEXCOORD = 5 local CONST_INDEX_BACKGROUND_COLOR = 6 - avatar_pick_frame:SetScript ("OnShow", function() + avatar_pick_frame:SetScript("OnShow", function() --get player avatar local avatar = NickTag:GetNicknameTable (UnitGUID ("player")) if (avatar) then - _G.AvatarPickFrameName:SetText ( avatar [1] or UnitName ("player")) + _G.AvatarPickFrameName:SetText( avatar [1] or UnitName ("player")) - _G.AvatarPickFrameAvatarPreview:SetTexture ( avatar [CONST_INDEX_AVATAR_PATH] or [[Interface\EncounterJournal\UI-EJ-BOSS-Default]] ) + _G.AvatarPickFrameAvatarPreview:SetTexture( avatar [CONST_INDEX_AVATAR_PATH] or [[Interface\EncounterJournal\UI-EJ-BOSS-Default]] ) avatar_pick_frame.selected_avatar = avatar [CONST_INDEX_AVATAR_PATH] or [[Interface\EncounterJournal\UI-EJ-BOSS-Default]] - _G.AvatarPickFrameAvatarPreview:SetTexCoord ( 0, 1, 0, 1 ) --> always + _G.AvatarPickFrameAvatarPreview:SetTexCoord ( 0, 1, 0, 1 ) --always - _G.AvatarPickFrameBackgroundPreview:SetTexture ( avatar [CONST_INDEX_BACKGROUND_PATH] or [[Interface\PetBattles\Weather-ArcaneStorm]] ) + _G.AvatarPickFrameBackgroundPreview:SetTexture( avatar [CONST_INDEX_BACKGROUND_PATH] or [[Interface\PetBattles\Weather-ArcaneStorm]] ) avatar_pick_frame.selected_background = avatar [CONST_INDEX_BACKGROUND_PATH] or [[Interface\PetBattles\Weather-ArcaneStorm]] if (avatar [CONST_INDEX_BACKGROUND_TEXCOORD]) then @@ -1076,14 +1076,14 @@ do avatar_pick_frame.selected_color = {1, 1, 1} end else - --> if none - _G.AvatarPickFrameAvatarPreview:SetTexture ( [[Interface\EncounterJournal\UI-EJ-BOSS-Default]] ) + --if none + _G.AvatarPickFrameAvatarPreview:SetTexture( [[Interface\EncounterJournal\UI-EJ-BOSS-Default]] ) avatar_pick_frame.selected_avatar = [[Interface\EncounterJournal\UI-EJ-BOSS-Default]] local background = NickTag.background_pool [1] if (background) then - _G.AvatarPickFrameBackgroundPreview:SetTexture ( background [1] ) + _G.AvatarPickFrameBackgroundPreview:SetTexture( background [1] ) avatar_pick_frame.selected_background = background [1] _G.AvatarPickFrameBackgroundPreview:SetTexCoord (unpack (background [3])) avatar_pick_frame.selected_texcoord = background [3] diff --git a/boot.lua b/boot.lua index 7e21c3ca..db5eb209 100644 --- a/boot.lua +++ b/boot.lua @@ -1,13 +1,13 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> global name declaration +--global name declaration _ = nil _G._detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") local version, build, date, tocversion = GetBuildInfo() - _detalhes.build_counter = 10129 - _detalhes.alpha_build_counter = 10129 --if this is higher than the regular counter, use it instead + _detalhes.build_counter = 10135 + _detalhes.alpha_build_counter = 10135 --if this is higher than the regular counter, use it instead _detalhes.dont_open_news = true _detalhes.game_version = version _detalhes.userversion = version .. " " .. _detalhes.build_counter @@ -50,7 +50,7 @@ Details.PlayerBreakdown = {} ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> initialization stuff +--initialization stuff local _ do @@ -321,7 +321,7 @@ do Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " - --> startup + --startup _detalhes.max_windowline_columns = 11 _detalhes.initializing = true _detalhes.enabled = true @@ -335,12 +335,12 @@ do --store functions to create options frame Details.optionsSection = {} - --> containers - --> armazenas as fun��es do parser - All parse functions + --containers + --armazenas as fun��es do parser - All parse functions _detalhes.parser = {} _detalhes.parser_functions = {} - _detalhes.parser_frame = CreateFrame ("Frame") - _detalhes.pvp_parser_frame = CreateFrame ("Frame") + _detalhes.parser_frame = CreateFrame("Frame") + _detalhes.pvp_parser_frame = CreateFrame("Frame") _detalhes.parser_frame:Hide() _detalhes.MacroList = { @@ -354,22 +354,22 @@ do {Name = "Report What is Shown In the Window", Desc = "Report the current data shown in the window, the number 1 is the window number, replace it to report another window.", MacroText = "/script Details:FastReportWindow(1)"}, } - --> current instances of the exp (need to maintain) + --current instances of the exp (need to maintain) _detalhes.InstancesToStoreData = { --mapId [2296] = true, --castle narnia [2450] = true, --sanctum of domination [2481] = true, --sepulcher of the first ones } - --> armazena os escudos - Shields information for absorbs + --armazena os escudos - Shields information for absorbs _detalhes.escudos = {} - --> armazena as fun��es dos frames - Frames functions + --armazena as fun��es dos frames - Frames functions _detalhes.gump = _G ["DetailsFramework"] function _detalhes:GetFramework() return self.gump end GameCooltip = GameCooltip2 - --> anima��es dos icones + --anima��es dos icones _detalhes.icon_animations = { load = { in_use = {}, @@ -383,58 +383,58 @@ do return "orange" end - --> armazena as fun��es para inicializa��o dos dados - Metatable functions + --armazena as fun��es para inicializa��o dos dados - Metatable functions _detalhes.refresh = {} - --> armazena as fun��es para limpar e guardas os dados - Metatable functions + --armazena as fun��es para limpar e guardas os dados - Metatable functions _detalhes.clear = {} - --> armazena a config do painel de fast switch + --armazena a config do painel de fast switch _detalhes.switch = {} - --> armazena os estilos salvos + --armazena os estilos salvos _detalhes.savedStyles = {} - --> armazena quais atributos possue janela de atributos - contain attributes and sub attributos wich have a detailed window (left click on a row) + --armazena quais atributos possue janela de atributos - contain attributes and sub attributos wich have a detailed window (left click on a row) _detalhes.row_singleclick_overwrite = {} - --> report + --report _detalhes.ReportOptions = {} - --> armazena os buffs registrados - store buffs ids and functions - _detalhes.Buffs = {} --> initialize buff table - --> cache de grupo + --armazena os buffs registrados - store buffs ids and functions + _detalhes.Buffs = {} --initialize buff table + -- cache de grupo _detalhes.cache_damage_group = {} _detalhes.cache_healing_group = {} _detalhes.cache_npc_ids = {} - --> cache de specs + --cache de specs _detalhes.cached_specs = {} _detalhes.cached_talents = {} - --> ignored pets + --ignored pets _detalhes.pets_ignored = {} _detalhes.pets_no_owner = {} _detalhes.pets_players = {} - --> dual candidates + --dual candidates _detalhes.duel_candidates = {} - --> armazena as skins dispon�veis para as janelas + --armazena as skins dispon�veis para as janelas _detalhes.skins = {} - --> armazena os hooks das fun��es do parser + --armazena os hooks das fun��es do parser _detalhes.hooks = {} - --> informa��es sobre a luta do boss atual + --informa��es sobre a luta do boss atual _detalhes.encounter_end_table = {} _detalhes.encounter_table = {} _detalhes.encounter_counter = {} _detalhes.encounter_dungeons = {} - --> unitId dos inimigos dentro de uma arena + --unitId dos inimigos dentro de uma arena _detalhes.arena_enemies = {} - --> reliable char data sources - --> actors that are using details! and sent character data, we don't need query inspect on these actors + --reliable char data sources + --actors that are using details! and sent character data, we don't need query inspect on these actors _detalhes.trusted_characters = {} - --> informa��es sobre a arena atual + --informa��es sobre a arena atual _detalhes.arena_table = {} _detalhes.arena_info = { - --> need to get the new mapID for 8.0.1 + --need to get the new mapID for 8.0.1 [562] = {file = "LoadScreenBladesEdgeArena", coords = {0, 1, 0.29296875, 0.9375}}, -- Circle of Blood Arena [617] = {file = "LoadScreenDalaranSewersArena", coords = {0, 1, 0.29296875, 0.857421875}}, --Dalaran Arena [559] = {file = "LoadScreenNagrandArenaBattlegrounds", coords = {0, 1, 0.341796875, 1}}, --Ring of Trials [980] = {file = "LoadScreenTolvirArena", coords = {0, 1, 0.29296875, 0.857421875}}, --Tol'Viron Arena [572] = {file = "LoadScreenRuinsofLordaeronBattlegrounds", coords = {0, 1, 0.341796875, 1}}, --Ruins of Lordaeron [1134] = {file = "LoadingScreen_Shadowpan_bg", coords = {0, 1, 0.29296875, 0.857421875}}, -- Tiger's Peak - --> legion, thanks @pas06 on curse forge for the mapIds + --legion, thanks @pas06 on curse forge for the mapIds [1552] = {file = "LoadingScreen_ArenaValSharah_wide", coords = {0, 1, 0.29296875, 0.857421875}}, -- Ashmane's Fall [1504] = {file = "LoadingScreen_BlackrookHoldArena_wide", coords = {0, 1, 0.29296875, 0.857421875}}, --Black Rook Hold @@ -448,7 +448,7 @@ do end end _detalhes.battleground_info = { - --> need to get the nwee mapID for 8.0.1 + --need to get the nwee mapID for 8.0.1 [489] = {file = "LoadScreenWarsongGulch", coords = {0, 1, 121/512, 484/512}}, --warsong gulch [727] = {file = "LoadScreenSilvershardMines", coords = {0, 1, 251/1024, 840/1024}}, --silvershard mines [529] = {file = "LoadscreenArathiBasin", coords = {0, 1, 126/512, 430/512}}, --arathi basin @@ -469,7 +469,7 @@ do end end - --> tokenid + --tokenid _detalhes.TokenID = { ["SPELL_PERIODIC_DAMAGE"] = 1, ["SPELL_EXTRA_ATTACKS"] = 2, @@ -507,11 +507,11 @@ do ["UNIT_DESTROYED"] = 34, } - --> armazena instancias inativas + --armazena instancias inativas _detalhes.unused_instances = {} _detalhes.default_skin_to_use = "Minimalistic" _detalhes.instance_title_text_timer = {} - --> player detail skin + --player detail skin _detalhes.playerdetailwindow_skins = {} _detalhes.BitfieldSwapDebuffsIDs = {265646, 272407, 269691, 273401, 269131, 260900, 260926, 284995, 292826, 311367, 310567, 308996, 307832, 327414, 337253, @@ -520,7 +520,7 @@ do [360418] = true } - --> auto run code + --auto run code _detalhes.RunCodeTypes = { {Name = "On Initialization", Desc = "Run code when Details! initialize or when a profile is changed.", Value = 1, ProfileKey = "on_init"}, {Name = "On Zone Changed", Desc = "Run code when the zone where the player is in has changed (e.g. entered in a raid).", Value = 2, ProfileKey = "on_zonechanged"}, @@ -542,7 +542,7 @@ do return true end - --> tooltip + --tooltip _detalhes.tooltip_backdrop = { bgFile = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]], edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]], @@ -555,21 +555,21 @@ do _detalhes.tooltip_spell_icon = {file = [[Interface\CHARACTERFRAME\UI-StateIcon]], coords = {36/64, 58/64, 7/64, 26/64}} _detalhes.tooltip_target_icon = {file = [[Interface\Addons\Details\images\icons]], coords = {0, 0.03125, 0.126953125, 0.15625}} - --> icons + --icons _detalhes.attribute_icons = [[Interface\AddOns\Details\images\atributos_icones]] function _detalhes:GetAttributeIcon (attribute) return _detalhes.attribute_icons, 0.125 * (attribute - 1), 0.125 * attribute, 0, 1 end - --> colors + --colors _detalhes.default_backdropcolor = {.094117, .094117, .094117, .8} _detalhes.default_backdropbordercolor = {0, 0, 0, 1} - --> Plugins + --Plugins - --> plugin templates + --plugin templates - _detalhes.gump:NewColor ("DETAILS_PLUGIN_BUTTONTEXT_COLOR", 0.9999, 0.8196, 0, 1) + _detalhes.gump:NewColor("DETAILS_PLUGIN_BUTTONTEXT_COLOR", 0.9999, 0.8196, 0, 1) _detalhes.gump:InstallTemplate ("button", "DETAILS_PLUGINPANEL_BUTTON_TEMPLATE", { @@ -631,52 +631,52 @@ do _detalhes.PluginsGlobalNames = {} _detalhes.PluginsLocalizedNames = {} - --> raid ------------------------------------------------------------------- - --> general function for raid mode plugins + --raid ------------------------------------------------------------------- + --general function for raid mode plugins _detalhes.RaidTables = {} - --> menu for raid modes + --menu for raid modes _detalhes.RaidTables.Menu = {} - --> plugin objects for raid mode + --plugin objects for raid mode _detalhes.RaidTables.Plugins = {} - --> name to plugin object + --name to plugin object _detalhes.RaidTables.NameTable = {} - --> using by + --using by _detalhes.RaidTables.InstancesInUse = {} _detalhes.RaidTables.PluginsInUse = {} - --> solo ------------------------------------------------------------------- - --> general functions for solo mode plugins + --solo ------------------------------------------------------------------- + --general functions for solo mode plugins _detalhes.SoloTables = {} - --> maintain plugin menu + --maintain plugin menu _detalhes.SoloTables.Menu = {} - --> plugins objects for solo mode + --plugins objects for solo mode _detalhes.SoloTables.Plugins = {} - --> name to plugin object + --name to plugin object _detalhes.SoloTables.NameTable = {} - --> toolbar ------------------------------------------------------------------- - --> plugins container + --toolbar ------------------------------------------------------------------- + --plugins container _detalhes.ToolBar = {} - --> current showing icons + --current showing icons _detalhes.ToolBar.Shown = {} _detalhes.ToolBar.AllButtons = {} - --> plugin objects + --plugin objects _detalhes.ToolBar.Plugins = {} - --> name to plugin object + --name to plugin object _detalhes.ToolBar.NameTable = {} _detalhes.ToolBar.Menu = {} - --> statusbar ------------------------------------------------------------------- - --> plugins container + --statusbar ------------------------------------------------------------------- + --plugins container _detalhes.StatusBar = {} - --> maintain plugin menu + --maintain plugin menu _detalhes.StatusBar.Menu = {} - --> plugins object + --plugins object _detalhes.StatusBar.Plugins = {} - --> name to plugin object + --name to plugin object _detalhes.StatusBar.NameTable = {} - --> constants + --constants if(DetailsFramework.IsWotLKWow()) then --[[global]] DETAILS_HEALTH_POTION_ID = 33447 -- Runic Healing Potion --[[global]] DETAILS_HEALTH_POTION2_ID = 41166 -- Runic Healing Injector @@ -731,25 +731,25 @@ do --[[global]] DETAILS_MODE_ALL = 3 _detalhes._detalhes_props = { - DATA_TYPE_START = 1, --> Something on start - DATA_TYPE_END = 2, --> Something on end + DATA_TYPE_START = 1, --Something on start + DATA_TYPE_END = 2, --Something on end - MODO_ALONE = 1, --> Solo - MODO_GROUP = 2, --> Group - MODO_ALL = 3, --> Everything - MODO_RAID = 4, --> Raid + MODO_ALONE = 1, --Solo + MODO_GROUP = 2, --Group + MODO_ALL = 3, --Everything + MODO_RAID = 4, --Raid } _detalhes.modos = { - alone = 1, --> Solo - group = 2, --> Group - all = 3, --> Everything - raid = 4 --> Raid + alone = 1, --Solo + group = 2, --Group + all = 3, --Everything + raid = 4 --Raid } _detalhes.divisores = { - abre = "(", --> open - fecha = ")", --> close - colocacao = ". " --> dot + abre = "(", --open + fecha = ")", --close + colocacao = ". " --dot } _detalhes.role_texcoord = { @@ -833,7 +833,7 @@ do --[[global]] DETAILS_MODE_ALL = 3 _detalhes.icones = { - --> report window + --report window report = { up = "Interface\\FriendsFrame\\UI-Toast-FriendOnlineIcon", down = "Interface\\ItemAnimations\\MINIMAP\\TRACKING\\Profession", @@ -842,7 +842,7 @@ do } } - _detalhes.missTypes = {"ABSORB", "BLOCK", "DEFLECT", "DODGE", "EVADE", "IMMUNE", "MISS", "PARRY", "REFLECT", "RESIST"} --> do not localize-me + _detalhes.missTypes = {"ABSORB", "BLOCK", "DEFLECT", "DODGE", "EVADE", "IMMUNE", "MISS", "PARRY", "REFLECT", "RESIST"} --do not localize-me function Details.SendHighFive() @@ -856,16 +856,16 @@ do end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> frames +--frames local _CreateFrame = CreateFrame --api locals local _UIParent = UIParent --api locals - --> Info Window + --Info Window _detalhes.playerDetailWindow = _CreateFrame ("Frame", "DetailsPlayerDetailsWindow", _UIParent, "BackdropTemplate") _detalhes.PlayerDetailsWindow = _detalhes.playerDetailWindow - --> Event Frame + --Event Frame _detalhes.listener = _CreateFrame ("Frame", nil, _UIParent) _detalhes.listener:RegisterEvent ("ADDON_LOADED") _detalhes.listener:SetFrameStrata ("LOW") @@ -875,13 +875,13 @@ do _detalhes.overlay_frame = _CreateFrame ("Frame", nil, _UIParent) _detalhes.overlay_frame:SetFrameStrata ("TOOLTIP") - --> Pet Owner Finder + --Pet Owner Finder _CreateFrame ("GameTooltip", "DetailsPetOwnerFinder", nil, "GameTooltipTemplate") ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> plugin defaults - --> backdrop +--plugin defaults + --backdrop _detalhes.PluginDefaults = {} _detalhes.PluginDefaults.Backdrop = {bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, @@ -896,19 +896,19 @@ do ------------------------------------------------------------------------------------------ ---> welcome panel +-- welcome panel function _detalhes:CreateWelcomePanel (name, parent, width, height, make_movable) - local f = CreateFrame ("frame", name, parent or UIParent, "BackdropTemplate") + local f = CreateFrame("frame", name, parent or UIParent, "BackdropTemplate") - --f:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 128, insets = {left=3, right=3, top=3, bottom=3}, edgeFile = [[Interface\AddOns\Details\images\border_welcome]], edgeSize = 16}) - f:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 128, insets = {left=0, right=0, top=0, bottom=0}, edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1}) - f:SetBackdropColor (1, 1, 1, 0.75) - f:SetBackdropBorderColor (0, 0, 0, 1) + --f:SetBackdrop({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 128, insets = {left=3, right=3, top=3, bottom=3}, edgeFile = [[Interface\AddOns\Details\images\border_welcome]], edgeSize = 16}) + f:SetBackdrop({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 128, insets = {left=0, right=0, top=0, bottom=0}, edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1}) + f:SetBackdropColor(1, 1, 1, 0.75) + f:SetBackdropBorderColor(0, 0, 0, 1) f:SetSize(width or 1, height or 1) if (make_movable) then - f:SetScript ("OnMouseDown", function(self, button) + f:SetScript("OnMouseDown", function(self, button) if (self.isMoving) then return end @@ -919,7 +919,7 @@ do self.isMoving = true end end) - f:SetScript ("OnMouseUp", function(self, button) + f:SetScript("OnMouseUp", function(self, button) if (self.isMoving and button == "LeftButton") then self:StopMovingOrSizing() self.isMoving = nil @@ -933,12 +933,12 @@ do end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> functions +--functions _detalhes.empty_function = function() end _detalhes.empty_table = {} - --> register textures and fonts for shared media + --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]]) @@ -984,9 +984,9 @@ do - --> dump table contents over chat panel + --dump table contents over chat panel function Details.VarDump(t) - if (type (t) ~= "table") then + if (type(t) ~= "table") then return end for a,b in pairs (t) do @@ -998,7 +998,7 @@ do return Details:Dump(value) end - --> copies a full table + --copies a full table function Details.CopyTable(orig) local orig_type = type(orig) local copy @@ -1014,31 +1014,31 @@ do return copy end - --> delay messages + --delay messages function _detalhes:DelayMsg (msg) _detalhes.delaymsgs = _detalhes.delaymsgs or {} _detalhes.delaymsgs [#_detalhes.delaymsgs+1] = msg end function _detalhes:ShowDelayMsg() if (_detalhes.delaymsgs and #_detalhes.delaymsgs > 0) then - for _, msg in ipairs (_detalhes.delaymsgs) do + for _, msg in ipairs(_detalhes.delaymsgs) do print (msg) end end _detalhes.delaymsgs = {} end - --> print messages + --print messages function _detalhes:Msg (_string, arg1, arg2, arg3, arg4) if (self.__name) then - --> yes, we have a name! + --yes, we have a name! print ("|cffffaeae" .. self.__name .. "|r |cffcc7c7c(plugin)|r: " .. (_string or ""), arg1 or "", arg2 or "", arg3 or "", arg4 or "") else print (Loc ["STRING_DETAILS1"] .. (_string or ""), arg1 or "", arg2 or "", arg3 or "", arg4 or "") end end - --> welcome + --welcome function _detalhes:WelcomeMsgLogon() _detalhes:Msg ("you can always reset the addon running the command |cFFFFFF00'/details reinstall'|r if it does fail to load after being updated.") @@ -1060,8 +1060,8 @@ do Details.failed_to_load = C_Timer.NewTimer(1, function() Details.Schedules.NewTimer(20, _detalhes.WelcomeMsgLogon) end) - --> key binds - --> header + --key binds + --header _G ["BINDING_HEADER_Details"] = "Details!" _G ["BINDING_HEADER_DETAILS_KEYBIND_SEGMENTCONTROL"] = Loc ["STRING_KEYBIND_SEGMENTCONTROL"] _G ["BINDING_HEADER_DETAILS_KEYBIND_SCROLLING"] = Loc ["STRING_KEYBIND_SCROLLING"] @@ -1069,7 +1069,7 @@ do _G ["BINDING_HEADER_DETAILS_KEYBIND_BOOKMARK"] = Loc ["STRING_KEYBIND_BOOKMARK"] _G ["BINDING_HEADER_DETAILS_KEYBIND_REPORT"] = Loc ["STRING_KEYBIND_WINDOW_REPORT_HEADER"] - --> keys + --keys _G ["BINDING_NAME_DETAILS_TOGGLE_ALL"] = Loc ["STRING_KEYBIND_TOGGLE_WINDOWS"] diff --git a/classes/class_combat.lua b/classes/class_combat.lua index 68fcc8e9..85fc4b3f 100644 --- a/classes/class_combat.lua +++ b/classes/class_combat.lua @@ -7,7 +7,7 @@ --[[global]] DETAILS_TOTALS_ONLYGROUP = true ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> local pointers +--local pointers local _setmetatable = setmetatable -- lua local local _ipairs = ipairs -- lua local @@ -21,7 +21,7 @@ local _GetTime = GetTime ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> constants +--constants local combate = _detalhes.combate local container_combatentes = _detalhes.container_combatentes @@ -37,7 +37,7 @@ local _tempo = _GetTime() ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> api functions +--api functions --combat (container type, actor name) _detalhes.call_combate = function(self, class_type, name) @@ -202,7 +202,7 @@ --[[global]] DETAILS_SEGMENTTYPE_PVP_BATTLEGROUND = 21 function combate:GetCombatType() - --> mythic dungeon + --mythic dungeon local isMythicDungeon = is_mythic_dungeon_segment if (isMythicDungeon) then local isMythicDungeonTrash = self.is_mythic_dungeon_trash @@ -226,19 +226,19 @@ end end - --> arena + --arena local arenaInfo = self.is_arena if (arenaInfo) then return DETAILS_SEGMENTTYPE_PVP_ARENA end - --> battleground + --battleground local battlegroundInfo = self.is_pvp if (battlegroundInfo) then return DETAILS_SEGMENTTYPE_PVP_BATTLEGROUND end - --> dungeon or raid + --dungeon or raid local instanceType = self.instance_type if (instanceType == "party") then @@ -258,7 +258,7 @@ end end - --> overall data + --overall data if (self == _detalhes.tabela_overall) then return DETAILS_SEGMENTTYPE_OVERALL end @@ -282,7 +282,7 @@ --return the combat time in seconds function combate:GetFormatedCombatTime() local time = self:GetCombatTime() - local m, s = _math_floor (time/60), _math_floor (time%60) + local m, s = _math_floor(time/60), _math_floor(time%60) return m, s end @@ -322,7 +322,7 @@ end elseif (attribute == 3) then - if (subAttribute == 5) then --> resources + if (subAttribute == 5) then --resources return self.totals.resources or 0 end if (onlyGroup) then @@ -435,7 +435,7 @@ end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> internals +--internals function combate:CreateNewCombatTable() return combate:NovaTabela() @@ -446,72 +446,72 @@ local esta_tabela = {true, true, true, true, true} - esta_tabela [1] = container_combatentes:NovoContainer (_detalhes.container_type.CONTAINER_DAMAGE_CLASS, esta_tabela, combatId) --> Damage - esta_tabela [2] = container_combatentes:NovoContainer (_detalhes.container_type.CONTAINER_HEAL_CLASS, esta_tabela, combatId) --> Healing - esta_tabela [3] = container_combatentes:NovoContainer (_detalhes.container_type.CONTAINER_ENERGY_CLASS, esta_tabela, combatId) --> Energies - esta_tabela [4] = container_combatentes:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS, esta_tabela, combatId) --> Misc - esta_tabela [5] = container_combatentes:NovoContainer (_detalhes.container_type.CONTAINER_DAMAGE_CLASS, esta_tabela, combatId) --> place holder for customs + esta_tabela [1] = container_combatentes:NovoContainer (_detalhes.container_type.CONTAINER_DAMAGE_CLASS, esta_tabela, combatId) --Damage + esta_tabela [2] = container_combatentes:NovoContainer (_detalhes.container_type.CONTAINER_HEAL_CLASS, esta_tabela, combatId) --Healing + esta_tabela [3] = container_combatentes:NovoContainer (_detalhes.container_type.CONTAINER_ENERGY_CLASS, esta_tabela, combatId) --Energies + esta_tabela [4] = container_combatentes:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS, esta_tabela, combatId) --Misc + esta_tabela [5] = container_combatentes:NovoContainer (_detalhes.container_type.CONTAINER_DAMAGE_CLASS, esta_tabela, combatId) --place holder for customs _setmetatable (esta_tabela, combate) _detalhes.combat_counter = _detalhes.combat_counter + 1 esta_tabela.combat_counter = _detalhes.combat_counter - --> try discover if is a pvp combat + --try discover if is a pvp combat local who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags = ... - if (who_serial) then --> aqui ir� identificar o boss ou o oponente - if (alvo_name and _bit_band (alvo_flags, REACTION_HOSTILE) ~= 0) then --> tentando pegar o inimigo pelo alvo + if (who_serial) then --aqui ir� identificar o boss ou o oponente + if (alvo_name and _bit_band (alvo_flags, REACTION_HOSTILE) ~= 0) then --tentando pegar o inimigo pelo alvo esta_tabela.contra = alvo_name if (_bit_band (alvo_flags, CONTROL_PLAYER) ~= 0) then - esta_tabela.pvp = true --> o alvo � da fac��o oposta ou foi dado mind control + esta_tabela.pvp = true --o alvo � da fac��o oposta ou foi dado mind control end - elseif (who_name and _bit_band (who_flags, REACTION_HOSTILE) ~= 0) then --> tentando pegar o inimigo pelo who caso o mob � quem deu o primeiro hit + elseif (who_name and _bit_band (who_flags, REACTION_HOSTILE) ~= 0) then --tentando pegar o inimigo pelo who caso o mob � quem deu o primeiro hit esta_tabela.contra = who_name if (_bit_band (who_flags, CONTROL_PLAYER) ~= 0) then - esta_tabela.pvp = true --> o who � da fac��o oposta ou foi dado mind control + esta_tabela.pvp = true --o who � da fac��o oposta ou foi dado mind control end else - esta_tabela.pvp = true --> se ambos s�o friendly, seria isso um PVP entre jogadores da mesma fac��o? + esta_tabela.pvp = true --se ambos s�o friendly, seria isso um PVP entre jogadores da mesma fac��o? end end - --> start/end time (duration) + --start/end time (duration) esta_tabela.data_fim = 0 esta_tabela.data_inicio = 0 esta_tabela.tempo_start = _tempo - --> record deaths + --record deaths esta_tabela.last_events_tables = {} - --> last events from players + --last events from players esta_tabela.player_last_events = {} - --> players in the raid + --players in the raid esta_tabela.raid_roster = {} esta_tabela.raid_roster_indexed = {} - --> frags + --frags esta_tabela.frags = {} esta_tabela.frags_need_refresh = false - --> alternate power + --alternate power esta_tabela.alternate_power = {} - --> time data container + --time data container esta_tabela.TimeData = _detalhes:TimeDataCreateCombatTables() esta_tabela.PhaseData = {{1, 1}, damage = {}, heal = {}, damage_section = {}, heal_section = {}} --[1] phase number [2] phase started - --> for external plugin usage, these tables are guaranteed to be saved with the combat + --for external plugin usage, these tables are guaranteed to be saved with the combat esta_tabela.spells_cast_timeline = {} esta_tabela.aura_timeline = {} esta_tabela.cleu_timeline = {} - --> cleu events + --cleu events esta_tabela.cleu_events = { n = 1 --event counter } - --> Skill cache (not used) + --Skill cache (not used) esta_tabela.CombatSkillCache = {} -- a tabela sem o tempo de inicio � a tabela descartavel do inicio do addon @@ -531,7 +531,7 @@ esta_tabela[4].need_refresh = true esta_tabela[5].need_refresh = true - if (_tabela_overall) then --> link � a tabela de combate do overall + if (_tabela_overall) then --link � a tabela de combate do overall esta_tabela[1].shadow = _tabela_overall[1] esta_tabela[2].shadow = _tabela_overall[2] esta_tabela[3].shadow = _tabela_overall[3] @@ -539,49 +539,49 @@ end esta_tabela.totals = { - 0, --> dano - 0, --> cura - {--> e_energy - [0] = 0, --> mana - [1] = 0, --> rage - [3] = 0, --> energy (rogues cat) - [6] = 0, --> runepower (dk) + 0, --dano + 0, --cura + {--e_energy + [0] = 0, --mana + [1] = 0, --rage + [3] = 0, --energy (rogues cat) + [6] = 0, --runepower (dk) alternatepower = 0, }, - {--> misc - cc_break = 0, --> armazena quantas quebras de CC - ress = 0, --> armazena quantos pessoas ele reviveu - interrupt = 0, --> armazena quantos interrupt a pessoa deu - dispell = 0, --> armazena quantos dispell esta pessoa recebeu - dead = 0, --> armazena quantas vezes essa pessia morreu - cooldowns_defensive = 0, --> armazena quantos cooldowns a raid usou - buff_uptime = 0, --> armazena quantos cooldowns a raid usou - debuff_uptime = 0 --> armazena quantos cooldowns a raid usou + {--misc + cc_break = 0, --armazena quantas quebras de CC + ress = 0, --armazena quantos pessoas ele reviveu + interrupt = 0, --armazena quantos interrupt a pessoa deu + dispell = 0, --armazena quantos dispell esta pessoa recebeu + dead = 0, --armazena quantas vezes essa pessia morreu + cooldowns_defensive = 0, --armazena quantos cooldowns a raid usou + buff_uptime = 0, --armazena quantos cooldowns a raid usou + debuff_uptime = 0 --armazena quantos cooldowns a raid usou }, - --> avoid using this values bellow, they aren't updated by the parser, only on demand by a user interaction. + --avoid using this values bellow, they aren't updated by the parser, only on demand by a user interaction. voidzone_damage = 0, frags_total = 0, - --> end + --end } esta_tabela.totals_grupo = { - 0, --> dano - 0, --> cura - {--> e_energy - [0] = 0, --> mana - [1] = 0, --> rage - [3] = 0, --> energy (rogues cat) - [6] = 0, --> runepower (dk) + 0, --dano + 0, --cura + {--e_energy + [0] = 0, --mana + [1] = 0, --rage + [3] = 0, --energy (rogues cat) + [6] = 0, --runepower (dk) alternatepower = 0, }, - {--> misc - cc_break = 0, --> armazena quantas quebras de CC - ress = 0, --> armazena quantos pessoas ele reviveu - interrupt = 0, --> armazena quantos interrupt a pessoa deu - dispell = 0, --> armazena quantos dispell esta pessoa recebeu - dead = 0, --> armazena quantas vezes essa oessia morreu - cooldowns_defensive = 0, --> armazena quantos cooldowns a raid usou + {--misc + cc_break = 0, --armazena quantas quebras de CC + ress = 0, --armazena quantos pessoas ele reviveu + interrupt = 0, --armazena quantos interrupt a pessoa deu + dispell = 0, --armazena quantos dispell esta pessoa recebeu + dead = 0, --armazena quantas vezes essa oessia morreu + cooldowns_defensive = 0, --armazena quantos cooldowns a raid usou buff_uptime = 0, debuff_uptime = 0 } @@ -591,7 +591,7 @@ end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> core +--core function combate:CreateLastEventsTable (player_name) local t = {} @@ -606,7 +606,7 @@ --trava o tempo dos jogadores ap�s o t�rmino do combate. function combate:TravarTempos() if (self [1]) then - for _, jogador in _ipairs (self [1]._ActorTable) do --> damage + for _, jogador in _ipairs(self [1]._ActorTable) do --damage if (jogador:Iniciar()) then -- retorna se ele esta com o dps ativo jogador:TerminarTempo() jogador:Iniciar (false) --trava o dps do jogador @@ -621,7 +621,7 @@ end end if (self [2]) then - for _, jogador in _ipairs (self [2]._ActorTable) do --> healing + for _, jogador in _ipairs(self [2]._ActorTable) do --healing if (jogador:Iniciar()) then -- retorna se ele esta com o dps ativo jogador:TerminarTempo() jogador:Iniciar (false) --trava o dps do jogador @@ -670,50 +670,50 @@ return end - --> sub dano - for index, actor_T2 in _ipairs (combate2[1]._ActorTable) do + --sub dano + for index, actor_T2 in _ipairs(combate2[1]._ActorTable) do local actor_T1 = combate1[1]:PegarCombatente (actor_T2.serial, actor_T2.nome, actor_T2.flag_original, true) actor_T1 = actor_T1 - actor_T2 actor_T2:subtract_total (combate1) end combate1 [1].need_refresh = true - --> sub heal - for index, actor_T2 in _ipairs (combate2[2]._ActorTable) do + --sub heal + for index, actor_T2 in _ipairs(combate2[2]._ActorTable) do local actor_T1 = combate1[2]:PegarCombatente (actor_T2.serial, actor_T2.nome, actor_T2.flag_original, true) actor_T1 = actor_T1 - actor_T2 actor_T2:subtract_total (combate1) end combate1 [2].need_refresh = true - --> sub energy - for index, actor_T2 in _ipairs (combate2[3]._ActorTable) do + --sub energy + for index, actor_T2 in _ipairs(combate2[3]._ActorTable) do local actor_T1 = combate1[3]:PegarCombatente (actor_T2.serial, actor_T2.nome, actor_T2.flag_original, true) actor_T1 = actor_T1 - actor_T2 actor_T2:subtract_total (combate1) end combate1 [3].need_refresh = true - --> sub misc - for index, actor_T2 in _ipairs (combate2[4]._ActorTable) do + --sub misc + for index, actor_T2 in _ipairs(combate2[4]._ActorTable) do local actor_T1 = combate1[4]:PegarCombatente (actor_T2.serial, actor_T2.nome, actor_T2.flag_original, true) actor_T1 = actor_T1 - actor_T2 actor_T2:subtract_total (combate1) end combate1 [4].need_refresh = true - --> reduz o tempo + --reduz o tempo combate1.start_time = combate1.start_time + combate2:GetCombatTime() - --> apaga as mortes da luta diminuida - local amt_mortes = #combate2.last_events_tables --> quantas mortes teve nessa luta + --apaga as mortes da luta diminuida + local amt_mortes = #combate2.last_events_tables --quantas mortes teve nessa luta if (amt_mortes > 0) then for i = #combate1.last_events_tables, #combate1.last_events_tables-amt_mortes, -1 do _table_remove (combate1.last_events_tables, #combate1.last_events_tables) end end - --> frags + --frags for fragName, fragAmount in pairs (combate2.frags) do if (fragAmount) then if (combate1.frags [fragName]) then @@ -725,7 +725,7 @@ end combate1.frags_need_refresh = true - --> alternate power + --alternate power local overallPowerTable = combate1.alternate_power for actorName, powerTable in pairs (combate2.alternate_power) do local power = overallPowerTable [actorName] @@ -747,8 +747,8 @@ custom_combat = combate1 end - for class_type, actor_container in ipairs (all_containers) do - for _, actor in ipairs (actor_container) do + for class_type, actor_container in ipairs(all_containers) do + for _, actor in ipairs(actor_container) do local shadow if (class_type == class_type_dano) then @@ -767,7 +767,7 @@ end end - --> alternate power + --alternate power local overallPowerTable = combate1.alternate_power for actorName, powerTable in pairs (combate2.alternate_power) do local power = overallPowerTable [actorName] diff --git a/classes/class_custom.lua b/classes/class_custom.lua index 3f0f6aa9..4e6fa2db 100644 --- a/classes/class_custom.lua +++ b/classes/class_custom.lua @@ -1,4 +1,4 @@ ---> customized display script +--customized display script local _detalhes = _G._detalhes local gump = _detalhes.gump @@ -7,7 +7,7 @@ _detalhes.custom_function_cache = {} ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> local pointers +--local pointers local _cstr = string.format --lua local local _math_floor = math.floor --lua local @@ -37,7 +37,7 @@ local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> constants +--constants local atributo_custom = _detalhes.atributo_custom atributo_custom.mt = {__index = atributo_custom} @@ -47,7 +47,7 @@ ["healdone"] = 2, } - --> hold the mini custom objects + --hold the mini custom objects atributo_custom._InstanceActorContainer = {} atributo_custom._InstanceLastCustomShown = {} atributo_custom._InstanceLastCombatShown = {} @@ -61,7 +61,7 @@ local UsingCustomLeftText = false ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> core +--core function atributo_custom:GetCombatContainerIndex (attribute) return combat_containers [attribute] @@ -69,17 +69,17 @@ function atributo_custom:RefreshWindow (instance, combat, force, export) - --> get the custom object + --get the custom object local custom_object = instance:GetCustomObject() if (not custom_object) then return instance:ResetAttribute() end - --> save the custom name in the instance + --save the custom name in the instance instance.customName = custom_object:GetName() - --> get the container holding the custom actor objects for this instance + --get the container holding the custom actor objects for this instance local instance_container = atributo_custom:GetInstanceCustomActorContainer (instance) local last_shown = atributo_custom._InstanceLastCustomShown [instance:GetId()] @@ -94,15 +94,15 @@ end atributo_custom._InstanceLastCombatShown [instance:GetId()] = combat - --> declare the main locals + --declare the main locals local total = 0 local top = 0 local amount = 0 - --> check if is a custom script (if has .script) + --check if is a custom script (if has .script) if (custom_object:IsScripted()) then - --> be save reseting the values on every refresh + --be save reseting the values on every refresh instance_container:ResetCustomActorContainer() local func @@ -166,17 +166,17 @@ amount = _amount or 0 else --does not have a .script - --> get the attribute + --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 + --get the combat container local container_index = self:GetCombatContainerIndex (attribute) local combat_container = combat [container_index]._ActorTable - --> build container + --build container total, top, amount = atributo_custom:BuildActorList (func, custom_object.source, custom_object.target, custom_object.spellid, combat, combat_container, container_index, instance_container, instance, custom_object) end @@ -190,7 +190,7 @@ if (force) then if (instance:IsGroupMode()) then for i = 1, instance.rows_fit_in_window do - Details.FadeHandler.Fader (instance.barras [i], "in", Details.fade_speed) + Details.FadeHandler.Fader(instance.barras [i], "in", Details.fade_speed) end end end @@ -216,33 +216,33 @@ local total_script = _detalhes.custom_function_cache [instance.customName .. "Total"] local okey - for index, actor in _ipairs (instance_container._ActorTable) do + for index, actor in _ipairs(instance_container._ActorTable) do local percent, ptotal if (percent_script) then - okey, percent = _pcall (percent_script, _math_floor (actor.value), top, total, combat, instance, actor) + okey, percent = _pcall (percent_script, _math_floor(actor.value), top, total, combat, instance, actor) if (not okey) then _detalhes:Msg ("|cFFFF9900percent script error|r:", percent) return _detalhes:EndRefresh (instance, 0, combat, combat [1]) end else - percent = _cstr ("%.1f", _math_floor (actor.value) / total * 100) + percent = _cstr ("%.1f", _math_floor(actor.value) / total * 100) end if (total_script) then - local okey, value = _pcall (total_script, _math_floor (actor.value), top, total, combat, instance, actor) + local okey, value = _pcall (total_script, _math_floor(actor.value), top, total, combat, instance, actor) if (not okey) then _detalhes:Msg ("|cFFFF9900total script error|r:", value) return _detalhes:EndRefresh (instance, 0, combat, combat [1]) end - if (type (value) == "number") then + if (type(value) == "number") then value = SelectedToKFunction (_, value) end ptotal = value else - ptotal = SelectedToKFunction (_, _math_floor (actor.value)) + ptotal = SelectedToKFunction (_, _math_floor(actor.value)) end actor.report_value = ptotal .. " (" .. percent .. "%)" @@ -275,13 +275,13 @@ function atributo_custom:BuildActorList (func, source, target, spellid, combat, combat_container, container_index, instance_container, instance, custom_object) - --> do the loop + --do the loop local total = 0 local top = 0 local amount = 0 - --> check if is a spell target custom + --check if is a spell target custom if (custom_object:IsSpellTarget()) then table.wipe (atributo_custom._TargetActorsProcessed) atributo_custom._TargetActorsProcessedAmt = 0 @@ -292,7 +292,7 @@ if (source == "[all]") then - for _, actor in _ipairs (combat_container) do + for _, actor in _ipairs(combat_container) do local actortotal = func (_, actor, source, target, spellid, combat, instance_container) if (actortotal > 0) then total = total + actortotal @@ -302,7 +302,7 @@ top = actortotal end - instance_container:SetValue (actor, actortotal) + instance_container:SetValue(actor, actortotal) end end @@ -316,7 +316,7 @@ end end - for _, actor in _ipairs (combat_container) do + for _, actor in _ipairs(combat_container) do if (actor.grupo) then if (not func) then Details:Msg("error on class_custom 'func' is invalid, backtrace:", debugstack()) @@ -332,7 +332,7 @@ top = actortotal end - instance_container:SetValue (actor, actortotal) + instance_container:SetValue(actor, actortotal) end end @@ -352,7 +352,7 @@ top = actortotal end - instance_container:SetValue (actor, actortotal) + instance_container:SetValue(actor, actortotal) end end else @@ -370,7 +370,7 @@ top = actortotal end - instance_container:SetValue (actor, actortotal) + instance_container:SetValue(actor, actortotal) end end end @@ -379,7 +379,7 @@ end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> refresh functions +--refresh functions function atributo_custom:Refresh (instance, instance_container, combat, force, total, top, custom_object) local whichRowLine = 1 @@ -390,7 +390,7 @@ UsingCustomLeftText = instance.row_info.textL_enable_custom_text UsingCustomRightText = instance.row_info.textR_enable_custom_text - --> total bar + --total bar local use_total_bar = false if (instance.total_bar.enabled) then use_total_bar = true @@ -418,17 +418,17 @@ local row1 = barras_container [1] row1.minha_tabela = nil - row1.lineText1:SetText (Loc ["STRING_TOTAL"]) - row1.lineText4:SetText (_detalhes:ToK2 (total) .. " (" .. _detalhes:ToK (total / combat_time) .. ")") + row1.lineText1:SetText(Loc ["STRING_TOTAL"]) + row1.lineText4:SetText(_detalhes:ToK2 (total) .. " (" .. _detalhes:ToK (total / combat_time) .. ")") - row1:SetValue (100) + row1:SetValue(100) local r, g, b = unpack (instance.total_bar.color) row1.textura:SetVertexColor (r, g, b) - row1.icone_classe:SetTexture (instance.total_bar.icon) + row1.icone_classe:SetTexture(instance.total_bar.icon) row1.icone_classe:SetTexCoord (0.0625, 0.9375, 0.0625, 0.9375) - Details.FadeHandler.Fader (row1, "out") + Details.FadeHandler.Fader(row1, "out") for i = instance.barraS[1], iter_last, 1 do instance_container._ActorTable[i]:UpdateBar (barras_container, whichRowLine, percentage_type, i, total, top, instance, force, percent_script, total_script, combat, bars_show_data, bars_brackets, bars_separator) @@ -454,25 +454,25 @@ local row1 = barras_container [1] row1.minha_tabela = nil - row1.lineText1:SetText (Loc ["STRING_TOTAL"]) - row1.lineText4:SetText (_detalhes:ToK2 (total) .. " (" .. _detalhes:ToK (total / combat_time) .. ")") + row1.lineText1:SetText(Loc ["STRING_TOTAL"]) + row1.lineText4:SetText(_detalhes:ToK2 (total) .. " (" .. _detalhes:ToK (total / combat_time) .. ")") - row1:SetValue (100) + row1:SetValue(100) local r, g, b = unpack (instance.total_bar.color) row1.textura:SetVertexColor (r, g, b) - row1.icone_classe:SetTexture (instance.total_bar.icon) + row1.icone_classe:SetTexture(instance.total_bar.icon) row1.icone_classe:SetTexCoord (0.0625, 0.9375, 0.0625, 0.9375) - Details.FadeHandler.Fader (row1, "out") + Details.FadeHandler.Fader(row1, "out") - for i = iter_last, instance.barraS[1], -1 do --> vai atualizar s� o range que esta sendo mostrado + for i = iter_last, instance.barraS[1], -1 do --vai atualizar s� o range que esta sendo mostrado instance_container._ActorTable[i]:UpdateBar (barras_container, whichRowLine, percentage_type, i, total, top, instance, force, percent_script, total_script, combat, bars_show_data, bars_brackets, bars_separator) whichRowLine = whichRowLine+1 end else - for i = instance.barraS[2], instance.barraS[1], -1 do --> vai atualizar s� o range que esta sendo mostrado + for i = instance.barraS[2], instance.barraS[1], -1 do --vai atualizar s� o range que esta sendo mostrado instance_container._ActorTable[i]:UpdateBar (barras_container, whichRowLine, percentage_type, i, total, top, instance, force, percent_script, total_script, combat, bars_show_data, bars_brackets, bars_separator) whichRowLine = whichRowLine+1 end @@ -483,14 +483,14 @@ if (force) then if (instance:IsGroupMode()) then for i = whichRowLine, instance.rows_fit_in_window do - Details.FadeHandler.Fader (instance.barras [i], "in", Details.fade_speed) + Details.FadeHandler.Fader(instance.barras [i], "in", Details.fade_speed) end end end end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> custom object functions +--custom object functions local actor_class_color_r, actor_class_color_g, actor_class_color_b @@ -506,7 +506,7 @@ local percent local okey - --> percent + --percent if (percent_script) then --local value, top, total, combat, instance = ... okey, percent = _pcall (percent_script, self.value, top, total, combat, instance, self) @@ -526,7 +526,7 @@ percent = "" end - --> total done + --total done if (total_script) then local okey, value = _pcall (total_script, self.value, top, total, combat, instance, self) if (not okey) then @@ -542,10 +542,10 @@ end else - if (type (value) == "number") then - row.lineText4:SetText (SelectedToKFunction (_, value) .. bars_brackets[1] .. percent .. bars_brackets[2]) + if (type(value) == "number") then + row.lineText4:SetText(SelectedToKFunction (_, value) .. bars_brackets[1] .. percent .. bars_brackets[2]) else - row.lineText4:SetText (value .. bars_brackets[1] .. percent .. bars_brackets[2]) + row.lineText4:SetText(value .. bars_brackets[1] .. percent .. bars_brackets[2]) end row.lineText3:SetText("") row.lineText2:SetText("") @@ -555,19 +555,19 @@ local rightText = formated_value .. bars_brackets[1] .. percent .. bars_brackets[2] if (UsingCustomRightText) then - row.lineText4:SetText (_string_replace (instance.row_info.textR_custom_text, formated_value, "", percent, self, combat, instance, rightText)) + row.lineText4:SetText(_string_replace (instance.row_info.textR_custom_text, formated_value, "", percent, self, combat, instance, rightText)) else if (instance.use_multi_fontstrings) then instance:SetInLineTexts(row, "", formated_value, percent) else - row.lineText4:SetText (rightText) + row.lineText4:SetText(rightText) row.lineText3:SetText("") row.lineText2:SetText("") end end end - local row_value = _math_floor ((self.value / top) * 100) + local row_value = _math_floor((self.value / top) * 100) -- update tooltip function -- @@ -593,13 +593,13 @@ function atributo_custom:RefreshBarra2 (esta_barra, instancia, tabela_anterior, forcar, esta_porcentagem, whichRowLine, barras_container) - --> primeiro colocado + --primeiro colocado if (esta_barra.colocacao == 1) then if (not tabela_anterior or tabela_anterior ~= esta_barra.minha_tabela or forcar) then - esta_barra:SetValue (100) + esta_barra:SetValue(100) if (esta_barra.hidden or esta_barra.fading_in or esta_barra.faded) then - Details.FadeHandler.Fader (esta_barra, "out") + Details.FadeHandler.Fader(esta_barra, "out") end return self:RefreshBarra (esta_barra, instancia) @@ -610,8 +610,8 @@ if (esta_barra.hidden or esta_barra.fading_in or esta_barra.faded) then - esta_barra:SetValue (esta_porcentagem) - Details.FadeHandler.Fader (esta_barra, "out") + esta_barra:SetValue(esta_porcentagem) + Details.FadeHandler.Fader(esta_barra, "out") if (instancia.row_info.texture_class_colors) then esta_barra.textura:SetVertexColor (actor_class_color_r, actor_class_color_g, actor_class_color_b) @@ -623,28 +623,28 @@ return self:RefreshBarra (esta_barra, instancia) else - --> agora esta comparando se a tabela da barra � diferente da tabela na atualiza��o anterior - if (not tabela_anterior or tabela_anterior ~= esta_barra.minha_tabela or forcar) then --> aqui diz se a barra do jogador mudou de posi��o ou se ela apenas ser� atualizada + --agora esta comparando se a tabela da barra � diferente da tabela na atualiza��o anterior + if (not tabela_anterior or tabela_anterior ~= esta_barra.minha_tabela or forcar) then --aqui diz se a barra do jogador mudou de posi��o ou se ela apenas ser� atualizada - esta_barra:SetValue (esta_porcentagem) + esta_barra:SetValue(esta_porcentagem) - esta_barra.last_value = esta_porcentagem --> reseta o ultimo valor da barra + esta_barra.last_value = esta_porcentagem --reseta o ultimo valor da barra if (_detalhes.is_using_row_animations and forcar) then esta_barra.tem_animacao = 0 - esta_barra:SetScript ("OnUpdate", nil) + esta_barra:SetScript("OnUpdate", nil) end return self:RefreshBarra (esta_barra, instancia) - elseif (esta_porcentagem ~= esta_barra.last_value) then --> continua mostrando a mesma tabela ent�o compara a porcentagem - --> apenas atualizar + elseif (esta_porcentagem ~= esta_barra.last_value) then --continua mostrando a mesma tabela ent�o compara a porcentagem + --apenas atualizar if (_detalhes.is_using_row_animations) then local upRow = barras_container [whichRowLine-1] if (upRow) then if (upRow.statusbar:GetValue() < esta_barra.statusbar:GetValue()) then - esta_barra:SetValue (esta_porcentagem) + esta_barra:SetValue(esta_porcentagem) else instancia:AnimarBarra (esta_barra, esta_porcentagem) end @@ -652,7 +652,7 @@ instancia:AnimarBarra (esta_barra, esta_porcentagem) end else - esta_barra:SetValue (esta_porcentagem) + esta_barra:SetValue(esta_porcentagem) end esta_barra.last_value = esta_porcentagem end @@ -686,62 +686,62 @@ _detalhes:SetBarColors (esta_barra, instancia, actor_class_color_r, actor_class_color_g, actor_class_color_b) - --> we need a customized icon settings for custom displays. + --we need a customized icon settings for custom displays. if (self.classe == "UNKNOW") then - esta_barra.icone_classe:SetTexture ("Interface\\LFGFRAME\\LFGROLE_BW") + esta_barra.icone_classe:SetTexture("Interface\\LFGFRAME\\LFGROLE_BW") esta_barra.icone_classe:SetTexCoord (.25, .5, 0, 1) esta_barra.icone_classe:SetVertexColor (1, 1, 1) elseif (self.classe == "UNGROUPPLAYER") then if (self.enemy) then if (_detalhes.faction_against == "Horde") then - esta_barra.icone_classe:SetTexture ("Interface\\ICONS\\Achievement_Character_Orc_Male") + esta_barra.icone_classe:SetTexture("Interface\\ICONS\\Achievement_Character_Orc_Male") esta_barra.icone_classe:SetTexCoord (0, 1, 0, 1) else - esta_barra.icone_classe:SetTexture ("Interface\\ICONS\\Achievement_Character_Human_Male") + esta_barra.icone_classe:SetTexture("Interface\\ICONS\\Achievement_Character_Human_Male") esta_barra.icone_classe:SetTexCoord (0, 1, 0, 1) end else if (_detalhes.faction_against == "Horde") then - esta_barra.icone_classe:SetTexture ("Interface\\ICONS\\Achievement_Character_Human_Male") + esta_barra.icone_classe:SetTexture("Interface\\ICONS\\Achievement_Character_Human_Male") esta_barra.icone_classe:SetTexCoord (0, 1, 0, 1) else - esta_barra.icone_classe:SetTexture ("Interface\\ICONS\\Achievement_Character_Orc_Male") + esta_barra.icone_classe:SetTexture("Interface\\ICONS\\Achievement_Character_Orc_Male") esta_barra.icone_classe:SetTexCoord (0, 1, 0, 1) end end esta_barra.icone_classe:SetVertexColor (1, 1, 1) elseif (self.classe == "PET") then - esta_barra.icone_classe:SetTexture (instancia.row_info.icon_file) + esta_barra.icone_classe:SetTexture(instancia.row_info.icon_file) esta_barra.icone_classe:SetTexCoord (0.25, 0.49609375, 0.75, 1) esta_barra.icone_classe:SetVertexColor (actor_class_color_r, actor_class_color_g, actor_class_color_b) else if (self.id) then esta_barra.icone_classe:SetTexCoord (0.078125, 0.921875, 0.078125, 0.921875) - esta_barra.icone_classe:SetTexture (self.icon) + esta_barra.icone_classe:SetTexture(self.icon) else if (instancia.row_info.use_spec_icons) then if ((self.spec and self.spec ~= 0) or (self.my_actor.spec and self.my_actor.spec ~= 0)) then - esta_barra.icone_classe:SetTexture (instancia.row_info.spec_file) + esta_barra.icone_classe:SetTexture(instancia.row_info.spec_file) esta_barra.icone_classe:SetTexCoord (_unpack (_detalhes.class_specs_coords [self.spec or self.my_actor.spec])) else - esta_barra.icone_classe:SetTexture ([[Interface\AddOns\Details\images\classes_small]]) + esta_barra.icone_classe:SetTexture([[Interface\AddOns\Details\images\classes_small]]) esta_barra.icone_classe:SetTexCoord (_unpack (CLASS_ICON_TCOORDS [self.classe])) end else - esta_barra.icone_classe:SetTexture (instancia.row_info.icon_file) + esta_barra.icone_classe:SetTexture(instancia.row_info.icon_file) esta_barra.icone_classe:SetTexCoord (_unpack (CLASS_ICON_TCOORDS [self.classe])) end end esta_barra.icone_classe:SetVertexColor (1, 1, 1) end - --> left text + --left text self:SetBarLeftText (esta_barra, instancia, enemy, arena_enemy, arena_ally, UsingCustomLeftText) - esta_barra.lineText1:SetSize (esta_barra:GetWidth() - esta_barra.lineText4:GetStringWidth() - 20, 15) + esta_barra.lineText1:SetSize(esta_barra:GetWidth() - esta_barra.lineText4:GetStringWidth() - 20, 15) end @@ -753,8 +753,8 @@ end function atributo_custom:ResetCustomActorContainer() - for _, actor in _ipairs (self._ActorTable) do - actor.value = actor.value - _math_floor (actor.value) + for _, actor in _ipairs(self._ActorTable) do + actor.value = actor.value - _math_floor(actor.value) --actor.value = _detalhes:GetOrderNumber(actor.nome) end end @@ -806,7 +806,7 @@ function atributo_custom:GetTotalAndHighestValue() local total, top = 0, 0 - for i, actor in ipairs (self._ActorTable) do + for i, actor in ipairs(self._ActorTable) do if (actor.value > top) then top = actor.value end @@ -848,7 +848,7 @@ class = "UNKNOW" end if (class == "UNKNOW") then - --> try once again + --try once again class = _detalhes:GetClass (actor.nome or actor.name) if (class and class ~= "UNKNOW") then actor.classe = class @@ -942,14 +942,14 @@ function atributo_custom:ToolTip (instance, bar_number, row_object, keydown) - --> get the custom object + --get the custom object local custom_object = instance:GetCustomObject() if (custom_object.notooltip) then return end - --> get the actor + --get the actor local actor = self.my_actor local r, g, b @@ -985,14 +985,14 @@ end end else - --> get the attribute + --get the attribute local attribute = custom_object:GetAttribute() local container_index = atributo_custom:GetCombatContainerIndex (attribute) - --> get the tooltip function + --get the tooltip function local func = atributo_custom [attribute .. "Tooltip"] - --> build the tooltip + --build the tooltip func (_, actor, custom_object.target, custom_object.spellid, instance.showing, instance) end @@ -1060,7 +1060,7 @@ function atributo_custom:SetSpellId (spellid) self.spellid = spellid end - function atributo_custom:SetScript (code) + function atributo_custom:SetScript(code) self.script = code end function atributo_custom:SetScriptToolip (code) @@ -1078,13 +1078,13 @@ function atributo_custom:RemoveCustom (index) if (not _detalhes.tabela_instancias) then - --> do not remove customs while the addon is loading. + --do not remove customs while the addon is loading. return end table.remove (_detalhes.custom, index) - for _, instance in _ipairs (_detalhes.tabela_instancias) do + for _, instance in _ipairs(_detalhes.tabela_instancias) do if (instance.atributo == 5 and instance.sub_atributo == index) then instance:ResetAttribute() elseif (instance.atributo == 5 and instance.sub_atributo > index) then @@ -1098,9 +1098,9 @@ _detalhes.switch:OnRemoveCustom (index) end - --> export for plugins + --export for plugins function _detalhes:RemoveCustomObject (object_name) - for index, object in ipairs (_detalhes.custom) do + for index, object in ipairs(_detalhes.custom) do if (object.name == object_name) then return atributo_custom:RemoveCustom (index) end @@ -1112,16 +1112,16 @@ end function _detalhes.refresh:r_atributo_custom() - --> check for non used temp displays + --check for non used temp displays if (_detalhes.tabela_instancias) then for i = #_detalhes.custom, 1, -1 do local custom_object = _detalhes.custom [i] if (custom_object.temp) then - --> check if there is a instance showing this custom + --check if there is a instance showing this custom local showing = false - for index, instance in _ipairs (_detalhes.tabela_instancias) do + for index, instance in _ipairs(_detalhes.tabela_instancias) do if (instance.atributo == 5 and instance.sub_atributo == i) then showing = true end @@ -1134,15 +1134,15 @@ end end - --> restore metatable and indexes - for index, custom_object in _ipairs (_detalhes.custom) do + --restore metatable and indexes + for index, custom_object in _ipairs(_detalhes.custom) do _setmetatable (custom_object, atributo_custom) custom_object.__index = atributo_custom end end function _detalhes.clear:c_atributo_custom() - for _, custom_object in _ipairs (_detalhes.custom) do + for _, custom_object in _ipairs(_detalhes.custom) do custom_object.__index = nil end end @@ -1158,14 +1158,14 @@ function _detalhes:InstallCustomObject (object) local have = false if (object.script_version) then - for _, custom in ipairs (_detalhes.custom) do + for _, custom in ipairs(_detalhes.custom) do if (custom.name == object.name and (custom.script_version and custom.script_version >= object.script_version) ) then have = true break end end else - for _, custom in ipairs (_detalhes.custom) do + for _, custom in ipairs(_detalhes.custom) do if (custom.name == object.name) then have = true break @@ -1174,7 +1174,7 @@ end if (not have) then - for i, custom in ipairs (_detalhes.custom) do + for i, custom in ipairs(_detalhes.custom) do if (custom.name == object.name) then table.remove (_detalhes.custom, i) break @@ -1207,7 +1207,7 @@ local misc_container = combat:GetActorList ( DETAILS_ATTRIBUTE_MISC ) --do the loop: - for _, player in ipairs ( misc_container ) do + for _, player in ipairs( misc_container ) do --only player in group if (player:IsGroupPlayer()) then @@ -1273,7 +1273,7 @@ local focus_potion = debuff_uptime_container [DETAILS_FOCUS_POTION_ID] if (focus_potion) then local name, _, icon = GetSpellInfo(DETAILS_FOCUS_POTION_ID) - GameCooltip:AddLine (name, 1) --> can use only 1 focus potion (can't be pre-potion) + 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) end @@ -1297,14 +1297,14 @@ } local have = false - for _, custom in ipairs (self.custom) do + for _, custom in ipairs(self.custom) do if (custom.name == Loc ["STRING_CUSTOM_POT_DEFAULT"] and (custom.script_version and custom.script_version >= PotionUsed.script_version) ) then have = true break end end if (not have) then - for i, custom in ipairs (self.custom) do + for i, custom in ipairs(self.custom) do if (custom.name == Loc ["STRING_CUSTOM_POT_DEFAULT"]) then table.remove (self.custom, i) end @@ -1334,7 +1334,7 @@ --do the loop local AllHealCharacters = combat:GetActorList (DETAILS_ATTRIBUTE_HEAL) - for index, character in ipairs (AllHealCharacters) do + for index, character in ipairs(AllHealCharacters) do local AllSpells = character:GetSpellList() local found = false for spellid, spell in pairs (AllSpells) do @@ -1400,14 +1400,14 @@ } -- /run _detalhes:AddDefaultCustomDisplays() local have = false - for _, custom in ipairs (self.custom) do + for _, custom in ipairs(self.custom) do if (custom.name == Loc ["STRING_CUSTOM_HEALTHSTONE_DEFAULT"] and (custom.script_version and custom.script_version >= Healthstone.script_version) ) then have = true break end end if (not have) then - for i, custom in ipairs (self.custom) do + for i, custom in ipairs(self.custom) do if (custom.name == Loc ["STRING_CUSTOM_HEALTHSTONE_DEFAULT"]) then table.remove (self.custom, i) end @@ -1447,7 +1447,7 @@ local damage_container = combat:GetActorList ( DETAILS_ATTRIBUTE_DAMAGE ) --do the loop: - for _, player in ipairs ( damage_container ) do + for _, player in ipairs( damage_container ) do if (player.grupo) then local activity = player:Tempo() total = total + activity @@ -1466,14 +1466,14 @@ } local have = false - for _, custom in ipairs (self.custom) do + for _, custom in ipairs(self.custom) do if (custom.name == Loc ["STRING_CUSTOM_ACTIVITY_DPS"] and (custom.script_version and custom.script_version >= DamageActivityTime.script_version) ) then have = true break end end if (not have) then - for i, custom in ipairs (self.custom) do + for i, custom in ipairs(self.custom) do if (custom.name == Loc ["STRING_CUSTOM_ACTIVITY_DPS"]) then table.remove (self.custom, i) end @@ -1511,7 +1511,7 @@ local damage_container = combat:GetActorList ( DETAILS_ATTRIBUTE_HEAL ) --do the loop: - for _, player in ipairs ( damage_container ) do + for _, player in ipairs( damage_container ) do if (player.grupo) then local activity = player:Tempo() total = total + activity @@ -1530,14 +1530,14 @@ } local have = false - for _, custom in ipairs (self.custom) do + for _, custom in ipairs(self.custom) do if (custom.name == Loc ["STRING_CUSTOM_ACTIVITY_HPS"] and (custom.script_version and custom.script_version >= HealActivityTime.script_version) ) then have = true break end end if (not have) then - for i, custom in ipairs (self.custom) do + for i, custom in ipairs(self.custom) do if (custom.name == Loc ["STRING_CUSTOM_ACTIVITY_HPS"]) then table.remove (self.custom, i) end @@ -1567,7 +1567,7 @@ local misc_actors = combat:GetActorList (DETAILS_ATTRIBUTE_MISC) - for index, character in ipairs (misc_actors) do + for index, character in ipairs(misc_actors) do if (character.cc_done and character:IsPlayer()) then local cc_done = floor (character.cc_done) instance_container:AddValue (character, cc_done) @@ -1590,7 +1590,7 @@ table.sort (spells, _detalhes.Sort2) - for index, spell in ipairs (spells) do + for index, spell in ipairs(spells) do local name, _, icon = GetSpellInfo(spell [1]) GameCooltip:AddLine (name, spell [2]) _detalhes:AddTooltipBackgroundStatusbar() @@ -1608,7 +1608,7 @@ local class, _, _, _, _, r, g, b = _detalhes:GetClass (actor.nome) _detalhes:AddTooltipHeaderStatusbar (1, 1, 1, 0.6) - for index, target in ipairs (targets) do + for index, target in ipairs(targets) do GameCooltip:AddLine (target[1], target [2]) _detalhes:AddTooltipBackgroundStatusbar() @@ -1631,7 +1631,7 @@ -- /run _detalhes:AddDefaultCustomDisplays() local have = false - for _, custom in ipairs (self.custom) do + for _, custom in ipairs(self.custom) do if (custom.name == Loc ["STRING_CUSTOM_CC_DONE"] and (custom.script_version and custom.script_version >= CC_Done.script_version) ) then have = true break @@ -1641,7 +1641,7 @@ setmetatable (CC_Done, _detalhes.atributo_custom) CC_Done.__index = _detalhes.atributo_custom - for i, custom in ipairs (self.custom) do + for i, custom in ipairs(self.custom) do if (custom.name == Loc ["STRING_CUSTOM_CC_DONE"]) then table.remove (self.custom, i) tinsert (self.custom, i, CC_Done) @@ -1673,7 +1673,7 @@ DETAILS_CUSTOM_CC_RECEIVED_CACHE = DETAILS_CUSTOM_CC_RECEIVED_CACHE or {} wipe (DETAILS_CUSTOM_CC_RECEIVED_CACHE) - for index, character in ipairs (misc_actors) do + for index, character in ipairs(misc_actors) do if (character.cc_done and character:IsPlayer()) then for player_name, amount in pairs (character.cc_done_targets) do @@ -1702,7 +1702,7 @@ local spells, from = {}, {} local misc_actors = combat:GetActorList (DETAILS_ATTRIBUTE_MISC) - for index, character in ipairs (misc_actors) do + for index, character in ipairs(misc_actors) do if (character.cc_done and character:IsPlayer()) then local on_actor = character.cc_done_targets [name] if (on_actor) then @@ -1713,7 +1713,7 @@ local spell_on_actor = spell.targets [name] if (spell_on_actor) then local has_spell - for index, spell_table in ipairs (spells) do + for index, spell_table in ipairs(spells) do if (spell_table [1] == spellid) then spell_table [2] = spell_table [2] + spell_on_actor has_spell = true @@ -1732,7 +1732,7 @@ table.sort (from, _detalhes.Sort2) table.sort (spells, _detalhes.Sort2) - for index, spell in ipairs (spells) do + for index, spell in ipairs(spells) do local name, _, icon = GetSpellInfo(spell [1]) GameCooltip:AddLine (name, spell [2]) _detalhes:AddTooltipBackgroundStatusbar() @@ -1742,7 +1742,7 @@ _detalhes:AddTooltipSpellHeaderText ("From", "yellow", #from) _detalhes:AddTooltipHeaderStatusbar (1, 1, 1, 0.6) - for index, t in ipairs (from) do + for index, t in ipairs(from) do GameCooltip:AddLine (t[1], t[2]) _detalhes:AddTooltipBackgroundStatusbar() @@ -1765,7 +1765,7 @@ -- /run _detalhes:AddDefaultCustomDisplays() local have = false - for _, custom in ipairs (self.custom) do + for _, custom in ipairs(self.custom) do if (custom.name == Loc ["STRING_CUSTOM_CC_RECEIVED"] and (custom.script_version and custom.script_version >= CC_Received.script_version) ) then have = true break @@ -1775,7 +1775,7 @@ setmetatable (CC_Received, _detalhes.atributo_custom) CC_Received.__index = _detalhes.atributo_custom - for i, custom in ipairs (self.custom) do + for i, custom in ipairs(self.custom) do if (custom.name == Loc ["STRING_CUSTOM_CC_RECEIVED"]) then table.remove (self.custom, i) tinsert (self.custom, i, CC_Received) @@ -1836,7 +1836,7 @@ amount = amount + 1 end - for _, PetName in ipairs (player.pets) do + for _, PetName in ipairs(player.pets) do local pet = combat (pet_attribute, PetName) if (pet) then for spellid, spell in pairs (pet:GetSpellList()) do @@ -1866,7 +1866,7 @@ --get the cooltip object (we dont use the convencional GameTooltip here) local GC = GameCooltip - GC:SetOption ("YSpacingMod", 0) + GC:SetOption("YSpacingMod", 0) local role = DetailsFramework.UnitGroupRolesAssigned ("player") @@ -2033,7 +2033,7 @@ } local have = false - for _, custom in ipairs (self.custom) do + for _, custom in ipairs(self.custom) do if (custom.name == Loc ["STRING_CUSTOM_MYSPELLS"] and (custom.script_version and custom.script_version >= MySpells.script_version) ) then have = true break @@ -2043,7 +2043,7 @@ setmetatable (MySpells, _detalhes.atributo_custom) MySpells.__index = _detalhes.atributo_custom - for i, custom in ipairs (self.custom) do + for i, custom in ipairs(self.custom) do if (custom.name == Loc ["STRING_CUSTOM_MYSPELLS"]) then table.remove (self.custom, i) tinsert (self.custom, i, MySpells) @@ -2084,7 +2084,7 @@ -- 1: star --do the loop - for _, actor in ipairs (Combat:GetActorList (DETAILS_ATTRIBUTE_DAMAGE)) do + for _, actor in ipairs(Combat:GetActorList (DETAILS_ATTRIBUTE_DAMAGE)) do if (actor:IsPlayer()) then if (actor.raid_targets [128]) then CustomContainer:AddValue (actor, actor.raid_targets [128]) @@ -2125,7 +2125,7 @@ -- /run _detalhes:AddDefaultCustomDisplays() local have = false - for _, custom in ipairs (self.custom) do + for _, custom in ipairs(self.custom) do if (custom.name == Loc ["STRING_CUSTOM_DAMAGEONSKULL"] and (custom.script_version and custom.script_version >= DamageOnSkullTarget.script_version) ) then have = true break @@ -2135,7 +2135,7 @@ setmetatable (DamageOnSkullTarget, _detalhes.atributo_custom) DamageOnSkullTarget.__index = _detalhes.atributo_custom - for i, custom in ipairs (self.custom) do + for i, custom in ipairs(self.custom) do if (custom.name == Loc ["STRING_CUSTOM_DAMAGEONSKULL"]) then table.remove (self.custom, i) tinsert (self.custom, i, DamageOnSkullTarget) @@ -2166,7 +2166,7 @@ local total, top, amount = 0, 0, 0 --do the loop - for _, actor in ipairs (Combat:GetActorList (DETAILS_ATTRIBUTE_DAMAGE)) do + for _, actor in ipairs(Combat:GetActorList (DETAILS_ATTRIBUTE_DAMAGE)) do if (actor:IsPlayer()) then local total = (actor.raid_targets [1] or 0) --star total = total + (actor.raid_targets [2] or 0) --circle @@ -2255,7 +2255,7 @@ -- /run _detalhes:AddDefaultCustomDisplays() local have = false - for _, custom in ipairs (self.custom) do + for _, custom in ipairs(self.custom) do if (custom.name == Loc ["STRING_CUSTOM_DAMAGEONANYMARKEDTARGET"] and (custom.script_version and custom.script_version >= DamageOnAnyTarget.script_version) ) then have = true break @@ -2265,7 +2265,7 @@ setmetatable (DamageOnAnyTarget, _detalhes.atributo_custom) DamageOnAnyTarget.__index = _detalhes.atributo_custom - for i, custom in ipairs (self.custom) do + for i, custom in ipairs(self.custom) do if (custom.name == Loc ["STRING_CUSTOM_DAMAGEONANYMARKEDTARGET"]) then table.remove (self.custom, i) tinsert (self.custom, i, DamageOnAnyTarget) @@ -2312,7 +2312,7 @@ local damage_container_current = CurrentCombat:GetActorList ( DETAILS_ATTRIBUTE_DAMAGE ) --do the loop: - for _, player in ipairs ( damage_container_overall ) do + for _, player in ipairs( damage_container_overall ) do --only player in group if (player:IsGroupPlayer()) then instance_container:AddValue (player, player.total) @@ -2320,7 +2320,7 @@ end if (Details.in_combat) then - for _, player in ipairs ( damage_container_current ) do + for _, player in ipairs( damage_container_current ) do --only player in group if (player:IsGroupPlayer()) then instance_container:AddValue (player, player.total) @@ -2385,7 +2385,7 @@ local topSpellTotal = sortedList and sortedList[1] and sortedList[1][2] or 0 - for i, t in ipairs (sortedList) do + for i, t in ipairs(sortedList) do local spellID, total = unpack (t) if (total > 1) then local spellName, _, spellIcon = Details.GetSpellInfo(spellID) @@ -2435,14 +2435,14 @@ } local have = false - for _, custom in ipairs (self.custom) do + for _, custom in ipairs(self.custom) do if (custom.name == Loc ["STRING_CUSTOM_DYNAMICOVERAL"] and (custom.script_version and custom.script_version >= DynamicOverallDamage.script_version) ) then have = true break end end if (not have) then - for i, custom in ipairs (self.custom) do + for i, custom in ipairs(self.custom) do if (custom.name == Loc ["STRING_CUSTOM_DYNAMICOVERAL"]) then table.remove (self.custom, i) end @@ -2471,14 +2471,14 @@ local total, top, amount = 0, 0, 0 --do the loop - for index, actor in ipairs (Combat:GetActorList(1)) do + for index, actor in ipairs(Combat:GetActorList(1)) do if (actor:IsPlayer()) then --get the actor total damage absorbed local totalAbsorb = actor.totalabsorbed --get the damage absorbed by all the actor pets - for petIndex, petName in ipairs (actor.pets) do + for petIndex, petName in ipairs(actor.pets) do local pet = Combat :GetActor (1, petName) if (pet) then totalAbsorb = totalAbsorb + pet.totalabsorbed @@ -2512,7 +2512,7 @@ local format_func = Details:GetCurrentToKFunction() --get the damage absorbed by all the actor pets - for petIndex, petName in ipairs (actor.pets) do + for petIndex, petName in ipairs(actor.pets) do local pet = Combat :GetActor (1, petName) if (pet) then totalAbsorb = totalAbsorb + pet.totalabsorbed @@ -2522,7 +2522,7 @@ GameCooltip:AddLine (actor:Name(), format_func (_, actor.totalabsorbed)) Details:AddTooltipBackgroundStatusbar() - for petIndex, petName in ipairs (actor.pets) do + for petIndex, petName in ipairs(actor.pets) do local pet = Combat :GetActor (1, petName) if (pet) then totalAbsorb = totalAbsorb + pet.totalabsorbed @@ -2536,14 +2536,14 @@ } local have = false - for _, custom in ipairs (self.custom) do + for _, custom in ipairs(self.custom) do if (custom.name == Loc ["STRING_CUSTOM_DAMAGEONSHIELDS"] and (custom.script_version and custom.script_version >= DamageOnShields.script_version) ) then have = true break end end if (not have) then - for i, custom in ipairs (self.custom) do + for i, custom in ipairs(self.custom) do if (custom.name == Loc ["STRING_CUSTOM_DAMAGEONSHIELDS"]) then table.remove (self.custom, i) end diff --git a/classes/class_damage.lua b/classes/class_damage.lua index 47ff2792..fbd3f987 100644 --- a/classes/class_damage.lua +++ b/classes/class_damage.lua @@ -37,7 +37,7 @@ local debugmode = false ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> constants +--constants local alvo_da_habilidade = Details.alvo_da_habilidade local container_habilidades = Details.container_habilidades @@ -166,7 +166,7 @@ function Details:ContainerSort (container, amount, keyName2) --[[exported]] _table_sort(container, Details.SortKeySimple) if (amount) then - for i = amount, 1, -1 do --> de tr�s pra frente + for i = amount, 1, -1 do --de tr�s pra frente if (container[i][keyName] < 1) then amount = amount-1 else @@ -278,10 +278,10 @@ function Details:ContainerSortEnemies (container, amount, keyName2) --[[exported local total = 0 - for index, player in _ipairs (container) do + 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 + if (bitBand(player.flag_original, 0x00000060) ~= 0 and not ignoredEnemyNpcsTable [npcid1]) then --� um inimigo total = total + player [keyName] else amount = index-1 @@ -353,7 +353,7 @@ function Details:GetBarColor(actor) --[[exported]] end else - if (not is_player_class[actor.classe] and actor.flag_original and bitBand(actor.flag_original, 0x00000020) ~= 0) then --> neutral + 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 @@ -406,7 +406,7 @@ end local alphabetical = Details:GetOrderNumber(nome) - --> constructor + --constructor local _new_damageActor = { tipo = class_type, @@ -447,7 +447,7 @@ end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> special cases +--special cases -- dps (calculate dps for actors) function atributo_damage:ContainerRefreshDps (container, combat_time) @@ -455,7 +455,7 @@ end local total = 0 if (Details.time_type == 2 or not Details:CaptureGet ("damage")) then - for _, actor in _ipairs (container) do + for _, actor in _ipairs(container) do if (actor.grupo) then actor.last_dps = actor.total / combat_time else @@ -464,7 +464,7 @@ end total = total + actor.last_dps end else - for _, actor in _ipairs (container) do + for _, actor in _ipairs(container) do actor.last_dps = actor.total / actor:Tempo() total = total + actor.last_dps end @@ -474,7 +474,7 @@ end end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> damage taken by spell +--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]]} @@ -488,22 +488,22 @@ end from_spellname = select (1, GetSpellInfo(from_spell)) end - --> get a list of all damage actors + --get a list of all damage actors local AllDamageCharacters = combat:GetActorList (DETAILS_ATTRIBUTE_DAMAGE) - --> hold the targets + --hold the targets local Targets = {} local total = 0 local top = 0 local is_custom_spell = false - for _, spellcustom in ipairs (Details.savedCustomSpells) do + for _, spellcustom in ipairs(Details.savedCustomSpells) do if (spellcustom[1] == from_spell) then is_custom_spell = true end end - for index, character in ipairs (AllDamageCharacters) do + for index, character in ipairs(AllDamageCharacters) do if (is_custom_spell) then for playername, ff_table in pairs(character.friendlyfire) do @@ -515,7 +515,7 @@ end local got - for index, t in ipairs (Targets) do + for index, t in ipairs(Targets) do if (t[1] == playername) then t[2] = t[2] + ff_table.spells [from_spell] total = total + ff_table.spells [from_spell] @@ -546,7 +546,7 @@ end 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 + for index, t in ipairs(Targets) do if (t[1] == playername) then t[2] = t[2] + amount total = total + amount @@ -571,7 +571,7 @@ end end end - --> search actors which used the spell shown in the bar + --search actors which used the spell shown in the bar local spell = character.spells._ActorTable [from_spell] if (spell) then @@ -582,7 +582,7 @@ end 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 + for index, t in ipairs(Targets) do if (t[1] == targetname) then t[2] = t[2] + amount total = total + amount @@ -617,7 +617,7 @@ end 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 + for index, t in ipairs(Targets) do if (t[1] == targetname) then t[2] = t[2] + amount total = total + amount @@ -648,7 +648,7 @@ end bs_tooltip_table = Targets bs_tooltip_table.damage_total = total - GameCooltip:SetOption ("StatusBarTexture", "Interface\\AddOns\\Details\\images\\bar_serenity") + GameCooltip:SetOption("StatusBarTexture", "Interface\\AddOns\\Details\\images\\bar_serenity") local spellname, _, spellicon = select (1, _GetSpellInfo(from_spell)) GameCooltip:AddLine (spellname .. " " .. Loc ["STRING_CUSTOM_ATTRIBUTE_DAMAGE"], nil, nil, headerColor, nil, 10) @@ -660,7 +660,7 @@ end local lineHeight = Details.tooltip.line_height - for index, t in ipairs (Targets) do + for index, t in ipairs(Targets) do 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]) @@ -684,7 +684,7 @@ end GameCooltip:AddLine (" ") Details:AddTooltipReportLineText() - GameCooltip:SetOption ("YSpacingMod", 0) + GameCooltip:SetOption("YSpacingMod", 0) GameCooltip:SetOwner (thisLine) GameCooltip:Show() @@ -700,11 +700,11 @@ end end local DTBS_search_code = [[ - --> get the parameters passed + --get the parameters passed local combat, instance_container, instance = ... - --> declade the values to return + --declade the values to return local total, top, amount = 0, 0, 0 - --> hold the targets + --hold the targets local Targets = {} local from_spell = @SPELLID@ @@ -713,17 +713,17 @@ end from_spellname = select (1, GetSpellInfo(from_spell)) end - --> get a list of all damage actors + --get a list of all damage actors local AllDamageCharacters = combat:GetActorList (DETAILS_ATTRIBUTE_DAMAGE) local is_custom_spell = false - for _, spellcustom in ipairs (Details.savedCustomSpells) do + for _, spellcustom in ipairs(Details.savedCustomSpells) do if (spellcustom[1] == from_spell) then is_custom_spell = true end end - for index, character in ipairs (AllDamageCharacters) do + for index, character in ipairs(AllDamageCharacters) do if (is_custom_spell) then for playername, ff_table in pairs(character.friendlyfire) do @@ -735,7 +735,7 @@ end local got - for index, t in ipairs (Targets) do + for index, t in ipairs(Targets) do if (t[1] == playername) then t[2] = t[2] + ff_table.spells [from_spell] if (t[2] > top) then @@ -765,7 +765,7 @@ end 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 + for index, t in ipairs(Targets) do if (t[1] == playername) then t[2] = t[2] + amount if (t[2] > top) then @@ -788,7 +788,7 @@ end end end - --> search actors which used the spell shown in the bar + --search actors which used the spell shown in the bar local spell = character.spells._ActorTable [from_spell] if (spell) then @@ -800,7 +800,7 @@ end 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 + for index, t in ipairs(Targets) do if (t[1] == targetname) then t[2] = t[2] + amount if (t[2] > top) then @@ -833,7 +833,7 @@ end 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 + for index, t in ipairs(Targets) do if (t[1] == targetname) then t[2] = t[2] + amount if (t[2] > top) then @@ -861,7 +861,7 @@ end table.sort (Targets, Details.Sort2) local amount = 0 - for index, t in ipairs (Targets) do + for index, t in ipairs(Targets) do instance_container:AddValue (t[3], t[2]) total = total + t[2] amount = amount + 1 @@ -876,9 +876,9 @@ end local custom_name = spellname .. " - " .. Loc ["STRING_CUSTOM_DTBS"] .. "" --check if already exists - for index, CustomObject in _ipairs (Details.custom) do + for index, CustomObject in _ipairs(Details.custom) do if (CustomObject:GetName() == custom_name) then - --> fix for not saving funcs on logout + --fix for not saving funcs on logout if (not CustomObject.OnSwitchShow) then CustomObject.OnSwitchShow = on_switch_DTBS_show end @@ -933,8 +933,8 @@ end 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 + 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 if (not thisLine) then print ("DEBUG: problema com "..whichRowLine .. " " .. colocacao) @@ -945,7 +945,7 @@ end local spellname, _, spellicon = _GetSpellInfo(tabela [1]) - tabela.nome = spellname --> evita dar erro ao redimencionar a janela + tabela.nome = spellname --evita dar erro ao redimencionar a janela tabela.minha_barra = whichRowLine thisLine.colocacao = colocacao @@ -1018,14 +1018,14 @@ end end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> frags +--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 + --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 ]] @@ -1042,7 +1042,7 @@ end 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 + 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 damage_taken_table [#damage_taken_table+1] = {aggressor, target_amount, damager_actor.classe} @@ -1111,7 +1111,7 @@ end GameCooltip:AddLine (" ") Details:AddTooltipReportLineText() - GameCooltip:SetOption ("StatusBarTexture", "Interface\\AddOns\\Details\\images\\bar_serenity") + GameCooltip:SetOption("StatusBarTexture", "Interface\\AddOns\\Details\\images\\bar_serenity") GameCooltip:ShowCooltip() end end @@ -1122,8 +1122,8 @@ 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 + 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) @@ -1134,7 +1134,7 @@ end thisLine.minha_tabela = tabela - tabela.nome = tabela [1] --> evita dar erro ao redimencionar a janela + tabela.nome = tabela [1] --evita dar erro ao redimencionar a janela tabela.minha_barra = whichRowLine thisLine.colocacao = colocacao @@ -1201,23 +1201,23 @@ end thisLine.icone_classe:SetVertexColor(1, 1, 1) end - if (thisLine.mouse_over and not instancia.baseframe.isMoving) then --> precisa atualizar o tooltip + if (thisLine.mouse_over and not instancia.baseframe.isMoving) then --precisa atualizar o tooltip --gump:UpdateTooltip(whichRowLine, thisLine, instancia) end end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> void zones +--void zones local on_switch_AVZ_show = function(instance) instance:TrocaTabela (instance, true, 1, 7) return true end local AVZ_search_code = [[ - --> get the parameters passed + --get the parameters passed local combat, instance_container, instance = ... - --> declade the values to return + --declade the values to return local total, top, amount = 0, 0, 0 local actor_name = "@ACTORNAME@" @@ -1272,10 +1272,10 @@ end i = i + 1 end - --> sort no container: + --sort no container: table.sort (tooltip_void_zone_temp, Details.sort_tooltip_void_zones) - for index, t in ipairs (tooltip_void_zone_temp) do + 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]) @@ -1313,9 +1313,9 @@ end local custom_name = spellname .. " - " .. Loc ["STRING_ATTRIBUTE_DAMAGE_DEBUFFS_REPORT"] .. "" --check if already exists - for index, CustomObject in _ipairs (Details.custom) do + for index, CustomObject in _ipairs(Details.custom) do if (CustomObject:GetName() == custom_name) then - --> fix for not saving funcs on logout + --fix for not saving funcs on logout if (not CustomObject.OnSwitchShow) then CustomObject.OnSwitchShow = on_switch_AVZ_show end @@ -1370,7 +1370,7 @@ end local report_table = {"Details!: " .. spelllink .. " " .. Loc ["STRING_ATTRIBUTE_DAMAGE_DEBUFFS_REPORT"]} local t = {} - for index, void_table in ipairs (tooltip_void_zone_temp) do + 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])} @@ -1458,10 +1458,10 @@ end i = i + 1 end - --> sort no container: + --sort no container: _table_sort(tooltip_void_zone_temp, sort_tooltip_void_zones) - --> monta o cooltip + --monta o cooltip local GameCooltip = GameCooltip local spellname, _, spellicon = _GetSpellInfo(actor.damage_spellid) @@ -1471,7 +1471,7 @@ end --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 + if (type(first) == "table") then first = first.damage end @@ -1480,7 +1480,7 @@ end local lineHeight = Details.tooltip.line_height - for index, t in _ipairs (tooltip_void_zone_temp) do + for index, t in _ipairs(tooltip_void_zone_temp) do if (t[3] == 0) then break @@ -1520,7 +1520,7 @@ end GameCooltip:AddLine (" ") Details:AddTooltipReportLineText() - GameCooltip:SetOption ("StatusBarTexture", "Interface\\AddOns\\Details\\images\\bar_serenity") + GameCooltip:SetOption("StatusBarTexture", "Interface\\AddOns\\Details\\images\\bar_serenity") GameCooltip:ShowCooltip() @@ -1532,7 +1532,7 @@ end function atributo_misc:AtualizarVoidZone (whichRowLine, colocacao, instancia) - --> pega a refer�ncia da barra na janela + --pega a refer�ncia da barra na janela local thisLine = instancia.barras [whichRowLine] if (not thisLine) then @@ -1733,10 +1733,10 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta index = index + 1 - local fragged_actor = showing._NameIndexTable [fragName] --> get index + local fragged_actor = showing._NameIndexTable [fragName] --get index local actor_classe if (fragged_actor) then - fragged_actor = showing._ActorTable [fragged_actor] --> get object + fragged_actor = showing._ActorTable [fragged_actor] --get object actor_classe = fragged_actor.classe end @@ -1782,7 +1782,7 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta if (total < 1) then instancia:EsconderScrollBar() - return Details:EndRefresh(instancia, total, combatObject, 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 combatObject.totals.frags_total = frags_total_kills @@ -1797,7 +1797,7 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta whichRowLine = whichRowLine+1 end - return Details:EndRefresh(instancia, total, combatObject, showing) --> retorna a tabela que precisa ganhar o refresh + return Details:EndRefresh(instancia, total, combatObject, showing) --retorna a tabela que precisa ganhar o refresh elseif (keyName == "damage_taken_by_spells") then @@ -1807,10 +1807,10 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta local combat = combatObject local AllDamageCharacters = combat:GetActorList (DETAILS_ATTRIBUTE_DAMAGE) - --> do a loop amoung the actors - for index, character in ipairs (AllDamageCharacters) do + --do a loop amoung the actors + for index, character in ipairs(AllDamageCharacters) do - --> is the actor a player? + --is the actor a player? if (character:IsPlayer()) then for source_name, _ in pairs(character.damage_from) do @@ -1818,7 +1818,7 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta local source = combat (1, source_name) if (source) then - --> came from an enemy + --came from an enemy if (not source:IsPlayer()) then local AllSpells = source:GetSpellList() @@ -1922,7 +1922,7 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta if (bs_index < 1) then instancia:EsconderScrollBar() - return Details:EndRefresh(instancia, bs_index, combatObject, 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 combatObject.totals.by_spell = total @@ -1947,7 +1947,7 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta local misc_container = combatObject [4] local voidzone_damage_total = 0 - for _, actor in _ipairs (misc_container._ActorTable) do + for _, actor in _ipairs(misc_container._ActorTable) do if (actor.boss_debuff) then index = index + 1 @@ -1962,7 +1962,7 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta if (spell) then - --> fix spell, sometimes there is two spells with the same name, one is the cast and other is the debuff + --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 @@ -1981,7 +1981,7 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta 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 + --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 @@ -2023,7 +2023,7 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta total = index if (exportar) then - for _, t in ipairs (vtable) do + for _, t in ipairs(vtable) do t.report_name = Details:GetSpellLink(t.damage_spellid) end return voidzone_damage_total, "damage", instancia.top, total, vtable, "report_name" @@ -2031,7 +2031,7 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta if (total < 1) then instancia:EsconderScrollBar() - return Details:EndRefresh(instancia, total, combatObject, 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 combatObject.totals.voidzone_damage = voidzone_damage_total @@ -2046,7 +2046,7 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta whichRowLine = whichRowLine+1 end - return Details:EndRefresh(instancia, total, combatObject, 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")) @@ -2073,26 +2073,26 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta --result of the first actor instancia.top = actorTableContent[1] and actorTableContent[1][keyName] - elseif (windowMode == modo_ALL) then --> mostrando ALL + elseif (windowMode == modo_ALL) then --mostrando ALL - --> faz o sort da categoria e retorna o amount corrigido + --faz o sort da categoria e retorna o amount corrigido --print (keyName) if (subAttribute == 2) then local combat_time = instancia.showing:GetCombatTime() total = atributo_damage:ContainerRefreshDps (actorTableContent, combat_time) else - --> pega o total ja aplicado na tabela do combate + --pega o total ja aplicado na tabela do combate total = combatObject.totals [class_type] end amount = Details:ContainerSort (actorTableContent, amount, keyName) - --> grava o total + --grava o total instancia.top = actorTableContent[1][keyName] - elseif (windowMode == modo_GROUP) then --> mostrando GROUP + elseif (windowMode == modo_GROUP) then --mostrando GROUP - --> organiza as tabelas + --organiza as tabelas if (Details.in_combat and instancia.segmento == 0 and not exportar) then isUsingCache = true @@ -2102,7 +2102,7 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta actorTableContent = Details.cache_damage_group - if (subAttribute == 2) then --> dps + if (subAttribute == 2) then --dps local combat_time = instancia.showing:GetCombatTime() atributo_damage:ContainerRefreshDps (actorTableContent, combat_time) end @@ -2132,7 +2132,7 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta total = total + actorTableContent[i][keyName] end else - if (subAttribute == 2) then --> dps + if (subAttribute == 2) then --dps local combat_time = instancia.showing:GetCombatTime() atributo_damage:ContainerRefreshDps (actorTableContent, combat_time) end @@ -2141,9 +2141,9 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta end -- 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 + 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 @@ -2161,7 +2161,7 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta end end - --> refaz o mapa do container + --refaz o mapa do container if (not isUsingCache) then showing:remapear() end @@ -2170,15 +2170,15 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta return total, keyName, instancia.top, amount end - if (amount < 1) then --> n�o h� barras para mostrar + if (amount < 1) then --n�o h� barras para mostrar if (forcar) then - if (instancia.modo == 2) then --> group + 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) end end end - instancia:EsconderScrollBar() --> precisaria esconder a scroll bar + instancia:EsconderScrollBar() --precisaria esconder a scroll bar if (Details.debug and false) then Details.showing_ActorTable_Timer2 = Details.showing_ActorTable_Timer2 or 0 @@ -2188,7 +2188,7 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta end end - return Details:EndRefresh(instancia, total, combatObject, 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) @@ -2212,7 +2212,7 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta if (following) then if (isUsingCache) then local pname = Details.playername - for i, actor in _ipairs (actorTableContent) do + for i, actor in _ipairs(actorTableContent) do if (actor.nome == pname) then myPos = i break @@ -2398,9 +2398,9 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta instancia:PerformAnimations(whichRowLine - 1) end - --> beta, hidar barras n�o usadas durante um refresh for�ado + --beta, hidar barras n�o usadas durante um refresh for�ado if (forcar) then - if (instancia.modo == 2) then --> group + 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) end @@ -2411,7 +2411,7 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta instancia:AutoAlignInLineFontStrings() - return Details:EndRefresh(instancia, total, combatObject, 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() @@ -2627,7 +2627,7 @@ function atributo_damage:RefreshLine (instance, lineContainer, whichRowLine, ran 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 + 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 @@ -3118,24 +3118,24 @@ end --------------------------------------------- // TOOLTIPS // --------------------------------------------- ----------> TOOLTIPS BIFURCA��O +---------TOOLTIPS BIFURCA��O -- ~tooltip function atributo_damage:ToolTip (instance, numero, barra, keydown) - --> seria possivel aqui colocar o icone da classe dele? + --seria possivel aqui colocar o icone da classe dele? - if (instance.atributo == 5) then --> custom + if (instance.atributo == 5) then --custom return self:TooltipForCustom(barra) else - if (instance.sub_atributo == 1 or instance.sub_atributo == 2) then --> damage done or Dps or enemy + 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) - elseif (instance.sub_atributo == 3) then --> damage taken + elseif (instance.sub_atributo == 3) then --damage taken return self:ToolTip_DamageTaken(instance, numero, barra, keydown) - elseif (instance.sub_atributo == 6) then --> enemies + elseif (instance.sub_atributo == 6) then --enemies return self:ToolTip_Enemies(instance, numero, barra, keydown) - elseif (instance.sub_atributo == 4) then --> friendly fire + elseif (instance.sub_atributo == 4) then --friendly fire return self:ToolTip_FriendlyFire(instance, numero, barra, keydown) end end @@ -3145,7 +3145,7 @@ end local r, g, b local barAlha = .6 ----------> DAMAGE DONE & DPS +---------DAMAGE DONE & DPS function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) local owner = self.owner @@ -3158,12 +3158,12 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) r, g, b = unpack(Details.class_colors [self.classe]) end - --> habilidades + --habilidades local icon_size = Details.tooltip.icon_size local icon_border = Details.tooltip.icon_border_texcoord do - --> TOP HABILIDADES + --TOP HABILIDADES --get variables --local ActorDamage = self.total_without_pet --mostrando os pets no tooltip @@ -3194,7 +3194,7 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) end --add actor pets - for petIndex, petName in _ipairs (self:Pets()) do + 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 @@ -3205,7 +3205,7 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) --sort _table_sort(ActorSkillsSortTable, Details.Sort2) - --> TOP INIMIGOS + --TOP INIMIGOS --get variables local ActorTargetsSortTable = {} @@ -3225,7 +3225,7 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) is_maximized = true end - --> MOSTRA HABILIDADES + --MOSTRA HABILIDADES Details:AddTooltipSpellHeaderText (Loc ["STRING_SPELLS"], headerColor, #ActorSkillsSortTable, Details.tooltip_spell_icon.file, unpack(Details.tooltip_spell_icon.coords)) if (is_maximized) then @@ -3240,7 +3240,7 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) 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 + for i = 1, _math_min(tooltip_max_abilities, #ActorSkillsSortTable) do local SkillTable = ActorSkillsSortTable [i] @@ -3277,7 +3277,7 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) GameCooltip:AddLine (Loc ["STRING_NO_SPELL"]) end - --> spell reflected + --spell reflected if (#reflectionSpells > 0) then --small blank space Details:AddTooltipSpellHeaderText ("", headerColor, 1, false, 0.1, 0.9, 0.1, 0.9, true) --add a space @@ -3299,7 +3299,7 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) end end - --> MOSTRA INIMIGOS + --MOSTRA INIMIGOS local topEnemy = ActorTargetsSortTable [1] and ActorTargetsSortTable [1][2] or 0 if (instancia.sub_atributo == 1 or instancia.sub_atributo == 6) then @@ -3324,7 +3324,7 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) Details:AddTooltipHeaderStatusbar (r, g, b, barAlha) end - for i = 1, _math_min (max_targets, #ActorTargetsSortTable) do + for i = 1, _math_min(max_targets, #ActorTargetsSortTable) do local este_inimigo = ActorTargetsSortTable [i] 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) @@ -3333,19 +3333,19 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) end end - --> PETS + --PETS local meus_pets = self.pets - if (#meus_pets > 0) then --> teve ajudantes + 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 + 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 + for index, nome in _ipairs(meus_pets) do if (not quantidade [nome]) then quantidade [nome] = 1 @@ -3399,7 +3399,7 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) end local topPet = totais [1] and totais [1][2] or 0 - for index, _table in _ipairs (totais) do + for index, _table in _ipairs(totais) do if (_table [2] > 0 and (index <= Details.tooltip.tooltip_max_pets or ismaximized)) then @@ -3433,7 +3433,7 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) end - --> ~Phases + --~Phases local segment = instancia:GetShowingCombat() if (segment and self.grupo) then local bossInfo = segment:GetBossInfo() @@ -3503,10 +3503,10 @@ function atributo_damage:ReportEnemyDamageTaken (actor, instance, ShiftKeyDown, local inimigo = actor.nome local custom_name = inimigo .. " -" .. Loc ["STRING_CUSTOM_ENEMY_DT"] - --> procura se j� tem um custom: - for index, CustomObject in _ipairs (Details.custom) do + --procura se j� tem um custom: + for index, CustomObject in _ipairs(Details.custom) do if (CustomObject:GetName() == custom_name) then - --> fix for not saving funcs on logout + --fix for not saving funcs on logout if (not CustomObject.OnSwitchShow) then CustomObject.OnSwitchShow = fromFrags and on_switch_show_frags or on_switch_show_enemies end @@ -3514,7 +3514,7 @@ function atributo_damage:ReportEnemyDamageTaken (actor, instance, ShiftKeyDown, end end - --> criar um custom para este actor. + --criar um custom para este actor. local new_custom_object = { name = custom_name, icon = [[Interface\ICONS\Pet_Type_Undead]], @@ -3571,10 +3571,10 @@ function atributo_damage:ToolTip_Enemies (instancia, numero, barra, keydown) local combat = instancia:GetShowingCombat() local enemy_name = self:name() - --> enemy damage taken + --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 @@ -3602,7 +3602,7 @@ function atributo_damage:ToolTip_Enemies (instancia, numero, barra, keydown) Details:AddTooltipHeaderStatusbar (1, 1, 1, 0.5) - --> build the tooltip + --build the tooltip local top = (tooltip_temp_table [1] and tooltip_temp_table [1][2]) or 0 tooltip_temp_table.damage_total = damage_taken @@ -3637,9 +3637,9 @@ function atributo_damage:ToolTip_Enemies (instancia, numero, barra, keydown) end - GameCooltip:SetOption ("StatusBarTexture", "Interface\\AddOns\\Details\\images\\bar_serenity") + GameCooltip:SetOption("StatusBarTexture", "Interface\\AddOns\\Details\\images\\bar_serenity") - --> damage done and heal + --damage done and heal GameCooltip:AddLine (" ") GameCooltip:AddLine (Loc ["STRING_ATTRIBUTE_DAMAGE_ENEMIES_DONE"], FormatTooltipNumber (_, _math_floor(self.total))) local half = 0.00048828125 @@ -3658,12 +3658,12 @@ function atributo_damage:ToolTip_Enemies (instancia, numero, barra, keydown) GameCooltip:AddLine (" ") Details:AddTooltipReportLineText() - GameCooltip:SetOption ("YSpacingMod", 0) + GameCooltip:SetOption("YSpacingMod", 0) return true end ----------> DAMAGE TAKEN +---------DAMAGE TAKEN function atributo_damage:ToolTip_DamageTaken (instancia, numero, barra, keydown) local owner = self.owner @@ -3677,23 +3677,23 @@ function atributo_damage:ToolTip_DamageTaken (instancia, numero, barra, keydown) 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 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 + --aggressors 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 + 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] @@ -3790,7 +3790,7 @@ function atributo_damage:ToolTip_DamageTaken (instancia, numero, barra, keydown) end end - for _, spell in _ipairs (all_spells) do + for _, spell in _ipairs(all_spells) do 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) @@ -3841,7 +3841,7 @@ function atributo_damage:ToolTip_DamageTaken (instancia, numero, barra, keydown) return true end ----------> FRIENDLY FIRE +---------FRIENDLY FIRE function atributo_damage:ToolTip_FriendlyFire (instancia, numero, barra, keydown) local owner = self.owner @@ -3894,7 +3894,7 @@ function atributo_damage:ToolTip_FriendlyFire (instancia, numero, barra, keydown max_abilities = 99 end - for i = 1, _math_min (max_abilities, #DamagedPlayers) do + for i = 1, _math_min(max_abilities, #DamagedPlayers) do local classe = DamagedPlayers[i][3] if (not classe) then classe = "UNKNOW" @@ -3942,7 +3942,7 @@ function atributo_damage:ToolTip_FriendlyFire (instancia, numero, barra, keydown end _table_sort(SpellsInOrder, Details.Sort2) - for i = 1, _math_min (max_abilities2, #SpellsInOrder) do + for i = 1, _math_min(max_abilities2, #SpellsInOrder) do 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) @@ -3956,18 +3956,18 @@ end --------------------------------------------- // JANELA DETALHES // --------------------------------------------- ----------> DETALHES BIFURCA��O ~detalhes ~detailswindow +---------DETALHES BIFURCA��O ~detalhes ~detailswindow function atributo_damage:MontaInfo() - if (info.sub_atributo == 1 or info.sub_atributo == 2 or info.sub_atributo == 6) then --> damage done & dps + if (info.sub_atributo == 1 or info.sub_atributo == 2 or info.sub_atributo == 6) then --damage done & dps return self:MontaInfoDamageDone() - elseif (info.sub_atributo == 3) then --> damage taken + elseif (info.sub_atributo == 3) then --damage taken return self:MontaInfoDamageTaken() - elseif (info.sub_atributo == 4) then --> friendly fire + elseif (info.sub_atributo == 4) then --friendly fire return self:MontaInfoFriendlyFire() end end ----------> DETALHES bloco da direita BIFURCA��O +---------DETALHES bloco da direita BIFURCA��O function atributo_damage:MontaDetalhes (spellid, barra, instancia) if (info.sub_atributo == 1 or info.sub_atributo == 2) then return self:MontaDetalhesDamageDone (spellid, barra, instancia) @@ -4018,7 +4018,7 @@ function atributo_damage:MontaInfoFriendlyFire() local FirstPlaceDamage = DamagedPlayers [1] and DamagedPlayers [1][2] or 0 - for index, tabela in _ipairs (DamagedPlayers) do + for index, tabela in _ipairs(DamagedPlayers) do local barra = barras [index] if (not barra) then @@ -4028,8 +4028,8 @@ function atributo_damage:MontaInfoFriendlyFire() 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 + 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 barra.textura:SetStatusBarColor (129/255, 125/255, 69/255, 1) barra.on_focus = true if (not info.mostrando) then @@ -4038,8 +4038,8 @@ function atributo_damage:MontaInfoFriendlyFire() end else if (barra.on_focus) then - barra.textura:SetStatusBarColor (1, 1, 1, 1) --> volta a cor antiga - barra:SetAlpha (.9) --> volta a alfa antiga + barra.textura:SetStatusBarColor (1, 1, 1, 1) --volta a cor antiga + barra:SetAlpha (.9) --volta a alfa antiga barra.on_focus = false end end @@ -4100,7 +4100,7 @@ function atributo_damage:MontaInfoFriendlyFire() FirstPlaceDamage = SkillTable [1] and SkillTable [1][2] or 0 - for index, tabela in _ipairs (SkillTable) do + for index, tabela in _ipairs(SkillTable) do local barra = barras2 [index] if (not barra) then @@ -4118,7 +4118,7 @@ function atributo_damage:MontaInfoFriendlyFire() 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.minha_tabela = nil --desativa o tooltip barra:Show() end @@ -4132,7 +4132,7 @@ function atributo_damage:MontaInfoDamageTaken() local agressores = self.damage_from 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 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 meus_agressores = {} @@ -4150,7 +4150,7 @@ function atributo_damage:MontaInfoDamageTaken() local amt = #meus_agressores - if (amt < 1) then --> caso houve apenas friendly fire + if (amt < 1) then --caso houve apenas friendly fire return true end @@ -4162,7 +4162,7 @@ function atributo_damage:MontaInfoDamageTaken() local max_ = meus_agressores [1] and meus_agressores [1][2] or 0 local barra - for index, tabela in _ipairs (meus_agressores) do + for index, tabela in _ipairs(meus_agressores) do barra = barras [index] if (not barra) then barra = gump:CriaNovaBarraInfo1 (instancia, index) @@ -4182,7 +4182,7 @@ function atributo_damage:MontaInfoDamageTaken() end --[[exported]] function Details:UpdadeInfoBar (row, index, spellid, name, value, value_formated, max, percent, icon, detalhes, texCoords, spellschool, class) - --> seta o tamanho da barra + --seta o tamanho da barra if (index == 1) then row.textura:SetValue(100) else @@ -4190,7 +4190,7 @@ end row.textura:SetValue(value/max*100) end - if (type (index) == "number") then + if (type(index) == "number") then if (debugmode) then row.lineText1:SetText(index .. ". " .. name .. " (" .. spellid .. ")") else @@ -4208,7 +4208,7 @@ end row.lineText1:SetSize(row:GetWidth() - row.lineText4:GetStringWidth() - 40, 15) - --> seta o icone + --seta o icone if (icon) then row.icone:SetTexture(icon) if (icon == "Interface\\AddOns\\Details\\images\\classes_small") then @@ -4221,10 +4221,10 @@ end 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) + 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 @@ -4236,7 +4236,7 @@ end row.minha_tabela = self row.show = spellid - row:Show() --> mostra a barra + row:Show() --mostra a barra if (spellschool) then local t = Details.spells_school [spellschool] @@ -4262,15 +4262,15 @@ 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?? + --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?? end end --[[exported]] function Details:FocusLock (row, spellid) if (not info.mostrando_mouse_over) then - if (spellid == self.detalhes) then --> tabela [1] = spellid = spellid que esta na caixa da direita - if (not row.on_focus) then --> se a barra n�o tiver no foco + if (spellid == self.detalhes) then --tabela [1] = spellid = spellid que esta na caixa da direita + if (not row.on_focus) then --se a barra n�o tiver no foco row.textura:SetStatusBarColor (129/255, 125/255, 69/255, 1) row.on_focus = true if (not info.mostrando) then @@ -4279,8 +4279,8 @@ end end else if (row.on_focus) then - row.textura:SetStatusBarColor (1, 1, 1, 1) --> volta a cor antiga - row:SetAlpha (.9) --> volta a alfa antiga + row.textura:SetStatusBarColor (1, 1, 1, 1) --volta a cor antiga + row:SetAlpha (.9) --volta a alfa antiga row.on_focus = false end end @@ -4292,7 +4292,7 @@ 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 = {} @@ -4306,7 +4306,7 @@ function atributo_damage:MontaInfoDamageDone() meu_tempo = info.instancia.showing:GetCombatTime() end - for _spellid, _skill in _pairs(ActorSkillsContainer) do --> da foreach em cada spellid do container + 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}) @@ -4318,13 +4318,13 @@ function atributo_damage:MontaInfoDamageDone() local diff = combat:GetDifficulty() local attribute, subattribute = instancia:GetDisplay() - --> check if is a raid encounter and if is heroic or mythic + --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() if (db) then local bestRank, encounterTable = Details.storage:GetBestFromPlayer (diff, combat:GetBossInfo().id, "damage", self.nome, true) if (bestRank) then - --> discover which are the player position in the guild rank + --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", "") .. ")" info:SetStatusbarText (text1, 10, "gray") @@ -4338,16 +4338,16 @@ function atributo_damage:MontaInfoDamageDone() info:SetStatusbarText() end - --> add pets + --add pets local ActorPets = self.pets --local class_color = RAID_CLASS_COLORS [self.classe] and RAID_CLASS_COLORS [self.classe].colorStr local class_color = "FFCCBBBB" --local class_color = "FFDDDD44" - for _, PetName in _ipairs (ActorPets) do + for _, PetName in _ipairs(ActorPets) do local PetActor = instancia.showing (class_type, PetName) if (PetActor) then local PetSkillsContainer = PetActor.spells._ActorTable - for _spellid, _skill in _pairs(PetSkillsContainer) do --> da foreach em cada spellid do container + 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 @@ -4361,22 +4361,22 @@ function atributo_damage:MontaInfoDamageDone() gump:JI_AtualizaContainerBarras (#ActorSkillsSortTable + 1) - local max_ = ActorSkillsSortTable[1] and ActorSkillsSortTable[1][2] or 0 --> dano que a primeiro magia vez + 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 + if (false) then --disabled for now barra = barras [1] if (not barra) then barra = gump:CriaNovaBarraInfo1 (instancia, 1) end 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")) + barra.textura:SetStatusBarColor (Details.gump:ParseColors("purple")) end --spell bars - for index, tabela in _ipairs (ActorSkillsSortTable) do + for index, tabela in _ipairs(ActorSkillsSortTable) do --index = index + 1 --with the aura bar index = index @@ -4400,13 +4400,13 @@ function atributo_damage:MontaInfoDamageDone() self:FocusLock (barra, tabela[1]) end - --> TOP INIMIGOS + --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 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 = {} @@ -4423,7 +4423,7 @@ function atributo_damage:MontaInfoDamageDone() local amt = #meus_agressores - if (amt < 1) then --> caso houve apenas friendly fire + if (amt < 1) then --caso houve apenas friendly fire return true end @@ -4432,15 +4432,15 @@ function atributo_damage:MontaInfoDamageDone() --_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 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 + for index, tabela in _ipairs(meus_agressores) do barra = barras [index] - if (not barra) then --> se a barra n�o existir, criar ela ent�o + if (not barra) then --se a barra n�o existir, criar ela ent�o barra = gump:CriaNovaBarraInfo2 (instancia, index) - barra.textura:SetStatusBarColor (1, 1, 1, 1) --> isso aqui � a parte da sele��o e descele��o + barra.textura:SetStatusBarColor (1, 1, 1, 1) --isso aqui � a parte da sele��o e descele��o end if (index == 1) then @@ -4469,7 +4469,7 @@ function atributo_damage:MontaInfoDamageDone() Details:name_space_info (barra) - if (barra.mouse_over) then --> atualizar o tooltip + if (barra.mouse_over) then --atualizar o tooltip if (barra.isAlvo) then GameTooltip:Hide() GameTooltip:SetOwner (barra, "ANCHOR_TOPRIGHT") @@ -4480,24 +4480,24 @@ function atributo_damage:MontaInfoDamageDone() 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? + 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" - barra:Show() --> mostra a barra + barra:Show() --mostra a barra end else local meus_inimigos = {} - --> my target container + --my target container conteudo = self.targets for target_name, amount in _pairs(conteudo) do _table_insert (meus_inimigos, {target_name, amount, amount/total*100}) end - --> sort + --sort _table_sort(meus_inimigos, Details.Sort2) local amt_alvos = #meus_inimigos @@ -4510,7 +4510,7 @@ function atributo_damage:MontaInfoDamageDone() local max_inimigos = meus_inimigos[1] and meus_inimigos[1][2] or 0 local barra - for index, tabela in _ipairs (meus_inimigos) do + for index, tabela in _ipairs(meus_inimigos) do barra = info.barras2 [index] @@ -4545,7 +4545,7 @@ function atributo_damage:MontaInfoDamageDone() barra.lineText4:SetText(SelectedToKFunction(_, tabela[2]) .." (" .. format ("%.1f", tabela[3]) .. "%)") end - if (barra.mouse_over) then --> atualizar o tooltip + if (barra.mouse_over) then --atualizar o tooltip if (barra.isAlvo) then --GameTooltip:Hide() --GameTooltip:SetOwner (barra, "ANCHOR_TOPRIGHT") @@ -4556,8 +4556,8 @@ function atributo_damage:MontaInfoDamageDone() 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? + 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] @@ -4570,7 +4570,7 @@ 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 @@ -4578,11 +4578,11 @@ function atributo_damage:MontaDetalhesFriendlyFire (nome, barra) 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 showing = tabela_do_combate [class_type] --o que esta sendo mostrado -> [1] - dano [2] - cura --pega o container com ._NameIndexTable ._ActorTable local friendlyfire = self.friendlyfire - local ff_table = self.friendlyfire [nome] --> assumindo que nome � o nome do Alvo que tomou dano // bastaria pegar a tabela de habilidades dele + local ff_table = self.friendlyfire [nome] --assumindo que nome � o nome do Alvo que tomou dano // bastaria pegar a tabela de habilidades dele if (not ff_table) then return end @@ -4590,28 +4590,28 @@ function atributo_damage:MontaDetalhesFriendlyFire (nome, barra) local minhas_magias = {} - for spellid, amount in _pairs(ff_table.spells) do --> da foreach em cada spellid do container + 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) - local max_ = minhas_magias[1] and minhas_magias[1][2] or 0 --> dano que a primeiro magia vez + 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 + for index, tabela in _ipairs(minhas_magias) do barra = barras [index] - if (not barra) then --> se a barra n�o existir, criar ela ent�o + if (not barra) then --se a barra n�o existir, criar ela ent�o barra = gump:CriaNovaBarraInfo3 (instancia, index) - barra.textura:SetStatusBarColor (1, 1, 1, 1) --> isso aqui � a parte da sele��o e descele��o + 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) 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 @@ -4620,7 +4620,7 @@ function atributo_damage:MontaDetalhesFriendlyFire (nome, barra) barra.icone:SetTexture(tabela[5]) barra.icone:SetTexCoord(0, 1, 0, 1) - barra:Show() --> mostra a barra + barra:Show() --mostra a barra if (index == 15) then break @@ -4632,7 +4632,7 @@ 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 @@ -4647,7 +4647,7 @@ function atributo_damage:MontaDetalhesEnemy (spellid, barra) if (barra.lineText1:IsTruncated()) then Details:CooltipPreset (2) - GameCooltip:SetOption ("FixedWidth", nil) + GameCooltip:SetOption("FixedWidth", nil) GameCooltip:AddLine (barra.lineText1.text) GameCooltip:SetOwner (barra, "bottomleft", "topleft", 5, -10) GameCooltip:ShowCooltip() @@ -4675,18 +4675,18 @@ function atributo_damage:MontaDetalhesEnemy (spellid, barra) local max_ = target_pool [1] and target_pool [1][2] or 0 local barra - for index, tabela in _ipairs (target_pool) do + for index, tabela in _ipairs(target_pool) do barra = barras [index] - if (not barra) then --> se a barra n�o existir, criar ela ent�o + if (not barra) then --se a barra n�o existir, criar ela ent�o barra = gump:CriaNovaBarraInfo3 (instancia, index) - barra.textura:SetStatusBarColor (1, 1, 1, 1) --> isso aqui � a parte da sele��o e descele��o + 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) 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 @@ -4713,7 +4713,7 @@ function atributo_damage:MontaDetalhesEnemy (spellid, barra) barra.icone:SetTexture("Interface\\AddOns\\Details\\images\\classes_small_alpha") barra.icone:SetTexCoord(unpack(texCoords)) - barra:Show() --> mostra a barra + barra:Show() --mostra a barra if (index == 15) then break @@ -4725,7 +4725,7 @@ 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 @@ -4733,7 +4733,7 @@ function atributo_damage:MontaDetalhesDamageTaken (nome, barra) 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 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]] @@ -4741,7 +4741,7 @@ function atributo_damage:MontaDetalhesDamageTaken (nome, barra) return end - local conteudo = este_agressor.spells._ActorTable --> _pairs[] com os IDs das magias + local conteudo = este_agressor.spells._ActorTable --_pairs[] com os IDs das magias local actor = info.jogador.nome @@ -4749,9 +4749,9 @@ function atributo_damage:MontaDetalhesDamageTaken (nome, barra) 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 + if (este_alvo) then --esta magia deu dano no actor local spell_nome, rank, icone = _GetSpellInfo(spellid) _table_insert (minhas_magias, {spellid, este_alvo, este_alvo/total*100, spell_nome, icone}) end @@ -4762,15 +4762,15 @@ function atributo_damage:MontaDetalhesDamageTaken (nome, barra) --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 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 + for index, tabela in _ipairs(minhas_magias) do barra = barras [index] - if (not barra) then --> se a barra n�o existir, criar ela ent�o + if (not barra) then --se a barra n�o existir, criar ela ent�o barra = gump:CriaNovaBarraInfo3 (instancia, index) - barra.textura:SetStatusBarColor (1, 1, 1, 1) --> isso aqui � a parte da sele��o e descele��o + barra.textura:SetStatusBarColor (1, 1, 1, 1) --isso aqui � a parte da sele��o e descele��o end if (index == 1) then @@ -4787,7 +4787,7 @@ function atributo_damage:MontaDetalhesDamageTaken (nome, barra) barra.icone:SetTexture(tabela[5]) barra.icone:SetTexCoord(0, 1, 0, 1) - barra:Show() --> mostra a barra + barra:Show() --mostra a barra if (index == 15) then break @@ -4826,7 +4826,7 @@ local MontaDetalhesBuffProcs = function(actor, row, instance) if (mainAuras) then local miscActor = instance:GetShowingCombat():GetActor (4, actor:name()) if (miscActor and miscActor.buff_uptime_spells) then - --> get the auras + --get the auras local added = 0 for i = 1, #mainAuras do local spellID = mainAuras [i] @@ -4875,7 +4875,7 @@ function atributo_damage:MontaDetalhesDamageDone (spellid, barra, instancia) return end - --> icone direito superior + --icone direito superior local _, _, icone = _GetSpellInfo(spellid) Details.playerDetailWindow.spell_icone:SetTexture(icone) @@ -4899,7 +4899,7 @@ function atributo_damage:MontaDetalhesDamageDone (spellid, barra, instancia) table.wipe (t4) table.wipe (data) - --> GERAL + --GERAL local media = 0 if (total_hits > 0) then media = esta_magia.total/total_hits @@ -4962,7 +4962,7 @@ function atributo_damage:MontaDetalhesDamageDone (spellid, barra, instancia) this_dps, Loc ["STRING_HITS"]..": " .. hits_string) - --> NORMAL + --NORMAL local normal_hits = esta_magia.n_amt if (normal_hits > 0) then local normal_dmg = esta_magia.n_dmg @@ -4986,7 +4986,7 @@ function atributo_damage:MontaDetalhesDamageDone (spellid, barra, instancia) end - --> CRITICO + --CRITICO 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 @@ -5012,7 +5012,7 @@ function atributo_damage:MontaDetalhesDamageDone (spellid, barra, instancia) end - --> Outros erros: GLACING, resisted, blocked, absorbed + --Outros erros: GLACING, resisted, blocked, absorbed local outros_desvios = esta_magia.g_amt + esta_magia.b_amt local parry = esta_magia ["PARRY"] or 0 local dodge = esta_magia ["DODGE"] or 0 @@ -5039,12 +5039,12 @@ function atributo_damage:MontaDetalhesDamageDone (spellid, barra, instancia) --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 + --spell damage chart --events: 1 2 3 4 5 6 7 8 15 _table_sort(data, Details.Sort1) - for index, tabela in _ipairs (data) do + 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 @@ -5059,12 +5059,12 @@ function Details:BuildPlayerDetailsSpellChart() if (not playerDetailSmallChart) then - playerDetailSmallChart = CreateFrame ("frame", "DetailsPlayerDetailSmallChart", info,"BackdropTemplate") + playerDetailSmallChart = CreateFrame("frame", "DetailsPlayerDetailSmallChart", info,"BackdropTemplate") DetailsFramework:ApplyStandardBackdrop (playerDetailSmallChart) playerDetailSmallChart.Lines = {} for i = 1, 200 do - local texture = playerDetailSmallChart:CreateTexture (nil, "artwork") + local texture = playerDetailSmallChart:CreateTexture(nil, "artwork") texture:SetColorTexture (1, 1, 1, 1) tinsert (playerDetailSmallChart.Lines, texture) end @@ -5102,8 +5102,8 @@ function Details:BuildPlayerDetailsSpellChart() end --200 lines, adjust the mini chart - playerDetailSmallChart:SetPoint ("topleft", parent, "topleft") - playerDetailSmallChart:SetPoint ("bottomright", parent, "bottomright") + playerDetailSmallChart:SetPoint("topleft", parent, "topleft") + playerDetailSmallChart:SetPoint("bottomright", parent, "bottomright") --update lines local width = playerDetailSmallChart:GetWidth() @@ -5117,14 +5117,14 @@ function Details:BuildPlayerDetailsSpellChart() local eventAmount = #eventList for i = 1, #playerDetailSmallChart.Lines do - playerDetailSmallChart.Lines [i]:SetWidth (width / 200) - playerDetailSmallChart.Lines [i]:SetHeight (1) + 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) - playerDetailSmallChart.Lines [i]:SetWidth (barWidth) - playerDetailSmallChart.Lines [i]:SetHeight (eventList [o][6] / peakValue * barHeight) + playerDetailSmallChart.Lines [i]:SetPoint("bottomleft", playerDetailSmallChart, "bottomleft", barWidth * (i - 1), 0) + playerDetailSmallChart.Lines [i]:SetWidth(barWidth) + playerDetailSmallChart.Lines [i]:SetHeight(eventList [o][6] / peakValue * barHeight) else currentIndex = o break @@ -5160,7 +5160,7 @@ function atributo_damage:MontaTooltipDamageTaken (thisLine, index) GameTooltip:AddLine (Loc ["STRING_DAMAGE_TAKEN_FROM2"]..":") GameTooltip:AddLine (" ") - for index, tabela in _ipairs (habilidades) do + for index, tabela in _ipairs(habilidades) do local nome, _, icone = _GetSpellInfo(tabela[1]) if (index < 8) then 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) @@ -5183,7 +5183,7 @@ function atributo_damage:MontaTooltipAlvos (thisLine, index, instancia) Details:FormatCooltipForSpells() GameCooltip:SetOwner(thisLine, "bottom", "top", 4, -2) - GameCooltip:SetOption ("MinWidth", _math_max (230, thisLine:GetWidth()*0.98)) + GameCooltip:SetOption("MinWidth", _math_max (230, thisLine:GetWidth()*0.98)) for spellid, spell in _pairs(self.spells._ActorTable) do if (spell.isReflection) then @@ -5220,8 +5220,8 @@ function atributo_damage:MontaTooltipAlvos (thisLine, index, instancia) end end - --> add pets - for _, PetName in _ipairs (self.pets) do + --add pets + for _, PetName in _ipairs(self.pets) do local PetActor = instancia.showing (class_type, PetName) if (PetActor) then local PetSkillsContainer = PetActor.spells._ActorTable @@ -5274,7 +5274,7 @@ function atributo_damage:MontaTooltipAlvos (thisLine, index, instancia) local topSpellDamage = habilidades[1] and habilidades[1][2] if (topSpellDamage) then - for index, tabela in _ipairs (habilidades) do + for index, tabela in _ipairs(habilidades) do if (tabela [2] < 1) then break end @@ -5298,10 +5298,10 @@ function atributo_damage:MontaTooltipAlvos (thisLine, index, instancia) end ---> controla se o dps do jogador esta travado ou destravado +--controla se o dps do jogador esta travado ou destravado function atributo_damage:Iniciar (iniciar) if (iniciar == nil) then - return self.dps_started --> retorna se o dps esta aberto ou fechado para este jogador + return self.dps_started --retorna se o dps esta aberto ou fechado para este jogador elseif (iniciar) then self.dps_started = true self:RegistrarNaTimeMachine() --coloca ele da timeMachine @@ -5312,9 +5312,9 @@ function atributo_damage:Iniciar (iniciar) end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> core functions +--core functions - --> limpa as tabelas tempor�rias ao resetar + --limpa as tabelas tempor�rias ao resetar function atributo_damage:ClearTempTables() for i = #ntable, 1, -1 do ntable [i] = nil @@ -5337,7 +5337,7 @@ end wipe (tooltip_void_zone_temp) end - --> atualize a funcao de abreviacao + --atualize a funcao de abreviacao function atributo_damage:UpdateSelectedToKFunction() SelectedToKFunction = ToKFunctions [Details.ps_abbreviation] FormatTooltipNumber = ToKFunctions [Details.tooltip.abbreviation] @@ -5345,7 +5345,7 @@ end headerColor = Details.tooltip.header_text_color end - --> diminui o total das tabelas do combate + --diminui o total das tabelas do combate function atributo_damage:subtract_total (combat_table) combat_table.totals [class_type] = combat_table.totals [class_type] - self.total if (self.grupo) then @@ -5359,7 +5359,7 @@ end end end - --> restaura a tabela de last event + --restaura a tabela de last event function atributo_damage:r_last_events_table (actor) if (not actor) then actor = self @@ -5367,9 +5367,9 @@ end --actor.last_events_table = Details:CreateActorLastEventTable() end - --> restaura e liga o ator com a sua shadow durante a inicializa��o (startup function) + --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 + --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]] @@ -5389,30 +5389,30 @@ end shadow.end_time = time() end - --> restaura a meta e indexes ao ator + --restaura a meta e indexes ao ator Details.refresh:r_atributo_damage (actor, shadow) - --> copia o container de alvos (captura de dados) + --copia o container de alvos (captura de dados) for target_name, amount in _pairs(actor.targets) do - --> cria e soma o valor do total + --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) + --copia o container de habilidades (captura de dados) for spellid, habilidade in _pairs(actor.spells._ActorTable) do - --> cria e soma o valor + --cria e soma o valor local habilidade_shadow = shadow.spells:PegaHabilidade (spellid, true, nil, true) - --> create the target value + --create the target value 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 + --create the extra value for spellId, amount in _pairs(habilidade.extra) do if (not habilidade_shadow.extra [spellId]) then habilidade_shadow.extra [spellId] = 0 @@ -5421,11 +5421,11 @@ end end - --> copia o container de friendly fire (captura de dados) + --copia o container de friendly fire (captura de dados) for target_name, ff_table in _pairs(actor.friendlyfire) do - --> cria ou pega a shadow + --cria ou pega a shadow local friendlyFire_shadow = shadow.friendlyfire [target_name] or shadow:CreateFFTable (target_name) - --> some as spells + --some as spells for spellid, amount in _pairs(ff_table.spells) do friendlyFire_shadow.spells [spellid] = 0 end @@ -5470,7 +5470,7 @@ end Details.refresh:r_atributo_damage (actor, shadow) end - --> tempo decorrido (captura de dados) + --tempo decorrido (captura de dados) local end_time = actor.end_time if (not actor.end_time) then end_time = time() @@ -5479,8 +5479,8 @@ 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 + --pets (add unique pet names) + for _, petName in _ipairs(actor.pets) do local hasPet = false for i = 1, #shadow.pets do if (shadow.pets[i] == petName) then @@ -5494,54 +5494,54 @@ end end end - --> total de dano (captura de dados) + --total de dano (captura de dados) shadow.total = shadow.total + actor.total shadow.totalabsorbed = shadow.totalabsorbed + actor.totalabsorbed - --> total de dano sem o pet (captura de dados) + --total de dano sem o pet (captura de dados) shadow.total_without_pet = shadow.total_without_pet + actor.total_without_pet - --> total de dano que o ator sofreu (captura de dados) + --total de dano que o ator sofreu (captura de dados) shadow.damage_taken = shadow.damage_taken + actor.damage_taken - --> total do friendly fire causado + --total do friendly fire causado shadow.friendlyfire_total = shadow.friendlyfire_total + actor.friendlyfire_total - --> total no combate overall (captura de dados) + --total no combate overall (captura de dados) host_combat.totals[1] = host_combat.totals[1] + actor.total if (actor.grupo) then host_combat.totals_grupo[1] = host_combat.totals_grupo[1] + actor.total end - --> copia o damage_from (captura de dados) + --copia o damage_from (captura de dados) for nome, _ in _pairs(actor.damage_from) do shadow.damage_from [nome] = true end - --> copia o container de alvos (captura de dados) + --copia o container de alvos (captura de dados) 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 + --copiar o container de raid targets 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) + --copia o container de habilidades (captura de dados) for spellid, habilidade in _pairs(actor.spells._ActorTable) do - --> cria e soma o valor + --cria e soma o valor local habilidade_shadow = shadow.spells:PegaHabilidade (spellid, true, nil, true) - --> refresh e soma os valores dos alvos + --refresh e soma os valores dos alvos 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 + --refresh and add extra values 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 + --soma todos os demais valores for key, value in _pairs(habilidade) do if (_type(value) == "number") then if (key ~= "id" and key ~= "spellschool") then @@ -5566,13 +5566,13 @@ end end end - --> copia o container de friendly fire (captura de dados) + --copia o container de friendly fire (captura de dados) for target_name, ff_table in _pairs(actor.friendlyfire) do - --> cria ou pega a shadow + --cria ou pega a shadow local friendlyFire_shadow = shadow.friendlyfire [target_name] or shadow:CreateFFTable (target_name) - --> soma o total + --soma o total friendlyFire_shadow.total = friendlyFire_shadow.total + ff_table.total - --> some as spells + --some as spells for spellid, amount in _pairs(ff_table.spells) do friendlyFire_shadow.spells [spellid] = (friendlyFire_shadow.spells [spellid] or 0) + amount end @@ -5675,27 +5675,27 @@ end atributo_damage.__add = function(tabela1, tabela2) - --> tempo decorrido + --tempo decorrido local tempo = (tabela2.end_time or time()) - tabela2.start_time tabela1.start_time = tabela1.start_time - tempo - --> total de dano + --total de dano tabela1.total = tabela1.total + tabela2.total tabela1.totalabsorbed = tabela1.totalabsorbed + tabela2.totalabsorbed - --> total de dano sem o pet + --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 + --total de dano que o cara levou tabela1.damage_taken = tabela1.damage_taken + tabela2.damage_taken - --> total do friendly fire causado + --total do friendly fire causado tabela1.friendlyfire_total = tabela1.friendlyfire_total + tabela2.friendlyfire_total - --> soma o damage_from + --soma o damage_from 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 + --pets (add unique pet names) + for _, petName in _ipairs(tabela2.pets) do local hasPet = false for i = 1, #tabela1.pets do if (tabela1.pets[i] == petName) then @@ -5709,32 +5709,32 @@ atributo_damage.__add = function(tabela1, tabela2) end end - --> soma os containers de alvos + --soma os containers de alvos 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 + --soma o container de raid targets 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 + --soma o container de habilidades for spellid, habilidade in _pairs(tabela2.spells._ActorTable) do - --> pega a habilidade no primeiro ator + --pega a habilidade no primeiro ator local habilidade_tabela1 = tabela1.spells:PegaHabilidade (spellid, true, "SPELL_DAMAGE", false) - --> soma os alvos + --soma os alvos 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 + --soma os extras for spellId, amount in _pairs(habilidade.extra) do habilidade_tabela1.extra = (habilidade_tabela1.extra [spellId] or 0) + amount end - --> soma os valores da habilidade + --soma os valores da habilidade for key, value in _pairs(habilidade) do if (_type(value) == "number") then if (key ~= "id" and key ~= "spellschool") then @@ -5759,14 +5759,14 @@ atributo_damage.__add = function(tabela1, tabela2) end end - --> soma o container de friendly fire + --soma o container de friendly fire for target_name, ff_table in _pairs(tabela2.friendlyfire) do - --> pega o ator ff no ator principal + --pega o ator ff no ator principal local friendlyFire_tabela1 = tabela1.friendlyfire [target_name] or tabela1:CreateFFTable (target_name) - --> soma o total + --soma o total friendlyFire_tabela1.total = friendlyFire_tabela1.total + ff_table.total - --> soma as habilidades + --soma as habilidades for spellid, amount in _pairs(ff_table.spells) do friendlyFire_tabela1.spells [spellid] = (friendlyFire_tabela1.spells [spellid] or 0) + amount end @@ -5777,22 +5777,22 @@ end atributo_damage.__sub = function(tabela1, tabela2) - --> tempo decorrido + --tempo decorrido local tempo = (tabela2.end_time or time()) - tabela2.start_time tabela1.start_time = tabela1.start_time + tempo - --> total de dano + --total de dano tabela1.total = tabela1.total - tabela2.total tabela1.totalabsorbed = tabela1.totalabsorbed - tabela2.totalabsorbed - --> total de dano sem o pet + --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 + --total de dano que o cara levou tabela1.damage_taken = tabela1.damage_taken - tabela2.damage_taken - --> total do friendly fire causado + --total do friendly fire causado tabela1.friendlyfire_total = tabela1.friendlyfire_total - tabela2.friendlyfire_total - --> reduz os containers de alvos + --reduz os containers de alvos for target_name, amount in _pairs(tabela2.targets) do local alvo_tabela1 = tabela1.targets [target_name] if (alvo_tabela1) then @@ -5800,19 +5800,19 @@ atributo_damage.__sub = function(tabela1, tabela2) end end - --> reduz o container de raid targets + --reduz o container de raid targets 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 + --reduz o container de habilidades for spellid, habilidade in _pairs(tabela2.spells._ActorTable) do - --> get the spell from the first actor + --get the spell from the first actor local habilidade_tabela1 = tabela1.spells:PegaHabilidade (spellid, true, "SPELL_DAMAGE", false) - --> subtract targets + --subtract targets for target_name, amount in _pairs(habilidade.targets) do local alvo_tabela1 = habilidade_tabela1.targets [target_name] if (alvo_tabela1) then @@ -5820,7 +5820,7 @@ atributo_damage.__sub = function(tabela1, tabela2) end end - --> subtract extra table + --subtract extra table for spellId, amount in _pairs(habilidade.extra) do local extra_tabela1 = habilidade_tabela1.extra [spellId] if (extra_tabela1) then @@ -5828,7 +5828,7 @@ atributo_damage.__sub = function(tabela1, tabela2) end end - --> subtrai os valores da habilidade + --subtrai os valores da habilidade for key, value in _pairs(habilidade) do if (_type(value) == "number") then if (key ~= "id" and key ~= "spellschool") then @@ -5851,9 +5851,9 @@ atributo_damage.__sub = function(tabela1, tabela2) end end - --> reduz o container de friendly fire + --reduz o container de friendly fire for target_name, ff_table in _pairs(tabela2.friendlyfire) do - --> pega o ator ff no ator principal + --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 @@ -5869,10 +5869,10 @@ atributo_damage.__sub = function(tabela1, tabela2) end function Details.refresh:r_atributo_damage (este_jogador, shadow) - --> restaura metas do ator + --restaura metas do ator _setmetatable (este_jogador, Details.atributo_damage) este_jogador.__index = Details.atributo_damage - --> restaura as metas dos containers + --restaura as metas dos containers Details.refresh:r_container_habilidades (este_jogador.spells, shadow and shadow.spells) end @@ -5887,14 +5887,14 @@ end --[[ - --> enemy damage done + --enemy damage done i = 1 local enemy = combat (1, enemy_name) if (enemy) then local damage_done = 0 - --> get targets + --get targets for target_name, amount in _pairs(enemy.targets) do local player = combat (1, target_name) if (player and player.grupo) then @@ -5910,7 +5910,7 @@ end end end - --> first clenup + --first clenup for o = i, #tooltip_temp_table do local t = tooltip_temp_table [o] t[2] = 0 @@ -5919,13 +5919,13 @@ end _table_sort(tooltip_temp_table, Details.Sort2) - --> enemy damage taken + --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 + --build the tooltip for o = 1, i-1 do local player = tooltip_temp_table [o][1] @@ -5953,7 +5953,7 @@ end end - --> clean up + --clean up for o = 1, #tooltip_temp_table do local t = tooltip_temp_table [o] t[2] = 0 diff --git a/classes/class_heal.lua b/classes/class_heal.lua index c2ab82a6..0da96eb5 100644 --- a/classes/class_heal.lua +++ b/classes/class_heal.lua @@ -72,10 +72,10 @@ function atributo_heal:NovaTabela (serial, nome, link) local alphabetical = _detalhes:GetOrderNumber(nome) - --> constructor + --constructor local _new_healActor = { - tipo = class_type, --> atributo 2 = cura + tipo = class_type, --atributo 2 = cura total = alphabetical, totalover = alphabetical, @@ -86,22 +86,22 @@ function atributo_heal:NovaTabela (serial, nome, link) total_without_pet = alphabetical, totalover_without_pet = alphabetical, - healing_taken = alphabetical, --> total de cura que este jogador recebeu - healing_from = {}, --> armazena os nomes que deram cura neste jogador + healing_taken = alphabetical, --total de cura que este jogador recebeu + healing_from = {}, --armazena os nomes que deram cura neste jogador - iniciar_hps = false, --> dps_started + iniciar_hps = false, --dps_started last_event = 0, on_hold = false, delay = 0, - last_value = nil, --> ultimo valor que este jogador teve, salvo quando a barra dele � atualizada - last_hps = 0, --> cura por segundo + last_value = nil, --ultimo valor que este jogador teve, salvo quando a barra dele � atualizada + last_hps = 0, --cura por segundo end_time = nil, start_time = 0, - pets = {}, --> nome j� formatado: pet nome + pets = {}, --nome j� formatado: pet nome - heal_enemy = {}, --> quando o jogador cura um inimigo + heal_enemy = {}, --quando o jogador cura um inimigo heal_enemy_amt = 0, --container armazenar� os IDs das habilidades usadas por este jogador @@ -119,7 +119,7 @@ end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> npc healing taken +--npc healing taken --local npchealingtaken_tooltip_background = {value = 100, color = {0.1960, 0.1960, 0.1960, 0.9097}, texture = [[Interface\AddOns\Details\images\bar_background2]]} @@ -164,7 +164,7 @@ function _detalhes:ContainerSortHeal (container, amount, keyName2) _table_sort (container, _detalhes.SortKeySimpleHeal) if (amount) then - for i = amount, 1, -1 do --> de tr�s pra frente + for i = amount, 1, -1 do --de tr�s pra frente if (container[i][keyName] < 1) then amount = amount-1 else @@ -181,7 +181,7 @@ function atributo_heal:ContainerRefreshHps (container, combat_time) local total = 0 if (_detalhes.time_type == 2 or not _detalhes:CaptureGet ("heal")) then - for _, actor in _ipairs (container) do + for _, actor in _ipairs(container) do if (actor.grupo) then actor.last_hps = actor.total / combat_time else @@ -190,7 +190,7 @@ function atributo_heal:ContainerRefreshHps (container, combat_time) total = total + actor.last_hps end else - for _, actor in _ipairs (container) do + for _, actor in _ipairs(container) do actor.last_hps = actor.total / actor:Tempo() total = total + actor.last_hps end @@ -216,78 +216,78 @@ end function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, exportar) - local showing = tabela_do_combate [class_type] --> o que esta sendo mostrado -> [1] - dano [2] - cura + local showing = tabela_do_combate [class_type] --o que esta sendo mostrado -> [1] - dano [2] - cura - --> n�o h� barras para mostrar -- not have something to show - if (#showing._ActorTable < 1) then --> n�o h� barras para mostrar - --> colocado isso recentemente para fazer as barras de dano sumirem na troca de atributo + --n�o h� barras para mostrar -- not have something to show + if (#showing._ActorTable < 1) then --n�o h� barras para mostrar + --colocado isso recentemente para fazer as barras de dano sumirem na troca de atributo return _detalhes: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 sub_atributo = instancia.sub_atributo --o que esta sendo mostrado nesta inst�ncia local conteudo = showing._ActorTable local amount = #conteudo local modo = instancia.modo - --> pega qual a sub key que ser� usada + --pega qual a sub key que ser� usada if (exportar) then - if (_type (exportar) == "boolean") then - if (sub_atributo == 1) then --> healing DONE + if (_type(exportar) == "boolean") then + if (sub_atributo == 1) then --healing DONE keyName = "total" - elseif (sub_atributo == 2) then --> HPS + elseif (sub_atributo == 2) then --HPS keyName = "last_hps" - elseif (sub_atributo == 3) then --> overheal + elseif (sub_atributo == 3) then --overheal keyName = "totalover" - elseif (sub_atributo == 4) then --> healing take + elseif (sub_atributo == 4) then --healing take keyName = "healing_taken" - elseif (sub_atributo == 5) then --> enemy heal + elseif (sub_atributo == 5) then --enemy heal keyName = "heal_enemy_amt" - elseif (sub_atributo == 6) then --> absorbs + elseif (sub_atributo == 6) then --absorbs keyName = "totalabsorb" - elseif (sub_atributo == 7) then --> heal absorb + elseif (sub_atributo == 7) then --heal absorb keyName = "totaldenied" end else keyName = exportar.key modo = exportar.modo end - elseif (instancia.atributo == 5) then --> custom + elseif (instancia.atributo == 5) then --custom keyName = "custom" total = tabela_do_combate.totals [instancia.customName] else - if (sub_atributo == 1) then --> healing DONE + if (sub_atributo == 1) then --healing DONE keyName = "total" - elseif (sub_atributo == 2) then --> HPS + elseif (sub_atributo == 2) then --HPS keyName = "last_hps" - elseif (sub_atributo == 3) then --> overheal + elseif (sub_atributo == 3) then --overheal keyName = "totalover" - elseif (sub_atributo == 4) then --> healing take + elseif (sub_atributo == 4) then --healing take keyName = "healing_taken" - elseif (sub_atributo == 5) then --> enemy heal + elseif (sub_atributo == 5) then --enemy heal keyName = "heal_enemy_amt" - elseif (sub_atributo == 6) then --> absorbs + elseif (sub_atributo == 6) then --absorbs keyName = "totalabsorb" - elseif (sub_atributo == 7) then --> heal absorb + elseif (sub_atributo == 7) then --heal absorb keyName = "totaldenied" end end - if (instancia.atributo == 5) then --> custom - --> faz o sort da categoria e retorna o amount corrigido + if (instancia.atributo == 5) then --custom + --faz o sort da categoria e retorna o amount corrigido amount = _detalhes:ContainerSortHeal (conteudo, amount, keyName) - --> grava o total + --grava o total instancia.top = conteudo[1][keyName] - elseif (instancia.modo == modo_ALL or sub_atributo == 5 or sub_atributo == 7) then --> mostrando ALL + elseif (instancia.modo == modo_ALL or sub_atributo == 5 or sub_atributo == 7) then --mostrando ALL amount = _detalhes:ContainerSortHeal (conteudo, amount, keyName) @@ -295,14 +295,14 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo local combat_time = instancia.showing:GetCombatTime() total = atributo_heal:ContainerRefreshHps (conteudo, combat_time) else - --> pega o total ja aplicado na tabela do combate + --pega o total ja aplicado na tabela do combate total = tabela_do_combate.totals [class_type] end - --> grava o total + --grava o total instancia.top = conteudo[1][keyName] - elseif (instancia.modo == modo_GROUP) then --> mostrando GROUP + elseif (instancia.modo == modo_GROUP) then --mostrando GROUP if (_detalhes.in_combat and instancia.segmento == 0 and not exportar) then using_cache = true @@ -312,7 +312,7 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo conteudo = _detalhes.cache_healing_group - if (sub_atributo == 2) then --> hps + if (sub_atributo == 2) then --hps local combat_time = instancia.showing:GetCombatTime() atributo_heal:ContainerRefreshHps (conteudo, combat_time) end @@ -335,7 +335,7 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo end else - if (sub_atributo == 2) then --> hps + if (sub_atributo == 2) then --hps local combat_time = instancia.showing:GetCombatTime() atributo_heal:ContainerRefreshHps (conteudo, combat_time) end @@ -344,12 +344,12 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo end -- if (not using_cache) then - for index, player in _ipairs (conteudo) do - if (player.grupo) then --> � um player e esta em grupo - if (player[keyName] < 1) then --> dano menor que 1, interromper o loop + for index, player in _ipairs(conteudo) 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 - elseif (index == 1) then --> esse IF aqui, precisa mesmo ser aqui? n�o daria pra pega-lo com uma chave [1] nad grupo == true? + elseif (index == 1) then --esse IF aqui, precisa mesmo ser aqui? n�o daria pra pega-lo com uma chave [1] nad grupo == true? instancia.top = conteudo[1][keyName] end @@ -363,17 +363,17 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo end - --> refaz o mapa do container - --> se for cache n�o precisa remapear + --refaz o mapa do container + --se for cache n�o precisa remapear showing:remapear() if (exportar) then return total, keyName, instancia.top, amount end - if (amount < 1) then --> n�o h� barras para mostrar + if (amount < 1) then --n�o h� barras para mostrar instancia:EsconderScrollBar() - return _detalhes:EndRefresh (instancia, total, tabela_do_combate, showing) --> retorna a tabela que precisa ganhar o refresh + return _detalhes:EndRefresh (instancia, total, tabela_do_combate, showing) --retorna a tabela que precisa ganhar o refresh end --estra mostrando ALL ent�o posso seguir o padr�o correto? primeiro, atualiza a scroll bar... @@ -381,7 +381,7 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo --depois faz a atualiza��o normal dele atrav�s dos iterators local whichRowLine = 1 - local barras_container = instancia.barras --> evita buscar N vezes a key .barras dentro da inst�ncia + local barras_container = instancia.barras --evita buscar N vezes a key .barras dentro da inst�ncia local percentage_type = instancia.row_info.percent_type local bars_show_data = instancia.row_info.textR_show_data local bars_brackets = instancia:GetBarBracket() @@ -400,7 +400,7 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo if (following) then if (using_cache) then local pname = _detalhes.playername - for i, actor in _ipairs (conteudo) do + for i, actor in _ipairs(conteudo) do if (actor.nome == pname) then myPos = i break @@ -436,24 +436,24 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo local row1 = barras_container [1] row1.minha_tabela = nil - row1.lineText1:SetText (Loc ["STRING_TOTAL"]) + row1.lineText1:SetText(Loc ["STRING_TOTAL"]) if (instancia.use_multi_fontstrings) then instancia:SetInLineTexts(row1, "", _detalhes:ToK2 (total), _detalhes:ToK (total / combat_time)) else - row1.lineText4:SetText (_detalhes:ToK2 (total) .. " (" .. _detalhes:ToK (total / combat_time) .. ")") + row1.lineText4:SetText(_detalhes:ToK2 (total) .. " (" .. _detalhes:ToK (total / combat_time) .. ")") end - row1:SetValue (100) + 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:SetTexture(instancia.total_bar.icon) row1.icone_classe:SetTexCoord (0.0625, 0.9375, 0.0625, 0.9375) - Details.FadeHandler.Fader (row1, "out") + Details.FadeHandler.Fader(row1, "out") 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 --> vai atualizar s� o range que esta sendo mostrado + for i = instancia.barraS[1], iter_last-1, 1 do --vai atualizar s� o range que esta sendo mostrado if (conteudo[i]) then conteudo[i]:RefreshLine (instancia, barras_container, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) whichRowLine = whichRowLine+1 @@ -464,7 +464,7 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo whichRowLine = whichRowLine+1 else - for i = instancia.barraS[1], iter_last, 1 do --> vai atualizar s� o range que esta sendo mostrado + for i = instancia.barraS[1], iter_last, 1 do --vai atualizar s� o range que esta sendo mostrado if (conteudo[i]) then conteudo[i]:RefreshLine (instancia, barras_container, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) whichRowLine = whichRowLine+1 @@ -474,7 +474,7 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo 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 --> vai atualizar s� o range que esta sendo mostrado + for i = instancia.barraS[1], instancia.barraS[2]-1, 1 do --vai atualizar s� o range que esta sendo mostrado if (conteudo[i]) then conteudo[i]:RefreshLine (instancia, barras_container, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) whichRowLine = whichRowLine+1 @@ -484,7 +484,7 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo conteudo[myPos]:RefreshLine (instancia, barras_container, whichRowLine, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) whichRowLine = whichRowLine+1 else - for i = instancia.barraS[1], instancia.barraS[2], 1 do --> vai atualizar s� o range que esta sendo mostrado + for i = instancia.barraS[1], instancia.barraS[2], 1 do --vai atualizar s� o range que esta sendo mostrado if (conteudo[i]) then conteudo[i]:RefreshLine (instancia, barras_container, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) whichRowLine = whichRowLine+1 @@ -505,34 +505,34 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo local row1 = barras_container [1] row1.minha_tabela = nil - row1.lineText1:SetText (Loc ["STRING_TOTAL"]) + row1.lineText1:SetText(Loc ["STRING_TOTAL"]) -- if (instancia.use_multi_fontstrings) then instancia:SetInLineTexts(row1, "", _detalhes:ToK2(total), _detalhes:ToK(total / combat_time)) else - row1.lineText4:SetText (_detalhes:ToK2 (total) .. " (" .. _detalhes:ToK (total / combat_time) .. ")") + row1.lineText4:SetText(_detalhes:ToK2 (total) .. " (" .. _detalhes:ToK (total / combat_time) .. ")") end - row1:SetValue (100) + 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:SetTexture(instancia.total_bar.icon) row1.icone_classe:SetTexCoord (0.0625, 0.9375, 0.0625, 0.9375) - Details.FadeHandler.Fader (row1, "out") + Details.FadeHandler.Fader(row1, "out") if (following and myPos and myPos > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then conteudo[myPos]:RefreshLine (instancia, barras_container, whichRowLine, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) whichRowLine = whichRowLine+1 - for i = iter_last-1, instancia.barraS[1], -1 do --> vai atualizar s� o range que esta sendo mostrado + for i = iter_last-1, instancia.barraS[1], -1 do --vai atualizar s� o range que esta sendo mostrado if (conteudo[i]) then conteudo[i]:RefreshLine (instancia, barras_container, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) whichRowLine = whichRowLine+1 end end else - for i = iter_last, instancia.barraS[1], -1 do --> vai atualizar s� o range que esta sendo mostrado + for i = iter_last, instancia.barraS[1], -1 do --vai atualizar s� o range que esta sendo mostrado if (conteudo[i]) then conteudo[i]:RefreshLine (instancia, barras_container, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) whichRowLine = whichRowLine+1 @@ -543,14 +543,14 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo if (following and myPos and myPos > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then conteudo[myPos]:RefreshLine (instancia, barras_container, whichRowLine, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) whichRowLine = whichRowLine+1 - for i = instancia.barraS[2]-1, instancia.barraS[1], -1 do --> vai atualizar s� o range que esta sendo mostrado + for i = instancia.barraS[2]-1, instancia.barraS[1], -1 do --vai atualizar s� o range que esta sendo mostrado if (conteudo[i]) then conteudo[i]:RefreshLine (instancia, barras_container, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) whichRowLine = whichRowLine+1 end end else - for i = instancia.barraS[2], instancia.barraS[1], -1 do --> vai atualizar s� o range que esta sendo mostrado + for i = instancia.barraS[2], instancia.barraS[1], -1 do --vai atualizar s� o range que esta sendo mostrado if (conteudo[i]) then conteudo[i]:RefreshLine (instancia, barras_container, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) whichRowLine = whichRowLine+1 @@ -565,9 +565,9 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo instancia:PerformAnimations (whichRowLine - 1) end - if (instancia.atributo == 5) then --> custom - --> zerar o .custom dos Actors - for index, player in _ipairs (conteudo) do + if (instancia.atributo == 5) then --custom + --zerar o .custom dos Actors + for index, player in _ipairs(conteudo) do if (player.custom > 0) then player.custom = 0 else @@ -576,11 +576,11 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo end end - --> beta, hidar barras n�o usadas durante um refresh for�ado + --beta, hidar barras n�o usadas durante um refresh for�ado if (forcar) then - if (instancia.modo == 2) then --> group + 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 @@ -588,7 +588,7 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo instancia:AutoAlignInLineFontStrings() -- showing.need_refresh = false - return Details:EndRefresh (instancia, total, tabela_do_combate, showing) --> retorna a tabela que precisa ganhar o refresh + return Details:EndRefresh (instancia, total, tabela_do_combate, showing) --retorna a tabela que precisa ganhar o refresh end @@ -597,7 +597,7 @@ local actor_class_color_r, actor_class_color_g, actor_class_color_b --function atributo_heal:RefreshLine (instancia, whichRowLine, lugar, total, sub_atributo, forcar) function atributo_heal:RefreshLine(instancia, barras_container, whichRowLine, lugar, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) - local thisLine = instancia.barras[whichRowLine] --> pega a refer�ncia da barra na janela + local thisLine = instancia.barras[whichRowLine] --pega a refer�ncia da barra na janela if (not thisLine) then print ("DEBUG: problema com "..whichRowLine.." "..lugar) @@ -607,12 +607,12 @@ function atributo_heal:RefreshLine(instancia, barras_container, whichRowLine, lu local tabela_anterior = thisLine.minha_tabela thisLine.minha_tabela = self --grava uma refer�ncia dessa classe de dano na barra - self.minha_barra = thisLine --> salva uma refer�ncia da barra no objeto do jogador + self.minha_barra = thisLine --salva uma refer�ncia da barra no objeto do jogador - thisLine.colocacao = lugar --> salva na barra qual a coloca��o dela. - self.colocacao = lugar --> salva qual a coloca��o do jogador no objeto dele + thisLine.colocacao = lugar --salva na barra qual a coloca��o dela. + self.colocacao = lugar --salva qual a coloca��o do jogador no objeto dele - local healing_total = self.total --> total de dano que este jogador deu + local healing_total = self.total --total de dano que este jogador deu local hps --local porcentagem = self [keyName] / total * 100 @@ -648,7 +648,7 @@ function atributo_heal:RefreshLine(instancia, barras_container, whichRowLine, lu else hps = self.last_hps - if (hps == 0) then --> n�o calculou o dps dele ainda mas entrou em standby + if (hps == 0) then --n�o calculou o dps dele ainda mas entrou em standby hps = healing_total/self:Tempo() self.last_hps = hps end @@ -656,19 +656,19 @@ function atributo_heal:RefreshLine(instancia, barras_container, whichRowLine, lu end -- >>>>>>>>>>>>>>> texto da direita - if (instancia.atributo == 5) then --> custom + if (instancia.atributo == 5) then --custom -- if (instancia.use_multi_fontstrings) then instancia:SetInLineTexts(thisLine, "", _detalhes:ToK (self.custom), porcentagem .. "%") else - thisLine.lineText4:SetText (_detalhes:ToK (self.custom) .. " (" .. porcentagem .. "%)") + thisLine.lineText4:SetText(_detalhes:ToK (self.custom) .. " (" .. porcentagem .. "%)") end - esta_porcentagem = _math_floor ((self.custom/instancia.top) * 100) + esta_porcentagem = _math_floor((self.custom/instancia.top) * 100) else - if (sub_atributo == 1) then --> mostrando healing done + if (sub_atributo == 1) then --mostrando healing done - hps = _math_floor (hps) + hps = _math_floor(hps) local formated_heal = SelectedToKFunction (_, healing_total) local formated_hps = SelectedToKFunction (_, hps) thisLine.ps_text = formated_hps @@ -687,7 +687,7 @@ function atributo_heal:RefreshLine(instancia, barras_container, whichRowLine, lu local rightText = formated_heal .. bars_brackets[1] .. formated_hps .. bars_separator .. porcentagem .. bars_brackets[2] if (UsingCustomRightText) then - thisLine.lineText4:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_heal, formated_hps, porcentagem, self, instancia.showing, instancia, rightText)) + thisLine.lineText4:SetText(_string_replace (instancia.row_info.textR_custom_text, formated_heal, formated_hps, porcentagem, self, instancia.showing, instancia, rightText)) else if (instancia.use_multi_fontstrings) then instancia:SetInLineTexts(thisLine, formated_heal, formated_hps, porcentagem) @@ -695,11 +695,11 @@ function atributo_heal:RefreshLine(instancia, barras_container, whichRowLine, lu thisLine.lineText4:SetText(rightText) end end - esta_porcentagem = _math_floor ((healing_total/instancia.top) * 100) + esta_porcentagem = _math_floor((healing_total/instancia.top) * 100) - elseif (sub_atributo == 2) then --> mostrando hps + elseif (sub_atributo == 2) then --mostrando hps - hps = _math_floor (hps) + hps = _math_floor(hps) local formated_heal = SelectedToKFunction (_, healing_total) local formated_hps = SelectedToKFunction (_, hps) thisLine.ps_text = formated_hps @@ -718,7 +718,7 @@ function atributo_heal:RefreshLine(instancia, barras_container, whichRowLine, lu local rightText = formated_hps .. bars_brackets[1] .. formated_heal .. bars_separator .. porcentagem .. bars_brackets[2] if (UsingCustomRightText) then - thisLine.lineText4:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_hps, formated_heal, porcentagem, self, instancia.showing, instancia, rightText)) + thisLine.lineText4:SetText(_string_replace (instancia.row_info.textR_custom_text, formated_hps, formated_heal, porcentagem, self, instancia.showing, instancia, rightText)) else if (instancia.use_multi_fontstrings) then instancia:SetInLineTexts(thisLine, formated_hps, formated_heal, porcentagem) @@ -727,9 +727,9 @@ function atributo_heal:RefreshLine(instancia, barras_container, whichRowLine, lu end end - esta_porcentagem = _math_floor ((hps/instancia.top) * 100) + esta_porcentagem = _math_floor((hps/instancia.top) * 100) - elseif (sub_atributo == 3) then --> mostrando overall + elseif (sub_atributo == 3) then --mostrando overall local formated_overheal = SelectedToKFunction (_, self.totalover) @@ -737,7 +737,7 @@ function atributo_heal:RefreshLine(instancia, barras_container, whichRowLine, lu local overheal_percent = _cstr ("%.1f", percent) local rr, gg, bb = _detalhes:percent_color (percent, true) - rr, gg, bb = _detalhes:hex (_math_floor (rr*255)), _detalhes:hex (_math_floor (gg*255)), _detalhes:hex (_math_floor (bb*255)) + rr, gg, bb = _detalhes:hex (_math_floor(rr*255)), _detalhes:hex (_math_floor(gg*255)), _detalhes:hex (_math_floor(bb*255)) overheal_percent = "|cFF" .. rr .. gg .. bb .. overheal_percent .. "|r" if (not bars_show_data [1]) then @@ -751,7 +751,7 @@ function atributo_heal:RefreshLine(instancia, barras_container, whichRowLine, lu local rightText = formated_overheal .. bars_brackets[1] .. overheal_percent .. bars_brackets[2] if (UsingCustomRightText) then - thisLine.lineText4:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_overheal, "", overheal_percent, self, instancia.showing, instancia, rightText)) + thisLine.lineText4:SetText(_string_replace (instancia.row_info.textR_custom_text, formated_overheal, "", overheal_percent, self, instancia.showing, instancia, rightText)) else if (instancia.use_multi_fontstrings) then instancia:SetInLineTexts(thisLine, "", formated_overheal, overheal_percent) @@ -760,9 +760,9 @@ function atributo_heal:RefreshLine(instancia, barras_container, whichRowLine, lu end end - esta_porcentagem = _math_floor ((self.totalover/instancia.top) * 100) + esta_porcentagem = _math_floor((self.totalover/instancia.top) * 100) - elseif (sub_atributo == 4) then --> mostrando healing taken + elseif (sub_atributo == 4) then --mostrando healing taken local formated_healtaken = SelectedToKFunction (_, self.healing_taken) @@ -777,7 +777,7 @@ function atributo_heal:RefreshLine(instancia, barras_container, whichRowLine, lu local rightText = formated_healtaken .. bars_brackets[1] .. porcentagem .. bars_brackets[2] if (UsingCustomRightText) then - thisLine.lineText4:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_healtaken, "", porcentagem, self, instancia.showing, instancia, rightText)) + thisLine.lineText4:SetText(_string_replace (instancia.row_info.textR_custom_text, formated_healtaken, "", porcentagem, self, instancia.showing, instancia, rightText)) else if (instancia.use_multi_fontstrings) then instancia:SetInLineTexts(thisLine, "", formated_healtaken, porcentagem) @@ -786,9 +786,9 @@ function atributo_heal:RefreshLine(instancia, barras_container, whichRowLine, lu end end - esta_porcentagem = _math_floor ((self.healing_taken/instancia.top) * 100) + esta_porcentagem = _math_floor((self.healing_taken/instancia.top) * 100) - elseif (sub_atributo == 5) then --> mostrando enemy heal + elseif (sub_atributo == 5) then --mostrando enemy heal local formated_enemyheal = SelectedToKFunction (_, self.heal_enemy_amt) @@ -803,7 +803,7 @@ function atributo_heal:RefreshLine(instancia, barras_container, whichRowLine, lu local rightText = formated_enemyheal .. bars_brackets[1] .. porcentagem .. bars_brackets[2] if (UsingCustomRightText) then - thisLine.lineText4:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_enemyheal, "", porcentagem, self, instancia.showing, instancia, rightText)) + thisLine.lineText4:SetText(_string_replace (instancia.row_info.textR_custom_text, formated_enemyheal, "", porcentagem, self, instancia.showing, instancia, rightText)) else if (instancia.use_multi_fontstrings) then instancia:SetInLineTexts(thisLine, "", formated_enemyheal, porcentagem) @@ -811,9 +811,9 @@ function atributo_heal:RefreshLine(instancia, barras_container, whichRowLine, lu thisLine.lineText4:SetText(rightText) end end - esta_porcentagem = _math_floor ((self.heal_enemy_amt/instancia.top) * 100) + esta_porcentagem = _math_floor((self.heal_enemy_amt/instancia.top) * 100) - elseif (sub_atributo == 6) then --> mostrando damage prevented + elseif (sub_atributo == 6) then --mostrando damage prevented local formated_absorbs = SelectedToKFunction (_, self.totalabsorb) @@ -828,7 +828,7 @@ function atributo_heal:RefreshLine(instancia, barras_container, whichRowLine, lu local rightText = formated_absorbs .. bars_brackets[1] .. porcentagem .. bars_brackets[2] if (UsingCustomRightText) then - thisLine.lineText4:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_absorbs, "", porcentagem, self, instancia.showing, instancia, rightText)) + thisLine.lineText4:SetText(_string_replace (instancia.row_info.textR_custom_text, formated_absorbs, "", porcentagem, self, instancia.showing, instancia, rightText)) else if (instancia.use_multi_fontstrings) then instancia:SetInLineTexts(thisLine, "", formated_absorbs, porcentagem) @@ -836,9 +836,9 @@ function atributo_heal:RefreshLine(instancia, barras_container, whichRowLine, lu thisLine.lineText4:SetText(rightText) end end - esta_porcentagem = _math_floor ((self.totalabsorb/instancia.top) * 100) + esta_porcentagem = _math_floor((self.totalabsorb/instancia.top) * 100) - elseif (sub_atributo == 7) then --> mostrando cura negada + elseif (sub_atributo == 7) then --mostrando cura negada local formated_absorbs = SelectedToKFunction (_, self.totaldenied) @@ -853,7 +853,7 @@ function atributo_heal:RefreshLine(instancia, barras_container, whichRowLine, lu local rightText = formated_absorbs .. bars_brackets[1] .. porcentagem .. bars_brackets[2] if (UsingCustomRightText) then - thisLine.lineText4:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_absorbs, "", porcentagem, self, instancia.showing, instancia, rightText)) + thisLine.lineText4:SetText(_string_replace (instancia.row_info.textR_custom_text, formated_absorbs, "", porcentagem, self, instancia.showing, instancia, rightText)) else if (instancia.use_multi_fontstrings) then instancia:SetInLineTexts(thisLine, "", formated_absorbs, porcentagem) @@ -861,12 +861,12 @@ function atributo_heal:RefreshLine(instancia, barras_container, whichRowLine, lu thisLine.lineText4:SetText(rightText) end end - esta_porcentagem = _math_floor ((self.totaldenied/instancia.top) * 100) + esta_porcentagem = _math_floor((self.totaldenied/instancia.top) * 100) end end - if (thisLine.mouse_over and not instancia.baseframe.isMoving) then --> precisa atualizar o tooltip + if (thisLine.mouse_over and not instancia.baseframe.isMoving) then --precisa atualizar o tooltip gump:UpdateTooltip (whichRowLine, thisLine, instancia) end @@ -877,13 +877,13 @@ end function atributo_heal:RefreshBarra2 (thisLine, instancia, tabela_anterior, forcar, esta_porcentagem, whichRowLine, barras_container, use_animations) - --> primeiro colocado + --primeiro colocado if (thisLine.colocacao == 1) then if (not tabela_anterior or tabela_anterior ~= thisLine.minha_tabela or forcar) then - thisLine:SetValue (100) + 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, instancia) @@ -894,14 +894,14 @@ function atributo_heal:RefreshBarra2 (thisLine, instancia, tabela_anterior, forc if (thisLine.hidden or thisLine.fading_in or thisLine.faded) then - thisLine:SetValue (esta_porcentagem) + thisLine:SetValue(esta_porcentagem) if (use_animations) then thisLine.animacao_fim = esta_porcentagem else thisLine.animacao_ignorar = true end - Details.FadeHandler.Fader (thisLine, "out") + Details.FadeHandler.Fader(thisLine, "out") if (instancia.row_info.texture_class_colors) then thisLine.textura:SetVertexColor (actor_class_color_r, actor_class_color_g, actor_class_color_b) @@ -913,26 +913,26 @@ function atributo_heal:RefreshBarra2 (thisLine, instancia, tabela_anterior, forc return self:RefreshBarra (thisLine, instancia) else - --> agora esta comparando se a tabela da barra � diferente da tabela na atualiza��o anterior - if (not tabela_anterior or tabela_anterior ~= thisLine.minha_tabela or forcar) then --> aqui diz se a barra do jogador mudou de posi��o ou se ela apenas ser� atualizada + --agora esta comparando se a tabela da barra � diferente da tabela na atualiza��o anterior + if (not tabela_anterior or tabela_anterior ~= 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 else - thisLine:SetValue (esta_porcentagem) + thisLine:SetValue(esta_porcentagem) thisLine.animacao_ignorar = true end - thisLine.last_value = esta_porcentagem --> reseta o ultimo valor da barra + thisLine.last_value = esta_porcentagem --reseta o ultimo valor da barra return self:RefreshBarra (thisLine, instancia) - elseif (esta_porcentagem ~= thisLine.last_value) then --> continua mostrando a mesma tabela ent�o compara a porcentagem - --> apenas atualizar + 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 else - thisLine:SetValue (esta_porcentagem) + thisLine:SetValue(esta_porcentagem) end thisLine.last_value = esta_porcentagem @@ -952,14 +952,14 @@ function atributo_heal:RefreshBarra (thisLine, instancia, from_resize) actor_class_color_r, actor_class_color_g, actor_class_color_b = self:GetBarColor() end - --> icon + --icon self:SetClassIcon (thisLine.icone_classe, instancia, class) - --> texture color + --texture color self:SetBarColors (thisLine, instancia, actor_class_color_r, actor_class_color_g, actor_class_color_b) - --> left text + --left text self:SetBarLeftText (thisLine, instancia, enemy, arena_enemy, arena_ally, UsingCustomLeftText) - thisLine.lineText1:SetSize (thisLine:GetWidth() - thisLine.lineText4:GetStringWidth() - 20, 15) + thisLine.lineText1:SetSize(thisLine:GetWidth() - thisLine.lineText4:GetStringWidth() - 20, 15) end @@ -1001,31 +1001,31 @@ end --------------------------------------------- // TOOLTIPS // --------------------------------------------- ----------> TOOLTIPS BIFURCA��O ~tooltip +---------TOOLTIPS BIFURCA��O ~tooltip function atributo_heal:ToolTip (instancia, numero, barra, keydown) - --> seria possivel aqui colocar o icone da classe dele? + --seria possivel aqui colocar o icone da classe dele? - if (instancia.atributo == 5) then --> custom + if (instancia.atributo == 5) then --custom return self:TooltipForCustom (barra) else --GameTooltip:ClearLines() --GameTooltip:AddLine (barra.colocacao..". "..self.nome) - if (instancia.sub_atributo <= 3) then --> healing done, HPS or Overheal + if (instancia.sub_atributo <= 3) then --healing done, HPS or Overheal return self:ToolTip_HealingDone (instancia, numero, barra, keydown) - elseif (instancia.sub_atributo == 6) then --> healing done, HPS or Overheal + elseif (instancia.sub_atributo == 6) then --healing done, HPS or Overheal return self:ToolTip_HealingDone (instancia, numero, barra, keydown) - elseif (instancia.sub_atributo == 4) then --> healing taken + elseif (instancia.sub_atributo == 4) then --healing taken return self:ToolTip_HealingTaken (instancia, numero, barra, keydown) - elseif (instancia.sub_atributo == 7) then --> heal denied + elseif (instancia.sub_atributo == 7) then --heal denied return self:ToolTip_HealingDenied (instancia, numero, barra, keydown) end end end ---> tooltip locals +--tooltip locals local r, g, b local barAlha = .6 ----------> HEAL DENIED +---------HEAL DENIED function atributo_heal:ToolTip_HealingDenied (instancia, numero, barra, keydown) local owner = self.owner @@ -1088,7 +1088,7 @@ function atributo_heal:ToolTip_HealingDenied (instancia, numero, barra, keydown) tooltip_max_abilities = 99 end - for i = 1, _math_min (tooltip_max_abilities, #spellList) do + for i = 1, _math_min(tooltip_max_abilities, #spellList) do local spellObject, spellTotal = unpack (spellList [i]) if (spellTotal < 1) then @@ -1129,7 +1129,7 @@ function atributo_heal:ToolTip_HealingDenied (instancia, numero, barra, keydown) tooltip_max_abilities2 = 99 end - for i = 1, _math_min (tooltip_max_abilities2, #playerSorted) do + for i = 1, _math_min(tooltip_max_abilities2, #playerSorted) do local playerName, amountDenied = unpack (playerSorted [i]) @@ -1167,7 +1167,7 @@ function atributo_heal:ToolTip_HealingDenied (instancia, numero, barra, keydown) ismaximized = true end - for i = 1, _math_min (tooltip_max_abilities3, #spellsSorted) do + for i = 1, _math_min(tooltip_max_abilities3, #spellsSorted) do local spellID, spellTotal = unpack (spellsSorted [i]) @@ -1218,7 +1218,7 @@ function atributo_heal:ToolTip_HealingDenied (instancia, numero, barra, keydown) return true end ----------> HEALING TAKEN +---------HEALING TAKEN function atributo_heal:ToolTip_HealingTaken (instancia, numero, barra, keydown) local owner = self.owner @@ -1232,13 +1232,13 @@ function atributo_heal:ToolTip_HealingTaken (instancia, numero, barra, keydown) local total_curado = self.healing_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 showing = tabela_do_combate [class_type] --o que esta sendo mostrado -> [1] - dano [2] - cura --pega o container com ._NameIndexTable ._ActorTable local meus_curadores = {} - for nome, _ in _pairs (curadores) do --> agressores seria a lista de nomes + for nome, _ in _pairs (curadores) do --agressores seria a lista de nomes local este_curador = showing._ActorTable[showing._NameIndexTable[nome]] - if (este_curador) then --> checagem por causa do total e do garbage collector que n�o limpa os nomes que deram dano + if (este_curador) then --checagem por causa do total e do garbage collector que n�o limpa os nomes que deram dano local alvos = este_curador.targets local este_alvo = alvos [self.nome] if (este_alvo and este_alvo > 0) then @@ -1273,7 +1273,7 @@ function atributo_heal:ToolTip_HealingTaken (instancia, numero, barra, keydown) local lineHeight = _detalhes.tooltip.line_height - for i = 1, _math_min (max, #meus_curadores) do + for i = 1, _math_min(max, #meus_curadores) do local onyName = _detalhes:GetOnlyName(meus_curadores[i][1]) --translate cyrillic alphabet to western alphabet by Vardex (https://github.com/Vardex May 22, 2019) @@ -1305,7 +1305,7 @@ function atributo_heal:ToolTip_HealingTaken (instancia, numero, barra, keydown) return true end ----------> HEALING DONE / HPS / OVERHEAL +---------HEALING DONE / HPS / OVERHEAL local background_heal_vs_absorbs = {value = 100, color = {1, 1, 0, .25}, specialSpark = false, texture = [[Interface\AddOns\Details\images\bar4_glass]]} function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown) @@ -1355,7 +1355,7 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown) end --add actor pets - for petIndex, petName in _ipairs (self:Pets()) do + 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 @@ -1378,7 +1378,7 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown) _table_sort (ActorHealingTable, _detalhes.Sort2) - --> TOP Curados + --TOP Curados ActorSkillsContainer = self.targets for target_name, amount in _pairs (ActorSkillsContainer) do if (amount > 0) then @@ -1393,7 +1393,7 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown) end _table_sort (ActorHealingTargets, _detalhes.Sort2) - --> Mostra as habilidades no tooltip + --Mostra as habilidades no tooltip _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_SPELLS"], headerColor, #ActorHealingTable, [[Interface\RAIDFRAME\Raid-Icon-Rez]], 0.109375, 0.890625, 0.0625, 0.90625) local ismaximized = false @@ -1420,7 +1420,7 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown) local topAbility = ActorHealingTable [1] and ActorHealingTable [1][2] or 0 - for i = 1, _math_min (tooltip_max_abilities, #ActorHealingTable) do + for i = 1, _math_min(tooltip_max_abilities, #ActorHealingTable) do if (ActorHealingTable[i][2] < 1) then local antiHeal = ActorHealingTable[i][8] if (not antiHeal) then @@ -1435,33 +1435,33 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown) spellName = spellName .. " (|cFFCCBBBB" .. petName .. "|r)" end - if (instancia.sub_atributo == 2) then --> hps + if (instancia.sub_atributo == 2) then --hps - local formatedTotal = FormatTooltipNumber (_, _math_floor (ActorHealingTable[i][5])) + local formatedTotal = FormatTooltipNumber (_, _math_floor(ActorHealingTable[i][5])) local antiHeal = ActorHealingTable[i][8] if (antiHeal) then - formatedTotal = formatedTotal .. " [|cFFFF5500" .. FormatTooltipNumber (_, _math_floor (antiHeal)) .." " .. Loc ["STRING_DAMAGE"] .."|r] " + formatedTotal = formatedTotal .. " [|cFFFF5500" .. FormatTooltipNumber (_, _math_floor(antiHeal)) .." " .. Loc ["STRING_DAMAGE"] .."|r] " end GameCooltip:AddLine (spellName , formatedTotal .. " (".._cstr ("%.1f", ActorHealingTable[i][3]).."%)") - elseif (instancia.sub_atributo == 3) then --> overheal + elseif (instancia.sub_atributo == 3) then --overheal local overheal = ActorHealingTable[i][2] local total = ActorHealingTable[i][6] - local formatedTotal = FormatTooltipNumber (_, _math_floor (ActorHealingTable[i][2])) + local formatedTotal = FormatTooltipNumber (_, _math_floor(ActorHealingTable[i][2])) local antiHeal = ActorHealingTable[i][8] if (antiHeal) then - formatedTotal = formatedTotal .. " [|cFFFF5500" .. FormatTooltipNumber (_, _math_floor (antiHeal)) .." " .. Loc ["STRING_DAMAGE"] .."|r] " + formatedTotal = formatedTotal .. " [|cFFFF5500" .. FormatTooltipNumber (_, _math_floor(antiHeal)) .." " .. Loc ["STRING_DAMAGE"] .."|r] " end - GameCooltip:AddLine (spellName .." (|cFFFF3333" .. _math_floor ( (overheal / (overheal+total)) *100) .. "%|r)", formatedTotal .. " (".._cstr ("%.1f", ActorHealingTable[i][3]).."%)") + GameCooltip:AddLine (spellName .." (|cFFFF3333" .. _math_floor( (overheal / (overheal+total)) *100) .. "%|r)", formatedTotal .. " (".._cstr ("%.1f", ActorHealingTable[i][3]).."%)") else local formatedTotal = FormatTooltipNumber (_, ActorHealingTable[i][2]) local antiHeal = ActorHealingTable[i][8] if (antiHeal) then - formatedTotal = formatedTotal .. " [|cFFFF5500" .. FormatTooltipNumber (_, _math_floor (antiHeal)) .." " .. Loc ["STRING_DAMAGE"] .."|r] " + formatedTotal = formatedTotal .. " [|cFFFF5500" .. FormatTooltipNumber (_, _math_floor(antiHeal)) .." " .. Loc ["STRING_DAMAGE"] .."|r] " end GameCooltip:AddLine (spellName , formatedTotal .. " (" .. _cstr ("%.1f", ActorHealingTable[i][3]) .. "%)") @@ -1502,7 +1502,7 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown) tooltip_max_abilities2 = 99 end - for i = 1, _math_min (tooltip_max_abilities2, #ActorHealingTargets) do + for i = 1, _math_min(tooltip_max_abilities2, #ActorHealingTargets) do if (ActorHealingTargets[i][2] < 1) then break end @@ -1531,15 +1531,15 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown) end end - --> PETS + --PETS local meus_pets = self.pets - if (#meus_pets > 0 and (instancia.sub_atributo == 1 or instancia.sub_atributo == 2 or instancia.sub_atributo == 3)) then --> teve ajudantes + if (#meus_pets > 0 and (instancia.sub_atributo == 1 or instancia.sub_atributo == 2 or instancia.sub_atributo == 3)) then --teve ajudantes - local quantidade = {} --> armazena a quantidade de pets iguais - local totais = {} --> armazena o dano total de cada objeto + local quantidade = {} --armazena a quantidade de pets iguais + local totais = {} --armazena o dano total de cada objeto - for index, nome in _ipairs (meus_pets) do + for index, nome in _ipairs(meus_pets) do if (not quantidade [nome]) then quantidade [nome] = 1 @@ -1575,7 +1575,7 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown) ismaximized = true end - for index, _table in _ipairs (totais) do + for index, _table in _ipairs(totais) do if (_table [2] >= 1 and (index < 3 or ismaximized)) then @@ -1596,12 +1596,12 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown) local n = _table [1]:gsub (("%s%<.*"), "") if (instancia.sub_atributo == 3) then --overheal - GameCooltip:AddLine (n .. " (|cFFFF3333" .. _math_floor ( (_table [2] / (_table [2] + _table [3])) * 100) .. "%|r):", FormatTooltipNumber (_, _math_floor (_table [2])) .. " (" .. _math_floor ( (_table [2] / (_table [2] + _table [3])) * 100) .. "%)") + GameCooltip:AddLine (n .. " (|cFFFF3333" .. _math_floor( (_table [2] / (_table [2] + _table [3])) * 100) .. "%|r):", FormatTooltipNumber (_, _math_floor(_table [2])) .. " (" .. _math_floor( (_table [2] / (_table [2] + _table [3])) * 100) .. "%)") elseif (instancia.sub_atributo == 2) then --hps - 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) .. "%)") else - 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) .. "%)") end _detalhes:AddTooltipBackgroundStatusbar() GameCooltip:AddIcon ([[Interface\AddOns\Details\images\classes_small]], 1, 1, icon_size.W, icon_size.H, 0.25, 0.49609375, 0.75, 1) @@ -1609,7 +1609,7 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown) end end - --> ~Phases + --~Phases if (instancia.sub_atributo == 1 or instancia.sub_atributo == 2) then local segment = instancia:GetShowingCombat() if (segment and self.grupo) then @@ -1679,7 +1679,7 @@ function atributo_heal:MontaInfoHealTaken() local curandeiros = self.healing_from 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 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 meus_curandeiros = {} @@ -1708,7 +1708,7 @@ function atributo_heal:MontaInfoHealTaken() local max_ = meus_curandeiros [1] and meus_curandeiros [1][2] or 0 local barra - for index, tabela in _ipairs (meus_curandeiros) do + for index, tabela in _ipairs(meus_curandeiros) do barra = barras [index] if (not barra) then barra = gump:CriaNovaBarraInfo1 (instancia, index) @@ -1723,14 +1723,14 @@ function atributo_heal:MontaInfoHealTaken() texCoords = _detalhes.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", true, texCoords) end end function atributo_heal:MontaInfoOverHealing() ---> pegar as habilidade de dar sort no heal +--pegar as habilidade de dar sort no heal local instancia = info.instancia local total = self.totalover @@ -1743,14 +1743,14 @@ function atributo_heal:MontaInfoOverHealing() _table_insert (minhas_curas, {spellid, tabela.overheal, tabela.overheal/total*100, nome, icone}) end - --> add pets + --add pets local ActorPets = self.pets local class_color = "FFDDDDDD" - for _, PetName in _ipairs (ActorPets) do + for _, PetName in _ipairs(ActorPets) do local PetActor = instancia.showing (class_type, PetName) if (PetActor) then local PetSkillsContainer = PetActor.spells._ActorTable - for _spellid, _skill in _pairs (PetSkillsContainer) do --> da foreach em cada spellid do container + for _spellid, _skill in _pairs (PetSkillsContainer) do --da foreach em cada spellid do container 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 @@ -1764,7 +1764,7 @@ function atributo_heal:MontaInfoOverHealing() local max_ = minhas_curas[1] and minhas_curas[1][2] or 0 - for index, tabela in _ipairs (minhas_curas) do + for index, tabela in _ipairs(minhas_curas) do local barra = barras [index] @@ -1775,8 +1775,8 @@ function atributo_heal:MontaInfoOverHealing() end if (not info.mostrando_mouse_over) then - if (tabela[1] == self.detalhes) then --> tabela [1] = spellid = spellid que esta na caixa da direita - if (not barra.on_focus) then --> se a barra n�o tiver no foco + if (tabela[1] == self.detalhes) then --tabela [1] = spellid = spellid que esta na caixa da direita + if (not barra.on_focus) then --se a barra n�o tiver no foco barra.textura:SetStatusBarColor (129/255, 125/255, 69/255, 1) barra.on_focus = true if (not info.mostrando) then @@ -1785,25 +1785,25 @@ function atributo_heal:MontaInfoOverHealing() end else if (barra.on_focus) then - barra.textura:SetStatusBarColor (1, 1, 1, 1) --> volta a cor antiga - barra:SetAlpha (.9) --> volta a alfa antiga + barra.textura:SetStatusBarColor (1, 1, 1, 1) --volta a cor antiga + barra:SetAlpha (.9) --volta a alfa antiga barra.on_focus = false end end 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.lineText1:SetText(index..instancia.divisores.colocacao..tabela[4]) --seta o texto da esqueda - local formated_value = SelectedToKFunction (_, _math_floor (tabela[2])) - barra.lineText4:SetText (formated_value .." (".. _cstr ("%.1f", tabela[3]) .."%)") + local formated_value = SelectedToKFunction (_, _math_floor(tabela[2])) + barra.lineText4:SetText(formated_value .." (".. _cstr ("%.1f", tabela[3]) .."%)") - barra.icone:SetTexture (tabela[5]) + barra.icone:SetTexture(tabela[5]) barra.other_actor = tabela [6] barra.minha_tabela = self @@ -1815,7 +1815,7 @@ function atributo_heal:MontaInfoOverHealing() end end - --> TOP OVERHEALED + --TOP OVERHEALED local jogadores_overhealed = {} tabela = self.targets_overheal local heal_container = instancia.showing[2] @@ -1834,7 +1834,7 @@ function atributo_heal:MontaInfoOverHealing() local max_inimigos = jogadores_overhealed[1] and jogadores_overhealed[1][2] or 0 - for index, tabela in _ipairs (jogadores_overhealed) do + for index, tabela in _ipairs(jogadores_overhealed) do local barra = info.barras2 [index] @@ -1844,17 +1844,17 @@ function atributo_heal:MontaInfoOverHealing() 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..instancia.divisores.colocacao..tabela[1]) --seta o texto da esqueda - barra.lineText4:SetText (_detalhes:comma_value (tabela[2]) .." ".. instancia.divisores.abre .. _cstr ("%.1f", tabela[3]) .. instancia.divisores.fecha) - barra.lineText1:SetWidth (barra:GetWidth() - barra.lineText4:GetStringWidth() - 30) + barra.lineText1:SetText(index..instancia.divisores.colocacao..tabela[1]) --seta o texto da esqueda + barra.lineText4:SetText(_detalhes:comma_value (tabela[2]) .." ".. instancia.divisores.abre .. _cstr ("%.1f", tabela[3]) .. instancia.divisores.fecha) + barra.lineText1:SetWidth(barra:GetWidth() - barra.lineText4:GetStringWidth() - 30) -- icon - barra.icone:SetTexture ([[Interface\AddOns\Details\images\classes_small]]) + barra.icone:SetTexture([[Interface\AddOns\Details\images\classes_small]]) local texCoords = _detalhes.class_coords [tabela[4]] if (not texCoords) then @@ -1871,7 +1871,7 @@ end function atributo_heal:MontaInfoHealingDone() - --> pegar as habilidade de dar sort no heal + --pegar as habilidade de dar sort no heal local instancia = info.instancia local total = self.total @@ -1902,15 +1902,15 @@ function atributo_heal:MontaInfoHealingDone() info:SetStatusbarText() - --> add pets + --add pets local ActorPets = self.pets --local class_color = RAID_CLASS_COLORS [self.classe] and RAID_CLASS_COLORS [self.classe].colorStr local class_color = "FFDDDDDD" - for _, PetName in _ipairs (ActorPets) do + for _, PetName in _ipairs(ActorPets) do local PetActor = instancia.showing (class_type, PetName) if (PetActor) then local PetSkillsContainer = PetActor.spells._ActorTable - for _spellid, _skill in _pairs (PetSkillsContainer) do --> da foreach em cada spellid do container + for _spellid, _skill in _pairs (PetSkillsContainer) do --da foreach em cada spellid do container local nome, _, icone = _GetSpellInfo(_spellid) _table_insert (minhas_curas, { _spellid, @@ -1932,7 +1932,7 @@ function atributo_heal:MontaInfoHealingDone() local max_ = minhas_curas[1] and minhas_curas[1][2] or 0 local foundSpellDetail = false - for index, tabela in _ipairs (minhas_curas) do + for index, tabela in _ipairs(minhas_curas) do local barra = barras [index] @@ -1947,12 +1947,12 @@ function atributo_heal:MontaInfoHealingDone() barra.other_actor = tabela [6] 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], tabela[4], tabela[2], formated_value, max_, tabela[3], tabela[5], true) else - local formated_value = SelectedToKFunction (_, _math_floor (tabela[2])) + local formated_value = SelectedToKFunction (_, _math_floor(tabela[2])) if (tabela [7]) then - formated_value = formated_value .. " [|cFFFF5500" .. SelectedToKFunction (_, _math_floor (tabela [7])) .." " .. Loc ["STRING_DAMAGE"] .."|r] " + formated_value = formated_value .. " [|cFFFF5500" .. SelectedToKFunction (_, _math_floor(tabela [7])) .." " .. Loc ["STRING_DAMAGE"] .."|r] " end self:UpdadeInfoBar (barra, index, tabela[1], tabela[4], tabela[2], formated_value, max_, tabela[3], tabela[5], true) end @@ -1968,7 +1968,7 @@ function atributo_heal:MontaInfoHealingDone() end end - --> TOP CURADOS + --TOP CURADOS local healedTargets = {} tabela = self.targets for target_name, amount in _pairs (tabela) do @@ -1979,7 +1979,7 @@ function atributo_heal:MontaInfoHealingDone() gump:JI_AtualizaContainerAlvos(#healedTargets) local topHealingDone = healedTargets[1] and healedTargets[1][2] - for index, tabela in _ipairs (healedTargets) do + for index, tabela in _ipairs(healedTargets) do local barra = info.barras2 [index] @@ -2000,18 +2000,18 @@ function atributo_heal:MontaInfoHealingDone() if (target_actor) then 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 = _detalhes.class_coords ["ENEMY"] barra.icone:SetTexCoord (_unpack (texCoords)) end - barra.lineText1:SetText (index .. ". " .. _detalhes:GetOnlyName (tabela[1])) + barra.lineText1:SetText(index .. ". " .. _detalhes:GetOnlyName (tabela[1])) barra.textura:SetStatusBarColor(1, 1, 1, 1) if (info.sub_atributo == 2) then - barra.lineText4:SetText (_detalhes:comma_value (_math_floor (healingDone/meu_tempo)) .." (" .. _cstr ("%.1f", tabela[3]) .. "%)") + barra.lineText4:SetText(_detalhes:comma_value (_math_floor(healingDone/meu_tempo)) .." (" .. _cstr ("%.1f", tabela[3]) .. "%)") else - barra.lineText4:SetText (SelectedToKFunction (_, healingDone) .. " (" .. _cstr ("%.1f", tabela[3]) .. "%)") + barra.lineText4:SetText(SelectedToKFunction (_, healingDone) .. " (" .. _cstr ("%.1f", tabela[3]) .. "%)") end barra.minha_tabela = self @@ -2034,7 +2034,7 @@ function atributo_heal:MontaTooltipAlvos (thisLine, index, instancia) local targets_key = "" - if (sub_atributo == 3) then --> overheal + if (sub_atributo == 3) then --overheal total = self.totalover targets_key = "_overheal" else @@ -2043,9 +2043,9 @@ function atributo_heal:MontaTooltipAlvos (thisLine, index, instancia) _detalhes:FormatCooltipForSpells() GameCooltip:SetOwner(thisLine, "bottom", "top", 4, -2) - GameCooltip:SetOption ("MinWidth", max(230, thisLine:GetWidth()*0.98)) + GameCooltip:SetOption("MinWidth", max(230, thisLine:GetWidth()*0.98)) - --> add spells + --add spells for spellid, tabela in _pairs (container) do for target_name, amount in _pairs (tabela ["targets" .. targets_key]) do if (target_name == inimigo) then @@ -2055,9 +2055,9 @@ function atributo_heal:MontaTooltipAlvos (thisLine, index, instancia) end end - --> add pets + --add pets local ActorPets = self.pets - for _, PetName in _ipairs (ActorPets) do + for _, PetName in _ipairs(ActorPets) do local PetActor = instancia.showing (class_type, PetName) if (PetActor) then local PetSkillsContainer = PetActor.spells._ActorTable @@ -2105,7 +2105,7 @@ function atributo_heal:MontaTooltipAlvos (thisLine, index, instancia) local topSpellHeal = habilidades[1] and habilidades[1][2] if (topSpellHeal) then - for index, tabela in _ipairs (habilidades) do + for index, tabela in _ipairs(habilidades) do if (tabela [2] < 1) then break end @@ -2113,7 +2113,7 @@ function atributo_heal:MontaTooltipAlvos (thisLine, index, instancia) local spellName, spellIcon = tabela[1], tabela [3] if (is_hps) then - GameCooltip:AddLine (spellName, _detalhes:comma_value (_math_floor (tabela[2]/meu_tempo)).." (".. _cstr ("%.1f", tabela[2]/total*100).."%)") + GameCooltip:AddLine (spellName, _detalhes:comma_value (_math_floor(tabela[2]/meu_tempo)).." (".. _cstr ("%.1f", tabela[2]/total*100).."%)") else GameCooltip:AddLine (spellName, SelectedToKFunction (_, tabela[2]).." (".. _cstr ("%.1f", tabela[2]/total*100).."%)") end @@ -2130,7 +2130,7 @@ function atributo_heal:MontaTooltipAlvos (thisLine, index, instancia) end function atributo_heal:MontaDetalhes (spellid, barra) - --> bifurga��es + --bifurga��es if (info.sub_atributo == 1 or info.sub_atributo == 2 or info.sub_atributo == 3) then return self:MontaDetalhesHealingDone (spellid, barra) elseif (info.sub_atributo == 4) then @@ -2140,7 +2140,7 @@ end function atributo_heal:MontaDetalhesHealingTaken (nome, barra) - for _, barra in _ipairs (info.barras3) do + for _, barra in _ipairs(info.barras3) do barra:Hide() end @@ -2148,10 +2148,10 @@ function atributo_heal:MontaDetalhesHealingTaken (nome, barra) 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 showing = tabela_do_combate [class_type] --o que esta sendo mostrado -> [1] - dano [2] - cura --pega o container com ._NameIndexTable ._ActorTable local este_curandeiro = showing._ActorTable[showing._NameIndexTable[nome]] - local conteudo = este_curandeiro.spells._ActorTable --> _pairs[] com os IDs das magias + local conteudo = este_curandeiro.spells._ActorTable --_pairs[] com os IDs das magias local actor = info.jogador.nome @@ -2159,7 +2159,7 @@ function atributo_heal:MontaDetalhesHealingTaken (nome, barra) 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 if (tabela.targets [actor]) then local spell_nome, _, icone = _GetSpellInfo(spellid) _table_insert (minhas_magias, {spellid, tabela.targets [actor], tabela.targets [actor] / total*100, spell_nome, icone}) @@ -2168,29 +2168,29 @@ function atributo_heal:MontaDetalhesHealingTaken (nome, barra) _table_sort (minhas_magias, _detalhes.Sort2) - local max_ = minhas_magias[1] and minhas_magias[1][2] or 0 --> dano que a primeiro magia vez + 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 + for index, tabela in _ipairs(minhas_magias) do barra = barras [index] - if (not barra) then --> se a barra n�o existir, criar ela ent�o + if (not barra) then --se a barra n�o existir, criar ela ent�o barra = gump:CriaNovaBarraInfo3 (instancia, index) - barra.textura:SetStatusBarColor (1, 1, 1, 1) --> isso aqui � a parte da sele��o e descele��o + 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 (_detalhes:comma_value (tabela[2]) .." ".. instancia.divisores.abre .._cstr("%.1f", tabela[3]) .."%".. instancia.divisores.fecha) + barra.lineText1:SetText(index..instancia.divisores.colocacao..tabela[4]) --seta o texto da esqueda + barra.lineText4:SetText(_detalhes:comma_value (tabela[2]) .." ".. instancia.divisores.abre .._cstr("%.1f", tabela[3]) .."%".. instancia.divisores.fecha) - barra.icone:SetTexture (tabela[5]) + barra.icone:SetTexture(tabela[5]) - barra:Show() --> mostra a barra + barra:Show() --mostra a barra if (index == 15) then break @@ -2220,9 +2220,9 @@ function atributo_heal:MontaDetalhesHealingDone (spellid, barra) return end - --> icone direito superior + --icone direito superior local _, _, icone = _GetSpellInfo(spellid) - info.spell_icone:SetTexture (icone) + info.spell_icone:SetTexture(icone) local total = self.total @@ -2248,7 +2248,7 @@ function atributo_heal:MontaDetalhesHealingDone (spellid, barra) if (esta_magia.total > 0) then - --> GERAL + --GERAL local media = esta_magia.total/total_hits local this_hps = nil @@ -2272,7 +2272,7 @@ function atributo_heal:MontaDetalhesHealingDone (spellid, barra) if (misc_actor) then local buff_uptime = misc_actor.buff_uptime_spells and misc_actor.buff_uptime_spells._ActorTable [spellid] and misc_actor.buff_uptime_spells._ActorTable [spellid].uptime if (buff_uptime) then - hits_string = hits_string .. " |cFFDDDD44(" .. _math_floor (buff_uptime / info.instancia.showing:GetCombatTime() * 100) .. "% uptime)|r" + hits_string = hits_string .. " |cFFDDDD44(" .. _math_floor(buff_uptime / info.instancia.showing:GetCombatTime() * 100) .. "% uptime)|r" end local spell_cast = misc_actor.spell_cast and misc_actor.spell_cast [spellid] @@ -2301,7 +2301,7 @@ function atributo_heal:MontaDetalhesHealingDone (spellid, barra) this_hps, Loc ["STRING_HITS"] .. ": " .. hits_string) - --> NORMAL + --NORMAL local normal_hits = esta_magia.n_amt if (normal_hits > 0) then local normal_curado = esta_magia.n_curado @@ -2333,7 +2333,7 @@ function atributo_heal:MontaDetalhesHealingDone (spellid, barra) end - --> CRITICO + --CRITICO if (esta_magia.c_amt > 0) then local media_critico = esta_magia.c_curado/esta_magia.c_amt local T = (meu_tempo*esta_magia.c_curado)/esta_magia.total @@ -2361,11 +2361,11 @@ function atributo_heal:MontaDetalhesHealingDone (spellid, barra) _table_sort (data, _detalhes.Sort1) --- for i = #data+1, 2 do --> para o antiheal aparecer na penultima barra +-- for i = #data+1, 2 do --para o antiheal aparecer na penultima barra -- data[i] = nil -- end - --> anti heal + --anti heal if (esta_magia.anti_heal and esta_magia.anti_heal > 0) then local porcentagem_anti_heal = esta_magia.anti_heal / meu_total * 100 data[3] = t3 @@ -2383,11 +2383,11 @@ function atributo_heal:MontaDetalhesHealingDone (spellid, barra) t3[8] = _detalhes:comma_value (esta_magia.anti_heal) .. " / " .. _cstr ("%.1f", porcentagem_anti_heal) .. "%" end --- for i = #data+1, 3 do --> para o overheal aparecer na ultima barra +-- for i = #data+1, 3 do --para o overheal aparecer na ultima barra -- data[i] = nil -- end - --> overhealing + --overhealing if (overheal > 0) then local porcentagem_overheal = overheal/meu_total*100 data[4] = t4 @@ -2435,9 +2435,9 @@ function atributo_heal:Iniciar (iniciar) end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> core functions +--core functions - --> atualize a funcao de abreviacao + --atualize a funcao de abreviacao function atributo_heal:UpdateSelectedToKFunction() SelectedToKFunction = ToKFunctions [_detalhes.ps_abbreviation] FormatTooltipNumber = ToKFunctions [_detalhes.tooltip.abbreviation] @@ -2445,7 +2445,7 @@ end headerColor = _detalhes.tooltip.header_text_color end - --> subtract total from a combat table + --subtract total from a combat table function atributo_heal:subtract_total (combat_table) combat_table.totals [class_type] = combat_table.totals [class_type] - self.total if (self.grupo) then @@ -2459,7 +2459,7 @@ end end end - --> restaura a tabela de last event + --restaura a tabela de last event function atributo_heal:r_last_events_table (actor) if (not actor) then actor = self @@ -2467,10 +2467,10 @@ end --actor.last_events_table = _detalhes:CreateActorLastEventTable() end - --> restaura e liga o ator com a sua shadow durante a inicializa��o + --restaura e liga o ator com a sua shadow durante a inicializa��o function atributo_heal:r_onlyrefresh_shadow (actor) - --> criar uma shadow desse ator se ainda n�o tiver uma + --criar uma shadow desse ator se ainda n�o tiver uma local overall_cura = _detalhes.tabela_overall [2] local shadow = overall_cura._ActorTable [overall_cura._NameIndexTable [actor.nome]] @@ -2490,10 +2490,10 @@ end shadow.end_time = time() end - --> restaura a meta e indexes ao ator + --restaura a meta e indexes ao ator _detalhes.refresh:r_atributo_heal (actor, shadow) - --> copia o container de alvos (captura de dados) + --copia o container de alvos (captura de dados) for target_name, amount in _pairs (actor.targets) do shadow.targets [target_name] = 0 end @@ -2504,11 +2504,11 @@ end shadow.targets_absorbs [target_name] = 0 end - --> copia o container de habilidades (captura de dados) + --copia o container de habilidades (captura de dados) for spellid, habilidade in _pairs (actor.spells._ActorTable) do - --> cria e soma o valor + --cria e soma o valor local habilidade_shadow = shadow.spells:PegaHabilidade (spellid, true, nil, true) - --> refresh e soma os valores dos alvos + --refresh e soma os valores dos alvos for target_name, amount in _pairs (habilidade.targets) do if (not habilidade_shadow.targets [target_name]) then @@ -2526,12 +2526,12 @@ end end end - --> copia o container de heal negado se ele existir + --copia o container de heal negado se ele existir if (habilidade.heal_denied) then - --> cria o container na shadow de ele n�o existir + --cria o container na shadow de ele n�o existir habilidade_shadow.heal_denied = habilidade_shadow.heal_denied or {} habilidade_shadow.heal_denied_healers = habilidade_shadow.heal_denied_healers or {} - --> copia + --copia for spellID, amount in _pairs (habilidade.heal_denied) do if (not habilidade_shadow.heal_denied [spellID]) then habilidade_shadow.heal_denied [spellID] = 0 @@ -2553,7 +2553,7 @@ end local host_combat = combat_object or _detalhes.tabela_overall - --> criar uma shadow desse ator se ainda n�o tiver uma + --criar uma shadow desse ator se ainda n�o tiver uma local overall_cura = host_combat [2] local shadow = overall_cura._ActorTable [overall_cura._NameIndexTable [actor.nome]] @@ -2573,12 +2573,12 @@ end shadow.end_time = time() end - --> restaura a meta e indexes ao ator + --restaura a meta e indexes ao ator if (not no_refresh) then _detalhes.refresh:r_atributo_heal (actor, shadow) end - --> tempo decorrido (captura de dados) + --tempo decorrido (captura de dados) local end_time = actor.end_time if (not actor.end_time) then end_time = time() @@ -2587,39 +2587,39 @@ 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 + --pets (add unique pet names) + for _, petName in _ipairs(actor.pets) do DetailsFramework.table.addunique (shadow.pets, petName) end - --> total de cura (captura de dados) + --total de cura (captura de dados) shadow.total = shadow.total + actor.total - --> total de overheal (captura de dados) + --total de overheal (captura de dados) shadow.totalover = shadow.totalover + actor.totalover - --> total de absorbs (captura de dados) + --total de absorbs (captura de dados) shadow.totalabsorb = shadow.totalabsorb + actor.totalabsorb - --> total de cura feita em inimigos (captura de dados) + --total de cura feita em inimigos (captura de dados) shadow.heal_enemy_amt = shadow.heal_enemy_amt + actor.heal_enemy_amt - --> total de heal negado + --total de heal negado shadow.totaldenied = shadow.totaldenied + actor.totaldenied - --> total sem pets (captura de dados) + --total sem pets (captura de dados) shadow.total_without_pet = shadow.total_without_pet + actor.total_without_pet shadow.totalover_without_pet = shadow.totalover_without_pet + actor.totalover_without_pet - --> total de cura recebida (captura de dados) + --total de cura recebida (captura de dados) shadow.healing_taken = shadow.healing_taken + actor.healing_taken - --> total no combate overall (captura de dados) + --total no combate overall (captura de dados) host_combat.totals[2] = host_combat.totals[2] + actor.total if (actor.grupo) then host_combat.totals_grupo[2] = host_combat.totals_grupo[2] + actor.total end - --> copia o healing_from (captura de dados) + --copia o healing_from (captura de dados) for nome, _ in _pairs (actor.healing_from) do shadow.healing_from [nome] = true end - --> copia o heal_enemy (captura de dados) + --copia o heal_enemy (captura de dados) for spellid, amount in _pairs (actor.heal_enemy) do if (shadow.heal_enemy [spellid]) then shadow.heal_enemy [spellid] = shadow.heal_enemy [spellid] + amount @@ -2628,7 +2628,7 @@ end end end - --> copia o container de alvos (captura de dados) + --copia o container de alvos (captura de dados) for target_name, amount in _pairs (actor.targets) do shadow.targets [target_name] = (shadow.targets [target_name] or 0) + amount end @@ -2639,12 +2639,12 @@ end shadow.targets_absorbs [target_name] = (shadow.targets_absorbs [target_name] or 0) + amount end - --> copia o container de habilidades (captura de dados) + --copia o container de habilidades (captura de dados) for spellid, habilidade in _pairs (actor.spells._ActorTable) do - --> cria e soma o valor + --cria e soma o valor local habilidade_shadow = shadow.spells:PegaHabilidade (spellid, true, nil, true) - --> refresh e soma os valores dos alvos + --refresh e soma os valores dos alvos for target_name, amount in _pairs (habilidade.targets) do habilidade_shadow.targets [target_name] = (habilidade_shadow.targets [target_name] or 0) + amount end @@ -2655,12 +2655,12 @@ end habilidade_shadow.targets_absorbs [target_name] = (habilidade_shadow.targets_absorbs [target_name] or 0) + amount end - --> copia o container de heal negado se ele existir + --copia o container de heal negado se ele existir if (habilidade.heal_denied) then - --> cria o container na shadow de ele n�o existir + --cria o container na shadow de ele n�o existir habilidade_shadow.heal_denied = habilidade_shadow.heal_denied or {} habilidade_shadow.heal_denied_healers = habilidade_shadow.heal_denied_healers or {} - --> copia + --copia for spellID, amount in _pairs (habilidade.heal_denied) do habilidade_shadow.heal_denied [spellID] = (habilidade_shadow.heal_denied [spellID] or 0) + amount end @@ -2669,9 +2669,9 @@ end end end - --> soma todos os demais valores + --soma todos os demais valores for key, value in _pairs (habilidade) do - if (_type (value) == "number") then + if (_type(value) == "number") then if (key ~= "id") then if (not habilidade_shadow [key]) then habilidade_shadow [key] = 0 @@ -2704,33 +2704,33 @@ end atributo_heal.__add = function(tabela1, tabela2) - --> tempo decorrido + --tempo decorrido local tempo = (tabela2.end_time or time()) - tabela2.start_time tabela1.start_time = tabela1.start_time - tempo - --> total de cura + --total de cura tabela1.total = tabela1.total + tabela2.total - --> total de overheal + --total de overheal tabela1.totalover = tabela1.totalover + tabela2.totalover - --> total de absorbs + --total de absorbs tabela1.totalabsorb = tabela1.totalabsorb + tabela2.totalabsorb - --> total de cura feita em inimigos + --total de cura feita em inimigos tabela1.heal_enemy_amt = tabela1.heal_enemy_amt + tabela2.heal_enemy_amt - --> total de cura negada + --total de cura negada tabela1.totaldenied = tabela1.totaldenied + tabela2.totaldenied - --> total sem pets + --total sem pets tabela1.total_without_pet = tabela1.total_without_pet + tabela2.total_without_pet tabela1.totalover_without_pet = tabela1.totalover_without_pet + tabela2.totalover_without_pet - --> total de cura recebida + --total de cura recebida tabela1.healing_taken = tabela1.healing_taken + tabela2.healing_taken - --> soma o healing_from + --soma o healing_from for nome, _ in _pairs (tabela2.healing_from) do tabela1.healing_from [nome] = true end - --> somar o heal_enemy + --somar o heal_enemy for spellid, amount in _pairs (tabela2.heal_enemy) do if (tabela1.heal_enemy [spellid]) then tabela1.heal_enemy [spellid] = tabela1.heal_enemy [spellid] + amount @@ -2739,7 +2739,7 @@ atributo_heal.__add = function(tabela1, tabela2) end end - --> somar o container de alvos + --somar o container de alvos for target_name, amount in _pairs (tabela2.targets) do tabela1.targets [target_name] = (tabela1.targets [target_name] or 0) + amount end @@ -2750,11 +2750,11 @@ atributo_heal.__add = function(tabela1, tabela2) tabela1.targets_absorbs [target_name] = (tabela1.targets_absorbs [target_name] or 0) + amount end - --> soma o container de habilidades + --soma o container de habilidades for spellid, habilidade in _pairs (tabela2.spells._ActorTable) do - --> pega a habilidade no primeiro ator + --pega a habilidade no primeiro ator local habilidade_tabela1 = tabela1.spells:PegaHabilidade (spellid, true, "SPELL_HEAL", false) - --> soma os alvos + --soma os alvos for target_name, amount in _pairs (habilidade.targets) do habilidade_tabela1.targets = (habilidade_tabela1.targets [target_name] or 0) + amount end @@ -2765,12 +2765,12 @@ atributo_heal.__add = function(tabela1, tabela2) habilidade_tabela1.targets_absorbs = (habilidade_tabela1.targets_absorbs [target_name] or 0) + amount end - --> copia o container de heal negado se ele existir + --copia o container de heal negado se ele existir if (habilidade.heal_denied) then - --> cria o container na shadow de ele n�o existir + --cria o container na shadow de ele n�o existir habilidade_tabela1.heal_denied = habilidade_tabela1.heal_denied or {} habilidade_tabela1.heal_denied_healers = habilidade_tabela1.heal_denied_healers or {} - --> copia + --copia for spellID, amount in _pairs (habilidade.heal_denied) do habilidade_tabela1.heal_denied [spellID] = (habilidade_tabela1.heal_denied [spellID] or 0) + amount end @@ -2779,9 +2779,9 @@ atributo_heal.__add = function(tabela1, tabela2) end end - --> soma os valores da habilidade + --soma os valores da habilidade for key, value in _pairs (habilidade) do - if (_type (value) == "number") then + if (_type(value) == "number") then if (key ~= "id") then if (not habilidade_tabela1 [key]) then habilidade_tabela1 [key] = 0 @@ -2807,28 +2807,28 @@ end atributo_heal.__sub = function(tabela1, tabela2) - --> tempo decorrido + --tempo decorrido local tempo = (tabela2.end_time or time()) - tabela2.start_time tabela1.start_time = tabela1.start_time + tempo - --> total de cura + --total de cura tabela1.total = tabela1.total - tabela2.total - --> total de overheal + --total de overheal tabela1.totalover = tabela1.totalover - tabela2.totalover - --> total de absorbs + --total de absorbs tabela1.totalabsorb = tabela1.totalabsorb - tabela2.totalabsorb - --> total de cura feita em inimigos + --total de cura feita em inimigos tabela1.heal_enemy_amt = tabela1.heal_enemy_amt - tabela2.heal_enemy_amt - --> total de cura negada + --total de cura negada tabela1.totaldenied = tabela1.totaldenied - tabela2.totaldenied - --> total sem pets + --total sem pets tabela1.total_without_pet = tabela1.total_without_pet - tabela2.total_without_pet tabela1.totalover_without_pet = tabela1.totalover_without_pet - tabela2.totalover_without_pet - --> total de cura recebida + --total de cura recebida tabela1.healing_taken = tabela1.healing_taken - tabela2.healing_taken - --> reduz o heal_enemy + --reduz o heal_enemy for spellid, amount in _pairs (tabela2.heal_enemy) do if (tabela1.heal_enemy [spellid]) then tabela1.heal_enemy [spellid] = tabela1.heal_enemy [spellid] - amount @@ -2837,7 +2837,7 @@ atributo_heal.__sub = function(tabela1, tabela2) end end - --> reduz o container de alvos + --reduz o container de alvos for target_name, amount in _pairs (tabela2.targets) do if (tabela1.targets [target_name]) then tabela1.targets [target_name] = tabela1.targets [target_name] - amount @@ -2854,11 +2854,11 @@ atributo_heal.__sub = function(tabela1, tabela2) end end - --> reduz o container de habilidades + --reduz o container de habilidades for spellid, habilidade in _pairs (tabela2.spells._ActorTable) do - --> pega a habilidade no primeiro ator + --pega a habilidade no primeiro ator local habilidade_tabela1 = tabela1.spells:PegaHabilidade (spellid, true, "SPELL_HEAL", false) - --> alvos + --alvos for target_name, amount in _pairs (habilidade.targets) do if (habilidade_tabela1.targets [target_name]) then habilidade_tabela1.targets [target_name] = habilidade_tabela1.targets [target_name] - amount @@ -2875,12 +2875,12 @@ atributo_heal.__sub = function(tabela1, tabela2) end end - --> copia o container de heal negado se ele existir + --copia o container de heal negado se ele existir if (habilidade.heal_denied) then - --> cria o container na shadow de ele n�o existir + --cria o container na shadow de ele n�o existir habilidade_tabela1.heal_denied = habilidade_tabela1.heal_denied or {} habilidade_tabela1.heal_denied_healers = habilidade_tabela1.heal_denied_healers or {} - --> copia + --copia for spellID, amount in _pairs (habilidade.heal_denied) do habilidade_tabela1.heal_denied [spellID] = (habilidade_tabela1.heal_denied [spellID] or 0) - amount end @@ -2889,9 +2889,9 @@ atributo_heal.__sub = function(tabela1, tabela2) end end - --> soma os valores da habilidade + --soma os valores da habilidade for key, value in _pairs (habilidade) do - if (_type (value) == "number") then + if (_type(value) == "number") then if (key ~= "id") then if (not habilidade_tabela1 [key]) then habilidade_tabela1 [key] = 0 diff --git a/classes/class_instance.lua b/classes/class_instance.lua index a5e02d9a..42859b05 100644 --- a/classes/class_instance.lua +++ b/classes/class_instance.lua @@ -2,23 +2,23 @@ local AceLocale = LibStub ("AceLocale-3.0") local Loc = AceLocale:GetLocale ( "Details" ) local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0") -local _type= type --> lua local -local _ipairs = ipairs --> lua local -local _pairs = pairs --> lua local -local _math_floor = math.floor --> lua local -local _math_abs = math.abs --> lua local -local _table_remove = table.remove --> lua local -local _getmetatable = getmetatable --> lua local -local _setmetatable = setmetatable --> lua local -local _string_len = string.len --> lua local -local _unpack = unpack --> lua local -local _cstr = string.format --> lua local -local _SendChatMessage = SendChatMessage --> wow api locals -local _GetChannelName = GetChannelName --> wow api locals -local _UnitExists = UnitExists --> wow api locals -local _UnitName = UnitName --> wow api locals -local _UnitIsPlayer = UnitIsPlayer --> wow api locals -local _UnitGroupRolesAssigned = DetailsFramework.UnitGroupRolesAssigned --> wow api locals +local _type= type --lua local +local _ipairs = ipairs --lua local +local _pairs = pairs --lua local +local _math_floor = math.floor --lua local +local _math_abs = math.abs --lua local +local _table_remove = table.remove --lua local +local _getmetatable = getmetatable --lua local +local _setmetatable = setmetatable --lua local +local _string_len = string.len --lua local +local _unpack = unpack --lua local +local _cstr = string.format --lua local +local _SendChatMessage = SendChatMessage --wow api locals +local _GetChannelName = GetChannelName --wow api locals +local _UnitExists = UnitExists --wow api locals +local _UnitName = UnitName --wow api locals +local _UnitIsPlayer = UnitIsPlayer --wow api locals +local _UnitGroupRolesAssigned = DetailsFramework.UnitGroupRolesAssigned --wow api locals local _detalhes = _G._detalhes local gump = _detalhes.gump @@ -36,7 +36,7 @@ local atributos = _detalhes.atributos local sub_atributos = _detalhes.sub_atributos local segmentos = _detalhes.segmentos ---> STARTUP reativa as instancias e regenera as tabelas das mesmas +--STARTUP reativa as instancias e regenera as tabelas das mesmas function _detalhes:RestartInstances() return _detalhes:ReativarInstancias() end @@ -45,7 +45,7 @@ local segmentos = _detalhes.segmentos _detalhes.opened_windows = 0 - --> set metatables + --set metatables for index = 1, #_detalhes.tabela_instancias do local instancia = _detalhes.tabela_instancias [index] if (not _getmetatable (instancia)) then @@ -53,7 +53,7 @@ local segmentos = _detalhes.segmentos end end - --> create frames + --create frames for index = 1, #_detalhes.tabela_instancias do local instancia = _detalhes.tabela_instancias [index] if (instancia:IsEnabled()) then @@ -64,7 +64,7 @@ local segmentos = _detalhes.segmentos end end - --> load + --load for index = 1, #_detalhes.tabela_instancias do local instancia = _detalhes.tabela_instancias [index] if (instancia:IsEnabled()) then @@ -74,12 +74,12 @@ local segmentos = _detalhes.segmentos end end - --> send open event + --send open event for index = 1, #_detalhes.tabela_instancias do local instancia = _detalhes.tabela_instancias [index] if (instancia:IsEnabled()) then if (not _detalhes.initializing) then - _detalhes:SendEvent ("DETAILS_INSTANCE_OPEN", nil, instancia) + _detalhes:SendEvent("DETAILS_INSTANCE_OPEN", nil, instancia) end end end @@ -87,48 +87,48 @@ local segmentos = _detalhes.segmentos ------------------------------------------------------------------------------------------------------------------------ ---> API: call a function to all enabled instances +--API: call a function to all enabled instances function _detalhes:InstanceCall (funcao, ...) - if (type (funcao) == "string") then + if (type(funcao) == "string") then funcao = _detalhes [funcao] end - for index, instance in _ipairs (_detalhes.tabela_instancias) do - if (instance:IsAtiva()) then --> only enabled + for index, instance in _ipairs(_detalhes.tabela_instancias) do + if (instance:IsAtiva()) then --only enabled funcao (instance, ...) end end end ---> chama a fun��o para ser executada em todas as inst�ncias (internal) +--chama a fun��o para ser executada em todas as inst�ncias (internal) function _detalhes:InstanciaCallFunction (funcao, ...) - for index, instancia in _ipairs (_detalhes.tabela_instancias) do - if (instancia:IsAtiva()) then --> s� reabre se ela estiver ativa + for index, instancia in _ipairs(_detalhes.tabela_instancias) do + if (instancia:IsAtiva()) then --s� reabre se ela estiver ativa funcao (_, instancia, ...) end end end ---> chama a fun��o para ser executada em todas as inst�ncias (internal) +--chama a fun��o para ser executada em todas as inst�ncias (internal) function _detalhes:InstanciaCallFunctionOffline (funcao, ...) - for index, instancia in _ipairs (_detalhes.tabela_instancias) do + for index, instancia in _ipairs(_detalhes.tabela_instancias) do funcao (_, instancia, ...) end end function Details:InstanceGroupCall(instance, funcName, ...) - for _, thisInstance in ipairs (instance:GetInstanceGroup()) do + for _, thisInstance in ipairs(instance:GetInstanceGroup()) do thisInstance[funcName](thisInstance, ...) end end function Details:InstanceGroupEditSetting(instance, keyName, value) - for _, thisInstance in ipairs (instance:GetInstanceGroup()) do + for _, thisInstance in ipairs(instance:GetInstanceGroup()) do thisInstance[keyName] = value end end function Details:InstanceGroupEditSettingOnTable(instance, table1Key, table2Key, table3Key, value) - for _, thisInstance in ipairs (instance:GetInstanceGroup()) do + for _, thisInstance in ipairs(instance:GetInstanceGroup()) do if (value == nil) then local value1 = table3Key local table1 = thisInstance[table1Key] @@ -142,7 +142,7 @@ end function _detalhes:GetLowerInstanceNumber() local lower = 999 - for index, instancia in _ipairs (_detalhes.tabela_instancias) do + for index, instancia in _ipairs(_detalhes.tabela_instancias) do if (instancia.ativa and instancia.baseframe) then if (instancia.meu_id < lower) then lower = instancia.meu_id @@ -177,7 +177,7 @@ end function _detalhes:GetInstance (id) return _detalhes.tabela_instancias [id] end ---> user friendly alias +--user friendly alias function _detalhes:GetWindow (id) return _detalhes.tabela_instancias [id] end @@ -237,7 +237,7 @@ end function _detalhes:GetCustomObject (object_name) if (object_name) then - for _, object in ipairs (_detalhes.custom) do + for _, object in ipairs(_detalhes.custom) do if (object.name == object_name) then return object end @@ -257,7 +257,7 @@ function _detalhes:ResetAttribute() end function _detalhes:ListInstances() - return _ipairs (_detalhes.tabela_instancias) + return _ipairs(_detalhes.tabela_instancias) end function _detalhes:GetPosition() @@ -273,7 +273,7 @@ function _detalhes:GetMaxInstancesAmount() end function _detalhes:SetMaxInstancesAmount (amount) - if (_type (amount) == "number") then + if (_type(amount) == "number") then _detalhes.instances_amount = amount end end @@ -362,12 +362,12 @@ end ------------------------------------------------------------------------------------------------------------------------ ---> retorna se a inst�ncia esta ou n�o ativa +--retorna se a inst�ncia esta ou n�o ativa function _detalhes:IsAtiva() return self.ativa end ---> english alias +--english alias function _detalhes:IsShown() return self.ativa end @@ -389,13 +389,13 @@ end self.posicao = Details.CopyTable (config.pos) end - if (_type (config.attribute) ~= "number") then + if (_type(config.attribute) ~= "number") then config.attribute = 1 end - if (_type (config.sub_attribute) ~= "number") then + if (_type(config.sub_attribute) ~= "number") then config.sub_attribute = 1 end - if (_type (config.segment) ~= "number") then + if (_type(config.segment) ~= "number") then config.segment = 1 end @@ -414,14 +414,14 @@ end end function _detalhes:ShutDownAllInstances() - for index, instance in _ipairs (_detalhes.tabela_instancias) do + for index, instance in _ipairs(_detalhes.tabela_instancias) do if (instance:IsEnabled() and instance.baseframe and not instance.ignore_mass_showhide) then instance:ShutDown(true) end end end - --> alias + --alias function _detalhes:HideWindow(all) return self:DesativarInstancia(all) end @@ -436,14 +436,14 @@ end end ---> desativando a inst�ncia ela fica em stand by e apenas hida a janela ~shutdown ~close ~fechar +--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 + --windown isn't initialized yet if (_detalhes.debug) then _detalhes:Msg ("(debug) called HideWindow() but the window isn't initialized yet.") end @@ -454,7 +454,7 @@ end _detalhes:GetLowerInstanceNumber() if (lower == self.meu_id) then - --> os icones dos plugins estao hostiados nessa instancia. + --os icones dos plugins estao hostiados nessa instancia. _detalhes.ToolBar:ReorganizeIcons (true) --n�o precisa recarregar toda a skin end @@ -464,10 +464,10 @@ 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) + 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) @@ -483,7 +483,7 @@ end end if (not _detalhes.initializing) then - _detalhes:SendEvent ("DETAILS_INSTANCE_CLOSE", nil, self) + _detalhes:SendEvent("DETAILS_INSTANCE_CLOSE", nil, self) end end @@ -493,10 +493,10 @@ end local _fadeType, _fadeSpeed = _unpack (_detalhes.row_fade_in) if (segmento) then if (instancia.segmento == segmento) then - return Details.FadeHandler.Fader (instancia, _fadeType, _fadeSpeed, "barras") + return Details.FadeHandler.Fader(instancia, _fadeType, _fadeSpeed, "barras") end else - return Details.FadeHandler.Fader (instancia, _fadeType, _fadeSpeed, "barras") + return Details.FadeHandler.Fader(instancia, _fadeType, _fadeSpeed, "barras") end end @@ -599,7 +599,7 @@ end function _detalhes:LockInstance (flag) - if (type (flag) == "boolean") then + if (type(flag) == "boolean") then self.isLocked = not flag end @@ -607,21 +607,21 @@ end self.isLocked = false if (self.baseframe) then self.baseframe.isLocked = false - self.baseframe.lock_button.label:SetText (Loc ["STRING_LOCK_WINDOW"]) - self.baseframe.lock_button:SetWidth (self.baseframe.lock_button.label:GetStringWidth()+2) + self.baseframe.lock_button.label:SetText(Loc ["STRING_LOCK_WINDOW"]) + self.baseframe.lock_button:SetWidth(self.baseframe.lock_button.label:GetStringWidth()+2) self.baseframe.resize_direita:SetAlpha (0) self.baseframe.resize_esquerda:SetAlpha (0) self.baseframe.lock_button:ClearAllPoints() - self.baseframe.lock_button:SetPoint ("right", self.baseframe.resize_direita, "left", -1, 1.5) + self.baseframe.lock_button:SetPoint("right", self.baseframe.resize_direita, "left", -1, 1.5) end else self.isLocked = true if (self.baseframe) then self.baseframe.isLocked = true - self.baseframe.lock_button.label:SetText (Loc ["STRING_UNLOCK_WINDOW"]) - self.baseframe.lock_button:SetWidth (self.baseframe.lock_button.label:GetStringWidth()+2) + self.baseframe.lock_button.label:SetText(Loc ["STRING_UNLOCK_WINDOW"]) + self.baseframe.lock_button:SetWidth(self.baseframe.lock_button.label:GetStringWidth()+2) self.baseframe.lock_button:ClearAllPoints() - self.baseframe.lock_button:SetPoint ("bottomright", self.baseframe, "bottomright", -3, 0) + self.baseframe.lock_button:SetPoint("bottomright", self.baseframe, "bottomright", -3, 0) self.baseframe.resize_direita:SetAlpha (0) self.baseframe.resize_esquerda:SetAlpha (0) end @@ -629,18 +629,18 @@ 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 - --> alias + --alias function _detalhes:ShowWindow (temp, all) return self:AtivarInstancia (temp, all) end @@ -657,8 +657,8 @@ end 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 + --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 @@ -673,15 +673,15 @@ end _detalhes:TrocaTabela (self, nil, nil, nil, true) if (self.hide_icon) then - Details.FadeHandler.Fader (self.baseframe.cabecalho.atributo_icon, 1) + Details.FadeHandler.Fader(self.baseframe.cabecalho.atributo_icon, 1) else - Details.FadeHandler.Fader (self.baseframe.cabecalho.atributo_icon, 0) + 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) + 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() @@ -713,7 +713,7 @@ end self:CheckFor_EnabledTrashSuppression() if (not temp and not _detalhes.initializing) then - _detalhes:SendEvent ("DETAILS_INSTANCE_OPEN", nil, self) + _detalhes:SendEvent("DETAILS_INSTANCE_OPEN", nil, self) end if (self.modo == modo_raid) then @@ -726,13 +726,13 @@ end end ------------------------------------------------------------------------------------------------------------------------ ---> apaga de vez um inst�ncia +--apaga de vez um inst�ncia function _detalhes:ApagarInstancia (ID) return _table_remove (_detalhes.tabela_instancias, ID) end ------------------------------------------------------------------------------------------------------------------------ ---> retorna quantas inst�ncia h� no momento +--retorna quantas inst�ncia h� no momento function _detalhes:GetNumInstancesAmount() return #_detalhes.tabela_instancias end @@ -749,7 +749,7 @@ end return false end - --> break snaps of previous and next window + --break snaps of previous and next window local left_instance = _detalhes:GetInstance (id-1) if (left_instance) then for snap_side, instance_id in _pairs (left_instance.snap) do @@ -767,7 +767,7 @@ end end end - --> re align snaps for higher instances + --re align snaps for higher instances for i = id+1, #_detalhes.tabela_instancias do local this_instance = _detalhes:GetInstance (i) --fix the snaps @@ -787,7 +787,7 @@ end ------------------------------------------------------------------------------------------------------------------------ ---> cria uma nova inst�ncia e a joga para o container de inst�ncias +--cria uma nova inst�ncia e a joga para o container de inst�ncias function _detalhes:CreateInstance (id) return _detalhes:CriarInstancia (_, id) @@ -795,7 +795,7 @@ end function _detalhes:CriarInstancia (_, id) - if (id and _type (id) == "boolean") then + if (id and _type(id) == "boolean") then if (#_detalhes.tabela_instancias >= _detalhes.instances_amount) then _detalhes:Msg (Loc ["STRING_INSTANCE_LIMIT"]) @@ -816,7 +816,7 @@ end if (_detalhes.standard_skin) then for key, value in pairs (_detalhes.standard_skin) do - if (type (value) == "table") then + if (type(value) == "table") then new_instance [key] = Details.CopyTable (value) else new_instance [key] = value @@ -825,7 +825,7 @@ end new_instance:ChangeSkin() else - --> se n�o tiver um padr�o, criar de outra inst�ncia j� aberta. + --se n�o tiver um padr�o, criar de outra inst�ncia j� aberta. local copy_from for i = 1, next_id-1 do local opened_instance = _detalhes:GetInstance (i) @@ -838,7 +838,7 @@ end if (copy_from) then for key, value in pairs (copy_from) do if (_detalhes.instance_defaults [key] ~= nil) then - if (type (value) == "table") then + if (type(value) == "table") then new_instance [key] = Details.CopyTable (value) else new_instance [key] = value @@ -860,8 +860,8 @@ end end end - --> antes de criar uma nova, ver se n�o h� alguma para reativar - for index, instancia in _ipairs (_detalhes.tabela_instancias) do + --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 instancia:AtivarInstancia() return instancia @@ -872,7 +872,7 @@ end return _detalhes:Msg (Loc ["STRING_INSTANCE_LIMIT"]) end - --> verifica se n�o tem uma janela na pool de janelas fechadas + --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 @@ -886,11 +886,11 @@ end return new_instance end - --> cria uma nova janela + --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) + _detalhes:SendEvent("DETAILS_INSTANCE_OPEN", nil, new_instance) end _detalhes:GetLowerInstanceNumber() @@ -899,12 +899,12 @@ end 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} +--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 + return true --ha possui uma janela grudapa neste lado elseif (lado == 1) then if (self.snap [3]) then return true @@ -923,21 +923,21 @@ function _detalhes:EstaAgrupada (esta_instancia, lado) --> lado //// 1 = encosto end end - return false --> do contr�rio retorna false + return false --do contr�rio retorna false end function _detalhes:BaseFrameSnap() local group = self:GetInstanceGroup() - for meu_id, instancia in _ipairs (group) do + for meu_id, instancia in _ipairs(group) do if (instancia:IsAtiva()) then instancia.baseframe:ClearAllPoints() end end local scale = self.window_scale - for _, instance in _ipairs (group) do + for _, instance in _ipairs(group) do instance:SetWindowScale (scale) end @@ -947,25 +947,25 @@ function _detalhes:BaseFrameSnap() if (instancia_alvo) then if (instancia_alvo.ativa and instancia_alvo.baseframe) then - if (lado == 1) then --> a esquerda - instancia_alvo.baseframe:SetPoint ("TOPRIGHT", my_baseframe, "TOPLEFT") + if (lado == 1) then --a esquerda + instancia_alvo.baseframe:SetPoint("TOPRIGHT", my_baseframe, "TOPLEFT") - elseif (lado == 2) then --> em baixo + 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) + 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 == 3) then --a direita + instancia_alvo.baseframe:SetPoint("BOTTOMLEFT", my_baseframe, "BOTTOMRIGHT") - elseif (lado == 4) then --> em cima + 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", my_baseframe, "TOPLEFT", 0, 34 + statusbar_y_mod) + instancia_alvo.baseframe:SetPoint("BOTTOMLEFT", my_baseframe, "TOPLEFT", 0, 34 + statusbar_y_mod) end end @@ -973,17 +973,17 @@ function _detalhes:BaseFrameSnap() end --[ - --> aqui precisa de um efeito reverso - 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: + --aqui precisa de um efeito reverso + 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 for meu_id = inicio_retro, 1, -1 do 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 + 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 + --ent�o tenho que pegar a inst�ncia do snap local instancia_alvo = _detalhes.tabela_instancias [snap_to] local lado_reverso @@ -997,32 +997,32 @@ function _detalhes:BaseFrameSnap() lado_reverso = 2 end - --> fazer os setpoints + --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") + if (lado_reverso == 1) then --a esquerda + instancia_alvo.baseframe:SetPoint("BOTTOMLEFT", instancia.baseframe, "BOTTOMRIGHT") - elseif (lado_reverso == 2) then --> em baixo + 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) + 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 == 3) then --a direita + instancia_alvo.baseframe:SetPoint("TOPRIGHT", instancia.baseframe, "TOPLEFT") - elseif (lado_reverso == 4) then --> em cima + 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) + instancia_alvo.baseframe:SetPoint("TOPLEFT", instancia.baseframe, "BOTTOMLEFT", 0, -34 + statusbar_y_mod) end end @@ -1032,34 +1032,34 @@ function _detalhes:BaseFrameSnap() end --]] - for meu_id, instancia in _ipairs (_detalhes.tabela_instancias) do + 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") + if (lado == 1) then --a esquerda + instancia_alvo.baseframe:SetPoint("TOPRIGHT", instancia.baseframe, "TOPLEFT") - elseif (lado == 2) then --> em baixo + 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) + 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 == 3) then --a direita + instancia_alvo.baseframe:SetPoint("BOTTOMLEFT", instancia.baseframe, "BOTTOMRIGHT") - elseif (lado == 4) then --> em cima + 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) + instancia_alvo.baseframe:SetPoint("BOTTOMLEFT", instancia.baseframe, "TOPLEFT", 0, 34 + statusbar_y_mod) end end @@ -1080,68 +1080,68 @@ function _detalhes:agrupar_janelas (lados) 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") + 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) + instancia:SetSize(nil, height) - --> salva o snap + --salva o snap self.snap [3] = esta_instancia.meu_id esta_instancia.snap [1] = self.meu_id - elseif (lado == 4) then --> cima - --> mover frame + 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) + 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) + instancia:SetSize(nil, height) - --> salva o snap + --salva o snap self.snap [4] = esta_instancia.meu_id esta_instancia.snap [2] = self.meu_id - elseif (lado == 1) then --> esquerda - --> mover frame + 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") + 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) + instancia:SetSize(nil, height) - --> salva o snap + --salva o snap self.snap [1] = esta_instancia.meu_id esta_instancia.snap [3] = self.meu_id - elseif (lado == 2) then --> baixo - --> mover frame + 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) + 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) + instancia:SetSize(nil, height) - --> salva o snap + --salva o snap self.snap [2] = esta_instancia.meu_id esta_instancia.snap [4] = self.meu_id @@ -1185,12 +1185,12 @@ function _detalhes:Desagrupar (instancia, lado, lado2) lado = lado2 end - if (self.meu_id and not lado2) then --> significa que self � uma instancia + if (self.meu_id and not lado2) then --significa que self � uma instancia lado = instancia instancia = self end - if (_type (instancia) == "number") then --> significa que passou o n�mero da inst�ncia + if (_type(instancia) == "number") then --significa que passou o n�mero da inst�ncia instancia = _detalhes.tabela_instancias [instancia] end @@ -1200,10 +1200,10 @@ function _detalhes:Desagrupar (instancia, lado, lado2) return end - if (lado < 0) then --> clicou no bot�o para desagrupar tudo + 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 @@ -1222,9 +1222,9 @@ function _detalhes:Desagrupar (instancia, lado, lado2) 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.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 @@ -1272,45 +1272,45 @@ function _detalhes:Desagrupar (instancia, lado, lado2) 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 - --esta_instancia.baseframe.rodape.esquerdo:SetTexture ("Interface\\AddOns\\Details\\images\\bar_down_left") + --esta_instancia.baseframe.rodape.esquerdo:SetTexture("Interface\\AddOns\\Details\\images\\bar_down_left") else - --esta_instancia.baseframe.rodape.esquerdo:SetTexture ("Interface\\AddOns\\Details\\images\\bar_down_left_snap") + --esta_instancia.baseframe.rodape.esquerdo:SetTexture("Interface\\AddOns\\Details\\images\\bar_down_left_snap") end end end end end ---> cria uma janela para uma nova inst�ncia - --> search key: ~new ~nova +--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 + --first check if we can recycle a old instance if (_detalhes.unused_instances [ID]) then local new_instance = _detalhes.unused_instances [ID] _detalhes.tabela_instancias [ID] = new_instance _detalhes.unused_instances [ID] = nil - --> replace the values on recycled instance + --replace the values on recycled instance new_instance:ResetInstanceConfig() - --> copy values from a previous skin saved + --copy values from a previous skin saved if (skin_table) then - --> copy from skin_table to new_instance + --copy from skin_table to new_instance _detalhes.table.copy (new_instance, skin_table) end return new_instance end - --> must create a new one + --must create a new one local new_instance = { - --> instance id + --instance id meu_id = ID, - --> internal stuff + --internal stuff barras = {}, --container que ir� armazenar todas as barras barraS = {nil, nil}, --de x at� x s�o as barras que est�o sendo mostradas na tela rolagem = false, --barra de rolagem n�o esta sendo mostrada @@ -1318,34 +1318,34 @@ end bar_mod = 0, bgdisplay_loc = 0, - --> displaying row info + --displaying row info rows_created = 0, rows_showing = 0, rows_max = 50, - --> saved pos for normal mode and lone wolf mode + --saved pos for normal mode and lone wolf mode posicao = { ["normal"] = {x = 1, y = 2, w = 300, h = 200}, ["solo"] = {x = 1, y = 2, w = 300, h = 200} }, - --> save information about window snaps + --save information about window snaps snap = {}, - --> current state starts as normal + --current state starts as normal mostrando = "normal", - --> menu consolidated + --menu consolidated consolidate = false, --deprecated icons = {true, true, true, true}, - --> status bar stuff + --status bar stuff StatusBar = {options = {}}, - --> more stuff - atributo = 1, --> dano - sub_atributo = 1, --> damage done + --more stuff + atributo = 1, --dano + sub_atributo = 1, --damage done sub_atributo_last = {1, 1, 1, 1, 1}, - segmento = 0, --> combate atual + segmento = 0, --combate atual modo = modo_grupo, last_modo = modo_grupo, LastModo = modo_grupo, @@ -1354,19 +1354,19 @@ end _setmetatable (new_instance, _detalhes) _detalhes.tabela_instancias [#_detalhes.tabela_instancias+1] = new_instance - --> fill the empty instance with default values + --fill the empty instance with default values new_instance:ResetInstanceConfig() - --> copy values from a previous skin saved + --copy values from a previous skin saved if (skin_table) then - --> copy from skin_table to new_instance + --copy from skin_table to new_instance _detalhes.table.copy (new_instance, skin_table) end - --> setup default wallpaper + --setup default wallpaper new_instance.wallpaper.texture = "Interface\\AddOns\\Details\\images\\background" - --> finish + --finish return new_instance end @@ -1376,15 +1376,15 @@ end _setmetatable (new_instance, _detalhes) _detalhes.tabela_instancias [#_detalhes.tabela_instancias+1] = new_instance - --> instance number + --instance number new_instance.meu_id = ID - --> setup all config + --setup all config new_instance:ResetInstanceConfig() - --> setup default wallpaper + --setup default wallpaper new_instance.wallpaper.texture = "Interface\\AddOns\\Details\\images\\background" - --> internal stuff + --internal stuff new_instance.barras = {} --container que ir� armazenar todas as barras new_instance.barraS = {nil, nil} --de x at� x s�o as barras que est�o sendo mostradas na tela new_instance.rolagem = false --barra de rolagem n�o esta sendo mostrada @@ -1393,27 +1393,27 @@ end new_instance.bgdisplay_loc = 0 new_instance.cached_bar_width = 0 - --> displaying row info + --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 + --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 + --save information about window snaps new_instance.snap = {} - --> current state starts as normal + --current state starts as normal new_instance.mostrando = "normal" - --> menu consolidated + --menu consolidated new_instance.consolidate = false new_instance.icons = {true, true, true, true} - --> create window frames + --create window frames local _baseframe, _bgframe, _bgframe_display, _scrollframe = gump:CriaJanelaPrincipal (ID, new_instance, true) new_instance.baseframe = _baseframe @@ -1421,7 +1421,7 @@ end new_instance.bgdisplay = _bgframe_display new_instance.scroll = _scrollframe - --> status bar stuff + --status bar stuff new_instance.StatusBar = {} new_instance.StatusBar.left = nil new_instance.StatusBar.center = nil @@ -1437,20 +1437,20 @@ end local dps = _detalhes.StatusBar:CreateStatusBarChildForInstance (new_instance, "DETAILS_STATUSBAR_PLUGIN_PDPS") _detalhes.StatusBar:SetRightPlugin (new_instance, dps) - --> internal stuff + --internal stuff new_instance.alturaAntiga = _baseframe:GetHeight() - new_instance.atributo = 1 --> dano - new_instance.sub_atributo = 1 --> damage done + 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.segmento = -1 --combate atual new_instance.modo = modo_grupo new_instance.last_modo = modo_grupo new_instance.LastModo = modo_grupo - --> change the attribute + --change the attribute _detalhes:TrocaTabela (new_instance, 0, 1, 1) - --> internal stuff + --internal stuff new_instance.row_height = new_instance.row_info.height + new_instance.row_info.space.between new_instance.oldwith = new_instance.baseframe:GetWidth() @@ -1458,9 +1458,9 @@ end 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) + new_instance.rows_fit_in_window = _math_floor(new_instance.posicao[new_instance.mostrando].h / new_instance.row_height) - --> all done + --all done new_instance:AtivarInstancia() new_instance:ShowSideBars() @@ -1468,7 +1468,7 @@ end new_instance.skin = "no skin" new_instance:ChangeSkin (_detalhes.default_skin_to_use) - --> apply standard skin if have one saved + --apply standard skin if have one saved --[[ if (_detalhes.standard_skin) then @@ -1479,10 +1479,10 @@ end instance.skin = "" instance:ChangeSkin (skin) - --> overwrite all instance parameters with saved ones + --overwrite all instance parameters with saved ones for key, value in pairs (style) do if (key ~= "skin") then - if (type (value) == "table") then + if (type(value) == "table") then instance [key] = Details.CopyTable (value) else instance [key] = value @@ -1493,7 +1493,7 @@ end end --]] - --> apply all changed attributes + --apply all changed attributes --new_instance:ChangeSkin() return new_instance @@ -1507,8 +1507,8 @@ end ---> ao reiniciar o addon esta fun��o � rodada para recriar a janela da inst�ncia ---> search key: ~restaura ~inicio ~start +--ao reiniciar o addon esta fun��o � rodada para recriar a janela da inst�ncia +--search key: ~restaura ~inicio ~start function Details:RestoreWindow(index, temp, loadOnly) self:RestauraJanela (index, temp, loadOnly) @@ -1516,10 +1516,10 @@ end function _detalhes:RestauraJanela(index, temp, load_only) - --> load + --load self:LoadInstanceConfig() - --> reset internal stuff + --reset internal stuff self.sub_atributo_last = self.sub_atributo_last or {1, 1, 1, 1, 1} self.rolagem = false self.need_rolagem = false @@ -1537,9 +1537,9 @@ function _detalhes:RestauraJanela(index, temp, load_only) self.last_modo = self.last_modo or modo_grupo 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) + self.rows_fit_in_window = _math_floor(self.posicao[self.mostrando].h / self.row_height) - --> create frames + --create frames local isLocked = self.isLocked local _baseframe, _bgframe, _bgframe_display, _scrollframe = gump:CriaJanelaPrincipal (self.meu_id, self) self.baseframe = _baseframe @@ -1551,24 +1551,24 @@ function _detalhes:RestauraJanela(index, temp, load_only) --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 + --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 + --set wallpaper if (self.wallpaper.enabled) then self:InstanceWallpaper (true) end - --> set the color of this instance window + --set the color of this instance window self:InstanceColor (self.color) - --> scrollbar + --scrollbar self:EsconderScrollBar (true) - --> check snaps + --check snaps self.snap = self.snap or {} - --> status bar stuff + --status bar stuff self.StatusBar = {} self.StatusBar.left = nil self.StatusBar.center = nil @@ -1597,10 +1597,10 @@ function _detalhes:RestauraJanela(index, temp, load_only) _detalhes.StatusBar:SetRightPlugin (self, durability, true) - --> load mode + --load mode if (self.modo == modo_alone) then - if (_detalhes.solo and _detalhes.solo ~= self.meu_id) then --> prote��o para ter apenas uma inst�ncia com a janela SOLO + if (_detalhes.solo and _detalhes.solo ~= self.meu_id) then --prote��o para ter apenas uma inst�ncia com a janela SOLO self.modo = modo_grupo self.mostrando = "normal" else @@ -1624,7 +1624,7 @@ function _detalhes:RestauraJanela(index, temp, load_only) end end - --> internal stuff + --internal stuff self.oldwith = self.baseframe:GetWidth() self:RestoreMainWindowPosition() @@ -1637,7 +1637,7 @@ function _detalhes:RestauraJanela(index, temp, load_only) self:ChangeSkin() end - --> all done + --all done return 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 @@ -1743,7 +1743,7 @@ function _detalhes:CheckSwitchOnCombatEnd (nowipe, warning) 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 @@ -1815,7 +1815,7 @@ function _detalhes:ExportSkin() --export the keys for key, value in pairs (self) do if (_detalhes.instance_defaults [key] ~= nil) then - if (type (value) == "table") then + if (type(value) == "table") then exported [key] = Details.CopyTable (value) else exported [key] = value @@ -1874,15 +1874,15 @@ function _detalhes:ApplySavedSkin (style) return _detalhes:Msg (Loc ["STRING_OPTIONS_PRESETTOOLD"]) end - --> set skin preset + --set skin preset local skin = style.skin self.skin = "" self:ChangeSkin (skin) - --> overwrite all instance parameters with saved ones + --overwrite all instance parameters with saved ones for key, value in pairs (style) do if (key ~= "skin") then - if (type (value) == "table") then + if (type(value) == "table") then self [key] = Details.CopyTable (value) else self [key] = value @@ -1890,12 +1890,12 @@ function _detalhes:ApplySavedSkin (style) end end - --> check for new keys inside tables + --check for new keys inside tables for key, value in pairs (_detalhes.instance_defaults) do - if (type (value) == "table") then + if (type(value) == "table") then for key2, value2 in pairs (value) do if (self [key] [key2] == nil) then - if (type (value2) == "table") then + if (type(value2) == "table") then self [key] [key2] = Details.CopyTable (_detalhes.instance_defaults [key] [key2]) else self [key] [key2] = value2 @@ -1909,7 +1909,7 @@ function _detalhes:ApplySavedSkin (style) self.StatusBar.options = self.StatusBarSaved.options _detalhes.StatusBar:UpdateChilds (self) - --> apply all changed attributes + --apply all changed attributes self:ChangeSkin() --export size and positioning @@ -1949,14 +1949,14 @@ end function _detalhes:SetBackgroundColor(...) local red = select (1, ...) if (not red) then - self.bgdisplay:SetBackdropColor (self.bg_r, self.bg_g, self.bg_b, self.bg_alpha) - self.baseframe:SetBackdropColor (self.bg_r, self.bg_g, self.bg_b, self.bg_alpha) + self.bgdisplay:SetBackdropColor(self.bg_r, self.bg_g, self.bg_b, self.bg_alpha) + self.baseframe:SetBackdropColor(self.bg_r, self.bg_g, self.bg_b, self.bg_alpha) return end - local r, g, b = gump:ParseColors (...) - self.bgdisplay:SetBackdropColor (r, g, b, self.bg_alpha or _detalhes.default_bg_alpha) - self.baseframe:SetBackdropColor (r, g, b, self.bg_alpha or _detalhes.default_bg_alpha) + local r, g, b = gump:ParseColors(...) + self.bgdisplay:SetBackdropColor(r, g, b, self.bg_alpha or _detalhes.default_bg_alpha) + self.baseframe:SetBackdropColor(r, g, b, self.bg_alpha or _detalhes.default_bg_alpha) self.bg_r = r self.bg_g = g self.bg_b = b @@ -1967,8 +1967,8 @@ function _detalhes:SetBackgroundAlpha (alpha) 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.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 end @@ -1993,18 +1993,18 @@ function _detalhes:GetPositionOnScreen() return xOfs/_UIscale, yOfs/_UIscale end ---> alias -function _detalhes:SetSize (w, h) +--alias +function _detalhes:SetSize(w, h) return self:Resize (w, h) end function _detalhes:Resize (w, h) if (w) then - self.baseframe:SetWidth (w) + self.baseframe:SetWidth(w) end if (h) then - self.baseframe:SetHeight (h) + self.baseframe:SetHeight(h) end self:SaveMainWindowPosition() @@ -2016,12 +2016,12 @@ end function _detalhes:ToggleMaxSize() if (self.is_in_max_size) then self.is_in_max_size = false - self:SetSize (self.original_width, self.original_height) + self:SetSize(self.original_width, self.original_height) else local original_width, original_height = self:GetSize() self.original_width, self.original_height = original_width, original_height self.is_in_max_size = true - self:SetSize (original_width, 450) + self:SetSize(original_width, 450) end end @@ -2040,7 +2040,7 @@ function Details:PostponeSwitchToCurrent(instance) ) then instance._postponing_switch = nil if (instance.segmento > 0 and instance.auto_current) then - instance:TrocaTabela(0) --> muda o segmento pra current + instance:TrocaTabela(0) --muda o segmento pra current instance:InstanceAlert(Loc ["STRING_CHANGED_TO_CURRENT"], {[[Interface\AddOns\Details\images\toolbar_icons]], 18, 18, false, 32/256, 64/256, 0, 1}, 6) return else @@ -2055,18 +2055,18 @@ function Details:PostponeSwitchToCurrent(instance) end function Details:CheckSwitchToCurrent() - for _, instance in _ipairs (Details.tabela_instancias) do + for _, instance in _ipairs(Details.tabela_instancias) do if (instance.ativa and instance.auto_current and instance.baseframe and instance.segmento > 0) then if (instance.is_interacting and instance.last_interaction < Details._tempo) then instance.last_interaction = Details._tempo end if ((instance.last_interaction and (instance.last_interaction+3 > Details._tempo)) or (DetailsReportWindow and DetailsReportWindow:IsShown()) or (Details.playerDetailWindow:IsShown())) then - --> postpone + --postpone --instance._postponing_switch = Details:ScheduleTimer ("PostponeSwitchToCurrent", 1, instance) instance._postponing_switch = Details.Schedules.NewTimer(1, Details.PostponeSwitchToCurrent, instance) else - instance:TrocaTabela(0) --> muda o segmento pra current + instance:TrocaTabela(0) --muda o segmento pra current instance:InstanceAlert (Loc ["STRING_CHANGED_TO_CURRENT"], {[[Interface\AddOns\Details\images\toolbar_icons]], 18, 18, false, 32/256, 64/256, 0, 1}, 6) instance._postponing_switch = nil end @@ -2082,7 +2082,7 @@ function Details:Freeze (instancia) if (not _detalhes.initializing) then instancia:ResetaGump() - Details.FadeHandler.Fader (instancia, "in", nil, "barras") + Details.FadeHandler.Fader(instancia, "in", nil, "barras") end instancia:InstanceMsg (Loc ["STRING_FREEZE"], [[Interface\CHARACTERFRAME\Disconnect-Icon]], "silver") @@ -2091,7 +2091,7 @@ function Details:Freeze (instancia) --instancia.freeze_texto:Show() local width = instancia:GetSize() - instancia.freeze_texto:SetWidth (width-64) + instancia.freeze_texto:SetWidth(width-64) instancia.freezed = true end @@ -2117,15 +2117,15 @@ end function _detalhes:AtualizaSegmentos (instancia) if (instancia.iniciada) then if (instancia.segmento == -1) then - --instancia.baseframe.rodape.segmento:SetText (segmentos.overall) --> localiza-me + --instancia.baseframe.rodape.segmento:SetText(segmentos.overall) --localiza-me instancia.showing = _detalhes.tabela_overall elseif (instancia.segmento == 0) then - --instancia.baseframe.rodape.segmento:SetText (segmentos.current) --> localiza-me + --instancia.baseframe.rodape.segmento:SetText(segmentos.current) --localiza-me instancia.showing = _detalhes.tabela_vigente --print ("==> Changing the Segment now! - classe_instancia.lua 1922") else instancia.showing = _detalhes.tabela_historico.tabelas [instancia.segmento] - --instancia.baseframe.rodape.segmento:SetText (segmentos.past..instancia.segmento) --> localiza-me + --instancia.baseframe.rodape.segmento:SetText(segmentos.past..instancia.segmento) --localiza-me end end end @@ -2133,32 +2133,32 @@ end function _detalhes:AtualizaSegmentos_AfterCombat (instancia, historico) if (instancia.freezed) then - return --> se esta congelada n�o tem o que fazer + return --se esta congelada n�o tem o que fazer end local segmento = instancia.segmento local _fadeType, _fadeSpeed = _unpack (_detalhes.row_fade_in) - if (segmento == _detalhes.segments_amount) then --> significa que o index [5] passou a ser [6] com a entrada da nova tabela - instancia.showing = historico.tabelas [_detalhes.segments_amount] --> ent�o ele volta a pegar o index [5] que antes era o index [4] + if (segmento == _detalhes.segments_amount) then --significa que o index [5] passou a ser [6] com a entrada da nova tabela + instancia.showing = historico.tabelas [_detalhes.segments_amount] --ent�o ele volta a pegar o index [5] que antes era o index [4] --print ("==> Changing the Segment now! - classe_instancia.lua 1942") - Details.FadeHandler.Fader (instancia, _fadeType, _fadeSpeed, "barras") + Details.FadeHandler.Fader(instancia, _fadeType, _fadeSpeed, "barras") instancia.showing[instancia.atributo].need_refresh = true instancia.v_barras = true instancia:ResetaGump() - instancia:RefreshMainWindow (true) + 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 + Details.FadeHandler.Fader(instancia, _fadeType, _fadeSpeed, "barras") --"in", nil instancia.showing[instancia.atributo].need_refresh = true instancia.v_barras = true instancia:ResetaGump() - instancia:RefreshMainWindow (true) + instancia:RefreshMainWindow(true) _detalhes:AtualizarJanela (instancia) end @@ -2200,7 +2200,7 @@ end function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, iniciando_instancia, InstanceMode) - if (self and self.meu_id and not instancia) then --> self � uma inst�ncia + if (self and self.meu_id and not instancia) then --self � uma inst�ncia InstanceMode = iniciando_instancia iniciando_instancia = sub_atributo sub_atributo = atributo @@ -2213,7 +2213,7 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini iniciando_instancia = nil end - if (_type (instancia) == "number") then + if (_type(instancia) == "number") then sub_atributo = atributo atributo = segmento segmento = instancia @@ -2227,11 +2227,11 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini local update_coolTip = false local sub_attribute_click = false - if (_type (segmento) == "boolean" and segmento) then --> clicou em um sub atributo + if (_type(segmento) == "boolean" and segmento) then --clicou em um sub atributo sub_attribute_click = true segmento = instancia.segmento - elseif (segmento == -2) then --> clicou para mudar de segmento + elseif (segmento == -2) then --clicou para mudar de segmento segmento = instancia.segmento + 1 if (segmento > _detalhes.segments_amount) then @@ -2239,7 +2239,7 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini end update_coolTip = true - elseif (segmento == -3) then --> clicou para mudar de atributo + elseif (segmento == -3) then --clicou para mudar de atributo segmento = instancia.segmento atributo = instancia.atributo+1 @@ -2248,7 +2248,7 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini end update_coolTip = true - elseif (segmento == -4) then --> clicou para mudar de sub atributo + elseif (segmento == -4) then --clicou para mudar de sub atributo segmento = instancia.segmento sub_atributo = instancia.sub_atributo+1 @@ -2258,24 +2258,24 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini update_coolTip = true end - --> pega os atributos desta instancia + --pega os atributos desta instancia 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 + --verifica se os valores passados s�o v�lidos if (not segmento) then segmento = instancia.segmento - elseif (_type (segmento) ~= "number") then + elseif (_type(segmento) ~= "number") then segmento = instancia.segmento end if (not atributo) then atributo = instancia.atributo - elseif (_type (atributo) ~= "number") then + elseif (_type(atributo) ~= "number") then atributo = instancia.atributo end @@ -2285,11 +2285,11 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini else sub_atributo = instancia.sub_atributo_last [atributo] end - elseif (_type (sub_atributo) ~= "number") then + elseif (_type(sub_atributo) ~= "number") then sub_atributo = instancia.sub_atributo end - --> j� esta mostrando isso que esta pedindo + --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 end @@ -2300,10 +2300,10 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini _detalhes:Msg ("invalid attribute, switching to damage done.") end - --> Muda o segmento caso necess�rio + --Muda o segmento caso necess�rio if (segmento ~= current_segmento or _detalhes.initializing or iniciando_instancia) then - --> na troca de segmento, conferir se a instancia esta frozen + --na troca de segmento, conferir se a instancia esta frozen if (instancia.freezed) then if (not iniciando_instancia) then instancia:UnFreeze() @@ -2314,12 +2314,12 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini instancia.segmento = segmento - if (segmento == -1) then --> overall + if (segmento == -1) then --overall instancia.showing = _detalhes.tabela_overall - elseif (segmento == 0) then --> combate atual + elseif (segmento == 0) then --combate atual instancia.showing = _detalhes.tabela_vigente --print ("==> Changing the Segment now! - classe_instancia.lua 2115") - else --> alguma tabela do hist�rico + else --alguma tabela do hist�rico instancia.showing = _detalhes.tabela_historico.tabelas [segmento] end @@ -2331,14 +2331,14 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini --print ("DEBUG: contra", instancia.showing.contra) end - _detalhes:SendEvent ("DETAILS_INSTANCE_CHANGESEGMENT", nil, instancia, segmento) + _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 + 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 if (instance:GetSegment() >= 0 and instancia:GetSegment() ~= -1) then if (instance.modo == 2 or instance.modo == 3) then - --> na troca de segmento, conferir se a instancia esta frozen + --na troca de segmento, conferir se a instancia esta frozen if (instance.freezed) then if (not iniciando_instancia) then instance:UnFreeze() @@ -2349,11 +2349,11 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini instance.segmento = segmento - if (segmento == -1) then --> overall + if (segmento == -1) then --overall instance.showing = _detalhes.tabela_overall - elseif (segmento == 0) then --> combate atual + elseif (segmento == 0) then --combate atual instance.showing = _detalhes.tabela_vigente; --print ("==> Changing the Segment now! - classe_instancia.lua 2148") - else --> alguma tabela do hist�rico + else --alguma tabela do hist�rico instance.showing = _detalhes.tabela_historico.tabelas [segmento] end @@ -2369,10 +2369,10 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini if (not _detalhes.initializing and not iniciando_instancia) then instance:ResetaGump() - instance:RefreshMainWindow (true) + instance:RefreshMainWindow(true) end - _detalhes:SendEvent ("DETAILS_INSTANCE_CHANGESEGMENT", nil, instance, segmento) + _detalhes:SendEvent("DETAILS_INSTANCE_CHANGESEGMENT", nil, instance, segmento) end end end @@ -2381,7 +2381,7 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini end - --> Muda o atributo caso necess�rio + --Muda o atributo caso necess�rio if (atributo == 5) then if (#_detalhes.custom < 1) then atributo = 1 @@ -2401,7 +2401,7 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini end return _detalhes.SoloTables.switch (nil, nil, -1) - elseif ( (instancia.modo == modo_raid) and not (_detalhes.initializing or iniciando_instancia) ) then --> raid + elseif ( (instancia.modo == modo_raid) and not (_detalhes.initializing or iniciando_instancia) ) then --raid return --nao faz nada quando clicar no bot�o end @@ -2409,7 +2409,7 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini instancia.atributo = atributo instancia.sub_atributo = instancia.sub_atributo_last [atributo] - --> troca icone + --troca icone instancia:ChangeIcon() if (update_coolTip) then @@ -2455,7 +2455,7 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini end _detalhes:InstanceCall (_detalhes.CheckPsUpdate) - _detalhes:SendEvent ("DETAILS_INSTANCE_CHANGEATTRIBUTE", nil, instancia, atributo, sub_atributo) + _detalhes:SendEvent("DETAILS_INSTANCE_CHANGEATTRIBUTE", nil, instancia, atributo, sub_atributo) end @@ -2466,7 +2466,7 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini instancia.sub_atributo_last[instancia.atributo] = instancia.sub_atributo end - if (instancia.atributo == 5) then --> custom + if (instancia.atributo == 5) then --custom instancia:ChangeIcon() end @@ -2496,7 +2496,7 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini end return else - --> verificar relogio, precisaria dar refresh no plugin clock + --verificar relogio, precisaria dar refresh no plugin clock end instancia.v_barras = true @@ -2554,7 +2554,7 @@ function _detalhes:MontaRaidOption (instancia) end local amount = 0 - for index, ptable in _ipairs (available_plugins) do + for index, ptable in _ipairs(available_plugins) do if (ptable [3].__enabled) then GameCooltip:AddMenu (1, _detalhes.RaidTables.switch, ptable [4], instancia, nil, ptable [1], ptable [2], true) --PluginName, PluginIcon, PluginObject, PluginAbsoluteName amount = amount + 1 @@ -2565,14 +2565,14 @@ function _detalhes:MontaRaidOption (instancia) return false end - GameCooltip:SetOption ("NoLastSelectedBar", true) + 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 @@ -2602,12 +2602,12 @@ function _detalhes:MontaAtributosOption (instancia, func) func = func or instancia.TrocaTabela local checked1 = instancia.atributo - local atributo_ativo = instancia.atributo --> pega o numero + local atributo_ativo = instancia.atributo --pega o numero local options - if (atributo_ativo == 5) then --> custom + 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 @@ -2615,10 +2615,10 @@ function _detalhes:MontaAtributosOption (instancia, func) end local CoolTip = _G.GameCooltip - local p = 0.125 --> 32/256 + local p = 0.125 --32/256 local gindex = 1 - for i = 1, atributos[0] do --> [0] armazena quantos atributos existem + 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) @@ -2634,7 +2634,7 @@ function _detalhes:MontaAtributosOption (instancia, func) CoolTip:SetWallpaper (2, [[Interface\TALENTFRAME\WarlockCurses-TopLeft]], {.2, 1, 0, 1}, wallpaper_bg_color) end else - --> wallpaper = main window + --wallpaper = main window --CoolTip:SetWallpaper (2, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true) end @@ -2660,7 +2660,7 @@ function _detalhes:MontaAtributosOption (instancia, func) CoolTip:SetLastSelected (2, i, instancia.sub_atributo_last [i]) end - --> custom + --custom --GameCooltip:AddLine ("$div") CoolTip:AddLine ("$div", nil, 1, -3, 1) @@ -2673,7 +2673,7 @@ function _detalhes:MontaAtributosOption (instancia, func) 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 @@ -2684,7 +2684,7 @@ function _detalhes:MontaAtributosOption (instancia, func) CoolTip:AddIcon (custom.icon, 2, 1, 20, 20) end - --> set the wallpaper on custom + --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) else @@ -2701,17 +2701,17 @@ function _detalhes:MontaAtributosOption (instancia, func) end end - CoolTip:SetOption ("StatusBarTexture", [[Interface\AddOns\Details\images\bar4_vidro]]) - CoolTip:SetOption ("ButtonsYMod", -7) - CoolTip:SetOption ("HeighMod", 7) + 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("ButtonsYModSub", -7) + CoolTip:SetOption("HeighModSub", 7) - CoolTip:SetOption ("SelectedTopAnchorMod", -2) - CoolTip:SetOption ("SelectedBottomAnchorMod", 2) + CoolTip:SetOption("SelectedTopAnchorMod", -2) + CoolTip:SetOption("SelectedBottomAnchorMod", 2) - CoolTip:SetOption ("TextFont", _detalhes.font_faces.menus) + CoolTip:SetOption("TextFont", _detalhes.font_faces.menus) _detalhes:SetTooltipMinWidth() @@ -2746,48 +2746,48 @@ function _detalhes:ChangeIcon(icon) if (not self.hide_icon) then if (skin.icon_on_top) then - self.baseframe.cabecalho.atributo_icon:SetParent (self.floatingframe) + self.baseframe.cabecalho.atributo_icon:SetParent(self.floatingframe) else - self.baseframe.cabecalho.atributo_icon:SetParent (self.baseframe) + self.baseframe.cabecalho.atributo_icon:SetParent(self.baseframe) end end if (icon) then - --> plugin chamou uma troca de icone - self.baseframe.cabecalho.atributo_icon:SetTexture (icon) + --plugin chamou uma troca de icone + 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]) + 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]) + self.baseframe.cabecalho.atributo_icon:SetPoint("TOPRIGHT", self.baseframe.cabecalho.ball_point, "TOPRIGHT", icon_anchor[1], icon_anchor[2]) - elseif (self.modo == modo_alone) then --> solo + elseif (self.modo == modo_alone) then --solo --icon is set by the plugin - elseif (self.modo == modo_grupo or self.modo == modo_all) then --> grupo + elseif (self.modo == modo_grupo or self.modo == modo_all) then --grupo if (self.atributo == 5) then - --> custom + --custom if (_detalhes.custom [self.sub_atributo]) then local icon = _detalhes.custom [self.sub_atributo].icon - self.baseframe.cabecalho.atributo_icon:SetTexture (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]) + 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]) + self.baseframe.cabecalho.atributo_icon:SetPoint("TOPRIGHT", self.baseframe.cabecalho.ball_point, "TOPRIGHT", icon_anchor[1], icon_anchor[2]) end else --set the attribute icon - self.baseframe.cabecalho.atributo_icon:SetTexture (menu_icones [self.atributo]) + self.baseframe.cabecalho.atributo_icon:SetTexture(menu_icones [self.atributo]) if (self.icon_desaturated) then self.baseframe.cabecalho.atributo_icon:SetDesaturated(true) @@ -2795,28 +2795,28 @@ function _detalhes:ChangeIcon(icon) self.baseframe.cabecalho.atributo_icon:SetDesaturated(false) end - local p = 0.125 --> 32/256 + 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: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) + 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]) + 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)) + self.baseframe.cabecalho.atributo_icon:SetSize(unpack (skin.attribute_icon_size)) end end - elseif (self.modo == modo_raid) then --> raid + elseif (self.modo == modo_raid) then --raid --icon is set by the plugin end end @@ -2827,7 +2827,7 @@ end function _detalhes:AlteraModo (instancia, qual, from_mode_menu) - if (_type (instancia) == "number") then + if (_type(instancia) == "number") then qual = instancia instancia = self end @@ -2868,14 +2868,14 @@ function _detalhes:AlteraModo (instancia, qual, from_mode_menu) _detalhes.RaidTables:DisableRaidMode (instancia) end - --> verifica se ja tem alguma instancia desativada em solo e remove o solo dela + --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) + _detalhes:SendEvent("DETAILS_INSTANCE_CHANGEMODE", nil, instancia, modo_alone) elseif (qual == modo_raid) then @@ -2892,7 +2892,7 @@ function _detalhes:AlteraModo (instancia, qual, from_mode_menu) _detalhes.RaidTables:EnableRaidMode (instancia) - _detalhes:SendEvent ("DETAILS_INSTANCE_CHANGEMODE", nil, instancia, modo_raid) + _detalhes:SendEvent("DETAILS_INSTANCE_CHANGEMODE", nil, instancia, modo_raid) elseif (qual == modo_grupo) then @@ -2906,15 +2906,15 @@ function _detalhes:AlteraModo (instancia, qual, from_mode_menu) end _detalhes:ResetaGump (instancia) - --Details.FadeHandler.Fader (instancia, 1, nil, "barras") + --Details.FadeHandler.Fader(instancia, 1, nil, "barras") instancia.modo = modo_grupo instancia:ChangeIcon() - instancia:RefreshMainWindow (true) + 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) + _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 @@ -2931,10 +2931,10 @@ function _detalhes:AlteraModo (instancia, qual, from_mode_menu) instancia.modo = modo_all instancia:ChangeIcon() - instancia:RefreshMainWindow (true) + instancia:RefreshMainWindow(true) instancia.last_modo = modo_all - _detalhes:SendEvent ("DETAILS_INSTANCE_CHANGEMODE", nil, instancia, modo_all) - _detalhes:SendEvent ("DETAILS_INSTANCE_CHANGEATTRIBUTE", nil, instancia, instancia.atributo, instancia.sub_atributo) + _detalhes:SendEvent("DETAILS_INSTANCE_CHANGEMODE", nil, instancia, modo_all) + _detalhes:SendEvent("DETAILS_INSTANCE_CHANGEATTRIBUTE", nil, instancia, instancia.atributo, instancia.sub_atributo) end local checked @@ -2953,8 +2953,8 @@ function _detalhes:AlteraModo (instancia, qual, from_mode_menu) 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) + --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) @@ -2985,7 +2985,7 @@ local function GetDpsHps (_thisActor, key) _thisActor [keyname] = dps --salva o dps dele return dps else - if (_thisActor [keyname] == 0) then --> n�o calculou o dps dele ainda mas entrou em standby + if (_thisActor [keyname] == 0) then --n�o calculou o dps dele ainda mas entrou em standby local dps = _thisActor.total/_thisActor:Tempo() _thisActor [keyname] = dps return dps @@ -3022,12 +3022,12 @@ function _detalhes:FormatReportLines (report_table, data, f1, f2, f3) end local fonte, _, flags = _detalhes.fontstring_len:GetFont() _detalhes.fontstring_len:SetFont (fonte, fontSize, flags) - _detalhes.fontstring_len:SetText ("DEFAULT NAME") + _detalhes.fontstring_len:SetText("DEFAULT NAME") local biggest_len = _detalhes.fontstring_len:GetStringWidth() - for index, t in ipairs (data) do + for index, t in ipairs(data) do local v1 = f1 (t[1]) - _detalhes.fontstring_len:SetText (v1) + _detalhes.fontstring_len:SetText(v1) local len = _detalhes.fontstring_len:GetStringWidth() if (len > biggest_len) then biggest_len = len @@ -3038,16 +3038,16 @@ function _detalhes:FormatReportLines (report_table, data, f1, f2, f3) biggest_len = 130 end - for index, t in ipairs (data) do + 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) + _detalhes.fontstring_len:SetText(v1) local len = _detalhes.fontstring_len:GetStringWidth() while (len < biggest_len) do v1 = v1 .. "." - _detalhes.fontstring_len:SetText (v1) + _detalhes.fontstring_len:SetText(v1) len = _detalhes.fontstring_len:GetStringWidth() end @@ -3073,11 +3073,11 @@ local report_amount_function = function(t) if (not is_string) then if (dps) then if (_detalhes.report_schema == 1) then - return _detalhes:ToKReport (_math_floor (amount)) .. " (" .. _detalhes:ToKMin (_math_floor (dps)) .. ", " .. percent .. "%)" + return _detalhes:ToKReport (_math_floor(amount)) .. " (" .. _detalhes:ToKMin (_math_floor(dps)) .. ", " .. percent .. "%)" elseif (_detalhes.report_schema == 2) then - return percent .. "% (" .. _detalhes:ToKMin (_math_floor (dps)) .. ", " .. _detalhes:ToKReport ( _math_floor (amount)) .. ")" + return percent .. "% (" .. _detalhes:ToKMin (_math_floor(dps)) .. ", " .. _detalhes:ToKReport ( _math_floor(amount)) .. ")" elseif (_detalhes.report_schema == 3) then - return percent .. "% (" .. _detalhes:ToKReport ( _math_floor (amount) ) .. ", " .. _detalhes:ToKMin (_math_floor (dps)) .. ")" + return percent .. "% (" .. _detalhes:ToKReport ( _math_floor(amount) ) .. ", " .. _detalhes:ToKMin (_math_floor(dps)) .. ")" end else if (_detalhes.report_schema == 1) then @@ -3095,11 +3095,11 @@ local report_build_line = function(i, v1, v2) return v1 .. " " .. v2 end ---> Reportar o que esta na janela da inst�ncia +--Reportar o que esta na janela da inst�ncia function _detalhes:monta_relatorio (este_relatorio, custom) if (custom) then - --> shrink + --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] @@ -3112,7 +3112,7 @@ function _detalhes:monta_relatorio (este_relatorio, custom) local report_lines = {} - if (self.atributo == 5) then --> custom + if (self.atributo == 5) then --custom if (self.segmento == -1) then --overall report_lines [#report_lines+1] = "Details!: " .. Loc ["STRING_OVERALL"] .. " " .. self.customName .. " " .. Loc ["STRING_CUSTOM_REPORT"] else @@ -3129,7 +3129,7 @@ function _detalhes:monta_relatorio (este_relatorio, custom) 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 + for index, reported in ipairs(_detalhes.latest_report_table) do if (reported [1] == self.meu_id and reported [2] == self.atributo and reported [3] == self.sub_atributo and reported [5] == _detalhes.report_where) then already_exists = index break @@ -3166,27 +3166,27 @@ function _detalhes:monta_relatorio (este_relatorio, custom) local atributo = self.atributo local container = self.showing [atributo]._ActorTable - if (atributo == 1) then --> damage - if (self.sub_atributo == 5) then --> frags + 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 - --> string para imprimir direto sem calculos + --string para imprimir direto sem calculos 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 + 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 + 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 + for _, t in ipairs(container) do t.nome = _detalhes:GetSpellLink(t.spellid) end @@ -3198,20 +3198,20 @@ function _detalhes:monta_relatorio (este_relatorio, custom) end end - elseif (atributo == 2) then --> heal + elseif (atributo == 2) then --heal total, keyName, first, container_amount = _detalhes.atributo_heal:RefreshWindow (self, self.showing, true, true) if (self.sub_atributo == 1) then keyNameSec = "hps" end - elseif (atributo == 3) then --> energy + elseif (atributo == 3) then --energy total, keyName, first, container_amount = _detalhes.atributo_energy:RefreshWindow (self, self.showing, true, true) - elseif (atributo == 4) then --> misc - if (self.sub_atributo == 5) then --> mortes + elseif (atributo == 4) then --misc + if (self.sub_atributo == 5) then --mortes 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 @@ -3220,7 +3220,7 @@ function _detalhes:monta_relatorio (este_relatorio, custom) else total, keyName, first, container_amount = _detalhes.atributo_misc:RefreshWindow (self, self.showing, true, true) end - elseif (atributo == 5) then --> custom + elseif (atributo == 5) then --custom if (_detalhes.custom [self.sub_atributo]) then total, container, first, container_amount, nm = _detalhes.atributo_custom:RefreshWindow (self, self.showing, true, true) @@ -3246,8 +3246,8 @@ function _detalhes:monta_relatorio (este_relatorio, custom) -- get the total local amount, is_string - if (type (actor [keyName]) == "number") then - amount = _math_floor (actor [keyName]) + if (type(actor [keyName]) == "number") then + amount = _math_floor(actor [keyName]) else amount = actor [keyName] is_string = true @@ -3505,17 +3505,17 @@ function _detalhes:envia_relatorio (linhas, custom) local editbox = _detalhes.janela_report.editbox - if (editbox.focus) then --> n�o precionou enter antes de clicar no okey + if (editbox.focus) then --n�o precionou enter antes de clicar no okey local texto = _detalhes:trim (editbox:GetText()) if (_string_len (texto) > 0) then _detalhes.report_to_who = texto editbox:AddHistoryLine (texto) - editbox:SetText (texto) + editbox:SetText(texto) else _detalhes.report_to_who = "" - editbox:SetText ("") + editbox:SetText("") end - editbox.perdeu_foco = true --> isso aqui pra quando estiver editando e clicar em outra caixa + editbox.perdeu_foco = true --isso aqui pra quando estiver editando e clicar em outra caixa editbox:ClearFocus() end @@ -3572,7 +3572,7 @@ function _detalhes:envia_relatorio (linhas, custom) return - elseif (to_who == "WHISPER") then --> whisper + elseif (to_who == "WHISPER") then --whisper local alvo = _detalhes.report_to_who @@ -3590,7 +3590,7 @@ function _detalhes:envia_relatorio (linhas, custom) end return - elseif (to_who == "WHISPER2") then --> whisper target + elseif (to_who == "WHISPER2") then --whisper target to_who = "WHISPER" local alvo diff --git a/classes/class_resources.lua b/classes/class_resources.lua index 76d250b0..d52b1627 100644 --- a/classes/class_resources.lua +++ b/classes/class_resources.lua @@ -64,7 +64,7 @@ local keyName function atributo_energy:NovaTabela (serial, nome, link) - --> constructor + --constructor local alphabetical = _detalhes:GetOrderNumber(nome) @@ -92,7 +92,7 @@ function atributo_energy:NovaTabela (serial, nome, link) return _new_energyActor end ---> resources sort +--resources sort function _detalhes.SortGroupResource (container, keyName2) keyName = keyName2 @@ -120,7 +120,7 @@ function _detalhes:ContainerSortResources (container, amount, keyName2) _table_sort (container, _detalhes.SortKeySimpleResources) if (amount) then - for i = amount, 1, -1 do --> de tr�s pra frente + for i = amount, 1, -1 do --de tr�s pra frente if (container[i][keyName] < 1) then amount = amount-1 else @@ -132,7 +132,7 @@ function _detalhes:ContainerSortResources (container, amount, keyName2) end end ---> power types sort +--power types sort local power_table = {0, 1, 3, 6} local power_type @@ -189,7 +189,7 @@ local sort_alternateenergy_group = function(t1, t2) end end ---> resource refresh +--resource refresh local function RefreshBarraResources (tabela, barra, instancia) tabela:AtualizarResources (tabela.minha_barra, barra.colocacao, instancia) @@ -214,7 +214,7 @@ function atributo_energy:AtualizarResources (whichRowLine, colocacao, instancia) local total = instancia.showing.totals.resources local combat_time = instancia.showing:GetCombatTime() - local rps = _math_floor (self.resource / combat_time) + local rps = _math_floor(self.resource / combat_time) local formated_resource = SelectedToKFunction (_, self.resource) local formated_rps = _cstr ("%.2f", self.resource / combat_time) @@ -245,39 +245,39 @@ function atributo_energy:AtualizarResources (whichRowLine, colocacao, instancia) local rightText = formated_resource .. bars_brackets[1] .. formated_rps .. " r/s" .. bars_separator .. porcentagem .. bars_brackets[2] if (UsingCustomRightText) then - esta_barra.lineText4:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_resource, formated_rps, porcentagem, self, instancia.showing, instancia, rightText)) + esta_barra.lineText4:SetText(_string_replace (instancia.row_info.textR_custom_text, formated_resource, formated_rps, porcentagem, self, instancia.showing, instancia, rightText)) else if (instancia.use_multi_fontstrings) then instancia:SetInLineTexts(esta_barra, formated_resource, formated_rps .. " r/s", porcentagem .. "%") else - esta_barra.lineText4:SetText (rightText) + esta_barra.lineText4:SetText(rightText) end end - esta_barra.lineText1:SetText (colocacao .. ". " .. self.nome) - esta_barra.lineText1:SetSize (esta_barra:GetWidth() - esta_barra.lineText4:GetStringWidth() - 20, 15) + esta_barra.lineText1:SetText(colocacao .. ". " .. self.nome) + esta_barra.lineText1:SetSize(esta_barra:GetWidth() - esta_barra.lineText4:GetStringWidth() - 20, 15) - esta_barra:SetValue (100) + esta_barra:SetValue(100) if (esta_barra.hidden or esta_barra.fading_in or esta_barra.faded) then - Details.FadeHandler.Fader (esta_barra, "out") + Details.FadeHandler.Fader(esta_barra, "out") end - --> texture color + --texture color actor_class_color_r, actor_class_color_g, actor_class_color_b = self:GetBarColor() self:SetBarColors (esta_barra, instancia, actor_class_color_r, actor_class_color_g, actor_class_color_b) - --> icon + --icon self:SetClassIcon (esta_barra.icone_classe, instancia, self.classe) end ---> refresh function +--refresh function function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, exportar) local showing = tabela_do_combate [class_type] - if (#showing._ActorTable < 1) then --> n�o h� barras para mostrar + if (#showing._ActorTable < 1) then --n�o h� barras para mostrar return _detalhes:EsconderBarrasNaoUsadas (instancia, showing), "", 0, 0 end @@ -290,7 +290,7 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex local modo = instancia.modo if (sub_atributo == 5) then - --> showing resources + --showing resources keyName = "resource" @@ -298,7 +298,7 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex amount = _detalhes:ContainerSortResources (conteudo, amount, "resource") instancia.top = conteudo[1].resource - for index, player in _ipairs (conteudo) do + for index, player in _ipairs(conteudo) do if (player.resource >= 1) then total = total + player.resource else @@ -309,9 +309,9 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex elseif (modo == modo_GROUP) then _table_sort (conteudo, _detalhes.SortKeyGroupResources) - for index, player in _ipairs (conteudo) do - if (player.grupo) then --> � um player e esta em grupo - if (player.resource < 1) then --> dano menor que 1, interromper o loop + for index, player in _ipairs(conteudo) do + if (player.grupo) then --� um player e esta em grupo + if (player.resource < 1) then --dano menor que 1, interromper o loop amount = index - 1 break end @@ -349,11 +349,11 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex whichRowLine = whichRowLine+1 end - --> beta, hidar barras n�o usadas durante um refresh for�ado + --beta, hidar barras n�o usadas durante um refresh for�ado if (forcar) then - if (instancia.modo == 2) then --> group + 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 @@ -371,7 +371,7 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex end if (exportar) then - if (_type (exportar) == "boolean") then + if (_type(exportar) == "boolean") then --keyName = "received" else keyName = exportar.key @@ -416,7 +416,7 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex _table_sort (conteudo, sort_alternateenergy_group) - for index, player in _ipairs (conteudo) do + for index, player in _ipairs(conteudo) do if (player.grupo) then if (player.alternatepower < 1) then amount = index - 1 @@ -435,7 +435,7 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex _table_sort (conteudo, sort_energy_group) - for index, player in _ipairs (conteudo) do + for index, player in _ipairs(conteudo) do if (player.grupo) then if (player.received < 1) then amount = index - 1 @@ -461,9 +461,9 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex return total, keyName, instancia.top, amount end - if (amount < 1) then --> n�o h� barras para mostrar + if (amount < 1) then --n�o h� barras para mostrar instancia:EsconderScrollBar() - return _detalhes:EndRefresh (instancia, total, tabela_do_combate, showing) --> retorna a tabela que precisa ganhar o refresh + return _detalhes:EndRefresh (instancia, total, tabela_do_combate, showing) --retorna a tabela que precisa ganhar o refresh end instancia:RefreshScrollBar (amount) @@ -488,7 +488,7 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex if (following) then if (using_cache) then local pname = _detalhes.playername - for i, actor in _ipairs (conteudo) do + for i, actor in _ipairs(conteudo) do if (actor.nome == pname) then myPos = i break @@ -524,49 +524,49 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex local row1 = barras_container [1] row1.minha_tabela = nil - row1.lineText1:SetText (Loc ["STRING_TOTAL"]) + row1.lineText1:SetText(Loc ["STRING_TOTAL"]) if (instancia.use_multi_fontstrings) then instancia:SetInLineTexts(row1, "", _detalhes:ToK2 (total, _detalhes:ToK (total / combat_time))) else - row1.lineText4:SetText (_detalhes:ToK2 (total) .. " (" .. _detalhes:ToK (total / combat_time) .. ")") + row1.lineText4:SetText(_detalhes:ToK2 (total) .. " (" .. _detalhes:ToK (total / combat_time) .. ")") end - row1:SetValue (100) + 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:SetTexture(instancia.total_bar.icon) row1.icone_classe:SetTexCoord (0.0625, 0.9375, 0.0625, 0.9375) - Details.FadeHandler.Fader (row1, "out") + Details.FadeHandler.Fader(row1, "out") 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 --> vai atualizar s� o range que esta sendo mostrado - conteudo[i]:RefreshLine (instancia, barras_container, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --> inst�ncia, index, total, valor da 1� barra + for i = instancia.barraS[1], iter_last-1, 1 do --vai atualizar s� o range que esta sendo mostrado + conteudo[i]:RefreshLine (instancia, barras_container, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --inst�ncia, index, total, valor da 1� barra whichRowLine = whichRowLine+1 end - conteudo[myPos]:RefreshLine (instancia, barras_container, whichRowLine, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --> inst�ncia, index, total, valor da 1� barra + conteudo[myPos]:RefreshLine (instancia, barras_container, whichRowLine, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --inst�ncia, index, total, valor da 1� barra whichRowLine = whichRowLine+1 else - for i = instancia.barraS[1], iter_last, 1 do --> vai atualizar s� o range que esta sendo mostrado - conteudo[i]:RefreshLine (instancia, barras_container, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --> inst�ncia, index, total, valor da 1� barra + for i = instancia.barraS[1], iter_last, 1 do --vai atualizar s� o range que esta sendo mostrado + conteudo[i]:RefreshLine (instancia, barras_container, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --inst�ncia, index, total, valor da 1� barra whichRowLine = whichRowLine+1 end end 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 --> vai atualizar s� o range que esta sendo mostrado - conteudo[i]:RefreshLine (instancia, barras_container, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --> inst�ncia, index, total, valor da 1� barra + for i = instancia.barraS[1], instancia.barraS[2]-1, 1 do --vai atualizar s� o range que esta sendo mostrado + conteudo[i]:RefreshLine (instancia, barras_container, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --inst�ncia, index, total, valor da 1� barra whichRowLine = whichRowLine+1 end - conteudo[myPos]:RefreshLine (instancia, barras_container, whichRowLine, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --> inst�ncia, index, total, valor da 1� barra + conteudo[myPos]:RefreshLine (instancia, barras_container, whichRowLine, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --inst�ncia, index, total, valor da 1� barra whichRowLine = whichRowLine+1 else - for i = instancia.barraS[1], instancia.barraS[2], 1 do --> vai atualizar s� o range que esta sendo mostrado - conteudo[i]:RefreshLine (instancia, barras_container, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --> inst�ncia, index, total, valor da 1� barra + for i = instancia.barraS[1], instancia.barraS[2], 1 do --vai atualizar s� o range que esta sendo mostrado + conteudo[i]:RefreshLine (instancia, barras_container, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --inst�ncia, index, total, valor da 1� barra whichRowLine = whichRowLine+1 end end @@ -584,47 +584,47 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex local row1 = barras_container [1] row1.minha_tabela = nil - row1.lineText1:SetText (Loc ["STRING_TOTAL"]) + row1.lineText1:SetText(Loc ["STRING_TOTAL"]) if (instancia.use_multi_fontstrings) then instancia:SetInLineTexts(row1, "", _detalhes:ToK2 (total), _detalhes:ToK (total / combat_time)) else - row1.lineText4:SetText (_detalhes:ToK2 (total) .. " (" .. _detalhes:ToK (total / combat_time) .. ")") + row1.lineText4:SetText(_detalhes:ToK2 (total) .. " (" .. _detalhes:ToK (total / combat_time) .. ")") end - row1:SetValue (100) + 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:SetTexture(instancia.total_bar.icon) row1.icone_classe:SetTexCoord (0.0625, 0.9375, 0.0625, 0.9375) - Details.FadeHandler.Fader (row1, "out") + Details.FadeHandler.Fader(row1, "out") if (following and myPos and myPos > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then - conteudo[myPos]:RefreshLine (instancia, barras_container, whichRowLine, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --> inst�ncia, index, total, valor da 1� barra + conteudo[myPos]:RefreshLine (instancia, barras_container, whichRowLine, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --inst�ncia, index, total, valor da 1� barra whichRowLine = whichRowLine+1 - for i = iter_last-1, instancia.barraS[1], -1 do --> vai atualizar s� o range que esta sendo mostrado - conteudo[i]:RefreshLine (instancia, barras_container, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --> inst�ncia, index, total, valor da 1� barra + for i = iter_last-1, instancia.barraS[1], -1 do --vai atualizar s� o range que esta sendo mostrado + conteudo[i]:RefreshLine (instancia, barras_container, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --inst�ncia, index, total, valor da 1� barra whichRowLine = whichRowLine+1 end else - for i = iter_last, instancia.barraS[1], -1 do --> vai atualizar s� o range que esta sendo mostrado - conteudo[i]:RefreshLine (instancia, barras_container, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --> inst�ncia, index, total, valor da 1� barra + for i = iter_last, instancia.barraS[1], -1 do --vai atualizar s� o range que esta sendo mostrado + conteudo[i]:RefreshLine (instancia, barras_container, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --inst�ncia, index, total, valor da 1� barra whichRowLine = whichRowLine+1 end end else if (following and myPos and myPos > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then - conteudo[myPos]:RefreshLine (instancia, barras_container, whichRowLine, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --> inst�ncia, index, total, valor da 1� barra + conteudo[myPos]:RefreshLine (instancia, barras_container, whichRowLine, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --inst�ncia, index, total, valor da 1� barra whichRowLine = whichRowLine+1 - for i = instancia.barraS[2]-1, instancia.barraS[1], -1 do --> vai atualizar s� o range que esta sendo mostrado - conteudo[i]:RefreshLine (instancia, barras_container, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --> inst�ncia, index, total, valor da 1� barra + for i = instancia.barraS[2]-1, instancia.barraS[1], -1 do --vai atualizar s� o range que esta sendo mostrado + conteudo[i]:RefreshLine (instancia, barras_container, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --inst�ncia, index, total, valor da 1� barra whichRowLine = whichRowLine+1 end else - for i = instancia.barraS[2], instancia.barraS[1], -1 do --> vai atualizar s� o range que esta sendo mostrado - conteudo[i]:RefreshLine (instancia, barras_container, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --> inst�ncia, index, total, valor da 1� barra + for i = instancia.barraS[2], instancia.barraS[1], -1 do --vai atualizar s� o range que esta sendo mostrado + conteudo[i]:RefreshLine (instancia, barras_container, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --inst�ncia, index, total, valor da 1� barra whichRowLine = whichRowLine+1 end end @@ -637,20 +637,20 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex end if (forcar) then - if (instancia.modo == 2) then --> group + 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 - return _detalhes:EndRefresh (instancia, total, tabela_do_combate, showing) --> retorna a tabela que precisa ganhar o refresh + return _detalhes:EndRefresh (instancia, total, tabela_do_combate, showing) --retorna a tabela que precisa ganhar o refresh end function atributo_energy:RefreshLine (instancia, barras_container, whichRowLine, lugar, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) - local esta_barra = instancia.barras[whichRowLine] --> pega a refer�ncia da barra na janela + local esta_barra = instancia.barras[whichRowLine] --pega a refer�ncia da barra na janela if (not esta_barra) then print ("DEBUG: problema com "..whichRowLine.." "..lugar) @@ -665,7 +665,7 @@ function atributo_energy:RefreshLine (instancia, barras_container, whichRowLine, self.minha_barra = esta_barra self.colocacao = lugar - local esta_e_energy_total = self [keyName] --> total de dano que este jogador deu + local esta_e_energy_total = self [keyName] --total de dano que este jogador deu -- local porcentagem = esta_e_energy_total / total * 100 local porcentagem @@ -675,7 +675,7 @@ function atributo_energy:RefreshLine (instancia, barras_container, whichRowLine, porcentagem = _cstr ("%.1f", esta_e_energy_total / instancia.top * 100) end - local esta_porcentagem = _math_floor ((esta_e_energy_total/instancia.top) * 100) + local esta_porcentagem = _math_floor((esta_e_energy_total/instancia.top) * 100) local formated_energy = SelectedToKFunction (_, esta_e_energy_total) @@ -690,16 +690,16 @@ function atributo_energy:RefreshLine (instancia, barras_container, whichRowLine, local rightText = formated_energy .. bars_brackets[1] .. porcentagem .. bars_brackets[2] if (UsingCustomRightText) then - esta_barra.lineText4:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_energy, "", porcentagem, self, instancia.showing, instancia, rightText)) + esta_barra.lineText4:SetText(_string_replace (instancia.row_info.textR_custom_text, formated_energy, "", porcentagem, self, instancia.showing, instancia, rightText)) else if (instancia.use_multi_fontstrings) then instancia:SetInLineTexts(esta_barra, "", formated_energy, porcentagem) else - esta_barra.lineText4:SetText (rightText) + esta_barra.lineText4:SetText(rightText) end end - if (esta_barra.mouse_over and not instancia.baseframe.isMoving) then --> precisa atualizar o tooltip + if (esta_barra.mouse_over and not instancia.baseframe.isMoving) then --precisa atualizar o tooltip gump:UpdateTooltip (whichRowLine, esta_barra, instancia) end @@ -710,13 +710,13 @@ end function atributo_energy:RefreshBarra2 (esta_barra, instancia, tabela_anterior, forcar, esta_porcentagem, whichRowLine, barras_container, use_animations) - --> primeiro colocado + --primeiro colocado if (esta_barra.colocacao == 1) then if (not tabela_anterior or tabela_anterior ~= esta_barra.minha_tabela or forcar) then - esta_barra:SetValue (100) + esta_barra:SetValue(100) if (esta_barra.hidden or esta_barra.fading_in or esta_barra.faded) then - Details.FadeHandler.Fader (esta_barra, "out") + Details.FadeHandler.Fader(esta_barra, "out") end return self:RefreshBarra (esta_barra, instancia) @@ -730,11 +730,11 @@ function atributo_energy:RefreshBarra2 (esta_barra, instancia, tabela_anterior, if (use_animations) then esta_barra.animacao_fim = esta_porcentagem else - esta_barra:SetValue (esta_porcentagem) + esta_barra:SetValue(esta_porcentagem) esta_barra.animacao_ignorar = true end - Details.FadeHandler.Fader (esta_barra, "out") + Details.FadeHandler.Fader(esta_barra, "out") if (instancia.row_info.texture_class_colors) then esta_barra.textura:SetVertexColor (actor_class_color_r, actor_class_color_g, actor_class_color_b) @@ -746,26 +746,26 @@ function atributo_energy:RefreshBarra2 (esta_barra, instancia, tabela_anterior, return self:RefreshBarra (esta_barra, instancia) else - --> agora esta comparando se a tabela da barra � diferente da tabela na atualiza��o anterior - if (not tabela_anterior or tabela_anterior ~= esta_barra.minha_tabela or forcar) then --> aqui diz se a barra do jogador mudou de posi��o ou se ela apenas ser� atualizada + --agora esta comparando se a tabela da barra � diferente da tabela na atualiza��o anterior + if (not tabela_anterior or tabela_anterior ~= esta_barra.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 esta_barra.animacao_fim = esta_porcentagem else - esta_barra:SetValue (esta_porcentagem) + esta_barra:SetValue(esta_porcentagem) esta_barra.animacao_ignorar = true end - esta_barra.last_value = esta_porcentagem --> reseta o ultimo valor da barra + esta_barra.last_value = esta_porcentagem --reseta o ultimo valor da barra return self:RefreshBarra (esta_barra, instancia) - elseif (esta_porcentagem ~= esta_barra.last_value) then --> continua mostrando a mesma tabela ent�o compara a porcentagem - --> apenas atualizar + elseif (esta_porcentagem ~= esta_barra.last_value) then --continua mostrando a mesma tabela ent�o compara a porcentagem + --apenas atualizar if (use_animations) then esta_barra.animacao_fim = esta_porcentagem else - esta_barra:SetValue (esta_porcentagem) + esta_barra:SetValue(esta_porcentagem) end esta_barra.last_value = esta_porcentagem @@ -785,14 +785,14 @@ function atributo_energy:RefreshBarra (esta_barra, instancia, from_resize) actor_class_color_r, actor_class_color_g, actor_class_color_b = self:GetBarColor() end - --> icon + --icon self:SetClassIcon (esta_barra.icone_classe, instancia, class) - --> texture color + --texture color self:SetBarColors (esta_barra, instancia, actor_class_color_r, actor_class_color_g, actor_class_color_b) - --> left text + --left text self:SetBarLeftText (esta_barra, instancia, enemy, arena_enemy, arena_ally, UsingCustomLeftText) - esta_barra.lineText1:SetSize (esta_barra:GetWidth() - esta_barra.lineText4:GetStringWidth() - 20, 15) + esta_barra.lineText1:SetSize(esta_barra:GetWidth() - esta_barra.lineText4:GetStringWidth() - 20, 15) end @@ -801,7 +801,7 @@ function atributo_energy:KeyNames (sub_atributo) return "total" end ----------> TOOLTIPS BIFURCA��O ~tooltip +---------TOOLTIPS BIFURCA��O ~tooltip local resource_bg_color = {.1, .1, .1, 0.6} local resource_bg_coords = {.6, 0.1, 0, 0.64453125} @@ -826,7 +826,7 @@ function atributo_energy:ToolTip (instancia, numero, barra, keydown) end end ---> tooltip locals +--tooltip locals local r, g, b local barAlha = .6 @@ -861,10 +861,10 @@ function atributo_energy:ToolTipRegenRecebido (instancia, numero, barra, keydown local total_regenerado = self.received local name = self.nome - --> spells: + --spells: local i = 1 - for index, actor in _ipairs (container._ActorTable) do + for index, actor in _ipairs(container._ActorTable) do if (actor.powertype == powertype) then for spellid, spell in _pairs (actor.spells._ActorTable) do @@ -930,11 +930,11 @@ function atributo_energy:ToolTipRegenRecebido (instancia, numero, barra, keydown _detalhes:AddTooltipBackgroundStatusbar (false, spell [2] / energy_tooltips_table [1][2] * 100) end - --> players + --players reset_tooltips_table() i = 1 - for index, actor in _ipairs (container._ActorTable) do + for index, actor in _ipairs(container._ActorTable) do if (actor.powertype == powertype) then local on_self = actor.targets [name] @@ -998,7 +998,7 @@ function atributo_energy:ToolTipRegenRecebido (instancia, numero, barra, keydown end - --> player generators + --player generators local allGeneratorSpells = {} local allGenerated = 0 for spellid, spellObject in _pairs (self.spells._ActorTable) do @@ -1032,14 +1032,14 @@ end --------------------------------------------- // JANELA DETALHES // --------------------------------------------- ----------> DETALHES BIFURCA��O +---------DETALHES BIFURCA��O function atributo_energy:MontaInfo() if (info.sub_atributo <= 4) then return self:MontaInfoRegenRecebido() end end ----------> DETALHES bloco da direita BIFURCA��O +---------DETALHES bloco da direita BIFURCA��O function atributo_energy:MontaDetalhes (spellid, barra) if (info.sub_atributo <= 4) then return self:MontaDetalhesRegenRecebido (spellid, barra) @@ -1063,10 +1063,10 @@ function atributo_energy:MontaInfoRegenRecebido() local my_name = self.nome local powertype = self.powertype - --> spells: + --spells: local i = 1 - for index, actor in _ipairs (container._ActorTable) do + for index, actor in _ipairs(container._ActorTable) do if (actor.powertype == powertype) then for spellid, spell in _pairs (actor.spells._ActorTable) do @@ -1106,7 +1106,7 @@ function atributo_energy:MontaInfoRegenRecebido() gump:JI_AtualizaContainerBarras (amt) local max_ = energy_tooltips_table [1][2] - for index, tabela in _ipairs (energy_tooltips_table) do + for index, tabela in _ipairs(energy_tooltips_table) do if (tabela [2] < 1) then break @@ -1137,12 +1137,12 @@ function atributo_energy:MontaInfoRegenRecebido() end - --> players: + --players: reset_tooltips_table() i = 1 - for index, actor in _ipairs (container._ActorTable) do + for index, actor in _ipairs(container._ActorTable) do if (actor.powertype == powertype) then local on_self = actor.targets [my_name] @@ -1168,7 +1168,7 @@ function atributo_energy:MontaInfoRegenRecebido() local max_fontes = energy_tooltips_table[1][2] local barra - for index, tabela in _ipairs (energy_tooltips_table) do + for index, tabela in _ipairs(energy_tooltips_table) do if (tabela [2] < 1) then break @@ -1182,15 +1182,15 @@ function atributo_energy:MontaInfoRegenRecebido() end if (index == 1) then - barra.textura:SetValue (100) + barra.textura:SetValue(100) else - barra.textura:SetValue (tabela[2]/max_fontes*100) + barra.textura:SetValue(tabela[2]/max_fontes*100) end - barra.lineText1:SetText (index..instancia.divisores.colocacao..tabela[1]) - barra.lineText4:SetText (_detalhes:comma_value (tabela[2]) .. " (" .. _cstr("%.1f", tabela[2]/total_regenerado * 100) .. ")") + barra.lineText1:SetText(index..instancia.divisores.colocacao..tabela[1]) + barra.lineText4:SetText(_detalhes:comma_value (tabela[2]) .. " (" .. _cstr("%.1f", tabela[2]/total_regenerado * 100) .. ")") - if (barra.mouse_over) then --> atualizar o tooltip + if (barra.mouse_over) then --atualizar o tooltip if (barra.isAlvo) then GameTooltip:Hide() GameTooltip:SetOwner (barra, "ANCHOR_TOPRIGHT") @@ -1213,7 +1213,7 @@ end function atributo_energy:MontaDetalhesRegenRecebido (nome, barra) - for _, barra in _ipairs (info.barras3) do + for _, barra in _ipairs(info.barras3) do barra:Hide() end @@ -1230,12 +1230,12 @@ function atributo_energy:MontaDetalhesRegenRecebido (nome, barra) local spellid = nome local who_name = self.nome - --> who is regenerating with the spell -> nome + --who is regenerating with the spell -> nome - --> spells: + --spells: local i = 1 - for index, actor in _ipairs (container._ActorTable) do + for index, actor in _ipairs(container._ActorTable) do if (actor.powertype == powertype) then local spell = actor.spells._ActorTable [spellid] if (spell) then @@ -1264,7 +1264,7 @@ function atributo_energy:MontaDetalhesRegenRecebido (nome, barra) local max_ = energy_tooltips_table [1][2] local barra - for index, tabela in _ipairs (from) do + for index, tabela in _ipairs(from) do if (tabela [2] < 1) then break @@ -1272,26 +1272,26 @@ function atributo_energy:MontaDetalhesRegenRecebido (nome, barra) barra = barras [index] - if (not barra) then --> se a barra n�o existir, criar ela ent�o + if (not barra) then --se a barra n�o existir, criar ela ent�o barra = gump:CriaNovaBarraInfo3 (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_ * 100) + barra.textura:SetValue(tabela[2] / max_ * 100) end - barra.lineText1:SetText (index .. "." .. tabela [1]) - barra.lineText4:SetText (_detalhes:comma_value (tabela[2]) .." (" .. _cstr("%.1f", tabela[2] / total_regenerado * 100) .."%)") + barra.lineText1:SetText(index .. "." .. tabela [1]) + barra.lineText4:SetText(_detalhes:comma_value (tabela[2]) .." (" .. _cstr("%.1f", tabela[2] / total_regenerado * 100) .."%)") barra.textura:SetStatusBarColor (_unpack (_detalhes.class_colors [tabela[3]])) - barra.icone:SetTexture ("Interface\\AddOns\\Details\\images\\classes_small") + barra.icone:SetTexture("Interface\\AddOns\\Details\\images\\classes_small") barra.icone:SetTexCoord (_unpack (_detalhes.class_coords [tabela[3]])) - barra:Show() --> mostra a barra + barra:Show() --mostra a barra if (index == 15) then break @@ -1317,7 +1317,7 @@ function atributo_energy:MontaTooltipAlvos (esta_barra, index) --print ("Mouse Over", actor, esta_barra.nome_inimigo, self.tipo) if (actor) then - --> spells: + --spells: local i = 1 for spellid, spell in _pairs (actor.spells._ActorTable) do @@ -1338,7 +1338,7 @@ function atributo_energy:MontaTooltipAlvos (esta_barra, index) --print (i, #energy_tooltips_table) - for index, spell in _ipairs (energy_tooltips_table) do + for index, spell in _ipairs(energy_tooltips_table) do if (spell [2] < 1) then break end @@ -1359,9 +1359,9 @@ function atributo_energy:Iniciar (iniciar) end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> core functions +--core functions - --> atualize a funcao de abreviacao + --atualize a funcao de abreviacao function atributo_energy:UpdateSelectedToKFunction() SelectedToKFunction = ToKFunctions [_detalhes.ps_abbreviation] FormatTooltipNumber = ToKFunctions [_detalhes.tooltip.abbreviation] @@ -1369,7 +1369,7 @@ end headerColor = _detalhes.tooltip.header_text_color end - --> subtract total from a combat table + --subtract total from a combat table function atributo_energy:subtract_total (combat_table) --print ("reduce total:", combat_table.totals [class_type] [self.powertype], self.total, self.powertype, self.nome) if (self.powertype and combat_table.totals [class_type] [self.powertype]) then @@ -1391,11 +1391,11 @@ end end end - --> restaura e liga o ator com a sua shadow durante a inicializa��o + --restaura e liga o ator com a sua shadow durante a inicializa��o function atributo_energy:r_onlyrefresh_shadow (actor) - --> criar uma shadow desse ator se ainda n�o tiver uma + --criar uma shadow desse ator se ainda n�o tiver uma local overall_energy = _detalhes.tabela_overall [3] local shadow = overall_energy._ActorTable [overall_energy._NameIndexTable [actor.nome]] @@ -1413,7 +1413,7 @@ end end - --> restaura a meta e indexes ao ator + --restaura a meta e indexes ao ator _detalhes.refresh:r_atributo_energy (actor, shadow) shadow.powertype = actor.powertype @@ -1422,15 +1422,15 @@ end shadow.resource_type = actor.resource_type end - --> targets + --targets for target_name, amount in _pairs (actor.targets) do shadow.targets [target_name] = 0 end - --> spells + --spells for spellid, habilidade in _pairs (actor.spells._ActorTable) do local habilidade_shadow = shadow.spells:PegaHabilidade (spellid, true, "SPELL_ENERGY", false) - --> spell targets + --spell targets for target_name, amount in _pairs (habilidade.targets) do habilidade_shadow.targets [target_name] = 0 end @@ -1443,7 +1443,7 @@ end local host_combat = combat_object or _detalhes.tabela_overall - --> criar uma shadow desse ator se ainda n�o tiver uma + --criar uma shadow desse ator se ainda n�o tiver uma local overall_energy = host_combat [3] local shadow = overall_energy._ActorTable [overall_energy._NameIndexTable [actor.nome]] @@ -1461,17 +1461,17 @@ end end - --> restaura a meta e indexes ao ator + --restaura a meta e indexes ao ator if (not no_refresh) then _detalhes.refresh:r_atributo_energy (actor, shadow) end - --> pets (add unique pet names) - for _, petName in _ipairs (actor.pets) do + --pets (add unique pet names) + for _, petName in _ipairs(actor.pets) do DetailsFramework.table.addunique (shadow.pets, petName) end - --> total das energias (captura de dados) + --total das energias (captura de dados) shadow.total = shadow.total + actor.total shadow.received = shadow.received + actor.received shadow.alternatepower = shadow.alternatepower + actor.alternatepower @@ -1488,19 +1488,19 @@ end shadow.resource_type = actor.resource_type end - --> total no combate overall (captura de dados) + --total no combate overall (captura de dados) host_combat.totals[3] [actor.powertype] = host_combat.totals[3] [actor.powertype] + actor.total if (actor.grupo) then host_combat.totals_grupo[3][actor.powertype] = host_combat.totals_grupo[3][actor.powertype] + actor.total end - --> targets + --targets for target_name, amount in _pairs (actor.targets) do shadow.targets [target_name] = (shadow.targets [target_name] or 0) + amount end - --> spells + --spells for spellid, habilidade in _pairs (actor.spells._ActorTable) do local habilidade_shadow = shadow.spells:PegaHabilidade (spellid, true, "SPELL_ENERGY", false) @@ -1508,7 +1508,7 @@ end habilidade_shadow.total = habilidade_shadow.total + habilidade.total habilidade_shadow.counter = habilidade_shadow.counter + habilidade.counter - --> spell targets + --spell targets for target_name, amount in _pairs (habilidade.targets) do habilidade_shadow.targets [target_name] = (habilidade_shadow.targets [target_name] or 0) + amount end @@ -1552,17 +1552,17 @@ atributo_energy.__add = function(tabela1, tabela2) tabela1.resource = tabela1.resource + (tabela2.resource or 0) end - --> total and received + --total and received tabela1.total = tabela1.total + tabela2.total tabela1.received = tabela1.received + tabela2.received tabela1.alternatepower = tabela1.alternatepower + tabela2.alternatepower - --> targets + --targets for target_name, amount in _pairs (tabela2.targets) do tabela1.targets [target_name] = (tabela1.targets [target_name] or 0) + amount end - --> spells + --spells for spellid, habilidade in _pairs (tabela2.spells._ActorTable) do local habilidade_tabela1 = tabela1.spells:PegaHabilidade (spellid, true, "SPELL_ENERGY", false) @@ -1570,7 +1570,7 @@ atributo_energy.__add = function(tabela1, tabela2) habilidade_tabela1.total = habilidade_tabela1.total + habilidade.total habilidade_tabela1.counter = habilidade_tabela1.counter + habilidade.counter - --> spell targets + --spell targets for target_name, amount in _pairs (habilidade.targets) do habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) + amount end @@ -1590,19 +1590,19 @@ atributo_energy.__sub = function(tabela1, tabela2) tabela1.resource = tabela1.resource - (tabela2.resource or 0) end - --> total and received + --total and received tabela1.total = tabela1.total - tabela2.total tabela1.received = tabela1.received - tabela2.received tabela1.alternatepower = tabela1.alternatepower - tabela2.alternatepower - --> targets + --targets for target_name, amount in _pairs (tabela2.targets) do if (tabela1.targets [target_name]) then tabela1.targets [target_name] = tabela1.targets [target_name] - amount end end - --> spells + --spells for spellid, habilidade in _pairs (tabela2.spells._ActorTable) do local habilidade_tabela1 = tabela1.spells:PegaHabilidade (spellid, true, "SPELL_ENERGY", false) @@ -1610,7 +1610,7 @@ atributo_energy.__sub = function(tabela1, tabela2) habilidade_tabela1.total = habilidade_tabela1.total - habilidade.total habilidade_tabela1.counter = habilidade_tabela1.counter - habilidade.counter - --> spell targets + --spell targets for target_name, amount in _pairs (habilidade.targets) do if (habilidade_tabela1.targets [target_name]) then habilidade_tabela1.targets [target_name] = habilidade_tabela1.targets [target_name] - amount diff --git a/classes/class_spelldamage.lua b/classes/class_spelldamage.lua index 1a3dd63a..37c993a2 100644 --- a/classes/class_spelldamage.lua +++ b/classes/class_spelldamage.lua @@ -4,13 +4,13 @@ local _ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> local pointers +--local pointers local _ipairs = ipairs--lua local local _pairs = pairs--lua local local _UnitAura = UnitAura--api local ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> constants +--constants local alvo_da_habilidade = _detalhes.alvo_da_habilidade local habilidade_dano = _detalhes.habilidade_dano @@ -21,7 +21,7 @@ local _recording_ability_with_buffs = false ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> internals +--internals function habilidade_dano:NovaTabela (id, link, token) @@ -32,31 +32,31 @@ id = id, --spellid successful_casted = 0, --successful casted times (only for enemies) - --> normal hits + --normal hits n_min = 0, n_max = 0, n_amt = 0, n_dmg = 0, - --> critical hits + --critical hits c_min = 0, c_max = 0, c_amt = 0, c_dmg = 0, - --> glacing hits + --glacing hits g_amt = 0, g_dmg = 0, - --> resisted + --resisted r_amt = 0, r_dmg = 0, - --> blocked + --blocked b_amt = 0, b_dmg = 0, - --> obsorved + --obsorved a_amt = 0, a_dmg = 0, @@ -93,27 +93,27 @@ self.counter = self.counter + 1 if (resisted and resisted > 0) then - self.r_dmg = self.r_dmg+amount --> tabela.total � o total de dano - self.r_amt = self.r_amt+1 --> tabela.total � o total de dano + self.r_dmg = self.r_dmg+amount --tabela.total � o total de dano + self.r_amt = self.r_amt+1 --tabela.total � o total de dano end if (blocked and blocked > 0) then - self.b_dmg = self.b_dmg+amount --> amount � o total de dano - self.b_amt = self.b_amt+1 --> amount � o total de dano + self.b_dmg = self.b_dmg+amount --amount � o total de dano + self.b_amt = self.b_amt+1 --amount � o total de dano end if (absorbed and absorbed > 0) then - self.a_dmg = self.a_dmg+amount --> amount � o total de dano - self.a_amt = self.a_amt+1 --> amount � o total de dano + self.a_dmg = self.a_dmg+amount --amount � o total de dano + self.a_amt = self.a_amt+1 --amount � o total de dano end if (glacing) then - self.g_dmg = self.g_dmg+amount --> amount � o total de dano - self.g_amt = self.g_amt+1 --> amount � o total de dano + self.g_dmg = self.g_dmg+amount --amount � o total de dano + self.g_amt = self.g_amt+1 --amount � o total de dano elseif (critical) then - self.c_dmg = self.c_dmg+amount --> amount � o total de dano - self.c_amt = self.c_amt+1 --> amount � o total de dano + self.c_dmg = self.c_dmg+amount --amount � o total de dano + self.c_amt = self.c_amt+1 --amount � o total de dano if (amount > self.c_max) then self.c_max = amount end @@ -145,14 +145,14 @@ end if (token == "SPELL_PERIODIC_DAMAGE") then - --> precisa ver se ele tinha na hora que aplicou + --precisa ver se ele tinha na hora que aplicou local SoloDebuffPower = _detalhes.tabela_vigente.SoloDebuffPower if (SoloDebuffPower) then local ThisDebuff = SoloDebuffPower [self.id] if (ThisDebuff) then local ThisDebuffOnTarget = ThisDebuff [serial] if (ThisDebuffOnTarget) then - for index, buff_name in _ipairs (ThisDebuffOnTarget.buffs) do + for index, buff_name in _ipairs(ThisDebuffOnTarget.buffs) do local buff_info = SpellBuffDetails [buff_name] or {["counter"] = 0, ["total"] = 0, ["critico"] = 0, ["critico_dano"] = 0} buff_info.counter = buff_info.counter+1 buff_info.total = buff_info.total+amount @@ -188,7 +188,7 @@ end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> core +--core function _detalhes:UpdateDamageAbilityGears() _recording_ability_with_buffs = _detalhes.RecordPlayerAbilityWithBuffs diff --git a/classes/class_spellhealing.lua b/classes/class_spellhealing.lua index cdae7d9c..0ce6b641 100644 --- a/classes/class_spellhealing.lua +++ b/classes/class_spellhealing.lua @@ -4,7 +4,7 @@ local _ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> constants +--constants local alvo_da_habilidade = _detalhes.alvo_da_habilidade local habilidade_cura = _detalhes.habilidade_cura @@ -13,7 +13,7 @@ local container_playernpc = _detalhes.container_type.CONTAINER_PLAYERNPC ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> internals +--internals function habilidade_cura:NovaTabela (id, link) @@ -22,26 +22,26 @@ id = id, counter = 0, - --> totals + --totals total = 0, totalabsorb = 0, absorbed = 0, overheal = 0, totaldenied = 0, - --> normal hits + --normal hits n_min = 0, n_max = 0, n_amt = 0, n_curado = 0, - --> critical hits + --critical hits c_min = 0, c_max = 0, c_amt = 0, c_curado = 0, - --> targets containers + --targets containers targets = {}, targets_overheal = {}, targets_absorbs = {} @@ -89,8 +89,8 @@ end if (critical) then - self.c_curado = self.c_curado+amount --> amount � o total de dano - self.c_amt = self.c_amt+1 --> amount � o total de dano + self.c_curado = self.c_curado+amount --amount � o total de dano + self.c_amt = self.c_amt+1 --amount � o total de dano if (amount > self.c_max) then self.c_max = amount end diff --git a/classes/class_spellresources.lua b/classes/class_spellresources.lua index d53a3813..6a822647 100644 --- a/classes/class_spellresources.lua +++ b/classes/class_spellresources.lua @@ -4,14 +4,14 @@ local _ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> local pointers +--local pointers local _setmetatable = setmetatable --lua local local _ipairs = ipairs --lua local local _UnitAura = UnitAura --api local ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> constants +--constants local alvo_da_habilidade = _detalhes.alvo_da_habilidade local habilidade_energy = _detalhes.habilidade_e_energy @@ -20,7 +20,7 @@ local container_playernpc = _detalhes.container_type.CONTAINER_PLAYERNPC ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> internals +--internals function habilidade_energy:NovaTabela (id, link, token) diff --git a/classes/class_spellutility.lua b/classes/class_spellutility.lua index 840f0a26..c4de7620 100644 --- a/classes/class_spellutility.lua +++ b/classes/class_spellutility.lua @@ -3,14 +3,14 @@ local _ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> local pointers +--local pointers local _setmetatable = setmetatable --lua local local _ipairs = ipairs --lua local local _UnitAura = UnitAura --api local ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> constants +--constants local alvo_da_habilidade = _detalhes.alvo_da_habilidade local habilidade_misc = _detalhes.habilidade_misc @@ -19,7 +19,7 @@ local container_playernpc = _detalhes.container_type.CONTAINER_PLAYERNPC ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> internals +--internals function habilidade_misc:NovaTabela (id, link, token) @@ -58,14 +58,14 @@ if (spellName == "COOLDOWN") then self.counter = self.counter + 1 - --> target + --target self.targets [nome] = (self.targets [nome] or 0) + 1 elseif (spellName == "BUFF_UPTIME_REFRESH") then if (self.actived_at and self.actived) then self.uptime = self.uptime + _detalhes._tempo - self.actived_at self.refreshamt = self.refreshamt + 1 - token.buff_uptime = token.buff_uptime + _detalhes._tempo - self.actived_at --> token = actor misc object + token.buff_uptime = token.buff_uptime + _detalhes._tempo - self.actived_at --token = actor misc object end self.actived_at = _detalhes._tempo self.actived = true @@ -73,7 +73,7 @@ elseif (spellName == "BUFF_UPTIME_OUT") then if (self.actived_at and self.actived) then self.uptime = self.uptime + _detalhes._tempo - self.actived_at - token.buff_uptime = token.buff_uptime + _detalhes._tempo - self.actived_at --> token = actor misc object + token.buff_uptime = token.buff_uptime + _detalhes._tempo - self.actived_at --token = actor misc object end self.actived = false self.actived_at = nil @@ -84,7 +84,7 @@ self.appliedamt = self.appliedamt + 1 if (self.actived_at and self.actived and spellName == "DEBUFF_UPTIME_IN") then - --> ja esta ativo em outro mob e jogou num novo + --ja esta ativo em outro mob e jogou num novo self.uptime = self.uptime + _detalhes._tempo - self.actived_at token.debuff_uptime = token.debuff_uptime + _detalhes._tempo - self.actived_at end @@ -103,7 +103,7 @@ elseif (spellName == "DEBUFF_UPTIME_OUT") then if (self.actived_at and self.actived) then self.uptime = self.uptime + _detalhes._tempo - self.actived_at - token.debuff_uptime = token.debuff_uptime + _detalhes._tempo - self.actived_at --> token = actor misc object + token.debuff_uptime = token.debuff_uptime + _detalhes._tempo - self.actived_at --token = actor misc object end self.activedamt = self.activedamt - 1 @@ -126,12 +126,12 @@ self.interrompeu_oque [spellID] = self.interrompeu_oque [spellID] + 1 end - --> target + --target self.targets [nome] = (self.targets [nome] or 0) + 1 elseif (token == "SPELL_RESURRECT") then self.ress = (self.ress or 0) + 1 - --> target + --target self.targets [nome] = (self.targets [nome] or 0) + 1 elseif (token == "SPELL_DISPEL" or token == "SPELL_STOLEN") then @@ -143,7 +143,7 @@ self.dispell_oque [spellID] = self.dispell_oque [spellID] + 1 end - --> target + --target self.targets [nome] = (self.targets [nome] or 0) + 1 elseif (token == "SPELL_AURA_BROKEN_SPELL" or token == "SPELL_AURA_BROKEN") then @@ -155,7 +155,7 @@ self.cc_break_oque [spellID] = self.cc_break_oque [spellID] + 1 end - --> target + --target self.targets [nome] = (self.targets [nome] or 0) + 1 end diff --git a/classes/class_utility.lua b/classes/class_utility.lua index 748bae7c..ea121a17 100644 --- a/classes/class_utility.lua +++ b/classes/class_utility.lua @@ -232,7 +232,7 @@ function Details:ShowDeathTooltip(combatObject, deathTable) local source = event[6] if (time + 12 > timeOfDeath) then - if (type (evType) == "boolean") then + if (type(evType) == "boolean") then --is damage or heal? if (evType) then --bool true --damage @@ -284,7 +284,7 @@ function Details:ShowDeathTooltip(combatObject, deathTable) end end - elseif (type (evType) == "number") then + elseif (type(evType) == "number") then if (evType == 1) then --cooldown gameCooltip:AddLine("" .. format("%.1f", time - timeOfDeath) .. "s " .. spellName .. " (" .. source .. ")", "cooldown (" .. healthPercent .. "%)", 1, "white", "white") @@ -414,7 +414,7 @@ function atributo_misc:ReportSingleDeadLine (morte, instancia) end local fonte, _, flags = _detalhes.fontstring_len:GetFont() _detalhes.fontstring_len:SetFont (fonte, fontSize, flags) - _detalhes.fontstring_len:SetText ("thisisspacement") + _detalhes.fontstring_len:SetText("thisisspacement") end local default_len = _detalhes.fontstring_len:GetStringWidth() @@ -422,8 +422,8 @@ function atributo_misc:ReportSingleDeadLine (morte, instancia) local report_array = report_table report_array[1] = {"Details! " .. Loc ["STRING_REPORT_SINGLE_DEATH"] .. " " .. morte [3] .. " " .. Loc ["STRING_ACTORFRAME_REPORTAT"] .. " " .. morte [6], "", "", ""} - for index, evento in ipairs (_detalhes.table.reverse (morte [1])) do - if (evento [1] and type (evento [1]) == "boolean") then --> damage + for index, evento in ipairs(_detalhes.table.reverse (morte [1])) do + 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]) @@ -439,7 +439,7 @@ function atributo_misc:ReportSingleDeadLine (morte, instancia) local source = _detalhes:GetOnlyName (evento [6]) local amount = evento [3] - local hp = _math_floor (evento [5] / max_health * 100) + local hp = _math_floor(evento [5] / max_health * 100) if (hp > 100) then hp = 100 end @@ -447,7 +447,7 @@ function atributo_misc:ReportSingleDeadLine (morte, instancia) tinsert (report_array, {elapsed .. " ", spelllink, " (" .. source .. ")", "-" .. _detalhes:ToK (amount) .. " (" .. hp .. "%) "}) end - elseif (not evento [1] and type (evento [1]) == "boolean") then --> heal + elseif (not evento [1] and type (evento [1]) == "boolean") then --heal local amount = evento [3] @@ -457,7 +457,7 @@ function atributo_misc:ReportSingleDeadLine (morte, instancia) local source = _detalhes:GetOnlyName (evento [6]) local spellname, _, spellicon = _GetSpellInfo(evento [2]) - local hp = _math_floor (evento [5] / max_health * 100) + local hp = _math_floor(evento [5] / max_health * 100) if (hp > 100) then hp = 100 end @@ -469,14 +469,14 @@ function atributo_misc:ReportSingleDeadLine (morte, instancia) end end - elseif (type (evento [1]) == "number" and evento [1] == 4) then --> debuff + 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 source = _detalhes:GetOnlyName (evento [6]) local spellname, _, spellicon = _GetSpellInfo(evento [2]) local stacks = evento [3] - local hp = _math_floor (evento [5] / max_health * 100) + local hp = _math_floor(evento [5] / max_health * 100) if (hp > 100) then hp = 100 end @@ -498,7 +498,7 @@ function atributo_misc:ReportSingleCooldownLine (misc_actor, instancia) reportar = {"Details!: " .. misc_actor.nome .. " - " .. Loc ["STRING_ATTRIBUTE_MISC_DEFENSIVE_COOLDOWNS"]} end - local meu_total = _math_floor (misc_actor.cooldowns_defensive) + local meu_total = _math_floor(misc_actor.cooldowns_defensive) local cooldowns = misc_actor.cooldowns_defensive_spells._ActorTable local cooldowns_used = {} @@ -507,7 +507,7 @@ function atributo_misc:ReportSingleCooldownLine (misc_actor, instancia) end table.sort (cooldowns_used, _detalhes.Sort2) - for i, spell in ipairs (cooldowns_used) do + for i, spell in ipairs(cooldowns_used) do local spelllink = GetSpellLink(spell [1]) reportar [#reportar+1] = spelllink .. ": " .. spell [2] @@ -524,14 +524,14 @@ function atributo_misc:ReportSingleCooldownLine (misc_actor, instancia) end local buff_format_name = function(spellid) - if (_type (spellid) == "string") then + if (_type(spellid) == "string") then return spellid end return _detalhes:GetSpellLink(spellid) end local buff_format_amount = function(t) local total, percent = unpack (t) - local m, s = _math_floor (total / 60), _math_floor (total % 60) + 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) @@ -575,8 +575,8 @@ end function atributo_misc:DeadAtualizarBarra (morte, whichRowLine, colocacao, instancia) - morte ["dead"] = true --> marca que esta tabela � uma tabela de mortes, usado no controla na hora de montar o tooltip - local esta_barra = instancia.barras[whichRowLine] --> pega a refer�ncia da barra na janela + morte ["dead"] = true --marca que esta tabela � uma tabela de mortes, usado no controla na hora de montar o tooltip + local esta_barra = instancia.barras[whichRowLine] --pega a refer�ncia da barra na janela if (not esta_barra) then print ("DEBUG: problema com "..whichRowLine.." "..lugar) @@ -587,7 +587,7 @@ function atributo_misc:DeadAtualizarBarra (morte, whichRowLine, colocacao, insta esta_barra.minha_tabela = morte - morte.nome = morte [3] --> evita dar erro ao redimencionar a janela + morte.nome = morte [3] --evita dar erro ao redimencionar a janela morte.minha_barra = whichRowLine esta_barra.colocacao = colocacao @@ -596,17 +596,17 @@ function atributo_misc:DeadAtualizarBarra (morte, whichRowLine, colocacao, insta morte._custom = true end - esta_barra.lineText1:SetText (colocacao .. ". " .. morte [3]:gsub (("%-.*"), "")) + esta_barra.lineText1:SetText(colocacao .. ". " .. morte [3]:gsub (("%-.*"), "")) esta_barra.lineText2:SetText("") esta_barra.lineText3:SetText("") - esta_barra.lineText4:SetText (morte [6]) + esta_barra.lineText4:SetText(morte [6]) - esta_barra:SetValue (100) + esta_barra:SetValue(100) if (esta_barra.hidden or esta_barra.fading_in or esta_barra.faded) then - Details.FadeHandler.Fader (esta_barra, "out") + Details.FadeHandler.Fader(esta_barra, "out") end - --> seta a cor da barra e a cor do texto caso eles esteja mostrando com a cor da classe + --seta a cor da barra e a cor do texto caso eles esteja mostrando com a cor da classe local r, g, b, a = unpack (_detalhes.class_colors [morte[4]]) _detalhes:SetBarColors (esta_barra, instancia, r, g, b, a) @@ -614,11 +614,11 @@ function atributo_misc:DeadAtualizarBarra (morte, whichRowLine, colocacao, insta local nome = morte[3] local spec = instancia.showing (1, nome) and instancia.showing (1, nome).spec or (instancia.showing (2, nome) and instancia.showing (2, nome).spec) if (spec and spec ~= 0) then - esta_barra.icone_classe:SetTexture (instancia.row_info.spec_file) + esta_barra.icone_classe:SetTexture(instancia.row_info.spec_file) esta_barra.icone_classe:SetTexCoord (unpack (_detalhes.class_specs_coords[spec])) else if (CLASS_ICON_TCOORDS [morte[4]]) then - esta_barra.icone_classe:SetTexture (instancia.row_info.icon_file) + esta_barra.icone_classe:SetTexture(instancia.row_info.icon_file) esta_barra.icone_classe:SetTexCoord (unpack (CLASS_ICON_TCOORDS [morte[4]])) else local texture, l, r, t, b = Details:GetUnknownClassIcon() @@ -628,7 +628,7 @@ function atributo_misc:DeadAtualizarBarra (morte, whichRowLine, colocacao, insta end else if (CLASS_ICON_TCOORDS [morte[4]]) then - esta_barra.icone_classe:SetTexture (instancia.row_info.icon_file) + esta_barra.icone_classe:SetTexture(instancia.row_info.icon_file) esta_barra.icone_classe:SetTexCoord (unpack (CLASS_ICON_TCOORDS [morte[4]])) else local texture, l, r, t, b = Details:GetUnknownClassIcon() @@ -639,47 +639,47 @@ function atributo_misc:DeadAtualizarBarra (morte, whichRowLine, colocacao, insta esta_barra.icone_classe:SetVertexColor (1, 1, 1) - if (esta_barra.mouse_over and not instancia.baseframe.isMoving) then --> precisa atualizar o tooltip + if (esta_barra.mouse_over and not instancia.baseframe.isMoving) then --precisa atualizar o tooltip gump:UpdateTooltip (whichRowLine, esta_barra, instancia) end - esta_barra.lineText1:SetSize (esta_barra:GetWidth() - esta_barra.lineText4:GetStringWidth() - 20, 15) + esta_barra.lineText1:SetSize(esta_barra:GetWidth() - esta_barra.lineText4:GetStringWidth() - 20, 15) end function atributo_misc: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 + local showing = tabela_do_combate [class_type] --o que esta sendo mostrado -> [1] - dano [2] - cura --pega o container com ._NameIndexTable ._ActorTable - if (#showing._ActorTable < 1) then --> n�o h� barras para mostrar + if (#showing._ActorTable < 1) then --n�o h� barras para mostrar return _detalhes:EsconderBarrasNaoUsadas (instancia, showing), "", 0, 0 end local total = 0 instancia.top = 0 - local sub_atributo = instancia.sub_atributo --> o que esta sendo mostrado nesta inst�ncia + local sub_atributo = instancia.sub_atributo --o que esta sendo mostrado nesta inst�ncia local conteudo = showing._ActorTable local amount = #conteudo local modo = instancia.modo if (exportar) then - if (_type (exportar) == "boolean") then - if (sub_atributo == 1) then --> CC BREAKS + if (_type(exportar) == "boolean") then + if (sub_atributo == 1) then --CC BREAKS keyName = "cc_break" - elseif (sub_atributo == 2) then --> RESS + elseif (sub_atributo == 2) then --RESS keyName = "ress" - elseif (sub_atributo == 3) then --> INTERRUPT + elseif (sub_atributo == 3) then --INTERRUPT keyName = "interrupt" - elseif (sub_atributo == 4) then --> DISPELLS + elseif (sub_atributo == 4) then --DISPELLS keyName = "dispell" - elseif (sub_atributo == 5) then --> DEATHS + elseif (sub_atributo == 5) then --DEATHS keyName = "dead" - elseif (sub_atributo == 6) then --> DEFENSIVE COOLDOWNS + elseif (sub_atributo == 6) then --DEFENSIVE COOLDOWNS keyName = "cooldowns_defensive" - elseif (sub_atributo == 7) then --> BUFF UPTIME + elseif (sub_atributo == 7) then --BUFF UPTIME keyName = "buff_uptime" - elseif (sub_atributo == 8) then --> DEBUFF UPTIME + elseif (sub_atributo == 8) then --DEBUFF UPTIME keyName = "debuff_uptime" end else @@ -687,28 +687,28 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo modo = exportar.modo end - elseif (instancia.atributo == 5) then --> custom + elseif (instancia.atributo == 5) then --custom keyName = "custom" total = tabela_do_combate.totals [instancia.customName] else - --> pega qual a sub key que ser� usada - if (sub_atributo == 1) then --> CC BREAKS + --pega qual a sub key que ser� usada + if (sub_atributo == 1) then --CC BREAKS keyName = "cc_break" - elseif (sub_atributo == 2) then --> RESS + elseif (sub_atributo == 2) then --RESS keyName = "ress" - elseif (sub_atributo == 3) then --> INTERRUPT + elseif (sub_atributo == 3) then --INTERRUPT keyName = "interrupt" - elseif (sub_atributo == 4) then --> DISPELLS + elseif (sub_atributo == 4) then --DISPELLS keyName = "dispell" - elseif (sub_atributo == 5) then --> DEATHS + elseif (sub_atributo == 5) then --DEATHS keyName = "dead" - elseif (sub_atributo == 6) then --> DEFENSIVE COOLDOWNS + elseif (sub_atributo == 6) then --DEFENSIVE COOLDOWNS keyName = "cooldowns_defensive" - elseif (sub_atributo == 7) then --> BUFF UPTIME + elseif (sub_atributo == 7) then --BUFF UPTIME keyName = "buff_uptime" - elseif (sub_atributo == 8) then --> DEBUFF UPTIME + elseif (sub_atributo == 8) then --DEBUFF UPTIME keyName = "debuff_uptime" end @@ -725,7 +725,7 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo if (total < 1) then instancia:EsconderScrollBar() - return _detalhes:EndRefresh (instancia, total, tabela_do_combate, showing) --> retorna a tabela que precisa ganhar o refresh + return _detalhes:EndRefresh (instancia, total, tabela_do_combate, showing) --retorna a tabela que precisa ganhar o refresh end --estra mostrando ALL ent�o posso seguir o padr�o correto? primeiro, atualiza a scroll bar... @@ -736,23 +736,23 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo local barras_container = instancia.barras local percentage_type = instancia.row_info.percent_type - for i = instancia.barraS[1], instancia.barraS[2], 1 do --> vai atualizar s� o range que esta sendo mostrado - if (mortes[i]) then --> corre��o para um raro e desconhecido problema onde mortes[i] � nil + for i = instancia.barraS[1], instancia.barraS[2], 1 do --vai atualizar s� o range que esta sendo mostrado + if (mortes[i]) then --corre��o para um raro e desconhecido problema onde mortes[i] � nil atributo_misc:DeadAtualizarBarra (mortes[i], whichRowLine, i, instancia) whichRowLine = whichRowLine+1 end end - return _detalhes:EndRefresh (instancia, total, tabela_do_combate, showing) --> retorna a tabela que precisa ganhar o refresh + return _detalhes:EndRefresh (instancia, total, tabela_do_combate, showing) --retorna a tabela que precisa ganhar o refresh else - if (instancia.atributo == 5) then --> custom - --> faz o sort da categoria e retorna o amount corrigido + if (instancia.atributo == 5) then --custom + --faz o sort da categoria e retorna o amount corrigido table.sort (conteudo, _detalhes.SortIfHaveKey) - --> n�o mostrar resultados com zero - for i = amount, 1, -1 do --> de tr�s pra frente + --n�o mostrar resultados com zero + for i = amount, 1, -1 do --de tr�s pra frente if (not conteudo[i][keyName] or conteudo[i][keyName] < 1) then amount = amount - 1 else @@ -760,18 +760,18 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo end end - --> pega o total ja aplicado na tabela do combate + --pega o total ja aplicado na tabela do combate total = tabela_do_combate.totals [class_type] [keyName] - --> grava o total + --grava o total instancia.top = conteudo[1][keyName] - elseif (modo == modo_ALL) then --> mostrando ALL + elseif (modo == modo_ALL) then --mostrando ALL table.sort (conteudo, _detalhes.SortIfHaveKey) - --> n�o mostrar resultados com zero - for i = amount, 1, -1 do --> de tr�s pra frente + --n�o mostrar resultados com zero + for i = amount, 1, -1 do --de tr�s pra frente if (not conteudo[i][keyName] or conteudo[i][keyName] < 1) then amount = amount - 1 else @@ -779,23 +779,23 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo end end - --> pega o total ja aplicado na tabela do combate + --pega o total ja aplicado na tabela do combate total = tabela_do_combate.totals [class_type] [keyName] - --> grava o total + --grava o total instancia.top = conteudo[1][keyName] - elseif (modo == modo_GROUP) then --> mostrando GROUP + elseif (modo == modo_GROUP) then --mostrando GROUP --if (refresh_needed) then table.sort (conteudo, _detalhes.SortGroupIfHaveKey) --end - for index, player in ipairs (conteudo) do - if (player.grupo) then --> � um player e esta em grupo - if (not player[keyName] or player[keyName] < 1) then --> dano menor que 1, interromper o loop + for index, player in ipairs(conteudo) do + if (player.grupo) then --� um player e esta em grupo + if (not player[keyName] or player[keyName] < 1) then --dano menor que 1, interromper o loop amount = index - 1 break - elseif (index == 1) then --> esse IF aqui, precisa mesmo ser aqui? n�o daria pra pega-lo com uma chave [1] nad grupo == true? + elseif (index == 1) then --esse IF aqui, precisa mesmo ser aqui? n�o daria pra pega-lo com uma chave [1] nad grupo == true? instancia.top = conteudo[1][keyName] end @@ -809,16 +809,16 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo end end - --> refaz o mapa do container + --refaz o mapa do container showing:remapear() if (exportar) then return total, keyName, instancia.top, amount end - if (amount < 1) then --> n�o h� barras para mostrar - instancia:EsconderScrollBar() --> precisaria esconder a scroll bar - return _detalhes:EndRefresh (instancia, total, tabela_do_combate, showing) --> retorna a tabela que precisa ganhar o refresh + if (amount < 1) then --n�o h� barras para mostrar + instancia:EsconderScrollBar() --precisaria esconder a scroll bar + return _detalhes:EndRefresh (instancia, total, tabela_do_combate, showing) --retorna a tabela que precisa ganhar o refresh end --estra mostrando ALL ent�o posso seguir o padr�o correto? primeiro, atualiza a scroll bar... @@ -841,13 +841,13 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo UsingCustomRightText = instancia.row_info.textR_enable_custom_text if (instancia.bars_sort_direction == 1) then --top to bottom - for i = instancia.barraS[1], instancia.barraS[2], 1 do --> vai atualizar s� o range que esta sendo mostrado + for i = instancia.barraS[1], instancia.barraS[2], 1 do --vai atualizar s� o range que esta sendo mostrado conteudo[i]:RefreshLine (instancia, barras_container, whichRowLine, i, total, sub_atributo, forcar, keyName, nil, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) whichRowLine = whichRowLine+1 end elseif (instancia.bars_sort_direction == 2) then --bottom to top - for i = instancia.barraS[2], instancia.barraS[1], -1 do --> vai atualizar s� o range que esta sendo mostrado + for i = instancia.barraS[2], instancia.barraS[1], -1 do --vai atualizar s� o range que esta sendo mostrado if (conteudo[i]) then conteudo[i]:RefreshLine (instancia, barras_container, whichRowLine, i, total, sub_atributo, forcar, keyName, nil, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) whichRowLine = whichRowLine+1 @@ -860,9 +860,9 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo instancia:PerformAnimations (whichRowLine-1) end - if (instancia.atributo == 5) then --> custom - --> zerar o .custom dos_ Actors - for index, player in ipairs (conteudo) do + if (instancia.atributo == 5) then --custom + --zerar o .custom dos_ Actors + for index, player in ipairs(conteudo) do if (player.custom > 0) then player.custom = 0 else @@ -871,16 +871,16 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo end end - --> beta, hidar barras n�o usadas durante um refresh for�ado + --beta, hidar barras n�o usadas durante um refresh for�ado if (forcar) then - if (instancia.modo == 2) then --> group + 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 - return _detalhes:EndRefresh (instancia, total, tabela_do_combate, showing) --> retorna a tabela que precisa ganhar o refresh + return _detalhes:EndRefresh (instancia, total, tabela_do_combate, showing) --retorna a tabela que precisa ganhar o refresh end @@ -888,7 +888,7 @@ local actor_class_color_r, actor_class_color_g, actor_class_color_b function atributo_misc:RefreshLine (instancia, barras_container, whichRowLine, lugar, total, sub_atributo, forcar, keyName, is_dead, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) - local esta_barra = instancia.barras[whichRowLine] --> pega a refer�ncia da barra na janela + local esta_barra = instancia.barras[whichRowLine] --pega a refer�ncia da barra na janela if (not esta_barra) then print ("DEBUG: problema com "..whichRowLine.." "..lugar) @@ -903,7 +903,7 @@ function atributo_misc:RefreshLine (instancia, barras_container, whichRowLine, l self.minha_barra = esta_barra self.colocacao = lugar - local meu_total = _math_floor (self [keyName] or 0) --> total + local meu_total = _math_floor(self [keyName] or 0) --total if (not meu_total) then return end @@ -915,7 +915,7 @@ function atributo_misc:RefreshLine (instancia, barras_container, whichRowLine, l porcentagem = _cstr ("%.1f", meu_total / instancia.top * 100) end - local esta_porcentagem = _math_floor ((meu_total/instancia.top) * 100) + local esta_porcentagem = _math_floor((meu_total/instancia.top) * 100) if (not bars_show_data [1]) then meu_total = "" @@ -928,7 +928,7 @@ function atributo_misc:RefreshLine (instancia, barras_container, whichRowLine, l local rightText = meu_total .. bars_brackets[1] .. porcentagem .. bars_brackets[2] if (UsingCustomRightText) then - esta_barra.lineText4:SetText (_string_replace (instancia.row_info.textR_custom_text, meu_total, "", porcentagem, self, instancia.showing, instancia, rightText)) + esta_barra.lineText4:SetText(_string_replace (instancia.row_info.textR_custom_text, meu_total, "", porcentagem, self, instancia.showing, instancia, rightText)) else if (instancia.use_multi_fontstrings) then instancia:SetInLineTexts(esta_barra, "", meu_total, porcentagem) @@ -937,7 +937,7 @@ function atributo_misc:RefreshLine (instancia, barras_container, whichRowLine, l end end - if (esta_barra.mouse_over and not instancia.baseframe.isMoving) then --> precisa atualizar o tooltip + if (esta_barra.mouse_over and not instancia.baseframe.isMoving) then --precisa atualizar o tooltip gump:UpdateTooltip (whichRowLine, esta_barra, instancia) end @@ -948,13 +948,13 @@ end function atributo_misc:RefreshBarra2 (esta_barra, instancia, tabela_anterior, forcar, esta_porcentagem, whichRowLine, barras_container, use_animations) - --> primeiro colocado + --primeiro colocado if (esta_barra.colocacao == 1) then if (not tabela_anterior or tabela_anterior ~= esta_barra.minha_tabela or forcar) then - esta_barra:SetValue (100) + esta_barra:SetValue(100) if (esta_barra.hidden or esta_barra.fading_in or esta_barra.faded) then - Details.FadeHandler.Fader (esta_barra, "out") + Details.FadeHandler.Fader(esta_barra, "out") end return self:RefreshBarra (esta_barra, instancia) @@ -968,11 +968,11 @@ function atributo_misc:RefreshBarra2 (esta_barra, instancia, tabela_anterior, fo if (use_animations) then esta_barra.animacao_fim = esta_porcentagem else - esta_barra:SetValue (esta_porcentagem) + esta_barra:SetValue(esta_porcentagem) esta_barra.animacao_ignorar = true end - Details.FadeHandler.Fader (esta_barra, "out") + Details.FadeHandler.Fader(esta_barra, "out") if (instancia.row_info.texture_class_colors) then esta_barra.textura:SetVertexColor (actor_class_color_r, actor_class_color_g, actor_class_color_b) @@ -984,26 +984,26 @@ function atributo_misc:RefreshBarra2 (esta_barra, instancia, tabela_anterior, fo return self:RefreshBarra (esta_barra, instancia) else - --> agora esta comparando se a tabela da barra � diferente da tabela na atualiza��o anterior - if (not tabela_anterior or tabela_anterior ~= esta_barra.minha_tabela or forcar) then --> aqui diz se a barra do jogador mudou de posi��o ou se ela apenas ser� atualizada + --agora esta comparando se a tabela da barra � diferente da tabela na atualiza��o anterior + if (not tabela_anterior or tabela_anterior ~= esta_barra.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 esta_barra.animacao_fim = esta_porcentagem else - esta_barra:SetValue (esta_porcentagem) + esta_barra:SetValue(esta_porcentagem) esta_barra.animacao_ignorar = true end - esta_barra.last_value = esta_porcentagem --> reseta o ultimo valor da barra + esta_barra.last_value = esta_porcentagem --reseta o ultimo valor da barra return self:RefreshBarra (esta_barra, instancia) - elseif (esta_porcentagem ~= esta_barra.last_value) then --> continua mostrando a mesma tabela ent�o compara a porcentagem - --> apenas atualizar + elseif (esta_porcentagem ~= esta_barra.last_value) then --continua mostrando a mesma tabela ent�o compara a porcentagem + --apenas atualizar if (use_animations) then esta_barra.animacao_fim = esta_porcentagem else - esta_barra:SetValue (esta_porcentagem) + esta_barra:SetValue(esta_porcentagem) end esta_barra.last_value = esta_porcentagem @@ -1022,14 +1022,14 @@ function atributo_misc:RefreshBarra (esta_barra, instancia, from_resize) actor_class_color_r, actor_class_color_g, actor_class_color_b = self:GetBarColor() end - --> icon + --icon self:SetClassIcon (esta_barra.icone_classe, instancia, class) - --> texture color + --texture color self:SetBarColors (esta_barra, instancia, actor_class_color_r, actor_class_color_g, actor_class_color_b) - --> left text + --left text self:SetBarLeftText (esta_barra, instancia, enemy, arena_enemy, arena_ally, UsingCustomLeftText) - esta_barra.lineText1:SetSize (esta_barra:GetWidth() - esta_barra.lineText4:GetStringWidth() - 20, 15) + esta_barra.lineText1:SetSize(esta_barra:GetWidth() - esta_barra.lineText4:GetStringWidth() - 20, 15) end --------------------------------------------- // TOOLTIPS // --------------------------------------------- @@ -1065,7 +1065,7 @@ function atributo_misc:ToolTip(instance, numero, barFrame, keydown) end end ---> tooltip locals +--tooltip locals local r, g, b local barAlha = .6 @@ -1087,7 +1087,7 @@ function atributo_misc:ToolTipCC (instancia, numero, barra) local meu_total = self ["cc_break"] local habilidades = self.cc_break_spells._ActorTable - --> habilidade usada para tirar o CC + --habilidade usada para tirar o CC local icon_size = _detalhes.tooltip.icon_size local icon_border = _detalhes.tooltip.icon_border_texcoord local lineHeight = _detalhes.tooltip.line_height @@ -1095,13 +1095,13 @@ function atributo_misc:ToolTipCC (instancia, numero, barra) for _spellid, _tabela in pairs (habilidades) do - --> quantidade + --quantidade 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) - --> o que quebrou + --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) @@ -1111,7 +1111,7 @@ function atributo_misc:ToolTipCC (instancia, numero, barra) GameCooltip:AddStatusBar (100, 1, 1, 0, 0, .2) end - --> em quem quebrou + --em quem quebrou for target_name, amount in pairs (_tabela.targets) do GameCooltip:AddLine (target_name .. ": ", amount .. " ") @@ -1140,14 +1140,14 @@ function atributo_misc:ToolTipDispell (instancia, numero, barra) r, g, b = unpack (_detalhes.class_colors [self.classe]) end - local meu_total = _math_floor (self ["dispell"]) + local meu_total = _math_floor(self ["dispell"]) local habilidades = self.dispell_spells._ActorTable ---> habilidade usada para dispelar +--habilidade usada para dispelar local meus_dispells = {} for _spellid, _tabela in pairs (habilidades) do if (_tabela.dispell) then - meus_dispells [#meus_dispells+1] = {_spellid, _math_floor (_tabela.dispell)} --_math_floor valor é nil, uma magia na tabela de dispel, sem dispel? + meus_dispells [#meus_dispells+1] = {_spellid, _math_floor(_tabela.dispell)} --_math_floor valor é nil, uma magia na tabela de dispel, sem dispel? else Details:Msg("D! table.dispell is invalid. spellId:", _spellid) end @@ -1172,7 +1172,7 @@ function atributo_misc:ToolTipDispell (instancia, numero, barra) GameTooltip:AddLine (Loc ["STRING_NO_SPELL"]) end ---> quais habilidades foram dispaladas +--quais habilidades foram dispaladas local buffs_dispelados = {} for _spellid, amt in pairs (self.dispell_oque) do buffs_dispelados [#buffs_dispelados+1] = {_spellid, amt} @@ -1192,11 +1192,11 @@ function atributo_misc:ToolTipDispell (instancia, numero, barra) end end ---> alvos dispelados +--alvos dispelados local alvos_dispelados = {} for target_name, amount in pairs (self.dispell_targets) do - alvos_dispelados [#alvos_dispelados + 1] = {target_name, _math_floor (amount), amount / meu_total * 100} + alvos_dispelados [#alvos_dispelados + 1] = {target_name, _math_floor(amount), amount / meu_total * 100} end table.sort (alvos_dispelados, _detalhes.Sort2) @@ -1226,16 +1226,16 @@ function atributo_misc:ToolTipDispell (instancia, numero, barra) end end ---> Pet +--Pet local meus_pets = self.pets - if (#meus_pets > 0) then --> teve ajudantes + if (#meus_pets > 0) then --teve ajudantes - local quantidade = {} --> armazena a quantidade de pets iguais - local interrupts = {} --> armazena as habilidades - local alvos = {} --> armazena os alvos - local totais = {} --> armazena o dano total de cada objeto + local quantidade = {} --armazena a quantidade de pets iguais + local interrupts = {} --armazena as habilidades + local alvos = {} --armazena os alvos + local totais = {} --armazena o dano total de cada objeto - for index, nome in ipairs (meus_pets) do + for index, nome in ipairs(meus_pets) do if (not quantidade [nome]) then quantidade [nome] = 1 @@ -1258,7 +1258,7 @@ function atributo_misc:ToolTipDispell (instancia, numero, barra) ismaximized = true end - for index, _table in ipairs (totais) do + for index, _table in ipairs(totais) do if (_table [2] > 0 and (index < 3 or ismaximized)) then @@ -1270,7 +1270,7 @@ function atributo_misc:ToolTipDispell (instancia, numero, barra) end local n = _table [1]:gsub (("%s%<.*"), "") - GameCooltip:AddLine (n, _table [2] .. " (" .. _math_floor (_table [2]/self.dispell*100) .. "%)") + GameCooltip:AddLine (n, _table [2] .. " (" .. _math_floor(_table [2]/self.dispell*100) .. "%)") _detalhes:AddTooltipBackgroundStatusbar() GameCooltip:AddIcon ([[Interface\AddOns\Details\images\classes_small]], 1, 1, 14, 14, 0.25, 0.49609375, 0.75, 1) end @@ -1288,9 +1288,9 @@ function _detalhes:CloseEnemyDebuffsUptime() local combat = _detalhes.tabela_vigente local misc_container = combat [4]._ActorTable - for _, actor in ipairs (misc_container) do + for _, actor in ipairs(misc_container) do if (actor.boss_debuff) then - for target_name, target in ipairs (actor.debuff_uptime_targets) do + for target_name, target in ipairs(actor.debuff_uptime_targets) do if (target.actived and target.actived_at) then target.uptime = target.uptime + _detalhes._tempo - target.actived_at actor.debuff_uptime = actor.debuff_uptime + _detalhes._tempo - target.actived_at @@ -1310,7 +1310,7 @@ function _detalhes:CatchRaidDebuffUptime (in_or_out) -- "DEBUFF_UPTIME_IN" local combat = _detalhes.tabela_vigente local misc_container = combat [4]._ActorTable - for _, actor in ipairs (misc_container) do + for _, actor in ipairs(misc_container) do if (actor.debuff_uptime) then for spellid, spell in pairs (actor.debuff_uptime_spells._ActorTable) do if (spell.actived and spell.actived_at) then @@ -1431,7 +1431,7 @@ function _detalhes:CatchRaidDebuffUptime (in_or_out) -- "DEBUFF_UPTIME_IN" end end ---> this shouldn't be hardcoded +--this shouldn't be hardcoded local runes_id = { [175457] = true, -- focus [175456] = true, --hyper @@ -1446,7 +1446,7 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) local pot_usage = {} local focus_augmentation = {} - --> raid groups + --raid groups local cacheGetTime = GetTime() for raidIndex = 1, _GetNumGroupMembers() do @@ -1479,7 +1479,7 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) end if (in_or_out == "BUFF_UPTIME_IN") then - local string_output = "pre-potion: " --> localize-me + local string_output = "pre-potion: " --localize-me for playername, potspellid in pairs (pot_usage) do local name, _, icon = _GetSpellInfo(potspellid) @@ -1493,7 +1493,7 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) _detalhes.pre_pot_used = string_output - _detalhes:SendEvent ("COMBAT_PREPOTION_UPDATED", nil, pot_usage, focus_augmentation) + _detalhes:SendEvent("COMBAT_PREPOTION_UPDATED", nil, pot_usage, focus_augmentation) end elseif (_IsInGroup()) then @@ -1564,7 +1564,7 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) end _detalhes.pre_pot_used = string_output - _detalhes:SendEvent ("COMBAT_PREPOTION_UPDATED", nil, pot_usage, focus_augmentation) + _detalhes:SendEvent("COMBAT_PREPOTION_UPDATED", nil, pot_usage, focus_augmentation) end else @@ -1605,7 +1605,7 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) end _detalhes.pre_pot_used = string_output - _detalhes:SendEvent ("COMBAT_PREPOTION_UPDATED", nil, pot_usage, focus_augmentation) + _detalhes:SendEvent("COMBAT_PREPOTION_UPDATED", nil, pot_usage, focus_augmentation) end --]] @@ -1630,7 +1630,7 @@ function atributo_misc:ToolTipDebuffUptime (instancia, numero, barra) local meu_total = self ["debuff_uptime"] local minha_tabela = self.debuff_uptime_spells._ActorTable ---> habilidade usada para interromper +--habilidade usada para interromper local debuffs_usados = {} local _combat_time = instancia.showing:GetCombatTime() @@ -1653,7 +1653,7 @@ function atributo_misc:ToolTipDebuffUptime (instancia, numero, barra) if (esta_habilidade[2] > 0) then local nome_magia, _, icone_magia = _GetSpellInfo(esta_habilidade[1]) - local minutos, segundos = _math_floor (esta_habilidade[2]/60), _math_floor (esta_habilidade[2]%60) + local minutos, segundos = _math_floor(esta_habilidade[2]/60), _math_floor(esta_habilidade[2]%60) if (esta_habilidade[2] >= _combat_time) then --GameCooltip:AddLine (nome_magia, minutos .. "m " .. segundos .. "s" .. " (" .. _cstr ("%.1f", esta_habilidade[2] / _combat_time * 100) .. "%)", nil, "gray", "gray") --GameCooltip:AddStatusBar (100, nil, 1, 0, 1, .3, false) @@ -1741,10 +1741,10 @@ function atributo_misc:ToolTipDefensiveCooldowns (instancia, numero, barra) r, g, b = unpack (_detalhes.class_colors [self.classe]) end - local meu_total = _math_floor (self ["cooldowns_defensive"]) + local meu_total = _math_floor(self ["cooldowns_defensive"]) local minha_tabela = self.cooldowns_defensive_spells._ActorTable ---> spells +--spells local cooldowns_usados = {} for _spellid, _tabela in pairs (minha_tabela) do @@ -1771,7 +1771,7 @@ function atributo_misc:ToolTipDefensiveCooldowns (instancia, numero, barra) GameCooltip:AddLine (Loc ["STRING_NO_SPELL"]) end ---> targets +--targets local meus_alvos = self.cooldowns_defensive_targets local alvos = {} @@ -1830,7 +1830,7 @@ function atributo_misc:ToolTipRess (instancia, numero, barra) local lineHeight = _detalhes.tooltip.line_height local icon_border = _detalhes.tooltip.icon_border_texcoord ---> habilidade usada para interromper +--habilidade usada para interromper local meus_ress = {} for _spellid, _tabela in pairs (minha_tabela) do @@ -1853,7 +1853,7 @@ function atributo_misc:ToolTipRess (instancia, numero, barra) GameCooltip:AddLine (Loc ["STRING_NO_SPELL"]) end ---> quem foi que o cara reviveu +--quem foi que o cara reviveu local meus_alvos = self.ress_targets local alvos = {} @@ -1912,7 +1912,7 @@ function atributo_misc:ToolTipInterrupt (instancia, numero, barra) local icon_border = _detalhes.tooltip.icon_border_texcoord local lineHeight = _detalhes.tooltip.line_height ---> habilidade usada para interromper +--habilidade usada para interromper local meus_interrupts = {} for _spellid, _tabela in pairs (minha_tabela) do @@ -1935,7 +1935,7 @@ function atributo_misc:ToolTipInterrupt (instancia, numero, barra) GameTooltip:AddLine (Loc ["STRING_NO_SPELL"]) end ---> quais habilidades foram interrompidas +--quais habilidades foram interrompidas local habilidades_interrompidas = {} for _spellid, amt in pairs (self.interrompeu_oque) do @@ -1956,16 +1956,16 @@ function atributo_misc:ToolTipInterrupt (instancia, numero, barra) end end ---> Pet +--Pet local meus_pets = self.pets - if (#meus_pets > 0) then --> teve ajudantes + if (#meus_pets > 0) then --teve ajudantes - local quantidade = {} --> armazena a quantidade de pets iguais - local interrupts = {} --> armazena as habilidades - local alvos = {} --> armazena os alvos - local totais = {} --> armazena o dano total de cada objeto + local quantidade = {} --armazena a quantidade de pets iguais + local interrupts = {} --armazena as habilidades + local alvos = {} --armazena os alvos + local totais = {} --armazena o dano total de cada objeto - for index, nome in ipairs (meus_pets) do + for index, nome in ipairs(meus_pets) do if (not quantidade [nome]) then quantidade [nome] = 1 @@ -1988,7 +1988,7 @@ function atributo_misc:ToolTipInterrupt (instancia, numero, barra) ismaximized = true end - for index, _table in ipairs (totais) do + for index, _table in ipairs(totais) do if (_table [2] > 0 and (index < 3 or ismaximized)) then @@ -2000,7 +2000,7 @@ function atributo_misc:ToolTipInterrupt (instancia, numero, barra) end local n = _table [1]:gsub (("%s%<.*"), "") - GameCooltip:AddLine (n, _table [2] .. " (" .. _math_floor (_table [2]/self.interrupt*100) .. "%)") + GameCooltip:AddLine (n, _table [2] .. " (" .. _math_floor(_table [2]/self.interrupt*100) .. "%)") _detalhes:AddTooltipBackgroundStatusbar() GameCooltip:AddIcon ([[Interface\AddOns\Details\images\classes_small]], 1, 1, 14, 14, 0.25, 0.49609375, 0.75, 1) end @@ -2015,16 +2015,16 @@ end --------------------------------------------- // JANELA DETALHES // --------------------------------------------- ----------> DETALHES BIFURCA��O +---------DETALHES BIFURCA��O function atributo_misc:MontaInfo() - if (info.sub_atributo == 3) then --> interrupt + if (info.sub_atributo == 3) then --interrupt return self:MontaInfoInterrupt() end end ----------> DETALHES bloco da direita BIFURCA��O +---------DETALHES bloco da direita BIFURCA��O function atributo_misc:MontaDetalhes (spellid, barra) - if (info.sub_atributo == 3) then --> interrupt + if (info.sub_atributo == 3) then --interrupt return self:MontaDetalhesInterrupt (spellid, barra) end end @@ -2046,18 +2046,18 @@ function atributo_misc:MontaInfoInterrupt() local meus_interrupts = {} --player - for _spellid, _tabela in pairs (minha_tabela) do --> da foreach em cada spellid do container + for _spellid, _tabela in pairs (minha_tabela) do --da foreach em cada spellid do container local nome, _, icone = _GetSpellInfo(_spellid) _table_insert (meus_interrupts, {_spellid, _tabela.counter, _tabela.counter/meu_total*100, nome, icone}) end --pet local ActorPets = self.pets local class_color = "FFDDDDDD" - for _, PetName in ipairs (ActorPets) do + for _, PetName in ipairs(ActorPets) do local PetActor = instancia.showing (class_type, PetName) 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 + for _spellid, _skill in pairs (PetSkillsContainer) do --da foreach em cada spellid do container 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 @@ -2069,25 +2069,25 @@ function atributo_misc:MontaInfoInterrupt() local amt = #meus_interrupts gump:JI_AtualizaContainerBarras (amt) - local max_ = meus_interrupts [1][2] --> dano que a primeiro magia vez + local max_ = meus_interrupts [1][2] --dano que a primeiro magia vez local barra - for index, tabela in ipairs (meus_interrupts) do + for index, tabela in ipairs(meus_interrupts) do barra = barras [index] - if (not barra) then --> se a barra n�o existir, criar ela ent�o + if (not barra) then --se a barra n�o existir, criar ela ent�o barra = gump:CriaNovaBarraInfo1 (instancia, index) - barra.textura:SetStatusBarColor (1, 1, 1, 1) --> isso aqui � a parte da sele��o e descele��o - barra.on_focus = false --> isso aqui � a parte da sele��o e descele��o + barra.textura:SetStatusBarColor (1, 1, 1, 1) --isso aqui � a parte da sele��o e descele��o + barra.on_focus = false --isso aqui � a parte da sele��o e descele��o end - --> isso aqui � tudo da sele��o e descele��o das barras + --isso aqui � tudo da sele��o e descele��o das barras if (not info.mostrando_mouse_over) then - if (tabela[1] == self.detalhes) then --> tabela [1] = spellid = spellid que esta na caixa da direita - if (not barra.on_focus) then --> se a barra n�o tiver no foco + if (tabela[1] == self.detalhes) then --tabela [1] = spellid = spellid que esta na caixa da direita + if (not barra.on_focus) then --se a barra n�o tiver no foco barra.textura:SetStatusBarColor (129/255, 125/255, 69/255, 1) barra.on_focus = true if (not info.mostrando) then @@ -2096,34 +2096,34 @@ function atributo_misc:MontaInfoInterrupt() end else if (barra.on_focus) then - barra.textura:SetStatusBarColor (1, 1, 1, 1) --> volta a cor antiga - barra:SetAlpha (.9) --> volta a alfa antiga + barra.textura:SetStatusBarColor (1, 1, 1, 1) --volta a cor antiga + barra:SetAlpha (.9) --volta a alfa antiga barra.on_focus = false end end 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 (tabela[2] .." ".. instancia.divisores.abre .._cstr("%.1f", tabela[3]) .."%".. instancia.divisores.fecha) --seta o texto da direita + barra.lineText1:SetText(index..instancia.divisores.colocacao..tabela[4]) --seta o texto da esqueda + barra.lineText4:SetText(tabela[2] .." ".. instancia.divisores.abre .._cstr("%.1f", tabela[3]) .."%".. instancia.divisores.fecha) --seta o texto da direita - barra.icone:SetTexture (tabela[5]) + barra.icone:SetTexture(tabela[5]) - barra.minha_tabela = self --> grava o jogador na barrinho... � estranho pq todas as barras v�o ter o mesmo valor do jogador - barra.show = tabela[1] --> grava o spellid na barra - barra:Show() --> mostra a barra + barra.minha_tabela = self --grava o jogador na barrinho... � estranho pq todas as barras v�o ter o mesmo valor do jogador + barra.show = tabela[1] --grava o spellid na barra + barra:Show() --mostra a barra if (self.detalhes and self.detalhes == barra.show) then - self:MontaDetalhes (self.detalhes, barra) --> poderia deixar isso pro final e montar uma tail call?? + self:MontaDetalhes (self.detalhes, barra) --poderia deixar isso pro final e montar uma tail call?? end end - --> Alvos do interrupt + --Alvos do interrupt local meus_alvos = {} for target_name, amount in pairs (self.interrupt_targets) do meus_alvos [#meus_alvos+1] = {target_name, amount} @@ -2139,7 +2139,7 @@ function atributo_misc:MontaInfoInterrupt() local max_alvos = meus_alvos[1][2] local barra - for index, tabela in ipairs (meus_alvos) do + for index, tabela in ipairs(meus_alvos) do barra = info.barras2 [index] @@ -2149,15 +2149,15 @@ function atributo_misc:MontaInfoInterrupt() end if (index == 1) then - barra.textura:SetValue (100) + barra.textura:SetValue(100) else - barra.textura:SetValue (tabela[2]/max_alvos*100) + barra.textura:SetValue(tabela[2]/max_alvos*100) end - barra.lineText1:SetText (index..instancia.divisores.colocacao..tabela[1]) --seta o texto da esqueda - barra.lineText4:SetText (tabela[2] .." ".. instancia.divisores.abre .._cstr("%.1f", tabela[2]/meu_total*100) .. instancia.divisores.fecha) --seta o texto da direita + barra.lineText1:SetText(index..instancia.divisores.colocacao..tabela[1]) --seta o texto da esqueda + barra.lineText4:SetText(tabela[2] .." ".. instancia.divisores.abre .._cstr("%.1f", tabela[2]/meu_total*100) .. instancia.divisores.fecha) --seta o texto da direita - if (barra.mouse_over) then --> atualizar o tooltip + if (barra.mouse_over) then --atualizar o tooltip if (barra.isAlvo) then GameTooltip:Hide() GameTooltip:SetOwner (barra, "ANCHOR_TOPRIGHT") @@ -2168,8 +2168,8 @@ function atributo_misc:MontaInfoInterrupt() 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? + barra.minha_tabela = self --grava o jogador na tabela + barra.nome_inimigo = tabela [1] --salva o nome do inimigo na barra --isso � necess�rio? barra:Show() end @@ -2180,7 +2180,7 @@ end ------ Detalhe Info Interrupt function atributo_misc:MontaDetalhesInterrupt (spellid, barra) - for _, barra in ipairs (info.barras3) do + for _, barra in ipairs(info.barras3) do barra:Hide() end @@ -2189,11 +2189,11 @@ function atributo_misc:MontaDetalhesInterrupt (spellid, barra) return end - --> icone direito superior + --icone direito superior local nome, _, icone = _GetSpellInfo(spellid) local infospell = {nome, nil, icone} - _detalhes.playerDetailWindow.spell_icone:SetTexture (infospell[3]) + _detalhes.playerDetailWindow.spell_icone:SetTexture(infospell[3]) local total = self.interrupt local meu_total = esta_magia.counter @@ -2213,28 +2213,28 @@ function atributo_misc:MontaDetalhesInterrupt (spellid, barra) local max_ = habilidades_alvos[1][2] local barra - for index, tabela in ipairs (habilidades_alvos) do + for index, tabela in ipairs(habilidades_alvos) do barra = barras [index] - if (not barra) then --> se a barra n�o existir, criar ela ent�o + if (not barra) then --se a barra n�o existir, criar ela ent�o barra = gump:CriaNovaBarraInfo3 (instancia, index) - barra.textura:SetStatusBarColor (1, 1, 1, 1) --> isso aqui � a parte da sele��o e descele��o + 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 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 + 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 - barra.icone:SetTexture (icone) + barra.icone:SetTexture(icone) - barra:Show() --> mostra a barra + barra:Show() --mostra a barra if (index == 15) then break @@ -2257,10 +2257,10 @@ function atributo_misc:MontaTooltipAlvos (esta_barra, index) local total = self.interrupt for spellid, tabela in pairs (container) do - --> tabela = classe_damage_habilidade + --tabela = classe_damage_habilidade local alvos = tabela.targets - for target_name, amount in ipairs (alvos) do - --> tabela = classe_target + for target_name, amount in ipairs(alvos) do + --tabela = classe_target if (target_name == inimigo) then habilidades [#habilidades+1] = {spellid, amount} end @@ -2273,7 +2273,7 @@ function atributo_misc:MontaTooltipAlvos (esta_barra, index) GameTooltip:AddLine (Loc ["STRING_SPELL_INTERRUPTED"] .. ":") GameTooltip:AddLine (" ") - for index, tabela in ipairs (habilidades) do + for index, tabela in ipairs(habilidades) do 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) @@ -2292,9 +2292,9 @@ function atributo_misc:Iniciar (iniciar) end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> core functions +--core functions - --> atualize a funcao de abreviacao + --atualize a funcao de abreviacao function atributo_misc:UpdateSelectedToKFunction() SelectedToKFunction = ToKFunctions [_detalhes.ps_abbreviation] FormatTooltipNumber = ToKFunctions [_detalhes.tooltip.abbreviation] @@ -2305,9 +2305,9 @@ end local sub_list = {"cc_break", "ress", "interrupt", "cooldowns_defensive", "dispell", "dead"} - --> subtract total from a combat table + --subtract total from a combat table function atributo_misc:subtract_total (combat_table) - for _, sub_attribute in ipairs (sub_list) do + for _, sub_attribute in ipairs(sub_list) do if (self [sub_attribute]) then combat_table.totals [class_type][sub_attribute] = combat_table.totals [class_type][sub_attribute] - self [sub_attribute] if (self.grupo) then @@ -2317,7 +2317,7 @@ end end end function atributo_misc:add_total (combat_table) - for _, sub_attribute in ipairs (sub_list) do + for _, sub_attribute in ipairs(sub_list) do if (self [sub_attribute]) then combat_table.totals [class_type][sub_attribute] = combat_table.totals [class_type][sub_attribute] + self [sub_attribute] if (self.grupo) then @@ -2364,7 +2364,7 @@ function atributo_misc:r_onlyrefresh_shadow (actor) _detalhes.refresh:r_atributo_misc (actor, shadow) - --> spell cast + --spell cast if (actor.spell_cast) then if (not shadow.spell_cast) then shadow.spell_cast = {} @@ -2374,25 +2374,25 @@ function atributo_misc:r_onlyrefresh_shadow (actor) end end - --> cc done + --cc done if (actor.cc_done) then refresh_alvos (shadow.cc_done_targets, actor.cc_done_targets) refresh_habilidades (shadow.cc_done_spells, actor.cc_done_spells) end - --> cooldowns + --cooldowns if (actor.cooldowns_defensive) then refresh_alvos (shadow.cooldowns_defensive_targets, actor.cooldowns_defensive_targets) refresh_habilidades (shadow.cooldowns_defensive_spells, actor.cooldowns_defensive_spells) end - --> buff uptime + --buff uptime if (actor.buff_uptime) then refresh_alvos (shadow.buff_uptime_targets, actor.buff_uptime_targets) refresh_habilidades (shadow.buff_uptime_spells, actor.buff_uptime_spells) end - --> debuff uptime + --debuff uptime if (actor.debuff_uptime) then refresh_habilidades (shadow.debuff_uptime_spells, actor.debuff_uptime_spells) if (actor.boss_debuff) then @@ -2403,7 +2403,7 @@ function atributo_misc:r_onlyrefresh_shadow (actor) end - --> interrupt + --interrupt if (actor.interrupt) then refresh_alvos (shadow.interrupt_targets, actor.interrupt_targets) refresh_habilidades (shadow.interrupt_spells, actor.interrupt_spells) @@ -2413,13 +2413,13 @@ function atributo_misc:r_onlyrefresh_shadow (actor) end end - --> ress + --ress if (actor.ress) then refresh_alvos (shadow.ress_targets, actor.ress_targets) refresh_habilidades (shadow.ress_spells, actor.ress_spells) end - --> dispell + --dispell if (actor.dispell) then refresh_alvos (shadow.dispell_targets, actor.dispell_targets) refresh_habilidades (shadow.dispell_spells, actor.dispell_spells) @@ -2429,7 +2429,7 @@ function atributo_misc:r_onlyrefresh_shadow (actor) end end - --> cc break + --cc break if (actor.cc_break) then refresh_alvos (shadow.cc_break_targets, actor.cc_break_targets) refresh_habilidades (shadow.cc_break_spells, actor.cc_break_spells) @@ -2445,7 +2445,7 @@ end local somar_keys = function(habilidade, habilidade_tabela1) for key, value in pairs (habilidade) do - if (_type (value) == "number") then + if (_type(value) == "number") then if (key ~= "id" and key ~= "spellschool") then habilidade_tabela1 [key] = (habilidade_tabela1 [key] or 0) + value end @@ -2469,7 +2469,7 @@ function atributo_misc:r_connect_shadow (actor, no_refresh, combat_object) local host_combat = combat_object or _detalhes.tabela_overall - --> criar uma shadow desse ator se ainda n�o tiver uma + --criar uma shadow desse ator se ainda n�o tiver uma local overall_misc = host_combat [4] local shadow = overall_misc._ActorTable [overall_misc._NameIndexTable [actor.nome]] @@ -2491,13 +2491,13 @@ function atributo_misc:r_connect_shadow (actor, no_refresh, combat_object) end - --> aplica a meta e indexes + --aplica a meta e indexes if (not no_refresh) then _detalhes.refresh:r_atributo_misc (actor, shadow) end - --> pets (add unique pet names) - for _, petName in ipairs (actor.pets) do + --pets (add unique pet names) + for _, petName in ipairs(actor.pets) do DetailsFramework.table.addunique (shadow.pets, petName) end @@ -2573,7 +2573,7 @@ function atributo_misc:r_connect_shadow (actor, no_refresh, combat_object) shadow.debuff_uptime = shadow.debuff_uptime + actor.debuff_uptime for target_name, amount in pairs (actor.debuff_uptime_targets) do - if (_type (amount) == "table") then --> boss debuff + if (_type(amount) == "table") then --boss debuff local t = shadow.debuff_uptime_targets [target_name] if (not t) then shadow.debuff_uptime_targets [target_name] = atributo_misc:CreateBuffTargetObject() @@ -2591,12 +2591,12 @@ function atributo_misc:r_connect_shadow (actor, no_refresh, combat_object) somar_habilidades (shadow.debuff_uptime_spells, actor.debuff_uptime_spells) end - --> interrupt + --interrupt if (actor.interrupt) then if (not shadow.interrupt_targets) then shadow.interrupt = 0 shadow.interrupt_targets = {} - shadow.interrupt_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) --> cria o container das habilidades usadas para interromper + shadow.interrupt_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) --cria o container das habilidades usadas para interromper shadow.interrompeu_oque = {} end @@ -2623,7 +2623,7 @@ function atributo_misc:r_connect_shadow (actor, no_refresh, combat_object) end end - --> ress + --ress if (actor.ress) then if (not shadow.ress_targets) then shadow.ress = 0 @@ -2641,7 +2641,7 @@ function atributo_misc:r_connect_shadow (actor, no_refresh, combat_object) somar_habilidades (shadow.ress_spells, actor.ress_spells) end - --> dispell + --dispell if (actor.dispell) then if (not shadow.dispell_targets) then shadow.dispell = 0 @@ -2676,7 +2676,7 @@ function atributo_misc:r_connect_shadow (actor, no_refresh, combat_object) if (not shadow.cc_break) then shadow.cc_break = 0 shadow.cc_break_targets = {} - shadow.cc_break_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) --> cria o container das habilidades usadas para interromper + shadow.cc_break_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) --cria o container das habilidades usadas para interromper shadow.cc_break_oque = {} end @@ -2713,14 +2713,14 @@ function _detalhes.refresh:r_atributo_misc (este_jogador, shadow) setmetatable (este_jogador, _detalhes.atributo_misc) este_jogador.__index = _detalhes.atributo_misc - --> refresh spell cast + --refresh spell cast if (este_jogador.spell_cast) then if (shadow and not shadow.spell_cast) then shadow.spell_cast = {} end end - --> refresh cc done + --refresh cc done if (este_jogador.cc_done) then if (shadow and not shadow.cc_done_targets) then shadow.cc_done = 0 @@ -2730,7 +2730,7 @@ function _detalhes.refresh:r_atributo_misc (este_jogador, shadow) _detalhes.refresh:r_container_habilidades (este_jogador.cc_done_spells, shadow and shadow.cc_done_spells) end - --> refresh interrupts + --refresh interrupts if (este_jogador.interrupt_targets) then if (shadow and not shadow.interrupt_targets) then shadow.interrupt = 0 @@ -2741,7 +2741,7 @@ function _detalhes.refresh:r_atributo_misc (este_jogador, shadow) _detalhes.refresh:r_container_habilidades (este_jogador.interrupt_spells, shadow and shadow.interrupt_spells) end - --> refresh buff uptime + --refresh buff uptime if (este_jogador.buff_uptime_targets) then if (shadow and not shadow.buff_uptime_targets) then shadow.buff_uptime = 0 @@ -2751,7 +2751,7 @@ function _detalhes.refresh:r_atributo_misc (este_jogador, shadow) _detalhes.refresh:r_container_habilidades (este_jogador.buff_uptime_spells, shadow and shadow.buff_uptime_spells) end - --> refresh buff uptime + --refresh buff uptime if (este_jogador.debuff_uptime_targets) then if (shadow and not shadow.debuff_uptime_targets) then shadow.debuff_uptime = 0 @@ -2770,7 +2770,7 @@ function _detalhes.refresh:r_atributo_misc (este_jogador, shadow) _detalhes.refresh:r_container_habilidades (este_jogador.debuff_uptime_spells, shadow and shadow.debuff_uptime_spells) end - --> refresh cooldowns defensive + --refresh cooldowns defensive if (este_jogador.cooldowns_defensive_targets) then if (shadow and not shadow.cooldowns_defensive_targets) then shadow.cooldowns_defensive = 0 @@ -2780,7 +2780,7 @@ function _detalhes.refresh:r_atributo_misc (este_jogador, shadow) _detalhes.refresh:r_container_habilidades (este_jogador.cooldowns_defensive_spells, shadow and shadow.cooldowns_defensive_spells) end - --> refresh ressers + --refresh ressers if (este_jogador.ress_targets) then if (shadow and not shadow.ress_targets) then shadow.ress = 0 @@ -2790,18 +2790,18 @@ function _detalhes.refresh:r_atributo_misc (este_jogador, shadow) _detalhes.refresh:r_container_habilidades (este_jogador.ress_spells, shadow and shadow.ress_spells) end - --> refresh dispells + --refresh dispells if (este_jogador.dispell_targets) then if (shadow and not shadow.dispell_targets) then shadow.dispell = 0 shadow.dispell_targets = {} - shadow.dispell_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) --> cria o container das habilidades usadas para interromper + shadow.dispell_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) --cria o container das habilidades usadas para interromper shadow.dispell_oque = {} end _detalhes.refresh:r_container_habilidades (este_jogador.dispell_spells, shadow and shadow.dispell_spells) end - --> refresh cc_breaks + --refresh cc_breaks if (este_jogador.cc_break_targets) then if (shadow and not shadow.cc_break) then shadow.cc_break = 0 @@ -2889,18 +2889,18 @@ atributo_misc.__add = function(tabela1, tabela2) tabela1.interrompeu_oque = {} end - --> total de interrupts + --total de interrupts tabela1.interrupt = tabela1.interrupt + tabela2.interrupt - --> soma o interrompeu o que + --soma o interrompeu o que for spellid, amount in pairs (tabela2.interrompeu_oque) do tabela1.interrompeu_oque [spellid] = (tabela1.interrompeu_oque [spellid] or 0) + amount end - --> soma os containers de alvos + --soma os containers de alvos for target_name, amount in pairs (tabela2.interrupt_targets) do tabela1.interrupt_targets [target_name] = (tabela1.interrupt_targets [target_name] or 0) + amount end - --> soma o container de habilidades + --soma o container de habilidades for spellid, habilidade in pairs (tabela2.interrupt_spells._ActorTable) do local habilidade_tabela1 = tabela1.interrupt_spells:PegaHabilidade (spellid, true, nil, false) @@ -2961,7 +2961,7 @@ atributo_misc.__add = function(tabela1, tabela2) tabela1.debuff_uptime = tabela1.debuff_uptime + tabela2.debuff_uptime for target_name, amount in pairs (tabela2.debuff_uptime_targets) do - if (_type (amount) == "table") then --> boss debuff + if (_type(amount) == "table") then --boss debuff local t = tabela1.debuff_uptime_targets [target_name] if (not t) then tabela1.debuff_uptime_targets [target_name] = atributo_misc:CreateBuffTargetObject() @@ -3112,7 +3112,7 @@ end local subtrair_keys = function(habilidade, habilidade_tabela1) for key, value in pairs (habilidade) do - if (_type (value) == "number") then + if (_type(value) == "number") then if (key ~= "id" and key ~= "spellschool") then habilidade_tabela1 [key] = (habilidade_tabela1 [key] or 0) - value end @@ -3147,18 +3147,18 @@ atributo_misc.__sub = function(tabela1, tabela2) end if (tabela2.interrupt) then - --> total de interrupts + --total de interrupts tabela1.interrupt = tabela1.interrupt - tabela2.interrupt - --> soma o interrompeu o que + --soma o interrompeu o que for spellid, amount in pairs (tabela2.interrompeu_oque) do tabela1.interrompeu_oque [spellid] = (tabela1.interrompeu_oque [spellid] or 0) - amount end - --> soma os containers de alvos + --soma os containers de alvos for target_name, amount in pairs (tabela2.interrupt_targets) do tabela1.interrupt_targets [target_name] = (tabela1.interrupt_targets [target_name] or 0) - amount end - --> soma o container de habilidades + --soma o container de habilidades for spellid, habilidade in pairs (tabela2.interrupt_spells._ActorTable) do local habilidade_tabela1 = tabela1.interrupt_spells:PegaHabilidade (spellid, true, nil, false) @@ -3197,7 +3197,7 @@ atributo_misc.__sub = function(tabela1, tabela2) tabela1.debuff_uptime = tabela1.debuff_uptime - tabela2.debuff_uptime for target_name, amount in pairs (tabela2.debuff_uptime_targets) do - if (_type (amount) == "table") then --> boss debuff + if (_type(amount) == "table") then --boss debuff local t = tabela1.debuff_uptime_targets [target_name] if (not t) then tabela1.debuff_uptime_targets [target_name] = atributo_misc:CreateBuffTargetObject() diff --git a/classes/container_actors.lua b/classes/container_actors.lua index 5cda0e6d..ed8528f8 100644 --- a/classes/container_actors.lua +++ b/classes/container_actors.lua @@ -8,7 +8,7 @@ local CONST_CLIENT_LANGUAGE = DF.ClientLanguage ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> local pointers +--local pointers local _UnitClass = UnitClass --api local local _IsInInstance = IsInInstance --api local @@ -29,7 +29,7 @@ local DeclineName = _G.DeclineName ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> constants +--constants local combatente = _detalhes.combatente local container_combatentes = _detalhes.container_combatentes @@ -53,7 +53,7 @@ local container_pets = {} - --> flags + --flags local REACTION_HOSTILE = 0x00000040 local IS_GROUP_OBJECT = 0x00000007 local REACTION_FRIENDLY = 0x00000010 @@ -88,7 +88,7 @@ } ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> api functions +--api functions function container_combatentes:GetActor (actorName) local index = self._NameIndexTable [actorName] @@ -120,7 +120,7 @@ function container_combatentes:GetTotal (key) local total = 0 key = key or "total" - for _, actor in _ipairs (self._ActorTable) do + for _, actor in _ipairs(self._ActorTable) do total = total + (actor [key] or 0) end @@ -131,7 +131,7 @@ local total = 0 key = key or "total" local roster = combat.raid_roster - for _, actor in _ipairs (self._ActorTable) do + for _, actor in _ipairs(self._ActorTable) do if (roster [actor.nome]) then total = total + (actor [key] or 0) end @@ -141,13 +141,13 @@ end function container_combatentes:ListActors() - return _ipairs (self._ActorTable) + return _ipairs(self._ActorTable) end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> internals +--internals - --> build a new actor container + --build a new actor container function container_combatentes:NovoContainer (tipo_do_container, combat_table, combat_id) local _newContainer = { funcao_de_criacao = container_combatentes:FuncaoDeCriacao (tipo_do_container), @@ -165,16 +165,16 @@ return _newContainer end - --> try to get the actor class from name + --try to get the actor class from name local function get_actor_class (novo_objeto, nome, flag, serial) - --> get spec + --get spec if (_detalhes.track_specs) then local have_cached = _detalhes.cached_specs [serial] if (have_cached) then novo_objeto.spec = have_cached - --> check is didn't changed the spec: + --check is didn't changed the spec: if (_detalhes.streamer_config.quick_detection) then - --> validate the spec more times if on quick detection + --validate the spec more times if on quick detection _detalhes:ScheduleTimer("ReGuessSpec", 2, {novo_objeto}) _detalhes:ScheduleTimer("ReGuessSpec", 4, {novo_objeto}) _detalhes:ScheduleTimer("ReGuessSpec", 6, {novo_objeto}) @@ -183,7 +183,7 @@ --print (nome, "spec em cache:", have_cached) else if (_detalhes.streamer_config.quick_detection) then - --> shoot detection early if in quick detection + --shoot detection early if in quick detection _detalhes:ScheduleTimer("GuessSpec", 1, {novo_objeto, nil, 1}) else _detalhes:ScheduleTimer("GuessSpec", 3, {novo_objeto, nil, 1}) @@ -198,7 +198,7 @@ return else if (flag) then - --> conferir se o jogador � um player + --conferir se o jogador � um player if (_bit_band (flag, OBJECT_TYPE_PLAYER) ~= 0) then novo_objeto.classe = "UNGROUPPLAYER" return @@ -234,11 +234,11 @@ return nickname end - --> read the actor flag + --read the actor flag local read_actor_flag = function(actorObject, dono_do_pet, serial, flag, nome, container_type) if (flag) then - --> this is player actor + --this is player actor if (_bit_band (flag, OBJECT_TYPE_PLAYER) ~= 0) then if (not _detalhes.ignore_nicktag) then actorObject.displayName = checkValidNickname(Details:GetNickname(nome, false, true), nome) --defaults to player name @@ -295,9 +295,9 @@ end end - --> pvp duel + --pvp duel if (_detalhes.duel_candidates [serial]) then - --> check if is recent + --check if is recent if (_detalhes.duel_candidates [serial]+20 > GetTime()) then actorObject.grupo = true actorObject.enemy = true @@ -376,7 +376,7 @@ end end - --> � um pet + --� um pet elseif (dono_do_pet) then actorObject.owner = dono_do_pet actorObject.ownerName = dono_do_pet.nome @@ -393,7 +393,7 @@ --end else - --> anything else that isn't a player or a pet + --anything else that isn't a player or a pet actorObject.displayName = nome --[=[ @@ -406,14 +406,14 @@ --]=] end - --> check if is hostile + --check if is hostile if (_bit_band (flag, REACTION_HOSTILE) ~= 0) then if (_bit_band (flag, OBJECT_TYPE_PLAYER) == 0) then - --> is hostile and isn't a player + --is hostile and isn't a player if (_bit_band (flag, OBJECT_TYPE_PETGUARDIAN) == 0) then - --> isn't a pet or guardian + --isn't a pet or guardian actorObject.monster = true end @@ -452,12 +452,12 @@ end end - --> check pet owner name with correct declension for ruRU locale (from user 'denis-kam' on github) + --check pet owner name with correct declension for ruRU locale (from user 'denis-kam' on github) local find_name_declension = function(petTooltip, playerName) - --> 2 - male, 3 - female + --2 - male, 3 - female for gender = 3, 2, -1 do for declensionSet = 1, GetNumDeclensionSets(playerName, gender) do - --> check genitive case of player name + --check genitive case of player name local genitive = DeclineName(playerName, gender, declensionSet) if petTooltip:find(genitive) then --print("found genitive: ", gender, declensionSet, playerName, petTooltip:find(genitive)) @@ -548,11 +548,11 @@ --print (nome, flag) --end - --> verifica se � um pet, se for confere se tem o nome do dono, se n�o tiver, precisa por + --verifica se � um pet, se for confere se tem o nome do dono, se n�o tiver, precisa por local dono_do_pet serial = serial or "ns" - if (container_pets [serial]) then --> � um pet reconhecido + if (container_pets [serial]) then --� um pet reconhecido --[[statistics]]-- _detalhes.statistics.container_pet_calls = _detalhes.statistics.container_pet_calls + 1 local nome_dele, dono_nome, dono_serial, dono_flag = _detalhes.tabela_pets:PegaDono (serial, nome, flag) @@ -561,11 +561,11 @@ dono_do_pet = self:PegarCombatente (dono_serial, dono_nome, dono_flag, true) end - elseif (not pet_blacklist [serial]) then --> verifica se � um pet + elseif (not pet_blacklist [serial]) then --verifica se � um pet pet_blacklist [serial] = true - --> try to find the owner + --try to find the owner if (flag and _bit_band (flag, OBJECT_TYPE_PETGUARDIAN) ~= 0) then --[[statistics]]-- _detalhes.statistics.container_unknow_pet = _detalhes.statistics.container_unknow_pet + 1 local find_nome, find_owner = find_pet_owner (serial, nome, flag, self) @@ -575,13 +575,13 @@ end end - --> pega o index no mapa + --pega o index no mapa local index = self._NameIndexTable [nome] - --> retorna o actor + --retorna o actor if (index) then return self._ActorTable [index], dono_do_pet, nome - --> n�o achou, criar + --n�o achou, criar elseif (criar) then local novo_objeto = self.funcao_de_criacao (_, serial, nome) @@ -589,7 +589,7 @@ novo_objeto.flag_original = flag novo_objeto.serial = serial - --> seta a classe default para desconhecido, assim nenhum objeto fica com classe nil + --seta a classe default para desconhecido, assim nenhum objeto fica com classe nil novo_objeto.classe = "UNKNOW" local forceClass @@ -625,7 +625,7 @@ -- tipo do container ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - if (self.tipo == container_damage) then --> CONTAINER DAMAGE + if (self.tipo == container_damage) then --CONTAINER DAMAGE local shouldScanOnce = get_actor_class (novo_objeto, nome, flag, serial) @@ -641,13 +641,13 @@ end end - if (novo_objeto.classe == "UNGROUPPLAYER") then --> is a player - if (_bit_band (flag, REACTION_HOSTILE ) ~= 0) then --> is hostile + if (novo_objeto.classe == "UNGROUPPLAYER") then --is a player + if (_bit_band (flag, REACTION_HOSTILE ) ~= 0) then --is hostile novo_objeto.enemy = true end - --> try to guess his class - if (self.shadow) then --> n�o executar 2x + --try to guess his class + if (self.shadow) then --n�o executar 2x _detalhes:ScheduleTimer ("GuessClass", 1, {novo_objeto, self, 1}) end @@ -660,7 +660,7 @@ novo_objeto.avoidance = _detalhes:CreateActorAvoidanceTable() end - elseif (self.tipo == container_heal) then --> CONTAINER HEALING + elseif (self.tipo == container_heal) then --CONTAINER HEALING local shouldScanOnce = get_actor_class (novo_objeto, nome, flag, serial) read_actor_flag (novo_objeto, dono_do_pet, serial, flag, nome, "heal") @@ -675,19 +675,19 @@ end end - if (novo_objeto.classe == "UNGROUPPLAYER") then --> is a player - if (_bit_band (flag, REACTION_HOSTILE ) ~= 0) then --> is hostile + if (novo_objeto.classe == "UNGROUPPLAYER") then --is a player + if (_bit_band (flag, REACTION_HOSTILE ) ~= 0) then --is hostile novo_objeto.enemy = true --print (nome.." EH UM INIMIGO -> " .. engRace) end - --> try to guess his class - if (self.shadow) then --> n�o executar 2x + --try to guess his class + if (self.shadow) then --n�o executar 2x _detalhes:ScheduleTimer ("GuessClass", 1, {novo_objeto, self, 1}) end end - elseif (self.tipo == container_energy) then --> CONTAINER ENERGY + elseif (self.tipo == container_energy) then --CONTAINER ENERGY local shouldScanOnce = get_actor_class (novo_objeto, nome, flag, serial) read_actor_flag (novo_objeto, dono_do_pet, serial, flag, nome, "energy") @@ -696,18 +696,18 @@ AddUnique (dono_do_pet.pets, nome) end - if (novo_objeto.classe == "UNGROUPPLAYER") then --> is a player - if (_bit_band (flag, REACTION_HOSTILE ) ~= 0) then --> is hostile + if (novo_objeto.classe == "UNGROUPPLAYER") then --is a player + if (_bit_band (flag, REACTION_HOSTILE ) ~= 0) then --is hostile novo_objeto.enemy = true end - --> try to guess his class - if (self.shadow) then --> n�o executar 2x + --try to guess his class + if (self.shadow) then --n�o executar 2x _detalhes:ScheduleTimer ("GuessClass", 1, {novo_objeto, self, 1}) end end - elseif (self.tipo == container_misc) then --> CONTAINER MISC + elseif (self.tipo == container_misc) then --CONTAINER MISC local shouldScanOnce = get_actor_class (novo_objeto, nome, flag, serial) read_actor_flag (novo_objeto, dono_do_pet, serial, flag, nome, "misc") @@ -716,20 +716,20 @@ AddUnique (dono_do_pet.pets, nome) end - if (novo_objeto.classe == "UNGROUPPLAYER") then --> is a player - if (_bit_band (flag, REACTION_HOSTILE ) ~= 0) then --> is hostile + if (novo_objeto.classe == "UNGROUPPLAYER") then --is a player + if (_bit_band (flag, REACTION_HOSTILE ) ~= 0) then --is hostile novo_objeto.enemy = true end - --> try to guess his class - if (self.shadow) then --> n�o executar 2x + --try to guess his class + if (self.shadow) then --n�o executar 2x _detalhes:ScheduleTimer ("GuessClass", 1, {novo_objeto, self, 1}) end end - elseif (self.tipo == container_damage_target) then --> CONTAINER ALVO DO DAMAGE + elseif (self.tipo == container_damage_target) then --CONTAINER ALVO DO DAMAGE - elseif (self.tipo == container_energy_target) then --> CONTAINER ALVOS DO ENERGY + elseif (self.tipo == container_energy_target) then --CONTAINER ALVOS DO ENERGY novo_objeto.mana = 0 novo_objeto.e_rage = 0 @@ -742,10 +742,10 @@ novo_objeto.actived = false novo_objeto.activedamt = 0 - elseif (self.tipo == container_misc_target) then --> CONTAINER ALVOS DO MISC + elseif (self.tipo == container_misc_target) then --CONTAINER ALVOS DO MISC - elseif (self.tipo == container_friendlyfire) then --> CONTAINER FRIENDLY FIRE + elseif (self.tipo == container_friendlyfire) then --CONTAINER FRIENDLY FIRE local shouldScanOnce = get_actor_class (novo_objeto, nome, serial) @@ -759,8 +759,8 @@ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -- grava o objeto no mapa do container local size = #self._ActorTable+1 - self._ActorTable [size] = novo_objeto --> grava na tabela de indexes - self._NameIndexTable [nome] = size --> grava no hash map o index deste jogador + self._ActorTable [size] = novo_objeto --grava na tabela de indexes + self._NameIndexTable [nome] = size --grava no hash map o index deste jogador if (_detalhes.is_in_battleground or _detalhes.is_in_arena) then novo_objeto.pvp = true @@ -790,7 +790,7 @@ end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> core +--core --_detalhes:AddToNpcIdCache (novo_objeto) function _detalhes:AddToNpcIdCache (actor) @@ -843,9 +843,9 @@ end end - --> chama a fun��o para ser executada em todos os atores + --chama a fun��o para ser executada em todos os atores function container_combatentes:ActorCallFunction (funcao, ...) - for index, actor in _ipairs (self._ActorTable) do + for index, actor in _ipairs(self._ActorTable) do funcao (nil, actor, ...) end end @@ -856,7 +856,7 @@ end function container_combatentes:SortByKey (key) - assert (type (key) == "string", "Container:SortByKey() expects a keyname on parameter 1.") + assert (type(key) == "string", "Container:SortByKey() expects a keyname on parameter 1.") bykey = key _table_sort (self._ActorTable, sort) self:remapear() @@ -875,19 +875,19 @@ end function _detalhes.refresh:r_container_combatentes (container, shadow) - --> reconstr�i meta e indexes + --reconstr�i meta e indexes _setmetatable (container, _detalhes.container_combatentes) container.__index = _detalhes.container_combatentes container.funcao_de_criacao = container_combatentes:FuncaoDeCriacao (container.tipo) - --> repara mapa + --repara mapa local mapa = {} for i = 1, #container._ActorTable do mapa [container._ActorTable[i].nome] = i end container._NameIndexTable = mapa - --> seta a shadow + --seta a shadow container.shadow = shadow end diff --git a/classes/container_pets.lua b/classes/container_pets.lua index 8daa29d4..28cda81d 100644 --- a/classes/container_pets.lua +++ b/classes/container_pets.lua @@ -23,8 +23,8 @@ local is_ignored = _detalhes.pets_ignored function container_pets:NovoContainer() local esta_tabela = {} _setmetatable (esta_tabela, _detalhes.container_pets) - esta_tabela.pets = {} --> armazena a pool -> uma dictionary com o [serial do pet] -> nome do dono - esta_tabela._ActorTable = {} --> armazena os 15 ultimos pets do jogador -> [jogador nome] -> {nil, nil, nil, ...} + esta_tabela.pets = {} --armazena a pool -> uma dictionary com o [serial do pet] -> nome do dono + esta_tabela._ActorTable = {} --armazena os 15 ultimos pets do jogador -> [jogador nome] -> {nil, nil, nil, ...} return esta_tabela end @@ -34,12 +34,12 @@ local PET_EM_GRUPO = 0x00001007 function container_pets:PegaDono (pet_serial, pet_nome, pet_flags) - --> sair se o pet estiver na ignore + --sair se o pet estiver na ignore if (is_ignored [pet_serial]) then return end - --> buscar pelo pet no container de pets + --buscar pelo pet no container de pets local busca = self.pets [pet_serial] if (busca) then --in merging operations, make sure to not add the owner name a second time in the name @@ -52,18 +52,18 @@ function container_pets:PegaDono (pet_serial, pet_nome, pet_flags) pet_nome = pet_nome .. " <".. ownerName ..">" end - --return busca[6] or pet_nome, busca[1], busca[2], busca[3] --> busca[6] poderia estar causando problemas - return pet_nome, busca[1], busca[2], busca[3] --> [1] dono nome [2] dono serial [3] dono flag + --return busca[6] or pet_nome, busca[1], busca[2], busca[3] --busca[6] poderia estar causando problemas + return pet_nome, busca[1], busca[2], busca[3] --[1] dono nome [2] dono serial [3] dono flag end - --> buscar pelo pet na raide + --buscar pelo pet na raide local dono_nome, dono_serial, dono_flags if (_IsInRaid()) then for i = 1, _GetNumGroupMembers() do if (pet_serial == _UnitGUID ("raidpet"..i)) then dono_serial = _UnitGUID ("raid"..i) - dono_flags = 0x00000417 --> emulate sourceflag flag + dono_flags = 0x00000417 --emulate sourceflag flag local nome, realm = _UnitName ("raid"..i) if (realm and realm ~= "") then @@ -77,7 +77,7 @@ function container_pets:PegaDono (pet_serial, pet_nome, pet_flags) for i = 1, _GetNumGroupMembers()-1 do if (pet_serial == _UnitGUID ("partypet"..i)) then dono_serial = _UnitGUID ("party"..i) - dono_flags = 0x00000417 --> emulate sourceflag flag + dono_flags = 0x00000417 --emulate sourceflag flag local nome, realm = _UnitName ("party"..i) if (realm and realm ~= "") then @@ -94,15 +94,15 @@ function container_pets:PegaDono (pet_serial, pet_nome, pet_flags) dono_nome = _GetUnitName ("player") dono_serial = _UnitGUID ("player") if (_IsInGroup() or _IsInRaid()) then - dono_flags = 0x00000417 --> emulate sourceflag flag + dono_flags = 0x00000417 --emulate sourceflag flag else - dono_flags = 0x00000411 --> emulate sourceflag flag + dono_flags = 0x00000411 --emulate sourceflag flag end end end if (dono_nome) then - self.pets [pet_serial] = {dono_nome, dono_serial, dono_flags, _detalhes._tempo, true, pet_nome, pet_serial} --> adicionada a flag emulada + self.pets [pet_serial] = {dono_nome, dono_serial, dono_flags, _detalhes._tempo, true, pet_nome, pet_serial} --adicionada a flag emulada if (not pet_nome:find ("<")) then pet_nome = pet_nome .. " <".. dono_nome ..">" @@ -111,7 +111,7 @@ function container_pets:PegaDono (pet_serial, pet_nome, pet_flags) return pet_nome, dono_nome, dono_serial, dono_flags else - if (pet_flags and _bit_band (pet_flags, OBJECT_TYPE_PET) ~= 0) then --> � um pet + if (pet_flags and _bit_band (pet_flags, OBJECT_TYPE_PET) ~= 0) then --� um pet if (not _detalhes.pets_no_owner [pet_serial] and _bit_band (pet_flags, EM_GRUPO) ~= 0) then _detalhes.pets_no_owner [pet_serial] = {pet_nome, pet_flags} _detalhes:Msg ("couldn't find the owner of the pet:", pet_nome) @@ -227,9 +227,9 @@ function _detalhes:WipePets() end function _detalhes:LimparPets() - --> erase old pet table by creating a new one + --erase old pet table by creating a new one local newPetTable = {} - --> minimum of 90 minutes to clean a pet from the pet table data + --minimum of 90 minutes to clean a pet from the pet table data for PetSerial, PetTable in _pairs (_detalhes.tabela_pets.pets) do if ( (PetTable[4] + 5400 > _detalhes._tempo + 1) or (PetTable[5] and PetTable[4] + 43200 > _detalhes._tempo) ) then newPetTable [PetSerial] = PetTable diff --git a/classes/container_segments.lua b/classes/container_segments.lua index 650bf2f0..5bf4a86a 100644 --- a/classes/container_segments.lua +++ b/classes/container_segments.lua @@ -16,30 +16,30 @@ local container_pets = _detalhes.container_pets local timeMachine = _detalhes.timeMachine ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> API +--API ---> reset only the overall data +--reset only the overall data function _detalhes:ResetSegmentOverallData() return historico:resetar_overall() end ---> reset segments and overall data +--reset segments and overall data function _detalhes:ResetSegmentData() return historico:resetar() end ---> returns the current active segment +--returns the current active segment function _detalhes:GetCurrentCombat() return _detalhes.tabela_vigente end ---> returns a private table containing all stored segments +--returns a private table containing all stored segments function _detalhes:GetCombatSegments() return _detalhes.tabela_historico.tabelas end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> internal +--internal function historico:NovoHistorico() local esta_tabela = {tabelas = {}} @@ -55,13 +55,13 @@ function historico:adicionar_overall (tabela) end if (_detalhes.overall_clear_newboss) then - --> only for raids + --only for raids if (tabela.instance_type == "raid" and tabela.is_boss) then if (_detalhes.last_encounter ~= _detalhes.last_encounter2) then if (_detalhes.debug) then _detalhes:Msg ("(debug) new boss detected 'overall_clear_newboss' is true, cleaning overall data.") end - for index, combat in ipairs (_detalhes.tabela_historico.tabelas) do + for index, combat in ipairs(_detalhes.tabela_historico.tabelas) do combat.overall_added = false end historico:resetar_overall() @@ -75,7 +75,7 @@ function historico:adicionar_overall (tabela) end local mythicInfo = tabela.is_mythic_dungeon if (mythicInfo) then - --> do not add overall mythic+ dungeon segments + --do not add overall mythic+ dungeon segments if (mythicInfo.TrashOverallSegment) then _detalhes:Msg ("error > attempt to add a TrashOverallSegment > func historico:adicionar_overall()") return @@ -85,7 +85,7 @@ function historico:adicionar_overall (tabela) end end - --> store the segments added to the overall data + --store the segments added to the overall data _detalhes.tabela_overall.segments_added = _detalhes.tabela_overall.segments_added or {} local this_clock = tabela.data_inicio @@ -148,24 +148,24 @@ end function _detalhes:CanAddCombatToOverall (tabela) - --> already added + --already added if (tabela.overall_added) then return false end - --> already scheduled to add + --already scheduled to add if (_detalhes.schedule_add_to_overall) then --deprecated - for _, combat in ipairs (_detalhes.schedule_add_to_overall) do + for _, combat in ipairs(_detalhes.schedule_add_to_overall) do if (combat == tabela) then return false end end end - --> special cases + --special cases local mythicInfo = tabela.is_mythic_dungeon if (mythicInfo) then - --> do not add overall mythic+ dungeon segments + --do not add overall mythic+ dungeon segments if (mythicInfo.TrashOverallSegment) then return false elseif (mythicInfo.OverallSegment) then @@ -173,7 +173,7 @@ function _detalhes:CanAddCombatToOverall (tabela) end end - --> raid boss - flag 0x1 + --raid boss - flag 0x1 if (bit.band (_detalhes.overall_flag, 0x1) ~= 0) then if (tabela.is_boss and tabela.instance_type == "raid" and not tabela.is_pvp) then if (tabela:GetCombatTime() >= 30) then @@ -182,33 +182,33 @@ function _detalhes:CanAddCombatToOverall (tabela) end end - --> raid trash - flag 0x2 + --raid trash - flag 0x2 if (bit.band (_detalhes.overall_flag, 0x2) ~= 0) then if (tabela.is_trash and tabela.instance_type == "raid") then return true end end - --> dungeon boss - flag 0x4 + --dungeon boss - flag 0x4 if (bit.band (_detalhes.overall_flag, 0x4) ~= 0) then if (tabela.is_boss and tabela.instance_type == "party" and not tabela.is_pvp) then return true end end - --> dungeon trash - flag 0x8 + --dungeon trash - flag 0x8 if (bit.band (_detalhes.overall_flag, 0x8) ~= 0) then if ((tabela.is_trash or tabela.is_mythic_dungeon_trash) and tabela.instance_type == "party") then return true end end - --> any combat + --any combat if (bit.band (_detalhes.overall_flag, 0x10) ~= 0) then return true end - --> is a PvP combat + --is a PvP combat if (tabela.is_pvp or tabela.is_arena) then return true end @@ -216,25 +216,25 @@ function _detalhes:CanAddCombatToOverall (tabela) return false end ---> sai do combate, chamou adicionar a tabela ao hist�rico +--sai do combate, chamou adicionar a tabela ao hist�rico function historico:adicionar (tabela) local tamanho = #self.tabelas - --> verifica se precisa dar UnFreeze() - if (tamanho < _detalhes.segments_amount) then --> vai preencher um novo index vazio + --verifica se precisa dar UnFreeze() + if (tamanho < _detalhes.segments_amount) then --vai preencher um novo index vazio local ultima_tabela = self.tabelas[tamanho] - if (not ultima_tabela) then --> n�o ha tabelas no historico, esta ser� a #1 - --> pega a tabela do combate atual + if (not ultima_tabela) then --n�o ha tabelas no historico, esta ser� a #1 + --pega a tabela do combate atual ultima_tabela = tabela end _detalhes:InstanciaCallFunction (_detalhes.CheckFreeze, tamanho+1, ultima_tabela) end - --> add to history table + --add to history table _table_insert (self.tabelas, 1, tabela) - --> count boss tries + --count boss tries local boss = tabela.is_boss and tabela.is_boss.name if (boss) then local try_number = _detalhes.encounter_counter [boss] @@ -260,7 +260,7 @@ function historico:adicionar (tabela) tabela.is_boss.try_number = try_number end - --> see if can add the encounter to overall data + --see if can add the encounter to overall data local canAddToOverall = _detalhes:CanAddCombatToOverall (tabela) if (canAddToOverall) then @@ -277,25 +277,25 @@ function historico:adicionar (tabela) --end end - --> erase trash segments + --erase trash segments if (self.tabelas[2]) then local _segundo_combate = self.tabelas[2] local container_damage = _segundo_combate [1] local container_heal = _segundo_combate [2] --regular cleanup - for _, jogador in ipairs (container_damage._ActorTable) do - --> remover a tabela de last events + for _, jogador in ipairs(container_damage._ActorTable) do + --remover a tabela de last events jogador.last_events_table = nil - --> verifica se ele ainda esta registrado na time machine + --verifica se ele ainda esta registrado na time machine if (jogador.timeMachine) then jogador:DesregistrarNaTimeMachine() end end - for _, jogador in ipairs (container_heal._ActorTable) do - --> remover a tabela de last events + for _, jogador in ipairs(container_heal._ActorTable) do + --remover a tabela de last events jogador.last_events_table = nil - --> verifica se ele ainda esta registrado na time machine + --verifica se ele ainda esta registrado na time machine if (jogador.timeMachine) then jogador:DesregistrarNaTimeMachine() end @@ -307,20 +307,20 @@ function historico:adicionar (tabela) if (_terceiro_combate and not _terceiro_combate.is_mythic_dungeon_segment) then if ((_terceiro_combate.is_trash and not _terceiro_combate.is_boss) or (_terceiro_combate.is_temporary)) then - --> verificar novamente a time machine - for _, jogador in ipairs (_terceiro_combate [1]._ActorTable) do --> damage + --verificar novamente a time machine + for _, jogador in ipairs(_terceiro_combate [1]._ActorTable) do --damage if (jogador.timeMachine) then jogador:DesregistrarNaTimeMachine() end end - for _, jogador in ipairs (_terceiro_combate [2]._ActorTable) do --> heal + for _, jogador in ipairs(_terceiro_combate [2]._ActorTable) do --heal if (jogador.timeMachine) then jogador:DesregistrarNaTimeMachine() end end - --> remover + --remover _table_remove (self.tabelas, 3) - _detalhes:SendEvent ("DETAILS_DATA_SEGMENTREMOVED", nil, nil) + _detalhes:SendEvent("DETAILS_DATA_SEGMENTREMOVED", nil, nil) end end @@ -329,12 +329,12 @@ function historico:adicionar (tabela) end - --> verifica se precisa apagar a �ltima tabela do hist�rico + --verifica se precisa apagar a �ltima tabela do hist�rico if (#self.tabelas > _detalhes.segments_amount) then local combat_removed, combat_index - --> verifica se est�o dando try em um boss e remove o combate menos relevante + --verifica se est�o dando try em um boss e remove o combate menos relevante local bossid = tabela.is_boss and tabela.is_boss.id local last_segment = self.tabelas [#self.tabelas] @@ -366,31 +366,31 @@ function historico:adicionar (tabela) combat_index = #self.tabelas end - --> verificar novamente a time machine - for _, jogador in ipairs (combat_removed [1]._ActorTable) do --> damage + --verificar novamente a time machine + for _, jogador in ipairs(combat_removed [1]._ActorTable) do --damage if (jogador.timeMachine) then jogador:DesregistrarNaTimeMachine() end end - for _, jogador in ipairs (combat_removed [2]._ActorTable) do --> heal + for _, jogador in ipairs(combat_removed [2]._ActorTable) do --heal if (jogador.timeMachine) then jogador:DesregistrarNaTimeMachine() end end - --> remover + --remover _table_remove (self.tabelas, combat_index) - _detalhes:SendEvent ("DETAILS_DATA_SEGMENTREMOVED") + _detalhes:SendEvent("DETAILS_DATA_SEGMENTREMOVED") end - --> chama a fun��o que ir� atualizar as inst�ncias com segmentos no hist�rico + --chama a fun��o que ir� atualizar as inst�ncias com segmentos no hist�rico _detalhes:InstanciaCallFunction (_detalhes.AtualizaSegmentos_AfterCombat, self) --_detalhes:InstanciaCallFunction (_detalhes.AtualizarJanela) end ---> verifica se tem alguma instancia congelada mostrando o segmento rec�m liberado +--verifica se tem alguma instancia congelada mostrando o segmento rec�m liberado function _detalhes:CheckFreeze (instancia, index_liberado, tabela) - if (instancia.freezed) then --> esta congelada + if (instancia.freezed) then --esta congelada if (instancia.segmento == index_liberado) then instancia.showing = tabela instancia:UnFreeze() @@ -423,12 +423,12 @@ function historico:resetar_overall() -- _detalhes:Msg (Loc ["STRING_ERASE_IN_COMBAT"]) -- _detalhes.schedule_remove_overall = true --else - --> fecha a janela de informa��es do jogador + --fecha a janela de informa��es do jogador _detalhes:FechaJanelaInfo() _detalhes.tabela_overall = combate:NovaTabela() - for index, instancia in ipairs (_detalhes.tabela_instancias) do + for index, instancia in ipairs(_detalhes.tabela_instancias) do if (instancia.ativa and instancia.segmento == -1) then instancia:InstanceReset() instancia:ReajustaGump() @@ -440,7 +440,7 @@ function historico:resetar_overall() end --end - --> stop bar testing if any + --stop bar testing if any _detalhes:StopTestBarUpdate() _detalhes:ClockPluginTickOnSegment() @@ -452,32 +452,32 @@ function historico:resetar() _detalhes.bosswindow:Reset() end - --> stop bar testing if any + --stop bar testing if any _detalhes:StopTestBarUpdate() - if (_detalhes.tabela_vigente.verifica_combate) then --> finaliza a checagem se esta ou n�o no combate + if (_detalhes.tabela_vigente.verifica_combate) then --finaliza a checagem se esta ou n�o no combate _detalhes:CancelTimer (_detalhes.tabela_vigente.verifica_combate) end _detalhes.last_closed_combat = nil - --> remove mythic dungeon schedules if any + --remove mythic dungeon schedules if any _detalhes.schedule_mythicdungeon_trash_merge = nil _detalhes.schedule_mythicdungeon_endtrash_merge = nil _detalhes.schedule_mythicdungeon_overallrun_merge = nil - --> clear other schedules + --clear other schedules _detalhes.schedule_flag_boss_components = nil _detalhes.schedule_store_boss_encounter = nil --_detalhes.schedule_remove_overall = nil - --> fecha a janela de informa��es do jogador + --fecha a janela de informa��es do jogador _detalhes:FechaJanelaInfo() - --> empty temporary tables + --empty temporary tables _detalhes.atributo_damage:ClearTempTables() - for _, combate in ipairs (_detalhes.tabela_historico.tabelas) do + for _, combate in ipairs(_detalhes.tabela_historico.tabelas) do _table_wipe (combate) end _table_wipe (_detalhes.tabela_vigente) @@ -489,7 +489,7 @@ function historico:resetar() end _detalhes:LimparPets() - _detalhes:ResetSpecCache (true) --> for�ar + _detalhes:ResetSpecCache (true) --for�ar -- novo container de historico _detalhes.tabela_historico = historico:NovoHistorico() --joga fora a tabela antiga e cria uma nova @@ -507,13 +507,13 @@ function historico:resetar() --zera o contador de combates _detalhes:NumeroCombate (0) - --> limpa o cache de magias + --limpa o cache de magias _detalhes:ClearSpellCache() - --> limpa a tabela de escudos + --limpa a tabela de escudos _table_wipe (_detalhes.escudos) - --> reinicia a time machine + --reinicia a time machine timeMachine:Reiniciar() _table_wipe (_detalhes.cache_damage_group) @@ -521,7 +521,7 @@ function historico:resetar() _detalhes:UpdateParserGears() if (not InCombatLockdown() and not UnitAffectingCombat ("player")) then - --> workarround for the "script run too long" issue while outside the combat lockdown + --workarround for the "script run too long" issue while outside the combat lockdown local cleargarbage = function() collectgarbage() end @@ -538,9 +538,9 @@ function historico:resetar() _detalhes:InstanciaCallFunction(_detalhes.ResetaGump) --_detalhes:ResetaGump ("de todas as instancias") _detalhes:InstanciaCallFunction(Details.FadeHandler.Fader, "IN", nil, "barras") - _detalhes:RefreshMainWindow (-1) --atualiza todas as instancias + _detalhes:RefreshMainWindow(-1) --atualiza todas as instancias - _detalhes:SendEvent ("DETAILS_DATA_RESET", nil, nil) + _detalhes:SendEvent("DETAILS_DATA_RESET", nil, nil) end @@ -558,7 +558,7 @@ end if (_terceiro_combate) then if (_terceiro_combate.is_trash and _segundo_combate.is_trash and not _terceiro_combate.is_boss and not _segundo_combate.is_boss) then - --> tabela 2 deve ser deletada e somada a tabela 1 + --tabela 2 deve ser deletada e somada a tabela 1 if (_detalhes.debug) then detalhes:Msg ("(debug) concatenating two trash segments.") end @@ -568,20 +568,20 @@ end _segundo_combate.is_trash = true - --> verificar novamente a time machine - for _, jogador in ipairs (_terceiro_combate [1]._ActorTable) do --> damage + --verificar novamente a time machine + for _, jogador in ipairs(_terceiro_combate [1]._ActorTable) do --damage if (jogador.timeMachine) then jogador:DesregistrarNaTimeMachine() end end - for _, jogador in ipairs (_terceiro_combate [2]._ActorTable) do --> heal + for _, jogador in ipairs(_terceiro_combate [2]._ActorTable) do --heal if (jogador.timeMachine) then jogador:DesregistrarNaTimeMachine() end end - --> remover + --remover _table_remove (self.tabelas, 3) - _detalhes:SendEvent ("DETAILS_DATA_SEGMENTREMOVED", nil, nil) + _detalhes:SendEvent("DETAILS_DATA_SEGMENTREMOVED", nil, nil) end end --]] diff --git a/classes/container_spells.lua b/classes/container_spells.lua index 0322d3cd..5fb9643b 100644 --- a/classes/container_spells.lua +++ b/classes/container_spells.lua @@ -4,12 +4,12 @@ local _detalhes = _G._detalhes local _ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> local pointers +--local pointers local _setmetatable = setmetatable --lua local ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> constants +--constants local container_playernpc = _detalhes.container_type.CONTAINER_PLAYERNPC local container_damage = _detalhes.container_type.CONTAINER_DAMAGE_CLASS @@ -30,7 +30,7 @@ local _ local container_habilidades = _detalhes.container_habilidades ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> internals +--internals function container_habilidades:NovoContainer (tipo_do_container) local _newContainer = { @@ -100,7 +100,7 @@ local _ end function _detalhes.refresh:r_container_habilidades (container, shadow) - --> reconstr�i meta e indexes + --reconstr�i meta e indexes _setmetatable (container, _detalhes.container_habilidades) container.__index = _detalhes.container_habilidades local func_criacao = container_habilidades:FuncaoDeCriacao (container.tipo) diff --git a/classes/custom_damagedone.lua b/classes/custom_damagedone.lua index 4d419738..25ba6f55 100644 --- a/classes/custom_damagedone.lua +++ b/classes/custom_damagedone.lua @@ -1,20 +1,20 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> attributes functions for customs ---> DAMAGEDONE +--attributes functions for customs +--DAMAGEDONE ---> customized display script +--customized display script ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> attributes functions for customs ---> DAMAGEDONE +--attributes functions for customs +--DAMAGEDONE ---> customized display script +--customized display script local _detalhes = _G._detalhes local _ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> local pointers +--local pointers local _cstr = string.format --lua local local _math_floor = math.floor --lua local @@ -40,7 +40,7 @@ local _GetNumRaidMembers = GetNumRaidMembers or GetNumGroupMembers -- api local local _GetUnitName = GetUnitName -- api local ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> constants +--constants local atributo_custom = _detalhes.atributo_custom @@ -106,7 +106,7 @@ local function SortOrder (main_table, func, ...) end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> damagedone tooltip +--damagedone tooltip function atributo_custom:damagedoneTooltip (actor, target, spellid, combat, instance) @@ -199,7 +199,7 @@ function atributo_custom:damagedoneTooltip (actor, target, spellid, combat, inst GameCooltip:AddIcon (icon, 1, 1, 14, 14) end - --for index, pet_name in ipairs (actor.pets) do + --for index, pet_name in ipairs(actor.pets) do --end end @@ -210,23 +210,23 @@ function atributo_custom:damagedoneTooltip (actor, target, spellid, combat, inst end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> damagedone search +--damagedone search function atributo_custom:damagedone (actor, source, target, spellid, combat, instance_container) - if (spellid) then --> spell is always damagedone + if (spellid) then --spell is always damagedone local spell = actor.spells._ActorTable [spellid] if (spell) then if (target) then if (target == "[all]") then for target_name, amount in _pairs (spell.targets) do - --> add amount + --add amount - --> we need to pass a object here in order to get name and class, so we just get the main damage actor from the combat + --we need to pass a object here in order to get name and class, so we just get the main damage actor from the combat instance_container:AddValue (combat (1, target_name), amount, true) -- atributo_custom._TargetActorsProcessedTotal = atributo_custom._TargetActorsProcessedTotal + amount - --> add to processed container + --add to processed container if (not atributo_custom._TargetActorsProcessed [target_name]) then atributo_custom._TargetActorsProcessed [target_name] = true atributo_custom._TargetActorsProcessedAmt = atributo_custom._TargetActorsProcessedAmt + 1 @@ -238,10 +238,10 @@ function atributo_custom:damagedone (actor, source, target, spellid, combat, ins local roster = combat.raid_roster for target_name, amount in _pairs (spell.targets) do if (roster [target_name]) then - --> add amount + --add amount instance_container:AddValue (combat (1, target_name), amount, true) atributo_custom._TargetActorsProcessedTotal = atributo_custom._TargetActorsProcessedTotal + amount - --> add to processed container + --add to processed container if (not atributo_custom._TargetActorsProcessed [target_name]) then atributo_custom._TargetActorsProcessed [target_name] = true atributo_custom._TargetActorsProcessedAmt = atributo_custom._TargetActorsProcessedAmt + 1 @@ -253,10 +253,10 @@ function atributo_custom:damagedone (actor, source, target, spellid, combat, ins elseif (target == "[player]") then local target_amount = spell.targets [_detalhes.playername] if (target_amount) then - --> add amount + --add amount instance_container:AddValue (combat (1, _detalhes.playername), target_amount, true) atributo_custom._TargetActorsProcessedTotal = atributo_custom._TargetActorsProcessedTotal + target_amount - --> add to processed container + --add to processed container if (not atributo_custom._TargetActorsProcessed [_detalhes.playername]) then atributo_custom._TargetActorsProcessed [_detalhes.playername] = true atributo_custom._TargetActorsProcessedAmt = atributo_custom._TargetActorsProcessedAmt + 1 @@ -267,10 +267,10 @@ function atributo_custom:damagedone (actor, source, target, spellid, combat, ins else local target_amount = actor.targets [target] if (target_amount) then - --> add amount + --add amount instance_container:AddValue (combat (1, target), target_amount, true) atributo_custom._TargetActorsProcessedTotal = atributo_custom._TargetActorsProcessedTotal + target_amount - --> add to processed container + --add to processed container if (not atributo_custom._TargetActorsProcessed [target]) then atributo_custom._TargetActorsProcessed [target] = true atributo_custom._TargetActorsProcessedAmt = atributo_custom._TargetActorsProcessedAmt + 1 diff --git a/classes/custom_healingdone.lua b/classes/custom_healingdone.lua index 94b0bba0..c22f3d4b 100644 --- a/classes/custom_healingdone.lua +++ b/classes/custom_healingdone.lua @@ -7,7 +7,7 @@ local _ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> local pointers +--local pointers local _cstr = string.format --lua local local _math_floor = math.floor --lua local @@ -33,7 +33,7 @@ local _GetUnitName = GetUnitName -- api local ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> constants +--constants local atributo_custom = _detalhes.atributo_custom @@ -99,7 +99,7 @@ end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> healing done tooltip +--healing done tooltip function atributo_custom:healdoneTooltip (actor, target, spellid, combat, instance) @@ -198,24 +198,24 @@ end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> healing done search +--healing done search function atributo_custom:healdone (actor, source, target, spellid, combat, instance_container) - if (spellid) then --> spell is always healing done + if (spellid) then --spell is always healing done local spell = actor.spells._ActorTable [spellid] local melee = actor.spells._ActorTable [1] if (spell) then if (target) then if (target == "[all]") then for target_name, amount in _pairs (spell.targets) do - --> add amount + --add amount - --> we need to pass a object here in order to get name and class, so we just get the main heal actor from the combat + --we need to pass a object here in order to get name and class, so we just get the main heal actor from the combat instance_container:AddValue (combat (1, target_name), amount, true) -- atributo_custom._TargetActorsProcessedTotal = atributo_custom._TargetActorsProcessedTotal + amount - --> add to processed container + --add to processed container if (not atributo_custom._TargetActorsProcessed [target_name]) then atributo_custom._TargetActorsProcessed [target_name] = true atributo_custom._TargetActorsProcessedAmt = atributo_custom._TargetActorsProcessedAmt + 1 @@ -227,10 +227,10 @@ local roster = combat.raid_roster for target_name, amount in _pairs (spell.targets) do if (roster [target_name]) then - --> add amount + --add amount instance_container:AddValue (combat (1, target_name), amount, true) atributo_custom._TargetActorsProcessedTotal = atributo_custom._TargetActorsProcessedTotal + amount - --> add to processed container + --add to processed container if (not atributo_custom._TargetActorsProcessed [target_name]) then atributo_custom._TargetActorsProcessed [target_name] = true atributo_custom._TargetActorsProcessedAmt = atributo_custom._TargetActorsProcessedAmt + 1 @@ -242,10 +242,10 @@ elseif (target == "[player]") then local target_amount = spell.targets [_detalhes.playername] if (target_amount) then - --> add amount + --add amount instance_container:AddValue (combat (1, _detalhes.playername), target_amount, true) atributo_custom._TargetActorsProcessedTotal = atributo_custom._TargetActorsProcessedTotal + target_amount - --> add to processed container + --add to processed container if (not atributo_custom._TargetActorsProcessed [_detalhes.playername]) then atributo_custom._TargetActorsProcessed [_detalhes.playername] = true atributo_custom._TargetActorsProcessedAmt = atributo_custom._TargetActorsProcessedAmt + 1 @@ -256,10 +256,10 @@ else local target_amount = actor.targets [target] if (target_amount) then - --> add amount + --add amount instance_container:AddValue (combat (1, target), target_amount, true) atributo_custom._TargetActorsProcessedTotal = atributo_custom._TargetActorsProcessedTotal + target_amount - --> add to processed container + --add to processed container if (not atributo_custom._TargetActorsProcessed [target]) then atributo_custom._TargetActorsProcessed [target] = true atributo_custom._TargetActorsProcessedAmt = atributo_custom._TargetActorsProcessedAmt + 1 diff --git a/classes/include_instance.lua b/classes/include_instance.lua index 1b1b1511..6de2dcba 100644 --- a/classes/include_instance.lua +++ b/classes/include_instance.lua @@ -12,7 +12,7 @@ local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0") function _detalhes:ResetInstanceConfig (maintainsnap) for key, value in pairs (_detalhes.instance_defaults) do - if (type (value) == "table") then + if (type(value) == "table") then self [key] = Details.CopyTable (value) else self [key] = value @@ -59,7 +59,7 @@ _detalhes.instance_skin_ignored_values = { function _detalhes:ResetInstanceConfigKeepingValues (maintainsnap) for key, value in pairs (_detalhes.instance_defaults) do if (not _detalhes.instance_skin_ignored_values [key]) then - if (type (value) == "table") then + if (type(value) == "table") then self [key] = Details.CopyTable (value) else self [key] = value @@ -77,16 +77,16 @@ end function _detalhes:LoadInstanceConfig() for key, value in pairs (_detalhes.instance_defaults) do if (self [key] == nil) then - if (type (value) == "table") then + if (type(value) == "table") then self [key] = Details.CopyTable (_detalhes.instance_defaults [key]) else self [key] = value end - elseif (type (value) == "table") then + elseif (type(value) == "table") then for key2, value2 in pairs (value) do if (self [key] [key2] == nil) then - if (type (value2) == "table") then + if (type(value2) == "table") then self [key] [key2] = Details.CopyTable (_detalhes.instance_defaults [key] [key2]) else self [key] [key2] = value2 @@ -99,13 +99,13 @@ end _detalhes.instance_defaults = { - --> click through settings + --click through settings clickthrough_toolbaricons = false, clickthrough_rows = false, clickthrough_window = false, clickthrough_incombatonly = true, - --> window settings + --window settings ignore_mass_showhide = false, --skin skin = _detalhes.default_skin_to_use, diff --git a/core/control.lua b/core/control.lua index 7966711b..6bfdde80 100644 --- a/core/control.lua +++ b/core/control.lua @@ -7,7 +7,7 @@ local _ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> local pointers +--local pointers local _math_floor = math.floor --lua local local _math_max = math.max --lua local @@ -36,7 +36,7 @@ local UnitGroupRolesAssigned = DetailsFramework.UnitGroupRolesAssigned ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> constants +--constants local modo_GROUP = Details.modos.group local modo_ALL = Details.modos.all @@ -44,13 +44,13 @@ local OBJECT_TYPE_PETS = 0x00003000 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> details api functions +--details api functions - --> try to find the opponent of last fight, can be called during a fight as well + --try to find the opponent of last fight, can be called during a fight as well function Details:FindEnemy() local ZoneName, InstanceType, DifficultyID, _, _, _, _, ZoneMapID = _GetInstanceInfo() - local in_instance = IsInInstance() --> garrison returns party as instance type. + local in_instance = IsInInstance() --garrison returns party as instance type. if ((InstanceType == "party" or InstanceType == "raid") and in_instance) then if (InstanceType == "party") then @@ -62,9 +62,9 @@ end end - for _, actor in ipairs (Details.tabela_vigente[class_type_dano]._ActorTable) do + for _, actor in ipairs(Details.tabela_vigente[class_type_dano]._ActorTable) do - if (not actor.grupo and not actor.owner and not actor.nome:find ("[*]") and _bit_band (actor.flag_original, 0x00000060) ~= 0) then --> 0x20+0x40 neutral + enemy reaction + if (not actor.grupo and not actor.owner and not actor.nome:find ("[*]") and _bit_band (actor.flag_original, 0x00000060) ~= 0) then --0x20+0x40 neutral + enemy reaction for name, _ in pairs (actor.targets) do if (name == Details.playername) then return actor.nome @@ -79,7 +79,7 @@ end - for _, actor in ipairs (Details.tabela_vigente[class_type_dano]._ActorTable) do + for _, actor in ipairs(Details.tabela_vigente[class_type_dano]._ActorTable) do if (actor.grupo and not actor.owner) then for target_name, _ in pairs (actor.targets) do @@ -146,7 +146,7 @@ if (boss_list) then local ActorsContainer = Details.tabela_vigente [class_type_dano]._ActorTable if (ActorsContainer) then - for index, Actor in ipairs (ActorsContainer) do + for index, Actor in ipairs(ActorsContainer) do if (not Actor.grupo) then if (boss_list [Actor.nome]) then Actor.boss = true @@ -163,7 +163,7 @@ if (Details.in_combat and not Details.leaving_combat) then - --> catch boss function if any + --catch boss function if any local bossFunction, bossFunctionType = Details:GetBossFunction (ZoneMapID, BossIndex) if (bossFunction) then if (_bit_band (bossFunctionType, 0x1) ~= 0) then --realtime @@ -177,19 +177,19 @@ if (endType and endData) then if (Details.debug) then - Details:Msg ("(debug) setting boss end type to:", endType) + Details:Msg("(debug) setting boss end type to:", endType) end Details.encounter_end_table.type = endType Details.encounter_end_table.killed = {} Details.encounter_end_table.data = {} - if (type (endData) == "table") then + if (type(endData) == "table") then if (Details.debug) then - Details:Msg ("(debug) boss type is table:", endType) + Details:Msg("(debug) boss type is table:", endType) end if (endType == 1 or endType == 2) then - for _, npcID in ipairs (endData) do + for _, npcID in ipairs(endData) do Details.encounter_end_table.data [npcID] = false end end @@ -202,9 +202,9 @@ end end - --> we the boss was found during the combat table creation, we must postpone the event trigger + --we the boss was found during the combat table creation, we must postpone the event trigger if (not Details.tabela_vigente.IsBeingCreated) then - Details:SendEvent ("COMBAT_BOSS_FOUND", nil, index, name) + Details:SendEvent("COMBAT_BOSS_FOUND", nil, index, name) Details:CheckFor_SuppressedWindowsOnEncounterFound() end @@ -238,7 +238,7 @@ if (BossIndex) then if (Details.debug) then - Details:Msg ("(debug) boss found:",Details:GetBossName (ZoneMapID, BossIndex)) + Details:Msg("(debug) boss found:",Details:GetBossName (ZoneMapID, BossIndex)) end return boss_found (BossIndex, Details:GetBossName (ZoneMapID, BossIndex), ZoneName, ZoneMapID, DifficultyID) @@ -266,7 +266,7 @@ local ActorsContainer = Details.tabela_vigente [class_type_dano]._ActorTable if (ActorsContainer) then - for index, Actor in ipairs (ActorsContainer) do + for index, Actor in ipairs(ActorsContainer) do if (not Actor.grupo) then local serial = Details:GetNpcIdFromGuid (Actor.serial) if (serial) then @@ -281,16 +281,16 @@ end end - noJournalSearch = true --> disabling the scan on encounter journal + noJournalSearch = true --disabling the scan on encounter journal if (not noJournalSearch) then - local in_instance = IsInInstance() --> garrison returns party as instance type. + local in_instance = IsInInstance() --garrison returns party as instance type. if ((InstanceType == "party" or InstanceType == "raid") and in_instance) then local boss_list = Details:GetCurrentDungeonBossListFromEJ() if (boss_list) then local ActorsContainer = Details.tabela_vigente [class_type_dano]._ActorTable if (ActorsContainer) then - for index, Actor in ipairs (ActorsContainer) do + for index, Actor in ipairs(ActorsContainer) do if (not Actor.grupo) then if (boss_list [Actor.nome]) then Actor.boss = true @@ -306,7 +306,7 @@ end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> internal functions +--internal functions -- Details.statistics = {container_calls = 0, container_pet_calls = 0, container_unknow_pet = 0, damage_calls = 0, heal_calls = 0, absorbs_calls = 0, energy_calls = 0, pets_summons = 0} function Details:StartCombat(...) return Details:EntrarEmCombate (...) @@ -315,7 +315,7 @@ -- ~start ~inicio ~novo �ovo function Details:EntrarEmCombate (...) if (Details.debug) then - Details:Msg ("(debug) |cFFFFFF00started a new combat|r|cFFFF7700", Details.encounter_table and Details.encounter_table.name or "") + Details:Msg("(debug) |cFFFFFF00started a new combat|r|cFFFF7700", Details.encounter_table and Details.encounter_table.name or "") --local from = debugstack (2, 1, 0) --print (from) end @@ -323,33 +323,33 @@ if (not Details.tabela_historico.tabelas[1]) then Details.tabela_overall = Details.combate:NovaTabela() - Details:InstanciaCallFunction (Details.ResetaGump, nil, -1) --> reseta scrollbar, iterators, rodap�, etc - Details:InstanciaCallFunction (Details.InstanciaFadeBarras, -1) --> esconde todas as barras - Details:InstanciaCallFunction (Details.AtualizaSegmentos) --> atualiza o showing + Details:InstanciaCallFunction (Details.ResetaGump, nil, -1) --reseta scrollbar, iterators, rodap�, etc + Details:InstanciaCallFunction (Details.InstanciaFadeBarras, -1) --esconde todas as barras + Details:InstanciaCallFunction (Details.AtualizaSegmentos) --atualiza o showing end - --> re-lock nos tempos da tabela passada -- lock again last table times + --re-lock nos tempos da tabela passada -- lock again last table times Details.tabela_vigente:TravarTempos() local n_combate = Details:NumeroCombate (1) --aumenta o contador de combates -- combat number up - --> cria a nova tabela de combates -- create new table + --cria a nova tabela de combates -- create new table local ultimo_combate = Details.tabela_vigente Details.tabela_vigente = Details.combate:NovaTabela (true, Details.tabela_overall, n_combate, ...) --cria uma nova tabela de combate - --> flag this combat as being created + --flag this combat as being created Details.tabela_vigente.IsBeingCreated = true Details.tabela_vigente.previous_combat = ultimo_combate Details.tabela_vigente:seta_data (Details._detalhes_props.DATA_TYPE_START) --seta na tabela do combate a data do inicio do combate -- setup time data Details.in_combat = true --sinaliza ao addon que h� um combate em andamento -- in combat flag up - Details.tabela_vigente.combat_id = n_combate --> grava o n�mero deste combate na tabela atual -- setup combat id on new table + Details.tabela_vigente.combat_id = n_combate --grava o n�mero deste combate na tabela atual -- setup combat id on new table Details.last_combat_pre_pot_used = nil Details:FlagCurrentCombat() - --> � o timer que ve se o jogador ta em combate ou n�o -- check if any party or raid members are in combat + --� o timer que ve se o jogador ta em combate ou n�o -- check if any party or raid members are in combat Details.tabela_vigente.verifica_combate = Details:ScheduleRepeatingTimer ("EstaEmCombate", 1) Details:ClearCCPetsBlackList() @@ -364,29 +364,29 @@ _table_wipe (Details.cache_healing_group) Details:UpdateParserGears() - --> get all buff already applied before the combat start + --get all buff already applied before the combat start Details:CatchRaidBuffUptime ("BUFF_UPTIME_IN") Details:CatchRaidDebuffUptime ("DEBUFF_UPTIME_IN") Details:UptadeRaidMembersCache() - --> we already have boss information? build .is_boss table + --we already have boss information? build .is_boss table if (Details.encounter_table.id and Details.encounter_table ["start"] >= GetTime() - 3 and not Details.encounter_table ["end"]) then local encounter_table = Details.encounter_table - --> boss_found will trigger "COMBAT_BOSS_FOUND" event, but at this point of the combat creation is safe to send it + --boss_found will trigger "COMBAT_BOSS_FOUND" event, but at this point of the combat creation is safe to send it boss_found (encounter_table.index, encounter_table.name, encounter_table.zone, encounter_table.mapid, encounter_table.diff, encounter_table.id) else - --> if we don't have this infor right now, lets check in few seconds dop + --if we don't have this infor right now, lets check in few seconds dop if (Details.EncounterInformation [Details.zone_id]) then Details:ScheduleTimer ("ReadBossFrames", 1) Details:ScheduleTimer ("ReadBossFrames", 30) end end - --> if the window is showing current segment, switch it for the new combat - --> also if the window has auto current, jump to current segment + --if the window is showing current segment, switch it for the new combat + --also if the window has auto current, jump to current segment Details:InstanciaCallFunction (Details.TrocaSegmentoAtual, Details.tabela_vigente.is_boss and true) - --> clear hosts and make the cloud capture stuff + --clear hosts and make the cloud capture stuff Details.host_of = nil Details.host_by = nil @@ -395,22 +395,22 @@ if (not Details:CaptureIsAllEnabled()) then Details:ScheduleSendCloudRequest() --if (Details.debug) then - -- Details:Msg ("(debug) requesting a cloud server.") + -- Details:Msg("(debug) requesting a cloud server.") --end end else --if (Details.debug) then - -- Details:Msg ("(debug) isn't inside a registred instance", Details:IsInInstance()) + -- Details:Msg("(debug) isn't inside a registred instance", Details:IsInInstance()) --end end else --if (Details.debug) then - -- Details:Msg ("(debug) isn't in group or cloud is turned off", Details.in_group, Details.cloud_capture) + -- Details:Msg("(debug) isn't in group or cloud is turned off", Details.in_group, Details.cloud_capture) --end end - --> hide / alpha / switch in combat - for index, instancia in ipairs (Details.tabela_instancias) do + --hide / alpha / switch in combat + for index, instancia in ipairs(Details.tabela_instancias) do if (instancia.ativa) then instancia:CheckSwitchOnCombatStart (true) end @@ -418,20 +418,20 @@ Details:InstanceCall (Details.CheckPsUpdate) - --> combat creation is completed, remove the flag + --combat creation is completed, remove the flag Details.tabela_vigente.IsBeingCreated = nil - Details:SendEvent ("COMBAT_PLAYER_ENTER", nil, Details.tabela_vigente, Details.encounter_table and Details.encounter_table.id) + Details:SendEvent("COMBAT_PLAYER_ENTER", nil, Details.tabela_vigente, Details.encounter_table and Details.encounter_table.id) if (Details.tabela_vigente.is_boss) then - --> the encounter was found through encounter_start event - Details:SendEvent ("COMBAT_BOSS_FOUND", nil, Details.tabela_vigente.is_boss.index, Details.tabela_vigente.is_boss.name) + --the encounter was found through encounter_start event + Details:SendEvent("COMBAT_BOSS_FOUND", nil, Details.tabela_vigente.is_boss.index, Details.tabela_vigente.is_boss.name) end Details:CheckSwitchToCurrent() Details:CheckForTextTimeCounter (true) - --> stop bar testing if any + --stop bar testing if any Details:StopTestBarUpdate() end @@ -449,7 +449,7 @@ function Details:ScheduleSyncPlayerActorData() if ((IsInGroup() or IsInRaid()) and (Details.zone_type == "party" or Details.zone_type == "raid")) then - --> do not sync if in battleground or arena + --do not sync if in battleground or arena Details:SendCharacterData() end end @@ -462,10 +462,10 @@ function Details:SairDoCombate (bossKilled, from_encounter_end) if (Details.debug) then - Details:Msg ("(debug) |cFFFFFF00ended a combat|r|cFFFF7700", Details.encounter_table and Details.encounter_table.name or "") + Details:Msg("(debug) |cFFFFFF00ended a combat|r|cFFFF7700", Details.encounter_table and Details.encounter_table.name or "") end - --> in case of something somehow someway call to close the same combat a second time. + --in case of something somehow someway call to close the same combat a second time. if (Details.tabela_vigente == Details.last_closed_combat) then return end @@ -484,13 +484,13 @@ Details:CatchRaidDebuffUptime ("DEBUFF_UPTIME_OUT") Details:CloseEnemyDebuffsUptime() - --> check if this isn't a boss and try to find a boss in the segment + --check if this isn't a boss and try to find a boss in the segment if (not Details.tabela_vigente.is_boss) then - --> if this is a mythic+ dungeon, do not scan for encounter journal boss names in the actor list + --if this is a mythic+ dungeon, do not scan for encounter journal boss names in the actor list Details:FindBoss() - --> still didn't find the boss + --still didn't find the boss if (not Details.tabela_vigente.is_boss) then local ZoneName, _, DifficultyID, _, _, _, _, ZoneMapID = _GetInstanceInfo() local findboss = Details:GetRaidBossFindFunction (ZoneMapID) @@ -508,28 +508,28 @@ Details.tabela_vigente.bossFunction = nil end - --> finaliza a checagem se esta ou n�o no combate -- finish combat check + --finaliza a checagem se esta ou n�o no combate -- finish combat check if (Details.tabela_vigente.verifica_combate) then Details:CancelTimer (Details.tabela_vigente.verifica_combate) Details.tabela_vigente.verifica_combate = nil end - --> lock timers + --lock timers Details.tabela_vigente:TravarTempos() - --> get waste shields + --get waste shields if (Details.close_shields) then Details:CloseShields (Details.tabela_vigente) end - --> salva hora, minuto, segundo do fim da luta + --salva hora, minuto, segundo do fim da luta Details.tabela_vigente:seta_data (Details._detalhes_props.DATA_TYPE_END) Details.tabela_vigente:seta_tempo_decorrido() - --> drop last events table to garbage collector + --drop last events table to garbage collector Details.tabela_vigente.player_last_events = {} - --> flag instance type + --flag instance type local _, InstanceType = _GetInstanceInfo() Details.tabela_vigente.instance_type = InstanceType @@ -565,14 +565,14 @@ end end - --> tag as a mythic dungeon segment, can be any type of segment, this tag also avoid the segment to be tagged as trash + --tag as a mythic dungeon segment, can be any type of segment, this tag also avoid the segment to be tagged as trash local mythicLevel = C_ChallengeMode and C_ChallengeMode.GetActiveKeystoneInfo() if (mythicLevel and mythicLevel >= 2) then Details.tabela_vigente.is_mythic_dungeon_segment = true Details.tabela_vigente.is_mythic_dungeon_run_id = Details.mythic_dungeon_id end - --> send item level after a combat if is in raid or party group + --send item level after a combat if is in raid or party group C_Timer.After (1, Details.ScheduleSyncPlayerActorData) --if this segment isn't a boss fight @@ -586,7 +586,7 @@ Details.tabela_vigente.enemy = "[" .. ARENA .. "] " .. Details.tabela_vigente.is_arena.name end - local in_instance = IsInInstance() --> garrison returns party as instance type. + local in_instance = IsInInstance() --garrison returns party as instance type. if ((InstanceType == "party" or InstanceType == "raid") and in_instance) then if (InstanceType == "party") then if (Details.tabela_vigente.is_mythic_dungeon_segment) then --setted just above @@ -599,7 +599,7 @@ EJID = Details.MythicPlus.ejID, } else - --> tag the combat as trash clean up + --tag the combat as trash clean up Details.tabela_vigente.is_trash = true end else @@ -617,18 +617,18 @@ local enemy = Details:FindEnemy() if (enemy and Details.debug) then - Details:Msg ("(debug) enemy found", enemy) + Details:Msg("(debug) enemy found", enemy) end Details.tabela_vigente.enemy = enemy end if (Details.debug) then - -- Details:Msg ("(debug) forcing equalize actors behavior.") + -- Details:Msg("(debug) forcing equalize actors behavior.") -- Details:EqualizeActorsSchedule (Details.host_of) end - --> verifica memoria + --verifica memoria Details:FlagActorsOnCommonFight() --fight_component --Details:CheckMemoryAfterCombat() -- 7.2.5 is doing some weird errors even out of combat else @@ -648,27 +648,27 @@ if (bossKilled) then Details.tabela_vigente.is_boss.killed = true - --> add to storage + --add to storage if (not InCombatLockdown() and not UnitAffectingCombat ("player") and not Details.logoff_saving_data) then local successful, errortext = pcall (Details.Database.StoreEncounter) if (not successful) then - Details:Msg ("error occurred on Details.Database.StoreEncounter():", errortext) + Details:Msg("error occurred on Details.Database.StoreEncounter():", errortext) end else Details.schedule_store_boss_encounter = true end - Details:SendEvent ("COMBAT_BOSS_DEFEATED", nil, Details.tabela_vigente) + Details:SendEvent("COMBAT_BOSS_DEFEATED", nil, Details.tabela_vigente) Details:CheckFor_TrashSuppressionOnEncounterEnd() else - Details:SendEvent ("COMBAT_BOSS_WIPE", nil, Details.tabela_vigente) + Details:SendEvent("COMBAT_BOSS_WIPE", nil, Details.tabela_vigente) - --> add to storage + --add to storage if (not InCombatLockdown() and not UnitAffectingCombat ("player") and not Details.logoff_saving_data) then local successful, errortext = pcall (Details.Database.StoreWipe) if (not successful) then - Details:Msg ("error occurred on Details.Database.StoreWipe():", errortext) + Details:Msg("error occurred on Details.Database.StoreWipe():", errortext) end else Details.schedule_store_boss_encounter_wipe = true @@ -692,7 +692,7 @@ end if (Details.pre_pot_used and Details.announce_prepots.enabled) then - Details:Msg (Details.pre_pot_used or "") + Details:Msg(Details.pre_pot_used or "") Details.pre_pot_used = nil end end @@ -704,21 +704,21 @@ Details.tabela_vigente:SetEndTime (Details.encounter_table ["end"] or GetTime()) end - --> encounter boss function + --encounter boss function local bossFunction, bossFunctionType = Details:GetBossFunction (Details.tabela_vigente.is_boss.mapid or 0, Details.tabela_vigente.is_boss.index or 0) if (bossFunction) then if (_bit_band (bossFunctionType, 0x2) ~= 0) then --end of combat if (not Details.logoff_saving_data) then local successful, errortext = pcall (bossFunction, Details.tabela_vigente) if (not successful) then - Details:Msg ("error occurred on Encounter Boss Function:", errortext) + Details:Msg("error occurred on Encounter Boss Function:", errortext) end end end end if (Details.tabela_vigente.instance_type == "raid") then - --> schedule captures off + --schedule captures off Details:CaptureSet (false, "damage", false, 15) Details:CaptureSet (false, "energy", false, 15) @@ -727,11 +727,11 @@ Details:CaptureSet (false, "spellcast", false, 15) if (Details.debug) then - Details:Msg ("(debug) freezing parser for 15 seconds.") + Details:Msg("(debug) freezing parser for 15 seconds.") end end - --> schedule sync + --schedule sync Details:EqualizeActorsSchedule (Details.host_of) if (Details:GetEncounterEqualize (Details.tabela_vigente.is_boss.mapid, Details.tabela_vigente.is_boss.index)) then Details:ScheduleTimer ("DelayedSyncAlert", 3) @@ -745,7 +745,7 @@ end if (Details.solo) then - --> debuffs need a checkup, not well functional right now + --debuffs need a checkup, not well functional right now Details.CloseSoloDebuffs() end @@ -810,14 +810,14 @@ else invalid_combat = Details.tabela_vigente - --> tutorial about the combat time < then 'minimum_combat_time' + --tutorial about the combat time < then 'minimum_combat_time' local hasSeenTutorial = Details:GetTutorialCVar ("MIN_COMBAT_TIME") if (not hasSeenTutorial) then local lower_instance = Details:GetLowerInstanceNumber() if (lower_instance) then lower_instance = Details:GetInstance (lower_instance) if (lower_instance) then - lower_instance:InstanceAlert ("combat ignored: less than 5 seconds.", {[[Interface\BUTTONS\UI-GROUPLOOT-PASS-DOWN]], 18, 18, false, 0, 1, 0, 1}, 20, {function() Details:Msg ("combat ignored: elapsed time less than 5 seconds."); Details:Msg ("add '|cFFFFFF00Details.minimum_combat_time = 2;|r' on Auto Run Code to change the minimum time.") end}) + lower_instance:InstanceAlert ("combat ignored: less than 5 seconds.", {[[Interface\BUTTONS\UI-GROUPLOOT-PASS-DOWN]], 18, 18, false, 0, 1, 0, 1}, 20, {function() Details:Msg("combat ignored: elapsed time less than 5 seconds."); Details:Msg("add '|cFFFFFF00Details.minimum_combat_time = 2;|r' on Auto Run Code to change the minimum time.") end}) Details:SetTutorialCVar ("MIN_COMBAT_TIME", true) end end @@ -827,7 +827,7 @@ if (not Details.tabela_historico.tabelas[1]) then Details.tabela_vigente = Details.tabela_vigente else - Details.tabela_vigente = Details.tabela_historico.tabelas[1] --> pega a tabela do ultimo combate + Details.tabela_vigente = Details.tabela_historico.tabelas[1] --pega a tabela do ultimo combate end if (Details.tabela_vigente:GetStartTime() == 0) then @@ -839,13 +839,13 @@ Details.tabela_vigente.resincked = true - --> tabela foi descartada, precisa atualizar os baseframes // precisa atualizer todos ou apenas o overall? + --tabela foi descartada, precisa atualizar os baseframes // precisa atualizer todos ou apenas o overall? Details:InstanciaCallFunction (Details.AtualizarJanela) if (Details.solo) then local esta_instancia = Details.tabela_instancias[Details.solo] - if (Details.SoloTables.CombatID == Details:NumeroCombate()) then --> significa que o solo mode validou o combate, como matar um bixo muito low level com uma s� porrada - if (Details.SoloTables.CombatIDLast and Details.SoloTables.CombatIDLast ~= 0) then --> volta os dados da luta anterior + if (Details.SoloTables.CombatID == Details:NumeroCombate()) then --significa que o solo mode validou o combate, como matar um bixo muito low level com uma s� porrada + if (Details.SoloTables.CombatIDLast and Details.SoloTables.CombatIDLast ~= 0) then --volta os dados da luta anterior Details.SoloTables.CombatID = Details.SoloTables.CombatIDLast @@ -880,8 +880,8 @@ Details:UpdateParserGears() - --> hide / alpha in combat - for index, instancia in ipairs (Details.tabela_instancias) do + --hide / alpha in combat + for index, instancia in ipairs(Details.tabela_instancias) do if (instancia.ativa) then if (instancia.auto_switch_to_old) then instancia:CheckSwitchOnCombatEnd() @@ -891,22 +891,22 @@ Details.pre_pot_used = nil - --> do not wipe the encounter table if is in the argus encounter ~REMOVE on 8.0 + --do not wipe the encounter table if is in the argus encounter ~REMOVE on 8.0 if (Details.encounter_table and Details.encounter_table.id ~= 2092) then _table_wipe (Details.encounter_table) else if (Details.debug) then - Details:Msg ("(debug) in argus encounter, cannot wipe the encounter table.") + Details:Msg("(debug) in argus encounter, cannot wipe the encounter table.") end end Details:InstanceCall (Details.CheckPsUpdate) if (invalid_combat) then - Details:SendEvent ("COMBAT_INVALID") - Details:SendEvent ("COMBAT_PLAYER_LEAVE", nil, invalid_combat) + Details:SendEvent("COMBAT_INVALID") + Details:SendEvent("COMBAT_PLAYER_LEAVE", nil, invalid_combat) else - Details:SendEvent ("COMBAT_PLAYER_LEAVE", nil, Details.tabela_vigente) + Details:SendEvent("COMBAT_PLAYER_LEAVE", nil, Details.tabela_vigente) end Details:CheckForTextTimeCounter() @@ -1016,7 +1016,7 @@ Details:SairDoCombate() end - --> registra os gr�ficos + --registra os gr�ficos Details:TimeDataRegister ("Your Team Damage", string_arena_myteam_damage, nil, "Details!", "v1.0", [[Interface\ICONS\Ability_DualWield]], true, true) Details:TimeDataRegister ("Enemy Team Damage", string_arena_enemyteam_damage, nil, "Details!", "v1.0", [[Interface\ICONS\Ability_DualWield]], true, true) @@ -1025,10 +1025,10 @@ Details.lastArenaStartTime = GetTime() - --> inicia um novo combate + --inicia um novo combate Details:EntrarEmCombate() - --> sinaliza que esse combate � arena + --sinaliza que esse combate � arena Details.tabela_vigente.arena = true Details.tabela_vigente.is_arena = {name = Details.zone_name, zone = Details.zone_name, mapid = Details.zone_id} @@ -1062,7 +1062,7 @@ function Details:EnteredInArena() if (Details.debug) then - Details:Msg ("(debug) the player EnteredInArena().") + Details:Msg("(debug) the player EnteredInArena().") end Details.arena_begun = false @@ -1072,7 +1072,7 @@ function Details:LeftArena() if (Details.debug) then - Details:Msg ("(debug) player LeftArena().") + Details:Msg("(debug) player LeftArena().") end Details.is_in_arena = false @@ -1088,7 +1088,7 @@ Details:TimeDataUnregister ("Your Team Healing") Details:TimeDataUnregister ("Enemy Team Healing") - Details:SendEvent ("COMBAT_ARENA_END") + Details:SendEvent("COMBAT_ARENA_END") end local validSpells = { @@ -1132,7 +1132,7 @@ } if (Details.debug) then - Details:Msg ("(debug) sending miss data packet:", spellID, containerType, commID) + Details:Msg("(debug) sending miss data packet:", spellID, containerType, commID) end Details:SendRaidOrPartyData (commID, data) @@ -1145,12 +1145,12 @@ local combat = Details.tabela_vigente if (Details.debug) then - Details:Msg ("(debug) miss data received from:", playerName, "spellID:", data [2], data [3], data [4]) + Details:Msg("(debug) miss data received from:", playerName, "spellID:", data [2], data [3], data [4]) end if (combat) then local containerType = data[1] - if (type (containerType) ~= "number" or containerType < 1 or containerType > 4) then + if (type(containerType) ~= "number" or containerType < 1 or containerType > 4) then return end @@ -1173,7 +1173,7 @@ end local total, counter = data[3], data[4] - if (type (total) ~= "number" or type (counter) ~= "number") then + if (type(total) ~= "number" or type (counter) ~= "number") then return end @@ -1193,7 +1193,7 @@ combat [containerType].need_refresh = true if (Details.debug) then - Details:Msg ("(debug) miss data successful added from:", playerName, data [2], "difference:", difference) + Details:Msg("(debug) miss data successful added from:", playerName, data [2], "difference:", difference) end end end @@ -1204,7 +1204,7 @@ function Details:MakeEqualizeOnActor (player, realm, receivedActor) - if (true) then --> disabled for testing + if (true) then --disabled for testing return end @@ -1213,11 +1213,11 @@ if (not damage and not heal and not energy and not misc) then - --> try adding server name + --try adding server name damage, heal, energy, misc = Details:GetAllActors ("current", player.."-"..realm) if (not damage and not heal and not energy and not misc) then - --> not found any actor object, so we need to create + --not found any actor object, so we need to create local actorName @@ -1239,11 +1239,11 @@ misc = combat [4]:PegarCombatente (guid, actorName, 0x514, true) if (Details.debug) then - Details:Msg ("(debug) equalize received actor:", actorName, damage, heal) + Details:Msg("(debug) equalize received actor:", actorName, damage, heal) end else if (Details.debug) then - Details:Msg ("(debug) equalize couldn't get guid for player ",player) + Details:Msg("(debug) equalize couldn't get guid for player ",player) end end end @@ -1257,7 +1257,7 @@ if (damage) then if (damage.total < receivedActor [1][1]) then if (Details.debug) then - Details:Msg (player .. " damage before: " .. damage.total .. " damage received: " .. receivedActor [1][1]) + Details:Msg(player .. " damage before: " .. damage.total .. " damage received: " .. receivedActor [1][1]) end damage.total = receivedActor [1][1] end @@ -1307,11 +1307,11 @@ end function Details:EqualizePets() - --> check for pets without owner - for _, actor in ipairs (Details.tabela_vigente[1]._ActorTable) do - --> have flag and the flag tell us he is a pet + --check for pets without owner + for _, actor in ipairs(Details.tabela_vigente[1]._ActorTable) do + --have flag and the flag tell us he is a pet if (actor.flag_original and bit.band (actor.flag_original, OBJECT_TYPE_PETS) ~= 0) then - --> do not have owner and he isn't on owner container + --do not have owner and he isn't on owner container if (not actor.owner and not Details.tabela_pets.pets [actor.serial]) then Details:SendPetOwnerRequest (actor.serial, actor.nome) end @@ -1321,17 +1321,17 @@ function Details:EqualizeActorsSchedule (host_of) - --> store pets sent through 'needpetowner' + --store pets sent through 'needpetowner' Details.sent_pets = Details.sent_pets or {n = time()} if (Details.sent_pets.n+20 < time()) then _table_wipe (Details.sent_pets) Details.sent_pets.n = time() end - --> pet equilize disabled on details 1.4.0 + --pet equilize disabled on details 1.4.0 --Details:ScheduleTimer ("EqualizePets", 1+math.random()) - --> do not equilize if there is any disabled capture + --do not equilize if there is any disabled capture --if (Details:CaptureIsAllEnabled()) then Details:ScheduleTimer ("EqualizeActors", 2+math.random()+math.random() , host_of) --end @@ -1339,13 +1339,13 @@ function Details:EqualizeActors (host_of) - --> Disabling the sync. Since WoD combatlog are sent between player on phased zones during encounters. - if (not host_of or true) then --> full disabled for testing + --Disabling the sync. Since WoD combatlog are sent between player on phased zones during encounters. + if (not host_of or true) then --full disabled for testing return end if (Details.debug) then - Details:Msg ("(debug) sending equilize actor data") + Details:Msg("(debug) sending equilize actor data") end local damage, heal, energy, misc @@ -1382,7 +1382,7 @@ local data = {damage, heal, energy, misc} - --> envia os dados do proprio host pra ele antes + --envia os dados do proprio host pra ele antes if (host_of) then Details:SendRaidDataAs (Details.network.ids.CLOUD_EQUALIZE, host_of, nil, data) Details:EqualizeActors() @@ -1393,16 +1393,16 @@ end function Details:FlagActorsOnPvPCombat() - for class_type, container in ipairs (Details.tabela_vigente) do - for _, actor in ipairs (container._ActorTable) do + for class_type, container in ipairs(Details.tabela_vigente) do + for _, actor in ipairs(container._ActorTable) do actor.pvp_component = true end end end function Details:FlagActorsOnBossFight() - for class_type, container in ipairs (Details.tabela_vigente) do - for _, actor in ipairs (container._ActorTable) do + for class_type, container in ipairs(Details.tabela_vigente) do + for _, actor in ipairs(container._ActorTable) do actor.boss_fight_component = true end end @@ -1428,9 +1428,9 @@ local mythicDungeonRun = Details.tabela_vigente.is_mythic_dungeon_segment - for class_type, container in ipairs ({damage_container, healing_container}) do + for class_type, container in ipairs({damage_container, healing_container}) do - for _, actor in ipairs (container._ActorTable) do + for _, actor in ipairs(container._ActorTable) do if (mythicDungeonRun) then actor.fight_component = true @@ -1470,7 +1470,7 @@ end function Details:AtualizarJanela (instancia, _segmento) - if (_segmento) then --> apenas atualizar janelas que estejam mostrando o segmento solicitado + if (_segmento) then --apenas atualizar janelas que estejam mostrando o segmento solicitado if (_segmento == instancia.segmento) then instancia:TrocaTabela (instancia, instancia.segmento, instancia.atributo, instancia.sub_atributo, true) end @@ -1515,7 +1515,7 @@ end if ((instancia.last_interaction and (instancia.last_interaction+3 > Details._tempo)) or (DetailsReportWindow and DetailsReportWindow:IsShown()) or (Details.playerDetailWindow:IsShown())) then - --> postpone + --postpone instancia._postponing_current = Details:ScheduleTimer ("PostponeInstanceToCurrent", 1, instancia) return end @@ -1527,12 +1527,12 @@ instancia._postponing_current = nil instancia.showing = Details.tabela_vigente instancia:ResetaGump() - Details.FadeHandler.Fader (instancia, "in", nil, "barras") + Details.FadeHandler.Fader(instancia, "in", nil, "barras") end end function Details:SetTrashSuppression (n) - assert (type (n) == "number", "SetTrashSuppression expects a number on index 1.") + assert (type(n) == "number", "SetTrashSuppression expects a number on index 1.") if (n < 0) then n = 0 end @@ -1556,12 +1556,12 @@ function Details:CheckFor_TrashSuppressionOnEncounterEnd() if (Details.instances_suppress_trash > 0) then Details.HasTrashSuppression = _tempo + Details.instances_suppress_trash - --> delaying in 3 seconds for other stuff like auto open windows after combat. + --delaying in 3 seconds for other stuff like auto open windows after combat. Details:ScheduleTimer ("SetTrashSuppressionAfterEncounter", 3) end end - --> internal GetCombatId() version + --internal GetCombatId() version function Details:NumeroCombate (flag) if (flag == 0) then Details.combat_id = 0 @@ -1571,7 +1571,7 @@ return Details.combat_id end - --> tooltip fork / search key: ~tooltip + --tooltip fork / search key: ~tooltip local avatarPoint = {"bottomleft", "topleft", -3, -4} local backgroundPoint = {{"bottomleft", "topleft", 0, -3}, {"bottomright", "topright", 0, -3}} local textPoint = {"left", "right", -11, -5} @@ -1634,30 +1634,30 @@ GameCooltip:Reset() GameCooltip:SetType ("tooltip") - GameCooltip:SetOption ("StatusBarTexture", [[Interface\AddOns\Details\images\bar_background]]) + GameCooltip:SetOption("StatusBarTexture", [[Interface\AddOns\Details\images\bar_background]]) - GameCooltip:SetOption ("TextSize", Details.tooltip.fontsize) - GameCooltip:SetOption ("TextFont", Details.tooltip.fontface) - GameCooltip:SetOption ("TextColor", Details.tooltip.fontcolor) - GameCooltip:SetOption ("TextColorRight", Details.tooltip.fontcolor_right) - GameCooltip:SetOption ("TextShadow", Details.tooltip.fontshadow and "OUTLINE") + GameCooltip:SetOption("TextSize", Details.tooltip.fontsize) + GameCooltip:SetOption("TextFont", Details.tooltip.fontface) + GameCooltip:SetOption("TextColor", Details.tooltip.fontcolor) + GameCooltip:SetOption("TextColorRight", Details.tooltip.fontcolor_right) + GameCooltip:SetOption("TextShadow", Details.tooltip.fontshadow and "OUTLINE") - GameCooltip:SetOption ("LeftBorderSize", -5) - GameCooltip:SetOption ("RightBorderSize", 5) - GameCooltip:SetOption ("RightTextMargin", 0) - GameCooltip:SetOption ("VerticalOffset", 9) - GameCooltip:SetOption ("AlignAsBlizzTooltip", true) - GameCooltip:SetOption ("AlignAsBlizzTooltipFrameHeightOffset", -8) - GameCooltip:SetOption ("LineHeightSizeOffset", 4) - GameCooltip:SetOption ("VerticalPadding", -4) + GameCooltip:SetOption("LeftBorderSize", -5) + GameCooltip:SetOption("RightBorderSize", 5) + GameCooltip:SetOption("RightTextMargin", 0) + GameCooltip:SetOption("VerticalOffset", 9) + GameCooltip:SetOption("AlignAsBlizzTooltip", true) + GameCooltip:SetOption("AlignAsBlizzTooltipFrameHeightOffset", -8) + GameCooltip:SetOption("LineHeightSizeOffset", 4) + GameCooltip:SetOption("VerticalPadding", -4) - GameCooltip:SetBackdrop (1, Details.cooltip_preset2_backdrop, bgColor, borderColor) + GameCooltip:SetBackdrop(1, Details.cooltip_preset2_backdrop, bgColor, borderColor) end function Details:BuildInstanceBarTooltip (frame) local GameCooltip = GameCooltip Details:FormatCooltipForSpells() - GameCooltip:SetOption ("MinWidth", _math_max (230, self.baseframe:GetWidth()*0.98)) + GameCooltip:SetOption("MinWidth", _math_max (230, self.baseframe:GetWidth()*0.98)) local myPoint = Details.tooltip.anchor_point local anchorPoint = Details.tooltip.anchor_relative @@ -1672,21 +1672,21 @@ end end - function Details:MontaTooltip (frame, whichRowLine, keydown) + function Details:MontaTooltip(frame, whichRowLine, keydown) self:BuildInstanceBarTooltip (frame) local GameCooltip = GameCooltip - local esta_barra = self.barras [whichRowLine] --> barra que o mouse passou em cima e ir� mostrar o tooltip - local objeto = esta_barra.minha_tabela --> pega a referencia da tabela --> retorna a classe_damage ou classe_heal - if (not objeto) then --> a barra n�o possui um objeto + local esta_barra = self.barras [whichRowLine] --barra que o mouse passou em cima e ir� mostrar o tooltip + local objeto = esta_barra.minha_tabela --pega a referencia da tabela --retorna a classe_damage ou classe_heal + if (not objeto) then --a barra n�o possui um objeto return false end --verifica por tooltips especiais: - if (objeto.dead) then --> � uma barra de dead - return Details:ToolTipDead (self, objeto, esta_barra, keydown) --> inst�ncia, [morte], barra + if (objeto.dead) then --� uma barra de dead + return Details:ToolTipDead (self, objeto, esta_barra, keydown) --inst�ncia, [morte], barra elseif (objeto.byspell) then return Details:ToolTipBySpell (self, objeto, esta_barra, keydown) elseif (objeto.frags) then @@ -1695,7 +1695,7 @@ return Details:ToolTipVoidZones (self, objeto, esta_barra, keydown) end - local t = objeto:ToolTip (self, whichRowLine, esta_barra, keydown) --> inst�ncia, n� barra, objeto barra, keydown + local t = objeto:ToolTip (self, whichRowLine, esta_barra, keydown) --inst�ncia, n� barra, objeto barra, keydown if (t) then @@ -1703,15 +1703,15 @@ local avatar = NickTag:GetNicknameTable (objeto.serial, true) if (avatar and not Details.ignore_nicktag) then if (avatar [2] and avatar [4] and avatar [1]) then - GameCooltip:SetBannerImage (1, avatar [2], 80, 40, avatarPoint, avatarTexCoord, nil) --> overlay [2] avatar path - GameCooltip:SetBannerImage (2, avatar [4], 200, 55, backgroundPoint, avatar [5], avatar [6]) --> background - GameCooltip:SetBannerText (1, (not Details.ignore_nicktag and avatar [1]) or objeto.nome, textPoint, avatarTextColor, 14, SharedMedia:Fetch ("font", Details.tooltip.fontface)) --> text [1] nickname + GameCooltip:SetBannerImage (1, avatar [2], 80, 40, avatarPoint, avatarTexCoord, nil) --overlay [2] avatar path + GameCooltip:SetBannerImage (2, avatar [4], 200, 55, backgroundPoint, avatar [5], avatar [6]) --background + GameCooltip:SetBannerText (1, (not Details.ignore_nicktag and avatar [1]) or objeto.nome, textPoint, avatarTextColor, 14, SharedMedia:Fetch ("font", Details.tooltip.fontface)) --text [1] nickname end else --if (Details.remove_realm_from_name and objeto.displayName:find ("%*")) then - -- GameCooltip:SetBannerImage (1, [[Interface\AddOns\Details\images\background]], 20, 30, avatarPoint, avatarTexCoord, {0, 0, 0, 0}) --> overlay [2] avatar path - -- GameCooltip:SetBannerImage (2, [[Interface\PetBattles\Weather-BurntEarth]], 160, 30, {{"bottomleft", "topleft", 0, -5}, {"bottomright", "topright", 0, -5}}, {0.12, 0.88, 1, 0}, {0, 0, 0, 0.1}) --> overlay [2] avatar path {0, 0, 0, 0} - -- GameCooltip:SetBannerText (1, objeto.nome, {"left", "left", 11, -8}, {1, 1, 1, 0.7}, 10, SharedMedia:Fetch ("font", Details.tooltip.fontface)) --> text [1] nickname + -- GameCooltip:SetBannerImage (1, [[Interface\AddOns\Details\images\background]], 20, 30, avatarPoint, avatarTexCoord, {0, 0, 0, 0}) --overlay [2] avatar path + -- GameCooltip:SetBannerImage (2, [[Interface\PetBattles\Weather-BurntEarth]], 160, 30, {{"bottomleft", "topleft", 0, -5}, {"bottomright", "topright", 0, -5}}, {0.12, 0.88, 1, 0}, {0, 0, 0, 0.1}) --overlay [2] avatar path {0, 0, 0, 0} + -- GameCooltip:SetBannerText (1, objeto.nome, {"left", "left", 11, -8}, {1, 1, 1, 0.7}, 10, SharedMedia:Fetch ("font", Details.tooltip.fontface)) --text [1] nickname --end end end @@ -1722,13 +1722,13 @@ function Details.gump:UpdateTooltip (whichRowLine, esta_barra, instancia) if (_IsShiftKeyDown()) then - return instancia:MontaTooltip (esta_barra, whichRowLine, "shift") + return instancia:MontaTooltip(esta_barra, whichRowLine, "shift") elseif (_IsControlKeyDown()) then - return instancia:MontaTooltip (esta_barra, whichRowLine, "ctrl") + return instancia:MontaTooltip(esta_barra, whichRowLine, "ctrl") elseif (_IsAltKeyDown()) then - return instancia:MontaTooltip (esta_barra, whichRowLine, "alt") + return instancia:MontaTooltip(esta_barra, whichRowLine, "alt") else - return instancia:MontaTooltip (esta_barra, whichRowLine) + return instancia:MontaTooltip(esta_barra, whichRowLine) end end @@ -1737,19 +1737,19 @@ end function Details:EsconderBarrasNaoUsadas (instancia, showing) - --> primeira atualiza��o ap�s uma mudan�a de segmento --> verifica se h� mais barras sendo mostradas do que o necess�rio + --primeira atualiza��o ap�s uma mudan�a de segmento -- verifica se h� mais barras sendo mostradas do que o necess�rio -------------------- if (instancia.v_barras) then --print ("mostrando", instancia.rows_showing, instancia.rows_created) for barra_numero = instancia.rows_showing+1, instancia.rows_created do - Details.FadeHandler.Fader (instancia.barras[barra_numero], "in") + Details.FadeHandler.Fader(instancia.barras[barra_numero], "in") end instancia.v_barras = false if (instancia.rows_showing == 0 and instancia:GetSegment() == -1) then -- -1 overall data if (not instancia:IsShowingOverallDataWarning()) then local tutorial = Details:GetTutorialCVar ("OVERALLDATA_WARNING1") or 0 - if ((type (tutorial) == "number") and (tutorial < 60)) then + if ((type(tutorial) == "number") and (tutorial < 60)) then Details:SetTutorialCVar ("OVERALLDATA_WARNING1", tutorial + 1) instancia:ShowOverallDataWarning (true) end @@ -1764,7 +1764,7 @@ return showing end - --> call update functions + --call update functions function Details:RefreshAllMainWindows (forcar) local combatTable = self.showing @@ -1779,24 +1779,24 @@ local need_refresh = combatTable[self.atributo].need_refresh if (not need_refresh and not forcar) then - return --> n�o precisa de refresh + return --n�o precisa de refresh --else --combatTable[self.atributo].need_refresh = false end - if (self.atributo == 1) then --> damage + if (self.atributo == 1) then --damage return atributo_damage:RefreshWindow(self, combatTable, forcar, nil, need_refresh) - elseif (self.atributo == 2) then --> heal + elseif (self.atributo == 2) then --heal return atributo_heal:RefreshWindow(self, combatTable, forcar, nil, need_refresh) - elseif (self.atributo == 3) then --> energy + elseif (self.atributo == 3) then --energy return atributo_energy:RefreshWindow(self, combatTable, forcar, nil, need_refresh) - elseif (self.atributo == 4) then --> outros + elseif (self.atributo == 4) then --outros return atributo_misc:RefreshWindow(self, combatTable, forcar, nil, need_refresh) - elseif (self.atributo == 5) then --> ocustom + elseif (self.atributo == 5) then --ocustom return atributo_custom:RefreshWindow(self, combatTable, forcar, nil, need_refresh) end @@ -1861,7 +1861,7 @@ end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> core +--core function Details:AutoEraseConfirm() @@ -1890,16 +1890,16 @@ --=]=] - local text = Details.gump:CreateLabel (panel, Loc ["STRING_OPTIONS_CONFIRM_ERASE"], nil, nil, "GameFontNormal") - text:SetPoint ("center", panel, "center") - text:SetPoint ("top", panel, "top", 0, -10) + local text = Details.gump:CreateLabel(panel, Loc ["STRING_OPTIONS_CONFIRM_ERASE"], nil, nil, "GameFontNormal") + text:SetPoint("center", panel, "center") + text:SetPoint("top", panel, "top", 0, -10) local no = Details.gump:CreateButton (panel, function() panel:Hide() end, 90, 20, Loc ["STRING_NO"]) - no:SetPoint ("bottomleft", panel, "bottomleft", 30, 10) + no:SetPoint("bottomleft", panel, "bottomleft", 30, 10) no:InstallCustomTexture (nil, nil, nil, nil, true) local yes = Details.gump:CreateButton (panel, function() panel:Hide(); Details.tabela_historico:resetar() end, 90, 20, Loc ["STRING_YES"]) - yes:SetPoint ("bottomright", panel, "bottomright", -30, 10) + yes:SetPoint("bottomright", panel, "bottomright", -30, 10) yes:InstallCustomTexture (nil, nil, nil, nil, true) end diff --git a/core/gears.lua b/core/gears.lua index 36fd77ac..77d7fb5d 100644 --- a/core/gears.lua +++ b/core/gears.lua @@ -27,7 +27,7 @@ function _detalhes:GetCoreVersion() end ------------------------------------------------------------------------------------------------------------ ---> chat hooks +--chat hooks _detalhes.chat_embed = _detalhes:CreateEventListener() _detalhes.chat_embed.startup = true @@ -74,7 +74,7 @@ end _detalhes.chat_tab_embed.single_window = is_single if (current_name ~= tab_name) then - --> rename the tab on chat frame + --rename the tab on chat frame local ChatFrame = _detalhes.chat_embed:GetTab (current_name) if (ChatFrame) then FCF_SetWindowName (ChatFrame, tab_name, false) @@ -82,7 +82,7 @@ end end if (is_enabled) then - --> was disabled, so we need to save the current window positions. + --was disabled, so we need to save the current window positions. if (not current_enabled_state) then local window1 = _detalhes:GetInstance (1) if (window1) then @@ -102,10 +102,10 @@ end end end - --> need to make the embed + --need to make the embed _detalhes.chat_embed:DoEmbed() else - --> need to release the frame + --need to release the frame if (current_enabled_state) then _detalhes.chat_embed:ReleaseEmbed() end @@ -158,27 +158,27 @@ end _detalhes.chat_tab_embed_onframe = ChatFrame if (_detalhes.chat_tab_embed.single_window) then - --> only one window + --only one window local window1 = _detalhes:GetInstance (1) window1:UngroupInstance() window1.baseframe:ClearAllPoints() - window1.baseframe:SetParent (ChatFrame) + window1.baseframe:SetParent(ChatFrame) - window1.rowframe:SetParent (window1.baseframe) + window1.rowframe:SetParent(window1.baseframe) window1.rowframe:ClearAllPoints() window1.rowframe:SetAllPoints() - window1.windowSwitchButton:SetParent (window1.baseframe) + window1.windowSwitchButton:SetParent(window1.baseframe) window1.windowSwitchButton:ClearAllPoints() window1.windowSwitchButton:SetAllPoints() local y_up = window1.toolbar_side == 1 and -20 or 0 local y_down = (window1.show_statusbar and 14 or 0) + (window1.toolbar_side == 2 and 20 or 0) - window1.baseframe:SetPoint ("topleft", ChatFrameBackground, "topleft", 0, y_up + _detalhes.chat_tab_embed.y_offset) - window1.baseframe:SetPoint ("bottomright", ChatFrameBackground, "bottomright", _detalhes.chat_tab_embed.x_offset, y_down) + window1.baseframe:SetPoint("topleft", ChatFrameBackground, "topleft", 0, y_up + _detalhes.chat_tab_embed.y_offset) + window1.baseframe:SetPoint("bottomright", ChatFrameBackground, "bottomright", _detalhes.chat_tab_embed.x_offset, y_down) window1:LockInstance (true) window1:SaveMainWindowPosition() @@ -186,13 +186,13 @@ end local window2 = _detalhes:GetInstance (2) if (window2 and window2.baseframe) then if (window2.baseframe:GetParent() == ChatFrame) then - --> need to detach + --need to detach _detalhes.chat_embed:ReleaseEmbed (true) end end else - --> window #1 and #2 + --window #1 and #2 local window1 = _detalhes:GetInstance (1) local window2 = _detalhes:GetInstance (2) if (not window2) then @@ -204,15 +204,15 @@ end window1.baseframe:ClearAllPoints() window2.baseframe:ClearAllPoints() - window1.baseframe:SetParent (ChatFrame) - window2.baseframe:SetParent (ChatFrame) - window1.rowframe:SetParent (window1.baseframe) - window2.rowframe:SetParent (window2.baseframe) + window1.baseframe:SetParent(ChatFrame) + window2.baseframe:SetParent(ChatFrame) + window1.rowframe:SetParent(window1.baseframe) + window2.rowframe:SetParent(window2.baseframe) - window1.windowSwitchButton:SetParent (window1.baseframe) + window1.windowSwitchButton:SetParent(window1.baseframe) window1.windowSwitchButton:ClearAllPoints() window1.windowSwitchButton:SetAllPoints() - window2.windowSwitchButton:SetParent (window2.baseframe) + window2.windowSwitchButton:SetParent(window2.baseframe) window2.windowSwitchButton:ClearAllPoints() window2.windowSwitchButton:SetAllPoints() @@ -232,11 +232,11 @@ end local width = ChatFrameBackground:GetWidth() / 2 local height = ChatFrameBackground:GetHeight() - y_down + y_up - window1.baseframe:SetSize (width + (_detalhes.chat_tab_embed.x_offset/2), height + _detalhes.chat_tab_embed.y_offset) - window2.baseframe:SetSize (width + (_detalhes.chat_tab_embed.x_offset/2), height + _detalhes.chat_tab_embed.y_offset) + window1.baseframe:SetSize(width + (_detalhes.chat_tab_embed.x_offset/2), height + _detalhes.chat_tab_embed.y_offset) + window2.baseframe:SetSize(width + (_detalhes.chat_tab_embed.x_offset/2), height + _detalhes.chat_tab_embed.y_offset) - window1.baseframe:SetPoint ("topleft", ChatFrameBackground, "topleft", 0, y_up + _detalhes.chat_tab_embed.y_offset) - window2.baseframe:SetPoint ("topright", ChatFrameBackground, "topright", _detalhes.chat_tab_embed.x_offset, y_up + _detalhes.chat_tab_embed.y_offset) + window1.baseframe:SetPoint("topleft", ChatFrameBackground, "topleft", 0, y_up + _detalhes.chat_tab_embed.y_offset) + window2.baseframe:SetPoint("topright", ChatFrameBackground, "topright", _detalhes.chat_tab_embed.x_offset, y_up + _detalhes.chat_tab_embed.y_offset) window1:SaveMainWindowPosition() window2:SaveMainWindowPosition() @@ -248,16 +248,16 @@ end end function _detalhes.chat_embed:ReleaseEmbed (second_window) - --> release + --release local window1 = _detalhes:GetInstance (1) local window2 = _detalhes:GetInstance (2) if (second_window) then window2.baseframe:ClearAllPoints() - window2.baseframe:SetParent (UIParent) - window2.rowframe:SetParent (UIParent) - window2.baseframe:SetPoint ("center", UIParent, "center", 200, 0) - window2.rowframe:SetPoint ("center", UIParent, "center", 200, 0) + window2.baseframe:SetParent(UIParent) + window2.rowframe:SetParent(UIParent) + window2.baseframe:SetPoint("center", UIParent, "center", 200, 0) + window2.rowframe:SetPoint("center", UIParent, "center", 200, 0) window2:LockInstance (false) window2:SaveMainWindowPosition() @@ -269,10 +269,10 @@ end end window1.baseframe:ClearAllPoints() - window1.baseframe:SetParent (UIParent) - window1.rowframe:SetParent (UIParent) - window1.baseframe:SetPoint ("center", UIParent, "center") - window1.rowframe:SetPoint ("center", UIParent, "center") + window1.baseframe:SetParent(UIParent) + window1.rowframe:SetParent(UIParent) + window1.baseframe:SetPoint("center", UIParent, "center") + window1.rowframe:SetPoint("center", UIParent, "center") window1:LockInstance (false) window1:SaveMainWindowPosition() @@ -283,10 +283,10 @@ end if (not _detalhes.chat_tab_embed.single_window and window2) then window2.baseframe:ClearAllPoints() - window2.baseframe:SetParent (UIParent) - window2.rowframe:SetParent (UIParent) - window2.baseframe:SetPoint ("center", UIParent, "center", 200, 0) - window2.rowframe:SetPoint ("center", UIParent, "center", 200, 0) + window2.baseframe:SetParent(UIParent) + window2.rowframe:SetParent(UIParent) + window2.baseframe:SetPoint("center", UIParent, "center", 200, 0) + window2.rowframe:SetPoint("center", UIParent, "center", 200, 0) window2:LockInstance (false) window2:SaveMainWindowPosition() @@ -343,7 +343,7 @@ function _detalhes:SetDeathLogLimit (limit) end else event_table.n = 1 - for _, t in ipairs (event_table) do + for _, t in ipairs(event_table) do wipe (t) end end @@ -385,13 +385,13 @@ function _detalhes:TrackSpecsNow (track_everything) end else local combatlist = {} - for _, combat in ipairs (_detalhes.tabela_historico.tabelas) do + for _, combat in ipairs(_detalhes.tabela_historico.tabelas) do tinsert (combatlist, combat) end tinsert (combatlist, _detalhes.tabela_vigente) tinsert (combatlist, _detalhes.tabela_overall) - for _, combat in ipairs (combatlist) do + for _, combat in ipairs(combatlist) do for _, actor in combat[1]:ListActors() do if (actor:IsPlayer()) then for spellid, spell in pairs (actor:GetSpellList()) do @@ -429,9 +429,9 @@ function _detalhes:ResetSpecCache (forced) if (_detalhes.track_specs) then local my_spec = DetailsFramework.GetSpecialization() - if (type (my_spec) == "number") then + if (type(my_spec) == "number") then local spec_number = DetailsFramework.GetSpecializationInfo (my_spec) - if (type (spec_number) == "number") then + if (type(spec_number) == "number") then local pguid = UnitGUID (_detalhes.playername) if (pguid) then _detalhes.cached_specs [pguid] = spec_number @@ -475,7 +475,7 @@ function _detalhes:RefreshUpdater(suggested_interval) local updateInterval = suggested_interval or _detalhes.update_speed if (_detalhes.streamer_config.faster_updates) then - --> force 60 updates per second + --force 60 updates per second updateInterval = 0.016 end @@ -623,7 +623,7 @@ end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> background tasks +--background tasks local background_tasks = {} @@ -635,12 +635,12 @@ local task_timers = { function _detalhes:RegisterBackgroundTask (name, func, priority, ...) - assert (type (self) == "table", "RegisterBackgroundTask 'self' must be a table.") - assert (type (name) == "string", "RegisterBackgroundTask param #1 must be a string.") - if (type (func) == "string") then - assert (type (self [func]) == "function", "RegisterBackgroundTask param #2 function not found on main object.") + assert (type(self) == "table", "RegisterBackgroundTask 'self' must be a table.") + assert (type(name) == "string", "RegisterBackgroundTask param #1 must be a string.") + if (type(func) == "string") then + assert (type(self [func]) == "function", "RegisterBackgroundTask param #2 function not found on main object.") else - assert (type (func) == "function", "RegisterBackgroundTask param #2 expect a function or function name.") + assert (type(func) == "function", "RegisterBackgroundTask param #2 expect a function or function name.") end priority = priority or "LOW" @@ -674,7 +674,7 @@ function _detalhes:DoBackgroundTasks() for taskName, taskTable in pairs (background_tasks) do if (t > taskTable.nextexec) then - if (type (taskTable.func) == "string") then + if (type(taskTable.func) == "string") then taskTable.object [taskTable.func] (taskTable.object, unpack (taskTable.args, 1, taskTable.args_amt)) else taskTable.func (unpack (taskTable.args, 1, taskTable.args_amt)) @@ -689,13 +689,13 @@ _detalhes.background_tasks_loop = _detalhes:ScheduleRepeatingTimer ("DoBackgroun ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> storage stuff ~storage +--storage stuff ~storage --global database _detalhes.storage = {} function _detalhes.storage:OpenRaidStorage() - --> check if the storage is already loaded + --check if the storage is already loaded if (not IsAddOnLoaded ("Details_DataStorage")) then local loaded, reason = LoadAddOn ("Details_DataStorage") if (not loaded) then @@ -703,7 +703,7 @@ function _detalhes.storage:OpenRaidStorage() end end - --> get the storage table + --get the storage table local db = DetailsDataStorage if (not db and _detalhes.CreateStorageDB) then @@ -733,13 +733,13 @@ function _detalhes.storage:HaveDataForEncounter (diff, encounter_id, guild_name) if (table) then local encounters = table [encounter_id] if (encounters) then - --> didn't requested a guild name, so just return 'we have data for this encounter' + --didn't requested a guild name, so just return 'we have data for this encounter' if (not guild_name) then return true end - --> data for a specific guild is requested, check if there is data for the guild - for index, encounter in ipairs (encounters) do + --data for a specific guild is requested, check if there is data for the guild + for index, encounter in ipairs(encounters) do if (encounter.guild == guild_name) then return true end @@ -786,7 +786,7 @@ function _detalhes.storage:GetBestFromGuild (diff, encounter_id, role, dps, guil if (table) then local encounters = table [encounter_id] if (encounters) then - for index, encounter in ipairs (encounters) do + for index, encounter in ipairs(encounters) do if (encounter.guild == guild_name) then local players = encounter [role] if (players) then @@ -852,7 +852,7 @@ function _detalhes.storage:GetPlayerGuildRank (diff, encounter_id, role, playern if (_table) then local encounters = _table [encounter_id] if (encounters) then - for index, encounter in ipairs (encounters) do + for index, encounter in ipairs(encounters) do if (encounter.guild == guild_name) then local roleTable = encounter [role] for playerName, playerTable in pairs (roleTable) do @@ -931,7 +931,7 @@ function _detalhes.storage:GetBestFromPlayer (diff, encounter_id, role, playerna if (table) then local encounters = table [encounter_id] if (encounters) then - for index, encounter in ipairs (encounters) do + for index, encounter in ipairs(encounters) do local player = encounter [role] and encounter [role] [playername] if (player) then if (best) then @@ -971,7 +971,7 @@ local encounter_is_current_tier = function(encounterID) if (OnlyFromCurrentRaidTier) then local mapID = _detalhes:GetInstanceIdFromEncounterId (encounterID) if (mapID) then - --> if isn'y the mapID in the table to save data + --if isn'y the mapID in the table to save data if (not _detalhes.InstancesToStoreData [mapID]) then return false end @@ -987,9 +987,9 @@ local have_encounter = function(db, ID) local maxTime = ID + 120 for diff, diffTable in pairs (db or {}) do - if (type (diffTable) == "table") then + if (type(diffTable) == "table") then for encounterID, encounterTable in pairs (diffTable) do - for index, encounter in ipairs (encounterTable) do + for index, encounter in ipairs(encounterTable) do --check if the encounter fits in the timespam window if (encounter.time >= minTime and encounter.time <= maxTime) then return true @@ -1030,10 +1030,10 @@ function _detalhes.storage:GetIDsToGuildSync() --build the encounter ID list for diff, diffTable in pairs (db or {}) do - if (type (diffTable) == "table") then + if (type(diffTable) == "table") then for encounterID, encounterTable in pairs (diffTable) do if (encounter_is_current_tier (encounterID)) then - for index, encounter in ipairs (encounterTable) do + for index, encounter in ipairs(encounterTable) do if (encounter.servertime) then if (myGuildName == encounter.guild) then tinsert (IDs, encounter.servertime) @@ -1061,7 +1061,7 @@ function _detalhes.storage:CheckMissingIDsToGuildSync (IDsList) return end - if (type (IDsList) ~= "table") then + if (type(IDsList) ~= "table") then if (_detalhes.debug) then _detalhes:Msg ("(debug) [RoS-EncounterSync] RoC IDsList isn't a table.") end @@ -1075,7 +1075,7 @@ function _detalhes.storage:CheckMissingIDsToGuildSync (IDsList) local RequestIDs = {} --check missing IDs - for index, ID in ipairs (IDsList) do + for index, ID in ipairs(IDsList) do if (not have_encounter (db, ID)) then if (not have_recent_requested_encounter (ID)) then tinsert (RequestIDs, ID) @@ -1099,7 +1099,7 @@ function _detalhes.storage:BuildEncounterDataToGuildSync (IDsList) return end - if (type (IDsList) ~= "table") then + if (type(IDsList) ~= "table") then if (_detalhes.debug) then _detalhes:Msg ("(debug) [RoS-EncounterSync] IDsList isn't a table.") end @@ -1117,14 +1117,14 @@ function _detalhes.storage:BuildEncounterDataToGuildSync (IDsList) _detalhes:Msg ("(debug) [RoS-EncounterSync] the client requested " .. #IDsList .. " encounters.") end - for index, ID in ipairs (IDsList) do + for index, ID in ipairs(IDsList) do for diff, diffTable in pairs (db or {}) do - if (type (diffTable) == "table") then + if (type(diffTable) == "table") then for encounterID, encounterTable in pairs (diffTable) do - for index, encounter in ipairs (encounterTable) do + for index, encounter in ipairs(encounterTable) do - if (ID == encounter.time or ID == encounter.servertime) then --> the time here is always exactly + if (ID == encounter.time or ID == encounter.servertime) then --the time here is always exactly --send this encounter CurrentTable [diff] = CurrentTable [diff] or {} CurrentTable [diff] [encounterID] = CurrentTable [diff] [encounterID] or {} @@ -1167,12 +1167,12 @@ function _detalhes.storage:AddGuildSyncData (data, source) _detalhes.LastGuildSyncReceived = GetTime() for diff, diffTable in pairs (data) do - if (type (diff) == "number" and type (diffTable) == "table") then + if (type(diff) == "number" and type (diffTable) == "table") then for encounterID, encounterTable in pairs (diffTable) do - if (type (encounterID) == "number" and type (encounterTable) == "table") then - for index, encounter in ipairs (encounterTable) do + if (type(encounterID) == "number" and type (encounterTable) == "table") then + for index, encounter in ipairs(encounterTable) do --validate the encounter - if (type (encounter.servertime) == "number" and type (encounter.time) == "number" and type (encounter.guild) == "string" and type (encounter.date) == "string" and type (encounter.healing) == "table" and type (encounter.elapsed) == "number" and type (encounter.damage) == "table") then + if (type(encounter.servertime) == "number" and type (encounter.time) == "number" and type (encounter.guild) == "string" and type (encounter.date) == "string" and type (encounter.healing) == "table" and type (encounter.elapsed) == "number" and type (encounter.damage) == "table") then --check if the encounter is from the current raiding tier if (encounter_is_current_tier (encounterID)) then --check if this encounter already has been added from another sync @@ -1266,7 +1266,7 @@ function _detalhes.storage:GetPlayerData (diff, encounter_id, playername) end local t = {} - assert (type (playername) == "string", "PlayerName must be a string.") + assert (type(playername) == "string", "PlayerName must be a string.") if (not diff) then @@ -1335,7 +1335,7 @@ function _detalhes.storage:GetEncounterData (diff, encounter_id, guild) local data = db [diff] assert (data, "Difficulty not found. Use: 14, 15 or 16.") - assert (type (encounter_id) == "number", "EncounterId must be a number.") + assert (type(encounter_id) == "number", "EncounterId must be a number.") data = data [encounter_id] @@ -1361,7 +1361,7 @@ function _detalhes.storage:GetEncounterData (diff, encounter_id, guild) end local create_storage_tables = function() - --> get the storage table + --get the storage table local db = DetailsDataStorage if (not db and _detalhes.CreateStorageDB) then @@ -1418,9 +1418,9 @@ end function _detalhes.OpenStorage() --if the player is in combat, this function return false, if failed to load by other reason it returns nil - --> check if the storage is already loaded + --check if the storage is already loaded if (not IsAddOnLoaded ("Details_DataStorage")) then - --> can't open it during combat + --can't open it during combat if (InCombatLockdown() or UnitAffectingCombat ("player")) then if (_detalhes.debug) then print ("|cFFFFFF00Details! Storage|r: can't load storage due to combat.") @@ -1462,7 +1462,7 @@ function Details.Database.LoadDB() end end - --> get the storage table + --get the storage table local db = _G.DetailsDataStorage if (not db and _detalhes.CreateStorageDB) then @@ -1621,7 +1621,7 @@ function Details.Database.StoreEncounter(combat) --total kills in a boss on raid or dungeon local totalkills_database = Details.Database.GetBossKillsDB(db) - --> store total kills on this boss + --store total kills on this boss --if the player is facing a raid boss if (IsInRaid()) then totalkills_database[encounter_id] = totalkills_database[encounter_id] or {} @@ -1663,10 +1663,10 @@ function Details.Database.StoreEncounter(combat) end - --> check for heroic and mythic + --check for heroic and mythic if (storageDebug or (diff == 15 or diff == 16 or diff == 14)) then --test on raid finder: ' or diff == 17' -- normal mode: diff == 14 or - --> check the guild name + --check the guild name local match = 0 local guildName = GetGuildInfo ("player") local raidSize = GetNumGroupMembers() or 0 @@ -1747,14 +1747,14 @@ function Details.Database.StoreEncounter(combat) end end - --> add the encounter data + --add the encounter data tinsert (encounter_database, this_combat_data) if (_detalhes.debug) then print ("|cFFFFFF00Details! Storage|r: combat data added to encounter database.") end local myrole = UnitGroupRolesAssigned ("player") - local mybest, onencounter = _detalhes.storage:GetBestFromPlayer (diff, encounter_id, myrole, _detalhes.playername, true) --> get dps or hps + local mybest, onencounter = _detalhes.storage:GetBestFromPlayer (diff, encounter_id, myrole, _detalhes.playername, true) --get dps or hps local mybest2 = mybest and mybest[1] or 0 if (mybest and onencounter) then @@ -1804,7 +1804,7 @@ function Details.Database.StoreEncounter(combat) end -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> inspect stuff +--inspect stuff _detalhes.ilevel = {} local ilvl_core = _detalhes:CreateEventListener() @@ -1827,7 +1827,7 @@ function ilvl_core:HasQueuedInspec (unitName) end end -local inspect_frame = CreateFrame ("frame") +local inspect_frame = CreateFrame("frame") inspect_frame:RegisterEvent ("INSPECT_READY") local two_hand = { @@ -1843,7 +1843,7 @@ local LOOP_TIME = 7 function _detalhes:IlvlFromNetwork (player, realm, core, serialNumber, itemLevel, talentsSelected, currentSpec) if (_detalhes.debug) then local talents = "Invalid Talents" - if (type (talentsSelected) == "table") then + if (type(talentsSelected) == "table") then talents = "" for i = 1, #talentsSelected do talents = talents .. talentsSelected [i] .. "," @@ -1856,44 +1856,44 @@ function _detalhes:IlvlFromNetwork (player, realm, core, serialNumber, itemLevel return end - --> older versions of details wont send serial nor talents nor spec + --older versions of details wont send serial nor talents nor spec if (not serialNumber or not itemLevel or not talentsSelected or not currentSpec) then --if any data is invalid, abort return end - --> won't inspect this actor + --won't inspect this actor _detalhes.trusted_characters [serialNumber] = true - if (type (serialNumber) ~= "string") then + if (type(serialNumber) ~= "string") then return end --store the item level - if (type (itemLevel) == "number") then + if (type(itemLevel) == "number") then _detalhes.item_level_pool [serialNumber] = {name = player, ilvl = itemLevel, time = time()} end --store talents - if (type (talentsSelected) == "table") then + if (type(talentsSelected) == "table") then if (talentsSelected [1]) then _detalhes.cached_talents [serialNumber] = talentsSelected end end --store the spec the player is playing - if (type (currentSpec) == "number") then + if (type(currentSpec) == "number") then _detalhes.cached_specs [serialNumber] = currentSpec end end ---> test +--test --/run _detalhes.ilevel:CalcItemLevel ("player", UnitGUID("player"), true) --/run wipe (_detalhes.item_level_pool) function ilvl_core:CalcItemLevel (unitid, guid, shout) - if (type (unitid) == "table") then + if (type(unitid) == "table") then shout = unitid [3] guid = unitid [2] unitid = unitid [1] @@ -1901,7 +1901,7 @@ function ilvl_core:CalcItemLevel (unitid, guid, shout) if (unitid and CanInspect(unitid) and UnitPlayerControlled(unitid) and CheckInteractDistance(unitid, CONST_INSPECT_ACHIEVEMENT_DISTANCE)) then - --> 16 = all itens including main and off hand + --16 = all itens including main and off hand local item_amount = 16 local item_level = 0 local failed = 0 @@ -1914,8 +1914,8 @@ function ilvl_core:CalcItemLevel (unitid, guid, shout) if (iLevel) then item_level = item_level + iLevel - --> 16 = main hand 17 = off hand - --> if using a two-hand, ignore the off hand slot + --16 = main hand 17 = off hand + -- if using a two-hand, ignore the off hand slot if (equip_id == 16 and two_hand [equipSlot]) then item_amount = 15 break @@ -1933,7 +1933,7 @@ function ilvl_core:CalcItemLevel (unitid, guid, shout) local average = item_level / item_amount --print (UnitName (unitid), "ILVL:", average, unitid, "items:", item_amount) - --> register + --register if (average > 0) then if (shout) then _detalhes:Msg (UnitName(unitid) .. " item level: " .. average) @@ -1977,7 +1977,7 @@ function ilvl_core:CalcItemLevel (unitid, guid, shout) -------------------------------------------------------------------------------------------------------- if (ilvl_core.forced_inspects [guid]) then - if (type (ilvl_core.forced_inspects [guid].callback) == "function") then + if (type(ilvl_core.forced_inspects [guid].callback) == "function") then local okey, errortext = pcall (ilvl_core.forced_inspects[guid].callback, guid, unitid, ilvl_core.forced_inspects[guid].param1, ilvl_core.forced_inspects[guid].param2) if (not okey) then _detalhes:Msg ("Error on QueryInspect callback: " .. errortext) @@ -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 @@ -2002,7 +2002,7 @@ inspect_frame:SetScript ("OnEvent", function(self, event, ...) ilvl_core:CancelTimer (cancel_tread) - --> do inspect stuff + --do inspect stuff if (unitid) then local t = {unitid, guid} --ilvl_core:ScheduleTimer ("CalcItemLevel", 0.5, t) @@ -2044,7 +2044,7 @@ function ilvl_core:GetItemLevel (unitid, guid, is_forced, try_number) return end - --> ddouble check + --ddouble check if (not is_forced and (UnitAffectingCombat ("player") or InCombatLockdown())) then return end @@ -2186,7 +2186,7 @@ function ilvl_core:Loop() return end - --> if already inspecting or the actor is in the list of trusted actors + --if already inspecting or the actor is in the list of trusted actors if (inspecting [guid] or _detalhes.trusted_characters [guid]) then return end @@ -2252,12 +2252,12 @@ function ilvl_core:OnLeave() end end ---> ilvl API +--ilvl API function _detalhes.ilevel:IsTrackerEnabled() return _detalhes.track_item_level end function _detalhes.ilevel:TrackItemLevel (bool) - if (type (bool) == "boolean") then + if (type(bool) == "boolean") then if (bool) then _detalhes.track_item_level = true if (can_start_loop()) then @@ -2349,27 +2349,27 @@ function Details:DecompressData (data, dataType) dataCompressed = LibDeflate:DecodeForPrint (data) if (not dataCompressed) then - Details:Msg ("couldn't decode the data.") + Details:Msg("couldn't decode the data.") return false end elseif (dataType == "comm") then dataCompressed = LibDeflate:DecodeForWoWAddonChannel (data) if (not dataCompressed) then - Details:Msg ("couldn't decode the data.") + Details:Msg("couldn't decode the data.") return false end end local dataSerialized = LibDeflate:DecompressDeflate (dataCompressed) if (not dataSerialized) then - Details:Msg ("couldn't uncompress the data.") + Details:Msg("couldn't uncompress the data.") return false end local okay, data = LibAceSerializer:Deserialize (dataSerialized) if (not okay) then - Details:Msg ("couldn't unserialize the data.") + Details:Msg("couldn't unserialize the data.") return false end @@ -2379,7 +2379,7 @@ end --oldschool talent tree if (DetailsFramework.IsWotLKWow()) then - local talentWatchClassic = CreateFrame ("frame") + local talentWatchClassic = CreateFrame("frame") talentWatchClassic:RegisterEvent("CHARACTER_POINTS_CHANGED") talentWatchClassic:RegisterEvent("SPELLS_CHANGED") talentWatchClassic:RegisterEvent("PLAYER_ENTERING_WORLD") @@ -2488,8 +2488,8 @@ if (DetailsFramework.IsWotLKWow()) then if (iLevel) then item_level = item_level + iLevel - --> 16 = main hand 17 = off hand - --> if using a two-hand, ignore the off hand slot + --16 = main hand 17 = off hand + -- if using a two-hand, ignore the off hand slot if (equip_id == 16 and two_hand [equipSlot]) then item_amount = 15 break diff --git a/core/meta.lua b/core/meta.lua index 19a7a56b..45e85637 100644 --- a/core/meta.lua +++ b/core/meta.lua @@ -4,7 +4,7 @@ local _tempo = time() ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> local pointers +--local pointers local _ local _pairs = pairs --lua local local _ipairs = ipairs --lua local @@ -30,7 +30,7 @@ local container_damage_target = _detalhes.container_type.CONTAINER_DAMAGETARGET_CLASS ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> constants +--constants local class_type_dano = _detalhes.atributos.dano local class_type_cura = _detalhes.atributos.cura @@ -38,9 +38,9 @@ local class_type_misc = _detalhes.atributos.misc ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> core +--core - --> reconstr�i o mapa do container + --reconstr�i o mapa do container local function ReconstroiMapa (tabela) local mapa = {} for i = 1, #tabela._ActorTable do @@ -49,7 +49,7 @@ tabela._NameIndexTable = mapa end - --> reaplica as tabelas no overall + --reaplica as tabelas no overall function _detalhes:RestauraOverallMetaTables() local is_in_instance = select (1, IsInInstance()) @@ -71,8 +71,8 @@ local todos_atributos = {combate [class_type_dano]._ActorTable, combate [class_type_cura]._ActorTable, combate [class_type_e_energy]._ActorTable, combate [class_type_misc]._ActorTable} - for class_type, atributo in _ipairs (todos_atributos) do - for _, esta_classe in _ipairs (atributo) do + for class_type, atributo in _ipairs(todos_atributos) do + for _, esta_classe in _ipairs(atributo) do local nome = esta_classe.nome @@ -101,9 +101,9 @@ end end - for class_type, atributo in _ipairs (todos_atributos) do - for _, esta_classe in _ipairs (atributo) do - if (esta_classe.ownerName) then --> nome do owner + for class_type, atributo in _ipairs(todos_atributos) do + for _, esta_classe in _ipairs(atributo) do + if (esta_classe.ownerName) then --nome do owner esta_classe.owner = combate (class_type, esta_classe.ownerName) end end @@ -111,26 +111,26 @@ end - --> reaplica indexes e metatables + --reaplica indexes e metatables function _detalhes:RestauraMetaTables() _detalhes.refresh:r_atributo_custom() - --> container de pets e hist�rico + --container de pets e hist�rico _detalhes.refresh:r_container_pets (_detalhes.tabela_pets) _detalhes.refresh:r_historico (_detalhes.tabela_historico) - --> tabelas dos combates + --tabelas dos combates local combate_overall = _detalhes.tabela_overall - local overall_dano = combate_overall [class_type_dano] --> damage atalho - local overall_cura = combate_overall [class_type_cura] --> heal atalho - local overall_energy = combate_overall [class_type_e_energy] --> energy atalho - local overall_misc = combate_overall [class_type_misc] --> misc atalho + local overall_dano = combate_overall [class_type_dano] --damage atalho + local overall_cura = combate_overall [class_type_cura] --heal atalho + local overall_energy = combate_overall [class_type_e_energy] --energy atalho + local overall_misc = combate_overall [class_type_misc] --misc atalho - local tabelas_do_historico = _detalhes.tabela_historico.tabelas --> atalho + local tabelas_do_historico = _detalhes.tabela_historico.tabelas --atalho - --> recupera meta function - for _, combat_table in _ipairs (tabelas_do_historico) do + --recupera meta function + for _, combat_table in _ipairs(tabelas_do_historico) do combat_table.__call = _detalhes.call_combate end @@ -139,7 +139,7 @@ combat.previous_combat = tabelas_do_historico [i+1] end - --> tempo padrao do overall + --tempo padrao do overall local overall_saved = combate_overall.overall_refreshed @@ -150,16 +150,16 @@ local is_in_instance = select (1, IsInInstance()) - --> inicia a recupera��o das tabelas e montagem do overall + --inicia a recupera��o das tabelas e montagem do overall if (#tabelas_do_historico > 0) then - for index, combate in _ipairs (tabelas_do_historico) do + for index, combate in _ipairs(tabelas_do_historico) do combate.hasSaved = true - --> recupera a meta e indexes da tabela do combate + --recupera a meta e indexes da tabela do combate _detalhes.refresh:r_combate (combate, combate_overall) - --> aumenta o tempo do combate do overall, seta as datas e os combates armazenados + --aumenta o tempo do combate do overall, seta as datas e os combates armazenados if (not overall_saved and combate.overall_added) then if (combate.end_time and combate.start_time) then @@ -185,22 +185,22 @@ end - --> recupera a meta e indexes dos 4 container + --recupera a meta e indexes dos 4 container _detalhes.refresh:r_container_combatentes (combate [class_type_dano], overall_dano) _detalhes.refresh:r_container_combatentes (combate [class_type_cura], overall_cura) _detalhes.refresh:r_container_combatentes (combate [class_type_e_energy], overall_energy) _detalhes.refresh:r_container_combatentes (combate [class_type_misc], overall_misc) - --> ghost container + --ghost container if (combate[5]) then _detalhes.refresh:r_container_combatentes (combate [5], combate_overall [5]) end - --> tabela com os 4 tabelas de jogadores + --tabela com os 4 tabelas de jogadores local todos_atributos = {combate [class_type_dano]._ActorTable, combate [class_type_cura]._ActorTable, combate [class_type_e_energy]._ActorTable, combate [class_type_misc]._ActorTable} - for class_type, atributo in _ipairs (todos_atributos) do - for _, esta_classe in _ipairs (atributo) do + for class_type, atributo in _ipairs(todos_atributos) do + for _, esta_classe in _ipairs(atributo) do local nome = esta_classe.nome @@ -246,10 +246,10 @@ end end - --> reconstr�i a tabela dos pets - for class_type, atributo in _ipairs (todos_atributos) do - for _, esta_classe in _ipairs (atributo) do - if (esta_classe.ownerName) then --> nome do owner + --reconstr�i a tabela dos pets + for class_type, atributo in _ipairs(todos_atributos) do + for _, esta_classe in _ipairs(atributo) do + if (esta_classe.ownerName) then --nome do owner esta_classe.owner = combate (class_type, esta_classe.ownerName) end end @@ -259,14 +259,14 @@ --fim end - --> restaura last_events_table - local primeiro_combate = tabelas_do_historico [1] --> primeiro combate + --restaura last_events_table + local primeiro_combate = tabelas_do_historico [1] --primeiro combate if (primeiro_combate) then primeiro_combate [1]:ActorCallFunction (atributo_damage.r_last_events_table) primeiro_combate [2]:ActorCallFunction (atributo_heal.r_last_events_table) end - local segundo_combate = tabelas_do_historico [2] --> segundo combate + local segundo_combate = tabelas_do_historico [2] --segundo combate if (segundo_combate) then segundo_combate [1]:ActorCallFunction (atributo_damage.r_last_events_table) segundo_combate [2]:ActorCallFunction (atributo_heal.r_last_events_table) @@ -276,8 +276,8 @@ function _detalhes:DoInstanceCleanup() - --> normal instances - for _, esta_instancia in _ipairs (_detalhes.tabela_instancias) do + --normal instances + for _, esta_instancia in _ipairs(_detalhes.tabela_instancias) do if (esta_instancia.StatusBar.left) then esta_instancia.StatusBarSaved = { @@ -292,7 +292,7 @@ } end - --> erase all widgets frames + --erase all widgets frames esta_instancia.scroll = nil esta_instancia.baseframe = nil @@ -329,8 +329,8 @@ end - --> unused instances - for _, esta_instancia in _ipairs (_detalhes.unused_instances) do + --unused instances + for _, esta_instancia in _ipairs(_detalhes.unused_instances) do if (esta_instancia.StatusBar.left) then esta_instancia.StatusBarSaved = { @@ -345,7 +345,7 @@ } end - --> erase all widgets frames + --erase all widgets frames esta_instancia.scroll = nil esta_instancia.baseframe = nil esta_instancia.bgframe = nil @@ -389,9 +389,9 @@ overall_added = true end - for index, combat in _ipairs (combats) do - for index, container in _ipairs (combat) do - for index, esta_classe in _ipairs (container._ActorTable) do + for index, combat in _ipairs(combats) do + for index, container in _ipairs(combat) do + for index, esta_classe in _ipairs(container._ActorTable) do esta_classe.owner = nil end end @@ -410,9 +410,9 @@ overall_added = true end - for index, combat in _ipairs (combats) do - for class_type, container in _ipairs (combat) do - for index, esta_classe in _ipairs (container._ActorTable) do + for index, combat in _ipairs(combats) do + for class_type, container in _ipairs(combat) do + for index, esta_classe in _ipairs(container._ActorTable) do esta_classe.displayName = nil esta_classe.minha_barra = nil @@ -444,9 +444,9 @@ overall_added = true end - for index, combat in _ipairs (combats) do + for index, combat in _ipairs(combats) do _detalhes.clear:c_combate (combat) - for index, container in _ipairs (combat) do + for index, container in _ipairs(combat) do _detalhes.clear:c_container_combatentes (container) end end @@ -464,8 +464,8 @@ overall_added = true end - for index, combat in _ipairs (combats) do - for index, container in _ipairs (combat) do + for index, combat in _ipairs(combats) do + for index, container in _ipairs(combat) do _detalhes.clear:c_container_combatentes_index (container) end end @@ -475,21 +475,21 @@ end end - --> limpa indexes, metatables e shadows + --limpa indexes, metatables e shadows function _detalhes:PrepareTablesForSave() _detalhes.clear_ungrouped = true - --> clear instances + --clear instances _detalhes:DoInstanceCleanup() _detalhes:DoClassesCleanup() --aumentou 1 combat _detalhes:DoContainerCleanup() --aumentou 1 combat - --> clear combats + --clear combats local tabelas_de_combate = {} local historico_tabelas = _detalhes.tabela_historico.tabelas or {} - --> remove os segmentos de trash + --remove os segmentos de trash for i = #historico_tabelas, 1, -1 do local combate = historico_tabelas [i] if (combate:IsTrash()) then @@ -497,7 +497,7 @@ end end - --> remove os segmentos > que o limite permitido para salvar + --remove os segmentos > que o limite permitido para salvar if (_detalhes.segments_amount_to_save and _detalhes.segments_amount_to_save < _detalhes.segments_amount) then for i = _detalhes.segments_amount, _detalhes.segments_amount_to_save+1, -1 do if (_detalhes.tabela_historico.tabelas [i]) then @@ -506,10 +506,10 @@ end end - --> tabela do combate atual + --tabela do combate atual local tabela_atual = _detalhes.tabela_vigente or _detalhes.combate:NovaTabela (_, _detalhes.tabela_overall) - --> limpa a tabela overall + --limpa a tabela overall if (_detalhes.overall_clear_logout) then _detalhes.tabela_overall = nil _detalhes_database.tabela_overall = nil @@ -519,14 +519,14 @@ _combate.previous_combat = nil local todos_atributos = {_combate [class_type_dano] or {}, _combate [class_type_cura] or {}, _combate [class_type_e_energy] or {}, _combate [class_type_misc] or {}} - for class_type, _tabela in _ipairs (todos_atributos) do + for class_type, _tabela in _ipairs(todos_atributos) do local conteudo = _tabela._ActorTable - --> Limpa tabelas que n�o estejam em grupo + --Limpa tabelas que n�o estejam em grupo if (conteudo) then if (_detalhes.clear_ungrouped) then --if (not _detalhes.clear_ungrouped) then - local _iter = {index = 1, data = conteudo[1], cleaned = 0} --> ._ActorTable[1] para pegar o primeiro index + local _iter = {index = 1, data = conteudo[1], cleaned = 0} --._ActorTable[1] para pegar o primeiro index while (_iter.data) do --search key: ~deletar ~apagar local can_erase = true @@ -567,18 +567,18 @@ end end - for _, _tabela in _ipairs (historico_tabelas) do + for _, _tabela in _ipairs(historico_tabelas) do tabelas_de_combate [#tabelas_de_combate+1] = _tabela end - for tabela_index, _combate in _ipairs (tabelas_de_combate) do + for tabela_index, _combate in _ipairs(tabelas_de_combate) do - --> limpa a tabela do grafico + --limpa a tabela do grafico if (_detalhes.clear_graphic) then _combate.TimeData = {} end - --> limpa a referencia do ultimo combate + --limpa a referencia do ultimo combate _combate.previous_combat = nil local container_dano = _combate [class_type_dano] or {} @@ -596,18 +596,18 @@ end if (not _combate.is_mythic_dungeon_segment) then - for class_type, _tabela in _ipairs (todos_atributos) do + for class_type, _tabela in _ipairs(todos_atributos) do local conteudo = _tabela._ActorTable - --> Limpa tabelas que n�o estejam em grupo + --Limpa tabelas que n�o estejam em grupo if (conteudo) then if (_detalhes.clear_ungrouped) then --n�o deleta dummies e actors de fora do grupo --if (not _detalhes.clear_ungrouped) then - local _iter = {index = 1, data = conteudo[1], cleaned = 0} --> ._ActorTable[1] para pegar o primeiro index + local _iter = {index = 1, data = conteudo[1], cleaned = 0} --._ActorTable[1] para pegar o primeiro index while (_iter.data) do --search key: ~deletar ~apagar local can_erase = true @@ -631,7 +631,7 @@ if (can_erase) then - if (not _iter.data.owner) then --> pet + if (not _iter.data.owner) then --pet local myself = _iter.data if (myself.tipo == class_type_dano or myself.tipo == class_type_cura) then @@ -659,7 +659,7 @@ _combate.totals_grupo [myself.tipo] ["ress"] = _combate.totals_grupo [myself.tipo] ["ress"] - myself.ress end end - --> n�o precisa diminuir o total dos buffs e debuffs + --n�o precisa diminuir o total dos buffs e debuffs if (myself.cooldowns_defensive) then _combate.totals [myself.tipo] ["cooldowns_defensive"] = _combate.totals [myself.tipo] ["cooldowns_defensive"] - myself.cooldowns_defensive if (myself.grupo) then @@ -708,27 +708,27 @@ end --end is mythic dungeon segment end - --> panic mode + --panic mode if (_detalhes.segments_panic_mode and _detalhes.can_panic_mode) then if (_detalhes.tabela_vigente.is_boss) then _detalhes.tabela_historico = _detalhes.historico:NovoHistorico() end end - --> clear all segments on logoff + --clear all segments on logoff if (_detalhes.data_cleanup_logout) then _detalhes.tabela_historico = _detalhes.historico:NovoHistorico() _detalhes.tabela_overall = nil _detalhes_database.tabela_overall = nil end - --> clear customs + --clear customs _detalhes.clear:c_atributo_custom() - --> clear owners + --clear owners _detalhes:DoOwnerCleanup() - --> cleaer container indexes + --cleaer container indexes _detalhes:DoContainerIndexCleanup() end @@ -737,7 +737,7 @@ instancia.showing[instancia.atributo].need_refresh = true instancia.v_barras = true instancia:ResetaGump() - instancia:RefreshMainWindow (true) + instancia:RefreshMainWindow(true) end end @@ -748,7 +748,7 @@ UpdateAddOnMemoryUsage() local memory = GetAddOnMemoryUsage ("Details") if (memory > _detalhes.memory_ram) then - _detalhes:IniciarColetaDeLixo (true, 60) --> sending true doesn't check anythink + _detalhes:IniciarColetaDeLixo (true, 60) --sending true doesn't check anythink end end end @@ -762,7 +762,7 @@ _detalhes:Msg ("(debug) checking memory periodically. Using: ",math.floor (memory)) end if (memory > _detalhes.memory_ram * 1000) then - _detalhes:IniciarColetaDeLixo (1, 60) --> sending 1 only check for combat and ignore garbage collect cooldown + _detalhes:IniciarColetaDeLixo (1, 60) --sending 1 only check for combat and ignore garbage collect cooldown end end end @@ -777,7 +777,7 @@ return end else - if (type (forcar) ~= "boolean") then + if (type(forcar) ~= "boolean") then if (forcar == 1) then if (_detalhes.in_combat or _InCombatLockdown()) then _detalhes:ScheduleTimer ("IniciarColetaDeLixo", 5, forcar) @@ -797,13 +797,13 @@ local memory = GetAddOnMemoryUsage ("Details") - --> reseta o cache do parser + --reseta o cache do parser _detalhes:ClearParserCache() - --> limpa barras que n�o est�o sendo usadas nas inst�ncias. - for index, instancia in _ipairs (_detalhes.tabela_instancias) do + --limpa barras que n�o est�o sendo usadas nas inst�ncias. + for index, instancia in _ipairs(_detalhes.tabela_instancias) do if (instancia.barras and instancia.barras [1]) then - for i, barra in _ipairs (instancia.barras) do + for i, barra in _ipairs(instancia.barras) do if (not barra:IsShown()) then barra.minha_tabela = nil end @@ -811,7 +811,7 @@ end end - --> faz a coleta nos 4 atributos + --faz a coleta nos 4 atributos local damage = atributo_damage:ColetarLixo (lastevent) local heal = atributo_heal:ColetarLixo (lastevent) local energy = atributo_energy:ColetarLixo (lastevent) @@ -819,28 +819,28 @@ local limpados = damage + heal + energy + misc - --> refresh nas janelas + --refresh nas janelas if (limpados > 0) then _detalhes:InstanciaCallFunction (_detalhes.reset_window) end _detalhes:ManutencaoTimeMachine() - --> print cache states + --print cache states --if (_detalhes.debug) then -- _detalhes:Msg ("(debug) removed: damage "..damage.." heal "..heal.." energy "..energy.." misc "..misc) --end - --> elimina pets antigos + --elimina pets antigos _detalhes:LimparPets() if (not _detalhes.in_combat) then _detalhes:ClearCCPetsBlackList() end - --> reseta cache de specs + --reseta cache de specs _detalhes:ResetSpecCache() - --> wipa container de escudos + --wipa container de escudos _table_wipe (_detalhes.escudos) _detalhes.ultima_coleta = _detalhes._tempo @@ -854,7 +854,7 @@ end - --> combates Normais + --combates Normais local function FazColeta (_combate, tipo, intervalo_overwrite) local conteudo = _combate [tipo]._ActorTable @@ -893,7 +893,7 @@ end if (can_garbage) then - if (not _actor.owner) then --> pet + if (not _actor.owner) then --pet _actor:subtract_total (_combate) end @@ -924,7 +924,7 @@ return _iter.cleaned end - --> Combate overall + --Combate overall function _detalhes:ColetarLixo (tipo, lastevent) --print ("fazendo coleta...") @@ -932,24 +932,24 @@ local _tempo = _time() local limpados = 0 - --> monta a lista de combates + --monta a lista de combates local tabelas_de_combate = {} - for _, _tabela in _ipairs (_detalhes.tabela_historico.tabelas) do + for _, _tabela in _ipairs(_detalhes.tabela_historico.tabelas) do if (_tabela ~= _detalhes.tabela_vigente) then tabelas_de_combate [#tabelas_de_combate+1] = _tabela end end tabelas_de_combate [#tabelas_de_combate+1] = _detalhes.tabela_vigente - --> faz a coleta em todos os combates para este atributo - for _, _combate in _ipairs (tabelas_de_combate) do + --faz a coleta em todos os combates para este atributo + for _, _combate in _ipairs(tabelas_de_combate) do limpados = limpados + FazColeta (_combate, tipo, lastevent) end - --> limpa a tabela overall para o atributo atual (limpa para os 4, um de cada vez atrav�s do ipairs) + --limpa a tabela overall para o atributo atual (limpa para os 4, um de cada vez atrav�s do ipairs) local _overall_combat = _detalhes.tabela_overall local conteudo = _overall_combat [tipo]._ActorTable - local _iter = {index = 1, data = conteudo[1], cleaned = 0} --> ._ActorTable[1] para pegar o primeiro index + local _iter = {index = 1, data = conteudo[1], cleaned = 0} --._ActorTable[1] para pegar o primeiro index while (_iter.data) do @@ -960,13 +960,13 @@ can_garbage = true end - if (can_garbage) then --> n�o h� refer�ncias a este objeto + if (can_garbage) then --n�o h� refer�ncias a este objeto - if (not _actor.owner) then --> pet + if (not _actor.owner) then --pet _actor:subtract_total (_overall_combat) end - --> apaga a refer�ncia deste jogador na tabela overall + --apaga a refer�ncia deste jogador na tabela overall _iter.cleaned = _iter.cleaned+1 _table_remove (conteudo, _iter.index) @@ -979,7 +979,7 @@ end - --> termina o coletor de lixo + --termina o coletor de lixo if (_iter.cleaned > 0) then _overall_combat[tipo].need_refresh = true ReconstroiMapa (_overall_combat [tipo]) @@ -988,7 +988,7 @@ if (limpados > 0) then _detalhes:InstanciaCallFunction (_detalhes.ScheduleUpdate) - _detalhes:RefreshMainWindow (-1) + _detalhes:RefreshMainWindow(-1) end return limpados diff --git a/core/network.lua b/core/network.lua index 4b9a1d60..abcea916 100644 --- a/core/network.lua +++ b/core/network.lua @@ -7,14 +7,14 @@ Details.network = {} ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> local pointers +--local pointers local UnitName = UnitName local GetRealmName = GetRealmName local select = select ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> constants +--constants _G.DETAILS_PREFIX_NETWORK = "DTLS" @@ -73,10 +73,10 @@ local registredPlugins = {} ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> comm functions +--comm functions ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> item level +--item level function Details:SendCharacterData() --only send if in group if (not IsInGroup() and not IsInRaid()) then @@ -162,7 +162,7 @@ function Details.network.Update_VersionReceived(player, realm, coreVersion, buildNumber) if (Details.debugnet) then - Details:Msg ("(debug) received version alert ", buildNumber) + Details:Msg("(debug) received version alert ", buildNumber) end if (Details.streamer_config.no_alerts) then @@ -432,7 +432,7 @@ } ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> register comm +--register comm function Details:CommReceived(commPrefix, data, channel, source) @@ -518,7 +518,7 @@ end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> send functions +--send functions function Details:GetChannelId(channel) --deprecated @@ -587,12 +587,12 @@ end function Details:SendGuildData(type, ...) - if not IsInGuild() then return end --> fix from Tim@WoWInterface + if not IsInGuild() then return end --fix from Tim@WoWInterface Details:SendCommMessage(DETAILS_PREFIX_NETWORK, Details:Serialize(type, UnitName("player"), GetRealmName(), Details.realversion, ...), "GUILD") end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> cloud +--cloud function Details:SendCloudRequest() --deprecated @@ -607,7 +607,7 @@ end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> update +--update function Details:CheckVersion(sendToGuild) if (IsInRaid()) then diff --git a/core/parser.lua b/core/parser.lua index d28461bc..f0e58700 100755 --- a/core/parser.lua +++ b/core/parser.lua @@ -9,7 +9,7 @@ local isWOTLK = DetailsFramework.IsWotLKWow() ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> local pointers +--local pointers local _UnitAffectingCombat = UnitAffectingCombat --wow api local local _UnitHealth = UnitHealth --wow api local @@ -44,7 +44,7 @@ local cc_spell_list = DetailsFramework.CrowdControlSpells local container_habilidades = _detalhes.container_habilidades --details local - --> localize the cooldown table from the framework + --localize the cooldown table from the framework local defensive_cooldowns = DetailsFramework.CooldownsAllDeffensive local spell_damage_func = _detalhes.habilidade_dano.Add --details local @@ -54,69 +54,69 @@ local spell_energy_func = _detalhes.habilidade_e_energy.Add --details local local spell_misc_func = _detalhes.habilidade_misc.Add --details local - --> current combat and overall pointers - local _current_combat = _detalhes.tabela_vigente or {} --> placeholder table - local _current_combat_cleu_events = {n = 1} --> placeholder + --current combat and overall pointers + local _current_combat = _detalhes.tabela_vigente or {} --placeholder table + local _current_combat_cleu_events = {n = 1} --placeholder - --> total container pointers + --total container pointers local _current_total = _current_combat.totals local _current_gtotal = _current_combat.totals_grupo - --> actors container pointers + --actors container pointers local _current_damage_container = _current_combat [1] local _current_heal_container = _current_combat [2] local _current_energy_container = _current_combat [3] local _current_misc_container = _current_combat [4] ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> cache - --> damage +--cache + --damage local damage_cache = setmetatable ({}, _detalhes.weaktable) local damage_cache_pets = setmetatable ({}, _detalhes.weaktable) local damage_cache_petsOwners = setmetatable ({}, _detalhes.weaktable) - --> heaing + --heaing local healing_cache = setmetatable ({}, _detalhes.weaktable) local banned_healing_spells = { [326514] = true, --remove on 10.0 - Forgeborne Reveries - necrolords ability } - --> energy + --energy local energy_cache = setmetatable ({}, _detalhes.weaktable) - --> misc + --misc local misc_cache = setmetatable ({}, _detalhes.weaktable) local misc_cache_pets = setmetatable ({}, _detalhes.weaktable) local misc_cache_petsOwners = setmetatable ({}, _detalhes.weaktable) - --> party & raid members + --party & raid members local raid_members_cache = setmetatable ({}, _detalhes.weaktable) - --> tanks + --tanks local tanks_members_cache = setmetatable ({}, _detalhes.weaktable) - --> auto regen + --auto regen local auto_regen_cache = setmetatable ({}, _detalhes.weaktable) - --> bitfield swap cache + --bitfield swap cache local bitfield_swap_cache = {} - --> damage and heal last events - local last_events_cache = {} --> initialize table (placeholder) - --> npcId cache + --damage and heal last events + local last_events_cache = {} --initialize table (placeholder) + --npcId cache local npcid_cache = {} - --> pets - local container_pets = {} --> initialize table (placeholder) - --> ignore deaths + --pets + local container_pets = {} --initialize table (placeholder) + --ignore deaths local ignore_death = {} - --> cache + --cache local cacheAnything = { arenaHealth = {}, } - --> druids kyrian bounds + --druids kyrian bounds local druid_kyrian_bounds = {} --remove on 10.0 - --> spell containers for special cases + --spell containers for special cases local monk_guard_talent = {} --guard talent for bm monks - --> spell reflection + --spell reflection local reflection_damage = {} --self-inflicted damage local reflection_debuffs = {} --self-inflicted debuffs local reflection_events = {} --spell_missed reflected events local reflection_auras = {} --active reflecting auras local reflection_dispels = {} --active reflecting dispels local reflection_spellid = { - --> we can track which spell caused the reflection - --> this is used to credit this aura as the one doing the damage + --we can track which spell caused the reflection + --this is used to credit this aura as the one doing the damage [23920] = true, --warrior spell reflection [216890] = true, --warrior spell reflection (pvp talent) [213915] = true, --warrior mass spell reflection @@ -124,27 +124,27 @@ --check pally legendary } local reflection_dispelid = { - --> some dispels also reflect, and we can track them + --some dispels also reflect, and we can track them [122783] = true, --monk diffuse magic --[205604] = true, --demon hunter reverse magic - --> this last one is an odd one, like most dh spells is kindy buggy combatlog wise - --> for now it doesn't fire SPELL_DISPEL events even when dispelling stuff (thanks blizzard) - --> maybe someone can figure out something to track it... but for now it doesnt work + --this last one is an odd one, like most dh spells is kindy buggy combatlog wise + --for now it doesn't fire SPELL_DISPEL events even when dispelling stuff (thanks blizzard) + --maybe someone can figure out something to track it... but for now it doesnt work } local reflection_ignore = { - --> common self-harm spells that we know weren't reflected - --> this list can be expanded + --common self-harm spells that we know weren't reflected + --this list can be expanded [111400] = true, --warlock burning rush [124255] = true, --monk stagger [196917] = true, --paladin light of the martyr [217979] = true, --warlock health funnel - --> bugged spells + --bugged spells [315197] = true, --thing from beyond grand delusions - --> this corruption when reflected causes insane amounts of damage to the thing from beyond - --> anywhere from a few hundred thousand damage to over 50 millons - --> filtering it the best course of action as nobody should care about this damage + --this corruption when reflected causes insane amounts of damage to the thing from beyond + --anywhere from a few hundred thousand damage to over 50 millons + --filtering it the best course of action as nobody should care about this damage } --army od the dead cache @@ -158,7 +158,7 @@ } ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> constants +--constants local container_misc = _detalhes.container_type.CONTAINER_MISC_CLASS local _token_ids = _detalhes.TokenID @@ -186,7 +186,7 @@ [1] = true, --0x1 star } - --> spellIds override + --spellIds override local override_spellId if (isTBC) then @@ -294,7 +294,7 @@ end local bitfield_debuffs = {} - for _, spellid in ipairs (_detalhes.BitfieldSwapDebuffsIDs) do + for _, spellid in ipairs(_detalhes.BitfieldSwapDebuffsIDs) do local spellname = GetSpellInfo(spellid) if (spellname) then bitfield_debuffs [spellname] = true @@ -320,7 +320,7 @@ --expose the override spells table to external scripts _detalhes.OverridedSpellIds = override_spellId - --> list of ignored npcs by the user + --list of ignored npcs by the user _detalhes.default_ignored_npcs = { --necrotic wake --remove on 10.0 [163126] = true, --brittlebone mage @@ -353,23 +353,23 @@ local ignored_npcids = {} - --> ignore soul link (damage from the warlock on his pet - current to demonology only) + --ignore soul link (damage from the warlock on his pet - current to demonology only) local SPELLID_WARLOCK_SOULLINK = 108446 - --> brewmaster monk guard talent + --brewmaster monk guard talent local SPELLID_MONK_GUARD = 115295 - --> brewmaster monk stagger mechanics + --brewmaster monk stagger mechanics local SPELLID_MONK_STAGGER = 124255 - --> restoration shaman spirit link totem + --restoration shaman spirit link totem local SPELLID_SHAMAN_SLT = 98021 - --> holy paladin light of the martyr - --> druid kyrian bound spirits + --holy paladin light of the martyr + --druid kyrian bound spirits local SPELLID_KYRIAN_DRUID = 326434 - --> druid kyrian bound damage, heal + --druid kyrian bound damage, heal local SPELLID_KYRIAN_DRUID_DAMAGE = 338411 local SPELLID_KYRIAN_DRUID_HEAL = 327149 local SPELLID_KYRIAN_DRUID_TANK = 327037 - --> shaman earth shield (bcc) + --shaman earth shield (bcc) local SPELLID_SHAMAN_EARTHSHIELD_HEAL = 379 local SPELLID_SHAMAN_EARTHSHIELD_BUFF_RANK1 = 974 local SPELLID_SHAMAN_EARTHSHIELD_BUFF_RANK2 = 32593 @@ -379,10 +379,10 @@ [SPELLID_SHAMAN_EARTHSHIELD_BUFF_RANK2] = true, [SPELLID_SHAMAN_EARTHSHIELD_BUFF_RANK3] = true, } - --> holy priest prayer of mending (bcc) + --holy priest prayer of mending (bcc) local SPELLID_PRIEST_POM_BUFF = 41635 local SPELLID_PRIEST_POM_HEAL = 33110 - --> druid lifebloom explosion (bcc) + --druid lifebloom explosion (bcc) local SPELLID_DRUID_LIFEBLOOM_BUFF = 33763 local SPELLID_DRUID_LIFEBLOOM_HEAL = 33778 @@ -396,12 +396,12 @@ local SPELLID_VENTYR_TAME_GARGOYLE = 342171 --REMOVE ON 10.0 - --> spells with special treatment + --spells with special treatment local special_damage_spells = { - [SPELLID_SHAMAN_SLT] = true, --> Spirit Link Toten - [SPELLID_MONK_STAGGER] = true, --> Stagger - [315161] = true, --> Eye of Corruption --REMOVE ON 9.0 - [315197] = true, --> Thing From Beyond --REMOVE ON 9.0 + [SPELLID_SHAMAN_SLT] = true, --Spirit Link Toten + [SPELLID_MONK_STAGGER] = true, --Stagger + [315161] = true, --Eye of Corruption --REMOVE ON 9.0 + [315197] = true, --Thing From Beyond --REMOVE ON 9.0 } local NPCID_SPIKEDBALL = 176581 --remove on 10.0 --spikeball npcId @@ -415,7 +415,7 @@ local NPCID_KELTHUZAD_ADDMIMICPLAYERS = 176605 - --> damage spells to ignore + --damage spells to ignore local damage_spells_to_ignore = { --the damage that the warlock apply to its pet through soullink is ignored --it is not useful for damage done or friendly fire @@ -424,35 +424,35 @@ [371701] = true, --Protoform Barrier } - --> expose the ignore spells table to external scripts + --expose the ignore spells table to external scripts _detalhes.SpellsToIgnore = damage_spells_to_ignore - --> is parser allowed to replace spellIDs? + --is parser allowed to replace spellIDs? local is_using_spellId_override = false - --> is this a timewalking exp? + --is this a timewalking exp? local is_classic_exp = DetailsFramework.IsClassicWow() local is_timewalk_exp = DetailsFramework.IsTimewalkWoW() - --> recording data options flags + --recording data options flags local _recording_self_buffs = false local _recording_ability_with_buffs = false local _recording_healing = false local _recording_buffs_and_debuffs = false - --> in combat flag + --in combat flag local _in_combat = false local _current_encounter_id local _is_storing_cleu = false local _in_resting_zone = false - --> deathlog + --deathlog local _death_event_amt = 16 - --> map type + --map type local _is_in_instance = false - --> hooks + --hooks local _hook_cooldowns = false local _hook_deaths = false local _hook_battleress = false @@ -463,7 +463,7 @@ local _hook_battleress_container = _detalhes.hooks ["HOOK_BATTLERESS"] local _hook_interrupt_container = _detalhes.hooks ["HOOK_INTERRUPT"] - --> encoutner rules + --encoutner rules local ignored_npc_ids = { --deprecated to be removed --amorphous cyst g'huun Uldir - ignore damage done to this npcs ["138185"] = true, --boss room mythic @@ -473,7 +473,7 @@ ["141265"] = true, } - --> regen overflow + --regen overflow local auto_regen_power_specs = { [103] = Enum.PowerType.Energy, --druid feral [259] = Enum.PowerType.Energy, --rogue ass @@ -544,19 +544,19 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> internal functions +--internal functions ----------------------------------------------------------------------------------------------------------------------------------------- - --> DAMAGE serach key: ~damage | + --DAMAGE serach key: ~damage | ----------------------------------------------------------------------------------------------------------------------------------------- function parser:swing (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand) - return parser:spell_dmg (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, 1, _G["MELEE"], 00000001, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand) --> localize-me + return parser:spell_dmg (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, 1, _G["MELEE"], 00000001, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand) --localize-me --spellid, spellname, spelltype end function parser:range (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand) - return parser:spell_dmg (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand) --> localize-me + return parser:spell_dmg (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand) --localize-me end -- /run local f=CreateFrame("frame");f:RegisterAllEvents();f:SetScript("OnEvent", function(self, ...)print (...);end) @@ -595,8 +595,8 @@ local lastRecordFound = {id = 0, diff = 0, combatTime = 0} _detalhes.PrintEncounterRecord = function(self) - --> this block won't execute if the storage isn't loaded - --> self is a timer reference from C_Timer + --this block won't execute if the storage isn't loaded + --self is a timer reference from C_Timer local encounterID = self.Boss local diff = self.Diff @@ -606,7 +606,7 @@ local value, rank, combatTime = 0, 0, 0 if (encounterID == lastRecordFound.id and diff == lastRecordFound.diff) then - --> is the same encounter, no need to find the value again. + --is the same encounter, no need to find the value again. value, rank, combatTime = lastRecordFound.value, lastRecordFound.rank, lastRecordFound.combatTime else local db = _detalhes.GetStorage() @@ -622,14 +622,14 @@ rank = rankPosition or 0 combatTime = encounterTable.elapsed - --> if found the result, cache the values so no need to search again next pull + --if found the result, cache the values so no need to search again next pull lastRecordFound.value = value lastRecordFound.rank = rank lastRecordFound.id = encounterID lastRecordFound.diff = diff lastRecordFound.combatTime = combatTime else - --> if didn't found, no reason to search again on next pull + --if didn't found, no reason to search again on next pull lastRecordFound.value = 0 lastRecordFound.rank = 0 lastRecordFound.combatTime = 0 @@ -639,11 +639,11 @@ end if (value and combatTime and value > 0 and combatTime > 0) then - _detalhes:Msg ("|cFFFFBB00Your Best Score|r:", _detalhes:ToK2 ((value) / combatTime) .. " [|cFFFFFF00Guild Rank: " .. rank .. "|r]") --> localize-me + _detalhes:Msg ("|cFFFFBB00Your Best Score|r:", _detalhes:ToK2 ((value) / combatTime) .. " [|cFFFFFF00Guild Rank: " .. rank .. "|r]") --localize-me end if ((not combatTime or combatTime == 0) and not _detalhes.SyncWarning) then - _detalhes:Msg ("|cFFFF3300you may need sync the rank within the guild, type '|cFFFFFF00/details rank|r'|r") --> localize-me + _detalhes:Msg ("|cFFFF3300you may need sync the rank within the guild, type '|cFFFFFF00/details rank|r'|r") --localize-me _detalhes.SyncWarning = true end end @@ -653,26 +653,26 @@ function parser:spell_dmg (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand, isreflected) ------------------------------------------------------------------------------------------------ - --> early checks and fixes + --early checks and fixes if (who_serial == "") then - if (who_flags and _bit_band (who_flags, OBJECT_TYPE_PETS) ~= 0) then --> � um pet - --> pets must have a serial + if (who_flags and _bit_band (who_flags, OBJECT_TYPE_PETS) ~= 0) then --� um pet + --pets must have a serial return end end if (not alvo_name) then - --> no target name, just quit + --no target name, just quit return elseif (not who_name) then - --> no actor name, use spell name instead + --no actor name, use spell name instead who_name = "[*] " .. spellname who_flags = 0xa48 who_serial = "" end - --> check if the spell isn't in the backlist + --check if the spell isn't in the backlist if (damage_spells_to_ignore [spellid]) then return end @@ -705,28 +705,28 @@ end ------------------------------------------------------------------------------------------------ - --> spell reflection + --spell reflection if (who_serial == alvo_serial and not reflection_ignore[spellid]) then --~reflect - --> this spell could've been reflected, check it + --this spell could've been reflected, check it if (reflection_events[who_serial] and reflection_events[who_serial][spellid] and time-reflection_events[who_serial][spellid].time > 3.5 and (not reflection_debuffs[who_serial] or (reflection_debuffs[who_serial] and not reflection_debuffs[who_serial][spellid]))) then - --> here we check if we have to filter old reflection data - --> we check for two conditions - --> the first is to see if this is an old reflection - --> if more than 3.5 seconds have past then we can say that it is old... but! - --> the second condition is to see if there is an active debuff with the same spellid - --> if there is one then we ignore the timer and skip this - --> this should be cleared afterwards somehow... don't know how... + --here we check if we have to filter old reflection data + --we check for two conditions + --the first is to see if this is an old reflection + --if more than 3.5 seconds have past then we can say that it is old... but! + --the second condition is to see if there is an active debuff with the same spellid + --if there is one then we ignore the timer and skip this + --this should be cleared afterwards somehow... don't know how... reflection_events[who_serial][spellid] = nil if (next(reflection_events[who_serial]) == nil) then - --> there should be some better way of handling this kind of filtering, any suggestion? + --there should be some better way of handling this kind of filtering, any suggestion? reflection_events[who_serial] = nil end end local reflection = reflection_events[who_serial] and reflection_events[who_serial][spellid] if (reflection) then - --> if we still have the reflection data then we conclude it was reflected + --if we still have the reflection data then we conclude it was reflected --extend the duration of the timer to catch the rare channelling spells reflection_events[who_serial][spellid].time = time @@ -745,7 +745,7 @@ return parser:spell_dmg(token,time,who_serial,who_name,who_flags,alvo_serial,alvo_name,alvo_flags,alvo_flags2,spellid,spellname,0x400,amount,-1,nil,nil,nil,nil,false,false,false,false, isreflected) else - --> saving information about this damage because it may occurred before a reflect event + --saving information about this damage because it may occurred before a reflect event reflection_damage[who_serial] = reflection_damage[who_serial] or {} reflection_damage[who_serial][spellid] = { amount = amount, @@ -754,7 +754,7 @@ end end - --> if the parser are allowed to replace spellIDs + --if the parser are allowed to replace spellIDs if (is_using_spellId_override) then spellid = override_spellId [spellid] or spellid end @@ -780,7 +780,7 @@ end - --> npcId check for ignored npcs + --npcId check for ignored npcs local npcId = npcid_cache[alvo_serial] --target @@ -905,17 +905,17 @@ end end - --> avoid doing spellID checks on each iteration + --avoid doing spellID checks on each iteration --if (special_damage_spells [spellid]) then --remove this IF due to have hit 60 local variables - --> stagger + --stagger if (spellid == SPELLID_MONK_STAGGER) then return parser:MonkStagger_damage (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spelltype, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand) - --> spirit link toten + --spirit link toten elseif (spellid == SPELLID_SHAMAN_SLT) then return parser:SLT_damage (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spelltype, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand) - --> Light of the Martyr - paladin spell which causes damage to the caster it self + --Light of the Martyr - paladin spell which causes damage to the caster it self elseif (spellid == 196917) then -- or spellid == 183998 < healing part return parser:LOTM_damage (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spelltype, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand) end @@ -930,7 +930,7 @@ end ------------------------------------------------------------------------------------------------ - --> check if need start an combat + --check if need start an combat if (not _in_combat) then --~startcombat ~combatstart if ( token ~= "SPELL_PERIODIC_DAMAGE" and @@ -942,7 +942,7 @@ (not _detalhes.in_group and who_flags and _bit_band (who_flags, AFFILIATION_GROUP) ~= 0) ) ) then - --> n�o entra em combate se for DOT + --n�o entra em combate se for DOT if (_detalhes.encounter_table.id and _detalhes.encounter_table ["start"] >= GetTime() - 3 and _detalhes.announce_firsthit.enabled) then local link if (spellid <= 10) then @@ -959,15 +959,15 @@ end _detalhes:EntrarEmCombate (who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags) else - --> entrar em combate se for dot e for do jogador e o ultimo combate ter sido a mais de 10 segundos atr�s + --entrar em combate se for dot e for do jogador e o ultimo combate ter sido a mais de 10 segundos atr�s if (token == "SPELL_PERIODIC_DAMAGE" and who_name == _detalhes.playername) then - --> ignora burning rush se o jogador estiver fora de combate + --ignora burning rush se o jogador estiver fora de combate --111400 warlock's burning rush --368637 is buff from trinket "Scars of Fraternal Strife" which make the player bleed even out-of-combat if (spellid == 111400 or spellid == 368637) then return end - --> faz o calculo dos 10 segundos + --faz o calculo dos 10 segundos if (_detalhes.last_combat_time+10 < _tempo) then _detalhes:EntrarEmCombate (who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags) end @@ -980,16 +980,16 @@ _current_damage_container.need_refresh = true ------------------------------------------------------------------------------------------------ - --> get actors + --get actors - --> source damager + --source damager local este_jogador, meu_dono = damage_cache [who_serial] or damage_cache_pets [who_serial] or damage_cache [who_name], damage_cache_petsOwners [who_serial] - if (not este_jogador) then --> pode ser um desconhecido ou um pet + if (not este_jogador) then --pode ser um desconhecido ou um pet este_jogador, meu_dono, who_name = _current_damage_container:PegarCombatente (who_serial, who_name, who_flags, true) - if (meu_dono) then --> � um pet + if (meu_dono) then --� um pet if (who_serial ~= "") then damage_cache_pets [who_serial] = este_jogador damage_cache_petsOwners [who_serial] = meu_dono @@ -999,7 +999,7 @@ damage_cache [meu_dono.serial] = meu_dono end else - if (who_flags) then --> ter certeza que n�o � um pet + if (who_flags) then --ter certeza que n�o � um pet if (who_serial ~= "") then damage_cache [who_serial] = este_jogador else @@ -1015,7 +1015,7 @@ end elseif (meu_dono) then - --> � um pet + --� um pet who_name = who_name .. " <" .. meu_dono.nome .. ">" end @@ -1027,7 +1027,7 @@ este_jogador.grupo = true end - --> his target + --his target local jogador_alvo, alvo_dono = damage_cache [alvo_serial] or damage_cache_pets [alvo_serial] or damage_cache [alvo_name], damage_cache_petsOwners [alvo_serial] if (not jogador_alvo) then @@ -1043,13 +1043,13 @@ damage_cache [alvo_dono.serial] = alvo_dono end else - if (alvo_flags and alvo_serial ~= "") then --> ter certeza que n�o � um pet + if (alvo_flags and alvo_serial ~= "") then --ter certeza que n�o � um pet damage_cache [alvo_serial] = jogador_alvo end end elseif (alvo_dono) then - --> � um pet + --� um pet alvo_name = alvo_name .. " <" .. alvo_dono.nome .. ">" end @@ -1060,11 +1060,11 @@ return end - --> last event + --last event este_jogador.last_event = _tempo ------------------------------------------------------------------------------------------------ - --> group checks and avoidance + --group checks and avoidance if (absorbed) then amount = absorbed + (amount or 0) @@ -1087,28 +1087,28 @@ end end - if (este_jogador.grupo and not este_jogador.arena_enemy and not este_jogador.enemy and not jogador_alvo.arena_enemy) then --> source = friendly player and not an enemy player + if (este_jogador.grupo and not este_jogador.arena_enemy and not este_jogador.enemy and not jogador_alvo.arena_enemy) then --source = friendly player and not an enemy player --dano to adversario estava caindo aqui por nao estar checando .enemy _current_gtotal [1] = _current_gtotal [1]+amount - elseif (jogador_alvo.grupo) then --> source = arena enemy or friendly player + elseif (jogador_alvo.grupo) then --source = arena enemy or friendly player if (jogador_alvo.arena_enemy) then _current_gtotal [1] = _current_gtotal [1]+amount end - --> record avoidance only for tank actors + --record avoidance only for tank actors if (tanks_members_cache [alvo_serial]) then - --> monk's stagger + --monk's stagger if (jogador_alvo.classe == "MONK") then if (absorbed) then - --> the absorbed amount was staggered and should not be count as damage taken now - --> this absorbed will hit the player with the stagger debuff + --the absorbed amount was staggered and should not be count as damage taken now + --this absorbed will hit the player with the stagger debuff amount = (amount or 0) - absorbed end else - --> advanced damage taken + --advanced damage taken --if advanced damage taken is enabled, the damage taken to tanks acts like the monk stuff above if (_detalhes.damage_taken_everything) then if (absorbed) then @@ -1117,7 +1117,7 @@ end end - --> avoidance + --avoidance local avoidance = jogador_alvo.avoidance if (not avoidance) then jogador_alvo.avoidance = _detalhes:CreateActorAvoidanceTable() @@ -1127,16 +1127,16 @@ local overall = avoidance.overall local mob = avoidance [who_name] - if (not mob) then --> if isn't in the table, build on the fly + if (not mob) then --if isn't in the table, build on the fly mob = _detalhes:CreateActorAvoidanceTable (true) avoidance [who_name] = mob end - overall ["ALL"] = overall ["ALL"] + 1 --> qualtipo de hit ou absorb - mob ["ALL"] = mob ["ALL"] + 1 --> qualtipo de hit ou absorb + overall ["ALL"] = overall ["ALL"] + 1 --qualtipo de hit ou absorb + mob ["ALL"] = mob ["ALL"] + 1 --qualtipo de hit ou absorb if (spellid < 3) then - --> overall + --overall overall ["HITS"] = overall ["HITS"] + 1 mob ["HITS"] = mob ["HITS"] + 1 end @@ -1148,9 +1148,9 @@ mob ["BLOCKED_AMT"] = mob ["BLOCKED_AMT"] + blocked end - --> absorbs status + --absorbs status if (absorbed) then - --> aqui pode ser apenas absorb parcial + --aqui pode ser apenas absorb parcial overall ["ABSORB"] = overall ["ABSORB"] + 1 overall ["PARTIAL_ABSORBED"] = overall ["PARTIAL_ABSORBED"] + 1 overall ["PARTIAL_ABSORB_AMT"] = overall ["PARTIAL_ABSORB_AMT"] + absorbed @@ -1160,7 +1160,7 @@ mob ["PARTIAL_ABSORB_AMT"] = mob ["PARTIAL_ABSORB_AMT"] + absorbed mob ["ABSORB_AMT"] = mob ["ABSORB_AMT"] + absorbed else - --> adicionar aos hits sem absorbs + --adicionar aos hits sem absorbs overall ["FULL_HIT"] = overall ["FULL_HIT"] + 1 overall ["FULL_HIT_AMT"] = overall ["FULL_HIT_AMT"] + amount mob ["FULL_HIT"] = mob ["FULL_HIT"] + 1 @@ -1168,7 +1168,7 @@ end end - --> record death log + --record death log local t = last_events_cache [alvo_name] if (not t) then @@ -1179,12 +1179,12 @@ local i = t.n local this_event = t [i] - this_event [1] = true --> true if this is a damage || false for healing - this_event [2] = spellid --> spellid || false if this is a battle ress line - this_event [3] = amount --> amount of damage or healing - this_event [4] = time --> parser time + this_event [1] = true --true if this is a damage || false for healing + this_event [2] = spellid --spellid || false if this is a battle ress line + this_event [3] = amount --amount of damage or healing + this_event [4] = time --parser time - --> current unit heal + --current unit heal if (jogador_alvo.arena_enemy) then --this is an arena enemy, get the heal with the unit Id local unitId = _detalhes.arena_enemies[alvo_name] @@ -1202,7 +1202,7 @@ this_event [5] = _UnitHealth(alvo_name) end - this_event [6] = who_name --> source name + this_event [6] = who_name --source name this_event [7] = absorbed this_event [8] = spelltype or school this_event [9] = false @@ -1221,7 +1221,7 @@ end ------------------------------------------------------------------------------------------------ - --> time start + --time start if (not este_jogador.dps_started) then @@ -1244,20 +1244,20 @@ este_jogador.start_time = _tempo end - if (este_jogador.nome == _detalhes.playername and token ~= "SPELL_PERIODIC_DAMAGE") then --> iniciando o dps do "PLAYER" + if (este_jogador.nome == _detalhes.playername and token ~= "SPELL_PERIODIC_DAMAGE") then --iniciando o dps do "PLAYER" if (_detalhes.solo) then - --> save solo attributes + --save solo attributes _detalhes:UpdateSolo() end if (_UnitAffectingCombat ("player")) then - _detalhes:SendEvent ("COMBAT_PLAYER_TIMESTARTED", nil, _current_combat, este_jogador) + _detalhes:SendEvent("COMBAT_PLAYER_TIMESTARTED", nil, _current_combat, este_jogador) end end end ------------------------------------------------------------------------------------------------ - --> firendly fire ~friendlyfire + --firendly fire ~friendlyfire local is_friendly_fire = false if (_is_in_instance) then @@ -1292,7 +1292,7 @@ end if (is_friendly_fire and spellid ~= SPELLID_KYRIAN_DRUID_TANK) then --kyrian spell remove on 10.0 - if (este_jogador.grupo) then --> se tiver ele n�o adiciona o evento l� em cima + if (este_jogador.grupo) then --se tiver ele n�o adiciona o evento l� em cima local t = last_events_cache[alvo_name] if (not t) then @@ -1302,12 +1302,12 @@ local i = t.n local this_event = t [i] - this_event [1] = true --> true if this is a damage || false for healing - this_event [2] = spellid --> spellid || false if this is a battle ress line - this_event [3] = amount --> amount of damage or healing - this_event [4] = time --> parser time - this_event [5] = _UnitHealth (alvo_name) --> current unit heal - this_event [6] = who_name --> source name + this_event [1] = true --true if this is a damage || false for healing + this_event [2] = spellid --spellid || false if this is a battle ress line + this_event [3] = amount --amount of damage or healing + this_event [4] = time --parser time + this_event [5] = _UnitHealth (alvo_name) --current unit heal + this_event [6] = who_name --source name this_event [7] = absorbed this_event [8] = spelltype or school this_event [9] = true @@ -1329,11 +1329,11 @@ friend.spells [spellid] = (friend.spells [spellid] or 0) + amount ------------------------------------------------------------------------------------------------ - --> damage taken + --damage taken - --> target - jogador_alvo.damage_taken = jogador_alvo.damage_taken + amount - (absorbed or 0) --> adiciona o dano tomado - if (not jogador_alvo.damage_from [who_name]) then --> adiciona a pool de dano tomado de quem + --target + jogador_alvo.damage_taken = jogador_alvo.damage_taken + amount - (absorbed or 0) --adiciona o dano tomado + if (not jogador_alvo.damage_from [who_name]) then --adiciona a pool de dano tomado de quem jogador_alvo.damage_from [who_name] = true end @@ -1342,48 +1342,48 @@ _current_total [1] = _current_total [1]+amount ------------------------------------------------------------------------------------------------ - --> damage taken + --damage taken - --> target - jogador_alvo.damage_taken = jogador_alvo.damage_taken + amount --> adiciona o dano tomado - if (not jogador_alvo.damage_from [who_name]) then --> adiciona a pool de dano tomado de quem + --target + jogador_alvo.damage_taken = jogador_alvo.damage_taken + amount --adiciona o dano tomado + if (not jogador_alvo.damage_from [who_name]) then --adiciona a pool de dano tomado de quem jogador_alvo.damage_from [who_name] = true end end ------------------------------------------------------------------------------------------------ - --> amount add + --amount add - --> actor owner (if any) - if (meu_dono) then --> se for dano de um Pet - meu_dono.total = meu_dono.total + amount --> e adiciona o dano ao pet + --actor owner (if any) + if (meu_dono) then --se for dano de um Pet + meu_dono.total = meu_dono.total + amount --e adiciona o dano ao pet - --> add owner targets + --add owner targets meu_dono.targets [alvo_name] = (meu_dono.targets [alvo_name] or 0) + amount meu_dono.last_event = _tempo if (RAID_TARGET_FLAGS [alvo_flags2]) then - --> add the amount done for the owner + --add the amount done for the owner meu_dono.raid_targets [alvo_flags2] = (meu_dono.raid_targets [alvo_flags2] or 0) + amount end end - --> raid targets + --raid targets if (RAID_TARGET_FLAGS [alvo_flags2]) then este_jogador.raid_targets [alvo_flags2] = (este_jogador.raid_targets [alvo_flags2] or 0) + amount end - --> actor + --actor este_jogador.total = este_jogador.total + amount - --> actor without pets + --actor without pets este_jogador.total_without_pet = este_jogador.total_without_pet + amount - --> actor targets + --actor targets este_jogador.targets [alvo_name] = (este_jogador.targets [alvo_name] or 0) + amount - --> actor spells table + --actor spells table local spell = este_jogador.spells._ActorTable [spellid] if (not spell) then spell = este_jogador.spells:PegaHabilidade (spellid, true, token) @@ -1407,18 +1407,18 @@ function parser:MonkStagger_damage (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spelltype, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand) - --> special behavior for monk stagger debuff periodic damage + --special behavior for monk stagger debuff periodic damage - --> tag the container to refresh + --tag the container to refresh _current_damage_container.need_refresh = true - --> get the monk damage object + --get the monk damage object local este_jogador, meu_dono = damage_cache [who_serial] or damage_cache_pets [who_serial] or damage_cache [who_name], damage_cache_petsOwners [who_serial] - if (not este_jogador) then --> pode ser um desconhecido ou um pet + if (not este_jogador) then --pode ser um desconhecido ou um pet este_jogador, meu_dono, who_name = _current_damage_container:PegarCombatente (who_serial, who_name, who_flags, true) - if (meu_dono) then --> � um pet + if (meu_dono) then --� um pet if (who_serial ~= "") then damage_cache_pets [who_serial] = este_jogador damage_cache_petsOwners [who_serial] = meu_dono @@ -1428,7 +1428,7 @@ damage_cache [meu_dono.serial] = meu_dono end else - if (who_flags) then --> ter certeza que n�o � um pet + if (who_flags) then --ter certeza que n�o � um pet if (who_serial ~= "") then damage_cache [who_serial] = este_jogador else @@ -1442,24 +1442,24 @@ end elseif (meu_dono) then - --> � um pet + --� um pet who_name = who_name .. " <" .. meu_dono.nome .. ">" end - --> last event + --last event este_jogador.last_event = _tempo - --> amount + --amount amount = (amount or 0) local total_amount = amount + (absorbed or 0) - --> damage taken + --damage taken este_jogador.damage_taken = este_jogador.damage_taken + amount - if (not este_jogador.damage_from [who_name]) then --> adiciona a pool de dano tomado de quem + if (not este_jogador.damage_from [who_name]) then --adiciona a pool de dano tomado de quem este_jogador.damage_from [who_name] = true end - --> friendly fire + --friendly fire --total este_jogador.friendlyfire_total = este_jogador.friendlyfire_total + amount --from who @@ -1467,7 +1467,7 @@ friend.total = friend.total + amount friend.spells [spellid] = (friend.spells [spellid] or 0) + amount - --> record death log + --record death log local t = last_events_cache [who_name] if (not t) then @@ -1482,15 +1482,15 @@ return print ("Parser Event Error -> Set to 16 DeathLogs and /reload", i, _death_event_amt) end - this_event [1] = true --> true if this is a damage || false for healing - this_event [2] = spellid --> spellid || false if this is a battle ress line - this_event [3] = amount --> amount of damage or healing - this_event [4] = time --> parser time - this_event [5] = _UnitHealth (who_name) --> current unit heal - this_event [6] = who_name --> source name + this_event [1] = true --true if this is a damage || false for healing + this_event [2] = spellid --spellid || false if this is a battle ress line + this_event [3] = amount --amount of damage or healing + this_event [4] = time --parser time + this_event [5] = _UnitHealth (who_name) --current unit heal + this_event [6] = who_name --source name this_event [7] = absorbed this_event [8] = school - this_event [9] = true --> friendly fire + this_event [9] = true --friendly fire this_event [10] = overkill i = i + 1 @@ -1501,7 +1501,7 @@ t.n = i end - --> avoidance + --avoidance local avoidance = este_jogador.avoidance if (not avoidance) then este_jogador.avoidance = _detalhes:CreateActorAvoidanceTable() @@ -1511,13 +1511,13 @@ local overall = avoidance.overall local mob = avoidance [who_name] - if (not mob) then --> if isn't in the table, build on the fly + if (not mob) then --if isn't in the table, build on the fly mob = _detalhes:CreateActorAvoidanceTable (true) avoidance [who_name] = mob end - overall ["ALL"] = overall ["ALL"] + 1 --> qualtipo de hit ou absorb - mob ["ALL"] = mob ["ALL"] + 1 --> qualtipo de hit ou absorb + overall ["ALL"] = overall ["ALL"] + 1 --qualtipo de hit ou absorb + mob ["ALL"] = mob ["ALL"] + 1 --qualtipo de hit ou absorb if (blocked and blocked > 0) then overall ["BLOCKED_HITS"] = overall ["BLOCKED_HITS"] + 1 @@ -1526,9 +1526,9 @@ mob ["BLOCKED_AMT"] = mob ["BLOCKED_AMT"] + blocked end - --> absorbs status + --absorbs status if (absorbed) then - --> aqui pode ser apenas absorb parcial + --aqui pode ser apenas absorb parcial overall ["ABSORB"] = overall ["ABSORB"] + 1 overall ["PARTIAL_ABSORBED"] = overall ["PARTIAL_ABSORBED"] + 1 overall ["PARTIAL_ABSORB_AMT"] = overall ["PARTIAL_ABSORB_AMT"] + absorbed @@ -1538,7 +1538,7 @@ mob ["PARTIAL_ABSORB_AMT"] = mob ["PARTIAL_ABSORB_AMT"] + absorbed mob ["ABSORB_AMT"] = mob ["ABSORB_AMT"] + absorbed else - --> adicionar aos hits sem absorbs + --adicionar aos hits sem absorbs overall ["FULL_HIT"] = overall ["FULL_HIT"] + 1 overall ["FULL_HIT_AMT"] = overall ["FULL_HIT_AMT"] + amount mob ["FULL_HIT"] = mob ["FULL_HIT"] + 1 @@ -1578,15 +1578,15 @@ return print ("Parser Event Error -> Set to 16 DeathLogs and /reload", i, _death_event_amt) end - this_event [1] = true --> true if this is a damage || false for healing - this_event [2] = spellid --> spellid || false if this is a battle ress line - this_event [3] = amount --> amount of damage or healing - this_event [4] = time --> parser time - this_event [5] = _UnitHealth (who_name) --> current unit heal - this_event [6] = who_name --> source name + this_event [1] = true --true if this is a damage || false for healing + this_event [2] = spellid --spellid || false if this is a battle ress line + this_event [3] = amount --amount of damage or healing + this_event [4] = time --parser time + this_event [5] = _UnitHealth (who_name) --current unit heal + this_event [6] = who_name --source name this_event [7] = absorbed this_event [8] = school - this_event [9] = true --> friendly fire + this_event [9] = true --friendly fire this_event [10] = overkill i = i + 1 @@ -1601,7 +1601,7 @@ if (damageActor) then --damage taken damageActor.damage_taken = damageActor.damage_taken + amount - if (not damageActor.damage_from [who_name]) then --> adiciona a pool de dano tomado de quem + if (not damageActor.damage_from [who_name]) then --adiciona a pool de dano tomado de quem damageActor.damage_from [who_name] = true end @@ -1616,14 +1616,14 @@ --special rule of SLT function parser:SLT_damage (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spelltype, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand) - --> damager + --damager local este_jogador, meu_dono = damage_cache [who_serial] or damage_cache_pets [who_serial] or damage_cache [who_name], damage_cache_petsOwners [who_serial] - if (not este_jogador) then --> pode ser um desconhecido ou um pet + if (not este_jogador) then --pode ser um desconhecido ou um pet este_jogador, meu_dono, who_name = _current_damage_container:PegarCombatente (who_serial, who_name, who_flags, true) - if (meu_dono) then --> � um pet + if (meu_dono) then --� um pet if (who_serial ~= "") then damage_cache_pets [who_serial] = este_jogador damage_cache_petsOwners [who_serial] = meu_dono @@ -1633,7 +1633,7 @@ damage_cache [meu_dono.serial] = meu_dono end else - if (who_flags) then --> ter certeza que n�o � um pet + if (who_flags) then --ter certeza que n�o � um pet if (who_serial ~= "") then damage_cache [who_serial] = este_jogador else @@ -1649,11 +1649,11 @@ end elseif (meu_dono) then - --> � um pet + --� um pet who_name = who_name .. " <" .. meu_dono.nome .. ">" end - --> his target + --his target local jogador_alvo, alvo_dono = damage_cache [alvo_serial] or damage_cache_pets [alvo_serial] or damage_cache [alvo_name], damage_cache_petsOwners [alvo_serial] if (not jogador_alvo) then @@ -1670,20 +1670,20 @@ damage_cache [alvo_dono.serial] = alvo_dono end else - if (alvo_flags and alvo_serial ~= "") then --> ter certeza que n�o � um pet + if (alvo_flags and alvo_serial ~= "") then --ter certeza que n�o � um pet damage_cache [alvo_serial] = jogador_alvo end end elseif (alvo_dono) then - --> � um pet + --� um pet alvo_name = alvo_name .. " <" .. alvo_dono.nome .. ">" end - --> last event + --last event este_jogador.last_event = _tempo - --> record death log + --record death log local t = last_events_cache [alvo_name] if (not t) then @@ -1698,12 +1698,12 @@ return print ("Parser Event Error -> Set to 16 DeathLogs and /reload", i, _death_event_amt) end - this_event [1] = true --> true if this is a damage || false for healing - this_event [2] = spellid --> spellid || false if this is a battle ress line - this_event [3] = amount --> amount of damage or healing - this_event [4] = time --> parser time - this_event [5] = _UnitHealth (alvo_name) --> current unit heal - this_event [6] = who_name --> source name + this_event [1] = true --true if this is a damage || false for healing + this_event [2] = spellid --spellid || false if this is a battle ress line + this_event [3] = amount --amount of damage or healing + this_event [4] = time --parser time + this_event [5] = _UnitHealth (alvo_name) --current unit heal + this_event [6] = who_name --source name this_event [7] = absorbed this_event [8] = spelltype or school this_event [9] = false @@ -1726,13 +1726,13 @@ local meu_dono este_jogador, meu_dono, who_name = _current_damage_container:PegarCombatente (who_serial, who_name, who_flags, true) if (not este_jogador) then - return --> just return if actor doen't exist yet + return --just return if actor doen't exist yet end end --/dump Details:GetCurrentCombat():GetPlayer("Hetdor").spells:GetSpell(1).extra["extra_attack"] - --> actor spells table + --actor spells table local spell = este_jogador.spells._ActorTable[1] --melee damage if (not spell) then return @@ -1754,40 +1754,40 @@ function parser:missed (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, missType, isOffHand, amountMissed, arg1, arg2, arg3) ------------------------------------------------------------------------------------------------ - --> early checks and fixes + --early checks and fixes if (not alvo_name) then - --> no target name, just quit + --no target name, just quit return elseif (not who_name) then - --> no actor name, use spell name instead + --no actor name, use spell name instead who_name = "[*] " .. spellname who_flags = 0xa48 who_serial = "" end ------------------------------------------------------------------------------------------------ - --> get actors + --get actors --todo tbc seems to not have misses? need further investigation --print ("MISS", "|", missType, "|", isOffHand, "|", amountMissed, "|", arg1) --print (missType, who_name, spellname, amountMissed) - --> 'misser' + --'misser' local este_jogador = damage_cache [who_serial] if (not este_jogador) then --este_jogador, meu_dono, who_name = _current_damage_container:PegarCombatente (nil, who_name) local meu_dono este_jogador, meu_dono, who_name = _current_damage_container:PegarCombatente (who_serial, who_name, who_flags, true) if (not este_jogador) then - return --> just return if actor doen't exist yet + return --just return if actor doen't exist yet end end este_jogador.last_event = _tempo - if (tanks_members_cache [alvo_serial]) then --> only track tanks + if (tanks_members_cache [alvo_serial]) then --only track tanks local TargetActor = damage_cache [alvo_serial] if (TargetActor) then @@ -1802,13 +1802,13 @@ local missTable = avoidance.overall [missType] if (missTable) then - --> overall + --overall local overall = avoidance.overall - overall [missType] = missTable + 1 --> adicionado a quantidade do miss + overall [missType] = missTable + 1 --adicionado a quantidade do miss - --> from this mob + --from this mob local mob = avoidance [who_name] - if (not mob) then --> if isn't in the table, build on the fly + if (not mob) then --if isn't in the table, build on the fly mob = _detalhes:CreateActorAvoidanceTable (true) avoidance [who_name] = mob end @@ -1816,12 +1816,12 @@ mob [missType] = mob [missType] + 1 if (missType == "ABSORB") then --full absorb - overall ["ALL"] = overall ["ALL"] + 1 --> qualtipo de hit ou absorb + overall ["ALL"] = overall ["ALL"] + 1 --qualtipo de hit ou absorb overall ["FULL_ABSORBED"] = overall ["FULL_ABSORBED"] + 1 --amount overall ["ABSORB_AMT"] = overall ["ABSORB_AMT"] + (amountMissed or 0) overall ["FULL_ABSORB_AMT"] = overall ["FULL_ABSORB_AMT"] + (amountMissed or 0) - mob ["ALL"] = mob ["ALL"] + 1 --> qualtipo de hit ou absorb + mob ["ALL"] = mob ["ALL"] + 1 --qualtipo de hit ou absorb mob ["FULL_ABSORBED"] = mob ["FULL_ABSORBED"] + 1 --amount mob ["ABSORB_AMT"] = mob ["ABSORB_AMT"] + (amountMissed or 0) mob ["FULL_ABSORB_AMT"] = mob ["FULL_ABSORB_AMT"] + (amountMissed or 0) @@ -1833,7 +1833,7 @@ end ------------------------------------------------------------------------------------------------ - --> amount add + --amount add if (missType == "ABSORB") then @@ -1852,27 +1852,27 @@ end ------------------------------------------------------------------------------------------------ - --> spell reflection + --spell reflection elseif (missType == "REFLECT" and reflection_auras[alvo_serial]) then --~reflect - --> a reflect event and we have the reflecting aura data + --a reflect event and we have the reflecting aura data if (reflection_damage[who_serial] and reflection_damage[who_serial][spellid] and time-reflection_damage[who_serial][spellid].time > 3.5 and (not reflection_debuffs[who_serial] or (reflection_debuffs[who_serial] and not reflection_debuffs[who_serial][spellid]))) then - --> here we check if we have to filter old damage data - --> we check for two conditions - --> the first is to see if this is an old damage - --> if more than 3.5 seconds have past then we can say that it is old... but! - --> the second condition is to see if there is an active debuff with the same spellid - --> if there is one then we ignore the timer and skip this - --> this should be cleared afterwards somehow... don't know how... + --here we check if we have to filter old damage data + --we check for two conditions + --the first is to see if this is an old damage + --if more than 3.5 seconds have past then we can say that it is old... but! + --the second condition is to see if there is an active debuff with the same spellid + --if there is one then we ignore the timer and skip this + --this should be cleared afterwards somehow... don't know how... reflection_damage[who_serial][spellid] = nil if (next(reflection_damage[who_serial]) == nil) then - --> there should be some better way of handling this kind of filtering, any suggestion? + --there should be some better way of handling this kind of filtering, any suggestion? reflection_damage[who_serial] = nil end end local damage = reflection_damage[who_serial] and reflection_damage[who_serial][spellid] local reflection = reflection_auras[alvo_serial] if (damage) then - --> damage ocurred first, so we have its data + --damage ocurred first, so we have its data local amount = reflection_damage[who_serial][spellid].amount local isreflected = spellid --which spell was reflected @@ -1882,18 +1882,18 @@ spellid = reflection.spellid spellname = reflection.spellname spelltype = reflection.spelltype - --> crediting the source of the aura that caused the reflection - --> also saying that the damage came from the aura that reflected the spell + --crediting the source of the aura that caused the reflection + --also saying that the damage came from the aura that reflected the spell reflection_damage[who_serial][spellid] = nil if next(reflection_damage[who_serial]) == nil then - --> this is so bad at clearing, there should be a better way of handling this + --this is so bad at clearing, there should be a better way of handling this reflection_damage[who_serial] = nil end return parser:spell_dmg(token,time,alvo_serial,alvo_name,alvo_flags,who_serial,who_name,who_flags,nil,spellid,spellname,spelltype,amount,-1,nil,nil,nil,nil,false,false,false,false, isreflected) else - --> saving information about this reflect because it occurred before the damage event + --saving information about this reflect because it occurred before the damage event reflection_events[who_serial] = reflection_events[who_serial] or {} reflection_events[who_serial][spellid] = reflection reflection_events[who_serial][spellid].time = time @@ -1905,7 +1905,7 @@ spellid = override_spellId [spellid] or spellid end - --> actor spells table + --actor spells table local spell = este_jogador.spells._ActorTable [spellid] if (not spell) then spell = este_jogador.spells:PegaHabilidade (spellid, true, token) @@ -1921,7 +1921,7 @@ end ----------------------------------------------------------------------------------------------------------------------------------------- - --> SUMMON serach key: ~summon | + --SUMMON serach key: ~summon | ----------------------------------------------------------------------------------------------------------------------------------------- function parser:summon (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellName) @@ -1965,9 +1965,9 @@ --alvo_name = "Fire Spirit" end - --> pet summon another pet + --pet summon another pet local sou_pet = container_pets [who_serial] - if (sou_pet) then --> okey, ja � um pet + if (sou_pet) then --okey, ja � um pet who_name, who_serial, who_flags = sou_pet[1], sou_pet[2], sou_pet[3] end @@ -1981,7 +1981,7 @@ end ----------------------------------------------------------------------------------------------------------------------------------------- - --> HEALING serach key: ~healing | + --HEALING serach key: ~healing | ----------------------------------------------------------------------------------------------------------------------------------------- local ignored_shields = { @@ -2005,24 +2005,24 @@ return end - --> check invalid serial against pets + --check invalid serial against pets if (who_serial == "") then - if (who_flags and _bit_band (who_flags, OBJECT_TYPE_PETS) ~= 0) then --> � um pet + if (who_flags and _bit_band (who_flags, OBJECT_TYPE_PETS) ~= 0) then --� um pet return end end - --> no name, use spellname + --no name, use spellname if (not who_name) then who_name = "[*] " .. (spellnameHeal or "--unknown spell--") end - --> no target, just ignore + --no target, just ignore if (not alvo_name) then return end - --> if no spellid + --if no spellid if (not spellidAbsorb) then spellidAbsorb = 1 spellnameAbsorb = "unknown" @@ -2035,12 +2035,12 @@ end ------------------------------------------------------------------------------------------------ - --> get actors + --get actors local este_jogador, meu_dono = healing_cache [who_serial] - if (not este_jogador) then --> pode ser um desconhecido ou um pet + if (not este_jogador) then --pode ser um desconhecido ou um pet este_jogador, meu_dono, who_name = _current_heal_container:PegarCombatente (who_serial, who_name, who_flags, true) - if (not meu_dono and who_flags and who_serial ~= "") then --> se n�o for um pet, adicionar no cache + if (not meu_dono and who_flags and who_serial ~= "") then --se n�o for um pet, adicionar no cache healing_cache [who_serial] = este_jogador end end @@ -2059,7 +2059,7 @@ este_jogador.totaldenied = este_jogador.totaldenied + amountDenied - --> actor spells table + --actor spells table local spell = este_jogador.spells._ActorTable [spellidAbsorb] if (not spell) then spell = este_jogador.spells:PegaHabilidade (spellidAbsorb, true, token) @@ -2114,7 +2114,7 @@ end end - --> diminuir o escudo nas tabelas de escudos + --diminuir o escudo nas tabelas de escudos local shields_on_target = escudo [alvo_name] if (shields_on_target) then local shields_by_spell = shields_on_target [shieldid] @@ -2126,7 +2126,7 @@ end end - --> chamar a fun��o de cura pra contar a cura + --chamar a fun��o de cura pra contar a cura parser:heal (token, time, owner_serial, owner_name, owner_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, shieldid, shieldname, shieldtype, amount, 0, 0, nil, true) end @@ -2134,35 +2134,35 @@ function parser:heal (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, amount, overhealing, absorbed, critical, is_shield) ------------------------------------------------------------------------------------------------ - --> early checks and fixes + --early checks and fixes - --> only capture heal if is in combat + --only capture heal if is in combat if (not _in_combat) then if (not _in_resting_zone) then return end end - --> check invalid serial against pets + --check invalid serial against pets if (who_serial == "") then - if (who_flags and _bit_band (who_flags, OBJECT_TYPE_PETS) ~= 0) then --> � um pet + if (who_flags and _bit_band (who_flags, OBJECT_TYPE_PETS) ~= 0) then --� um pet return end --who_serial = nil end - --> no name, use spellname + --no name, use spellname if (not who_name) then --who_name = "[*] " .. (spellname or "--unknown spell--") who_name = "[*] "..spellname end - --> no target, just ignore + --no target, just ignore if (not alvo_name) then return end - --> check for banned spells + --check for banned spells if (banned_healing_spells[spellid]) then return end @@ -2171,7 +2171,7 @@ spellid = spellname end - --> spirit link toten + --spirit link toten if (spellid == SPELLID_SHAMAN_SLT) then return parser:SLT_healing (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spelltype, amount, overhealing, absorbed, critical, is_shield) end @@ -2191,7 +2191,7 @@ local cura_efetiva = absorbed if (is_shield) then - --> o shield ja passa o numero exato da cura e o overheal + --o shield ja passa o numero exato da cura e o overheal cura_efetiva = amount else --cura_efetiva = absorbed + amount - overhealing @@ -2251,12 +2251,12 @@ end ------------------------------------------------------------------------------------------------ - --> get actors + --get actors local este_jogador, meu_dono = healing_cache [who_serial] - if (not este_jogador) then --> pode ser um desconhecido ou um pet + if (not este_jogador) then --pode ser um desconhecido ou um pet este_jogador, meu_dono, who_name = _current_heal_container:PegarCombatente (who_serial, who_name, who_flags, true) - if (not meu_dono and who_flags and who_serial ~= "") then --> se n�o for um pet, adicionar no cache + if (not meu_dono and who_flags and who_serial ~= "") then --se n�o for um pet, adicionar no cache healing_cache [who_serial] = este_jogador end end @@ -2273,7 +2273,7 @@ ------------------------------------------------------------------------------------------------ - --> an enemy healing enemy or an player actor healing a enemy + --an enemy healing enemy or an player actor healing a enemy if (spellid == SPELLID_SANGUINE_HEAL) then --sanguine ichor (heal enemies) este_jogador.grupo = true @@ -2291,7 +2291,7 @@ end ------------------------------------------------------------------------------------------------ - --> group checks + --group checks if (este_jogador.grupo and not jogador_alvo.arena_enemy) then --_current_combat.totals_grupo[2] = _current_combat.totals_grupo[2] + cura_efetiva @@ -2310,10 +2310,10 @@ local this_event = t [i] - this_event [1] = false --> true if this is a damage || false for healing - this_event [2] = spellid --> spellid || false if this is a battle ress line - this_event [3] = amount --> amount of damage or healing - this_event [4] = time --> parser time + this_event [1] = false --true if this is a damage || false for healing + this_event [2] = spellid --spellid || false if this is a battle ress line + this_event [3] = amount --amount of damage or healing + this_event [4] = time --parser time --current unit heal if (jogador_alvo.arena_enemy) then @@ -2331,7 +2331,7 @@ this_event [5] = _UnitHealth(alvo_name) end - this_event [6] = who_name --> source name + this_event [6] = who_name --source name this_event [7] = is_shield this_event [8] = absorbed @@ -2347,7 +2347,7 @@ end ------------------------------------------------------------------------------------------------ - --> timer + --timer if (not este_jogador.iniciar_hps) then @@ -2363,7 +2363,7 @@ end end - if (este_jogador.end_time) then --> o combate terminou, reabrir o tempo + if (este_jogador.end_time) then --o combate terminou, reabrir o tempo este_jogador.end_time = nil else --este_jogador:IniciarTempo (_tempo) @@ -2372,22 +2372,22 @@ end ------------------------------------------------------------------------------------------------ - --> add amount + --add amount - --> actor target + --actor target if (cura_efetiva > 0) then - --> combat total + --combat total _current_total [2] = _current_total [2] + cura_efetiva - --> actor healing amount + --actor healing amount este_jogador.total = este_jogador.total + cura_efetiva este_jogador.total_without_pet = este_jogador.total_without_pet + cura_efetiva - --> healing taken - jogador_alvo.healing_taken = jogador_alvo.healing_taken + cura_efetiva --> adiciona o dano tomado - if (not jogador_alvo.healing_from [who_name]) then --> adiciona a pool de dano tomado de quem + --healing taken + jogador_alvo.healing_taken = jogador_alvo.healing_taken + cura_efetiva --adiciona o dano tomado + if (not jogador_alvo.healing_from [who_name]) then --adiciona a pool de dano tomado de quem jogador_alvo.healing_from [who_name] = true end @@ -2396,13 +2396,13 @@ este_jogador.targets_absorbs [alvo_name] = (este_jogador.targets_absorbs [alvo_name] or 0) + cura_efetiva end - --> pet + --pet if (meu_dono) then - meu_dono.total = meu_dono.total + cura_efetiva --> heal do pet + meu_dono.total = meu_dono.total + cura_efetiva --heal do pet meu_dono.targets [alvo_name] = (meu_dono.targets [alvo_name] or 0) + cura_efetiva end - --> target amount + --target amount este_jogador.targets [alvo_name] = (este_jogador.targets [alvo_name] or 0) + cura_efetiva end @@ -2419,7 +2419,7 @@ end end - --> actor spells table + --actor spells table local spell = este_jogador.spells._ActorTable [spellid] if (not spell) then spell = este_jogador.spells:PegaHabilidade (spellid, true, token) @@ -2447,11 +2447,11 @@ function parser:SLT_healing (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spelltype, amount, overhealing, absorbed, critical, is_shield) - --> get actors + --get actors local este_jogador, meu_dono = healing_cache [who_serial] - if (not este_jogador) then --> pode ser um desconhecido ou um pet + if (not este_jogador) then --pode ser um desconhecido ou um pet este_jogador, meu_dono, who_name = _current_heal_container:PegarCombatente (who_serial, who_name, who_flags, true) - if (not meu_dono and who_flags and who_serial ~= "") then --> se n�o for um pet, adicionar no cache + if (not meu_dono and who_flags and who_serial ~= "") then --se n�o for um pet, adicionar no cache healing_cache [who_serial] = este_jogador end end @@ -2476,12 +2476,12 @@ local this_event = t [i] - this_event [1] = false --> true if this is a damage || false for healing - this_event [2] = spellid --> spellid || false if this is a battle ress line - this_event [3] = amount --> amount of damage or healing - this_event [4] = time --> parser time - this_event [5] = _UnitHealth (alvo_name) --> current unit heal - this_event [6] = who_name --> source name + this_event [1] = false --true if this is a damage || false for healing + this_event [2] = spellid --spellid || false if this is a battle ress line + this_event [3] = amount --amount of damage or healing + this_event [4] = time --parser time + this_event [5] = _UnitHealth (alvo_name) --current unit heal + this_event [6] = who_name --source name this_event [7] = is_shield this_event [8] = absorbed @@ -2503,28 +2503,28 @@ end ----------------------------------------------------------------------------------------------------------------------------------------- - --> BUFFS & DEBUFFS search key: ~buff ~aura ~shield | + --BUFFS & DEBUFFS search key: ~buff ~aura ~shield | ----------------------------------------------------------------------------------------------------------------------------------------- function parser:buff (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spellschool, tipo, amount, arg1, arg2, arg3) - --> not yet well know about unnamed buff casters + --not yet well know about unnamed buff casters if (not alvo_name) then alvo_name = "[*] Unknown shield target" elseif (not who_name) then - --> no actor name, use spell name instead + --no actor name, use spell name instead who_name = "[*] " .. spellname who_flags = 0xa48 who_serial = "" end ------------------------------------------------------------------------------------------------ - --> spell reflection + --spell reflection if (reflection_spellid[spellid]) then --~reflect - --> this is a spell reflect aura - --> we save the info on who received this aura and from whom - --> this will be used to credit this spell as the one doing the damage + --this is a spell reflect aura + --we save the info on who received this aura and from whom + --this will be used to credit this spell as the one doing the damage reflection_auras[alvo_serial] = { who_serial = who_serial, who_name = who_name, @@ -2536,11 +2536,11 @@ end ------------------------------------------------------------------------------------------------ - --> handle shields + --handle shields if (tipo == "BUFF") then ------------------------------------------------------------------------------------------------ - --> buff uptime + --buff uptime if (LIB_OPEN_RAID_BLOODLUST and LIB_OPEN_RAID_BLOODLUST[spellid]) then if (_detalhes.playername == alvo_name) then @@ -2549,7 +2549,7 @@ end end - if (spellid == 27827) then --> spirit of redemption (holy ~priest) ~spirit + if (spellid == 27827) then --spirit of redemption (holy ~priest) ~spirit --C_Timer.After(0.1, function() parser:dead ("UNIT_DIED", time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags) ignore_death [who_name] = true @@ -2557,7 +2557,7 @@ return elseif (spellid == SPELLID_MONK_GUARD) then - --> BfA monk talent + --BfA monk talent monk_guard_talent [who_serial] = amount elseif (spellid == SPELLID_NECROMANCER_CHEAT_DEATH) then @@ -2578,7 +2578,7 @@ if (_recording_buffs_and_debuffs) then if (who_name == alvo_name and raid_members_cache [who_serial] and _in_combat) then - --> call record buffs uptime + --call record buffs uptime parser:add_buff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, "BUFF_UPTIME_IN") elseif (container_pets [who_serial] and container_pets [who_serial][2] == alvo_serial) then @@ -2591,7 +2591,7 @@ end ------------------------------------------------------------------------------------------------ - --> healing done absorbs + --healing done absorbs if (absorb_spell_list [spellid] and _recording_healing and amount) then if (not escudo [alvo_name]) then escudo [alvo_name] = {} @@ -2606,7 +2606,7 @@ end ------------------------------------------------------------------------------------------------ - --> recording debuffs applied by player + --recording debuffs applied by player elseif (tipo == "DEBUFF") then @@ -2627,10 +2627,10 @@ end ------------------------------------------------------------------------------------------------ - --> spell reflection + --spell reflection if (who_serial == alvo_serial and not reflection_ignore[spellid]) then - --> self-inflicted debuff that could've been reflected - --> just saving it as a boolean to check for reflections + --self-inflicted debuff that could've been reflected + --just saving it as a boolean to check for reflections reflection_debuffs[who_serial] = reflection_debuffs[who_serial] or {} reflection_debuffs[who_serial][spellid] = true end @@ -2642,7 +2642,7 @@ if (_in_combat) then ------------------------------------------------------------------------------------------------ - --> buff uptime + --buff uptime if (_recording_buffs_and_debuffs) then if (cc_spell_list [spellid]) then @@ -2654,10 +2654,10 @@ end if (raid_members_cache [who_serial]) then - --> call record debuffs uptime + --call record debuffs uptime parser:add_debuff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, "DEBUFF_UPTIME_IN") - elseif (raid_members_cache [alvo_serial] and not raid_members_cache [who_serial]) then --> alvo � da raide e who � alguem de fora da raide + elseif (raid_members_cache [alvo_serial] and not raid_members_cache [who_serial]) then --alvo � da raide e who � alguem de fora da raide parser:add_bad_debuff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spellschool, "DEBUFF_UPTIME_IN") end end @@ -2665,7 +2665,7 @@ if (_recording_ability_with_buffs) then if (who_name == _detalhes.playername) then - --> record debuff uptime + --record debuff uptime local SoloDebuffUptime = _current_combat.SoloDebuffUptime if (not SoloDebuffUptime) then SoloDebuffUptime = {} @@ -2683,7 +2683,7 @@ ThisDebuff.Active = true end - --> record debuff spell and attack power + --record debuff spell and attack power local SoloDebuffPower = _current_combat.SoloDebuffPower if (not SoloDebuffPower) then SoloDebuffPower = {} @@ -2704,7 +2704,7 @@ local RangedAttackPower = base+posBuff+negBuff local SpellPower = GetSpellBonusDamage (3) - --> record buffs active on player when the debuff was applied + --record buffs active on player when the debuff was applied local BuffsOn = {} for BuffName, BuffTable in _pairs (_detalhes.Buffs.BuffsTable) do if (BuffTable.active) then @@ -2712,16 +2712,16 @@ end end - if (not ThisDebuffOnTarget) then --> apply + if (not ThisDebuffOnTarget) then --apply ThisDebuff [alvo_serial] = {power = math.max (AttackPower, RangedAttackPower, SpellPower), onTarget = true, buffs = BuffsOn} - else --> re applying + else --re applying ThisDebuff [alvo_serial].power = math.max (AttackPower, RangedAttackPower, SpellPower) ThisDebuff [alvo_serial].buffs = BuffsOn ThisDebuff [alvo_serial].onTarget = true end - --> send event for plugins - _detalhes:SendEvent ("BUFF_UPDATE_DEBUFFPOWER") + --send event for plugins + _detalhes:SendEvent("BUFF_UPDATE_DEBUFFPOWER") end end @@ -2733,24 +2733,24 @@ function parser:add_cc_done (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname) ------------------------------------------------------------------------------------------------ - --> early checks and fixes + --early checks and fixes _current_misc_container.need_refresh = true ------------------------------------------------------------------------------------------------ - --> get actors + --get actors - --> main actor + --main actor local este_jogador, meu_dono = misc_cache [who_name] - if (not este_jogador) then --> pode ser um desconhecido ou um pet + if (not este_jogador) then --pode ser um desconhecido ou um pet este_jogador, meu_dono, who_name = _current_misc_container:PegarCombatente (who_serial, who_name, who_flags, true) - if (not meu_dono) then --> se n�o for um pet, adicionar no cache + if (not meu_dono) then --se n�o for um pet, adicionar no cache misc_cache [who_name] = este_jogador end end ------------------------------------------------------------------------------------------------ - --> build containers on the fly + --build containers on the fly if (not este_jogador.cc_done) then este_jogador.cc_done = _detalhes:GetOrderNumber() @@ -2759,16 +2759,16 @@ end ------------------------------------------------------------------------------------------------ - --> add amount + --add amount - --> update last event + --update last event este_jogador.last_event = _tempo - --> add amount + --add amount este_jogador.cc_done = este_jogador.cc_done + 1 este_jogador.cc_done_targets [alvo_name] = (este_jogador.cc_done_targets [alvo_name] or 0) + 1 - --> actor spells table + --actor spells table local spell = este_jogador.cc_done_spells._ActorTable [spellid] if (not spell) then spell = este_jogador.cc_done_spells:PegaHabilidade (spellid, true) @@ -2777,7 +2777,7 @@ spell.targets [alvo_name] = (spell.targets [alvo_name] or 0) + 1 spell.counter = spell.counter + 1 - --> add the crowd control for the pet owner + --add the crowd control for the pet owner if (meu_dono) then if (not meu_dono.cc_done) then @@ -2786,11 +2786,11 @@ meu_dono.cc_done_targets = {} end - --> add amount + --add amount meu_dono.cc_done = meu_dono.cc_done + 1 meu_dono.cc_done_targets [alvo_name] = (meu_dono.cc_done_targets [alvo_name] or 0) + 1 - --> actor spells table + --actor spells table local spell = meu_dono.cc_done_spells._ActorTable [spellid] if (not spell) then spell = meu_dono.cc_done_spells:PegaHabilidade (spellid, true) @@ -2800,7 +2800,7 @@ spell.counter = spell.counter + 1 end - --> verifica a classe + --verifica a classe if (who_flags and _bit_band (who_flags, OBJECT_TYPE_PLAYER) ~= 0) then if (este_jogador.classe == "UNKNOW" or este_jogador.classe == "UNGROUPPLAYER") then local damager_object = damage_cache [who_serial] @@ -2819,15 +2819,15 @@ function parser:buff_refresh (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spellschool, tipo, amount) ------------------------------------------------------------------------------------------------ - --> handle shields + --handle shields if (tipo == "BUFF") then ------------------------------------------------------------------------------------------------ - --> buff uptime + --buff uptime if (_recording_buffs_and_debuffs) then if (who_name == alvo_name and raid_members_cache [who_serial] and _in_combat) then - --> call record buffs uptime + --call record buffs uptime parser:add_buff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, "BUFF_UPTIME_REFRESH") elseif (container_pets [who_serial] and container_pets [who_serial][2] == alvo_serial) then --um pet colocando uma aura do dono @@ -2839,7 +2839,7 @@ end ------------------------------------------------------------------------------------------------ - --> healing done (shields) + --healing done (shields) if (absorb_spell_list [spellid] and _recording_healing and amount) then if (escudo [alvo_name] and escudo [alvo_name][spellid] and escudo [alvo_name][spellid][who_name]) then if (ignored_overheal [spellid]) then @@ -2867,10 +2867,10 @@ end ------------------------------------------------------------------------------------------------ - --> recording buffs + --recording buffs elseif (_recording_self_buffs) then - if (who_name == _detalhes.playername or alvo_name == _detalhes.playername) then --> foi colocado pelo player + if (who_name == _detalhes.playername or alvo_name == _detalhes.playername) then --foi colocado pelo player local bufftable = _detalhes.Buffs.BuffsTable [spellname] if (bufftable) then @@ -2882,7 +2882,7 @@ end ------------------------------------------------------------------------------------------------ - --> recording debuffs applied by player + --recording debuffs applied by player elseif (tipo == "DEBUFF") then @@ -2905,12 +2905,12 @@ if (_in_combat) then ------------------------------------------------------------------------------------------------ - --> buff uptime + --buff uptime if (_recording_buffs_and_debuffs) then if (raid_members_cache [who_serial]) then - --> call record debuffs uptime + --call record debuffs uptime parser:add_debuff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, "DEBUFF_UPTIME_REFRESH") - elseif (raid_members_cache [alvo_serial] and not raid_members_cache [who_serial]) then --> alvo � da raide e o caster � inimigo + elseif (raid_members_cache [alvo_serial] and not raid_members_cache [who_serial]) then --alvo � da raide e o caster � inimigo parser:add_bad_debuff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spellschool, "DEBUFF_UPTIME_REFRESH", amount) end end @@ -2918,7 +2918,7 @@ if (_recording_ability_with_buffs) then if (who_name == _detalhes.playername) then - --> record debuff uptime + --record debuff uptime local SoloDebuffUptime = _current_combat.SoloDebuffUptime if (SoloDebuffUptime) then local ThisDebuff = SoloDebuffUptime [spellid] @@ -2927,12 +2927,12 @@ ThisDebuff.duration = ThisDebuff.duration + (_tempo - ThisDebuff.start) ThisDebuff.start = _tempo - --> send event for plugins - _detalhes:SendEvent ("BUFF_UPDATE_DEBUFFPOWER") + --send event for plugins + _detalhes:SendEvent("BUFF_UPDATE_DEBUFFPOWER") end end - --> record debuff spell and attack power + --record debuff spell and attack power local SoloDebuffPower = _current_combat.SoloDebuffPower if (SoloDebuffPower) then local ThisDebuff = SoloDebuffPower [spellid] @@ -2955,8 +2955,8 @@ ThisDebuff [alvo_serial].power = math.max (AttackPower, RangedAttackPower, SpellPower) ThisDebuff [alvo_serial].buffs = BuffsOn - --> send event for plugins - _detalhes:SendEvent ("BUFF_UPDATE_DEBUFFPOWER") + --send event for plugins + _detalhes:SendEvent("BUFF_UPDATE_DEBUFFPOWER") end end end @@ -2971,15 +2971,15 @@ function parser:unbuff (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spellschool, tipo, amount) ------------------------------------------------------------------------------------------------ - --> handle shields + --handle shields if (tipo == "BUFF") then ------------------------------------------------------------------------------------------------ - --> buff uptime + --buff uptime if (_recording_buffs_and_debuffs) then if (who_name == alvo_name and raid_members_cache [who_serial] and _in_combat) then - --> call record buffs uptime + --call record buffs uptime parser:add_buff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, "BUFF_UPTIME_OUT") elseif (container_pets [who_serial] and container_pets [who_serial][2] == alvo_serial) then --um pet colocando uma aura do dono @@ -2991,7 +2991,7 @@ end if (spellid == SPELLID_MONK_GUARD) then - --> BfA monk talent + --BfA monk talent if (monk_guard_talent [who_serial]) then local damage_prevented = monk_guard_talent [who_serial] - (amount or 0) parser:heal (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spellschool, damage_prevented, _math_ceil (amount or 0), 0, 0, true) @@ -3024,7 +3024,7 @@ end ------------------------------------------------------------------------------------------------ - --> healing done (shields) + --healing done (shields) if (absorb_spell_list [spellid] and _recording_healing) then local spellName = GetSpellInfo(spellid) @@ -3035,9 +3035,9 @@ --overheal não esta dando refresh quando um valor é adicionado ao escudo escudo [alvo_name][spellid][who_name] = 0 - --> can't use monk guard since its overheal is computed inside the unbuff + --can't use monk guard since its overheal is computed inside the unbuff if (amount > 0 and spellid ~= SPELLID_MONK_GUARD) then - --> removing the nil at the end before true for is_shield, I have no documentation change about it, not sure the reason why it was addded + --removing the nil at the end before true for is_shield, I have no documentation change about it, not sure the reason why it was addded return parser:heal (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, nil, 0, _math_ceil (amount), 0, 0, true) --0, 0, nil, true else return @@ -3048,9 +3048,9 @@ end ------------------------------------------------------------------------------------------------ - --> recording buffs + --recording buffs elseif (_recording_self_buffs) then - if (who_name == _detalhes.playername or alvo_name == _detalhes.playername) then --> foi colocado pelo player + if (who_name == _detalhes.playername or alvo_name == _detalhes.playername) then --foi colocado pelo player local bufftable = _detalhes.Buffs.BuffsTable [spellname] if (bufftable) then @@ -3062,7 +3062,7 @@ end ------------------------------------------------------------------------------------------------ - --> recording debuffs applied by player + --recording debuffs applied by player elseif (tipo == "DEBUFF") then --Eye of Corruption 8.3 REMOVE ON 9.0 @@ -3078,10 +3078,10 @@ end ------------------------------------------------------------------------------------------------ - --> spell reflection + --spell reflection if (reflection_dispels[alvo_serial] and reflection_dispels[alvo_serial][spellid]) then - --> debuff was dispelled by a reflecting dispel and could've been reflected - --> save the data about whom dispelled who and the spell that was dispelled + --debuff was dispelled by a reflecting dispel and could've been reflected + --save the data about whom dispelled who and the spell that was dispelled local reflection = reflection_dispels[alvo_serial][spellid] reflection_events[who_serial] = reflection_events[who_serial] or {} reflection_events[who_serial][spellid] = { @@ -3101,24 +3101,24 @@ end ------------------------------------------------------------------------------------------------ - --> spell reflection + --spell reflection if (reflection_debuffs[who_serial] and reflection_debuffs[who_serial][spellid]) then - --> self-inflicted debuff was removed, so we just clear this data + --self-inflicted debuff was removed, so we just clear this data reflection_debuffs[who_serial][spellid] = nil if (next(reflection_debuffs[who_serial]) == nil) then - --> better way of doing this? accepting suggestions + --better way of doing this? accepting suggestions reflection_debuffs[who_serial] = nil end end if (_in_combat) then ------------------------------------------------------------------------------------------------ - --> buff uptime + --buff uptime if (_recording_buffs_and_debuffs) then if (raid_members_cache [who_serial]) then - --> call record debuffs uptime + --call record debuffs uptime parser:add_debuff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, "DEBUFF_UPTIME_OUT") - elseif (raid_members_cache [alvo_serial] and not raid_members_cache [who_serial]) then --> alvo � da raide e o caster � inimigo + elseif (raid_members_cache [alvo_serial] and not raid_members_cache [who_serial]) then --alvo � da raide e o caster � inimigo parser:add_bad_debuff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spellschool, "DEBUFF_UPTIME_OUT") end end @@ -3131,7 +3131,7 @@ if (who_name == _detalhes.playername) then - --> record debuff uptime + --record debuff uptime local SoloDebuffUptime = _current_combat.SoloDebuffUptime local sendevent = false if (SoloDebuffUptime) then @@ -3145,7 +3145,7 @@ end end - --> record debuff spell and attack power + --record debuff spell and attack power local SoloDebuffPower = _current_combat.SoloDebuffPower if (SoloDebuffPower) then local ThisDebuff = SoloDebuffPower [spellid] @@ -3156,7 +3156,7 @@ end if (sendevent) then - _detalhes:SendEvent ("BUFF_UPDATE_DEBUFFPOWER") + _detalhes:SendEvent("BUFF_UPDATE_DEBUFFPOWER") end end end @@ -3165,30 +3165,30 @@ end ----------------------------------------------------------------------------------------------------------------------------------------- - --> MISC search key: ~buffuptime ~buffsuptime | + --MISC search key: ~buffuptime ~buffsuptime | ----------------------------------------------------------------------------------------------------------------------------------------- function parser:add_bad_debuff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spellschool, in_out, stack_amount) if (not alvo_name) then - --> no target name, just quit + --no target name, just quit return elseif (not who_name) then - --> no actor name, use spell name instead + --no actor name, use spell name instead who_name = "[*] "..spellname end ------------------------------------------------------------------------------------------------ - --> get actors - --> nome do debuff ser� usado para armazenar o nome do ator + --get actors + --nome do debuff ser� usado para armazenar o nome do ator local este_jogador = misc_cache [spellname] - if (not este_jogador) then --> pode ser um desconhecido ou um pet + if (not este_jogador) then --pode ser um desconhecido ou um pet este_jogador = _current_misc_container:PegarCombatente (who_serial, spellname, who_flags, true) misc_cache [spellname] = este_jogador end ------------------------------------------------------------------------------------------------ - --> build containers on the fly + --build containers on the fly if (not este_jogador.debuff_uptime) then este_jogador.boss_debuff = true @@ -3201,12 +3201,12 @@ end ------------------------------------------------------------------------------------------------ - --> add amount + --add amount - --> update last event + --update last event este_jogador.last_event = _tempo - --> actor target + --actor target local este_alvo = este_jogador.debuff_uptime_targets [alvo_name] if (not este_alvo) then este_alvo = _detalhes.atributo_misc:CreateBuffTargetObject() @@ -3223,7 +3223,7 @@ este_alvo.actived_at = _tempo --death log - --> record death log + --record death log if (not necro_cheat_deaths[alvo_serial]) then --remove on 10.0 local t = last_events_cache [alvo_name] @@ -3239,12 +3239,12 @@ return print ("Parser Event Error -> Set to 16 DeathLogs and /reload", i, _death_event_amt) end - this_event [1] = 4 --> 4 = debuff aplication - this_event [2] = spellid --> spellid + this_event [1] = 4 --4 = debuff aplication + this_event [2] = spellid --spellid this_event [3] = 1 - this_event [4] = time --> parser time - this_event [5] = _UnitHealth (alvo_name) --> current unit heal - this_event [6] = who_name --> source name + this_event [4] = time --parser time + this_event [5] = _UnitHealth (alvo_name) --current unit heal + this_event [6] = who_name --source name this_event [7] = false this_event [8] = false this_event [9] = false @@ -3272,7 +3272,7 @@ --local name, texture, count, debuffType, duration, expirationTime, caster, canStealOrPurge, nameplateShowPersonal, spellId = UnitAura (alvo_name, spellname, nil, "HARMFUL") --UnitAura ("Kastfall", "Gulp Frog Toxin", nil, "HARMFUL") - --> record death log + --record death log if (not necro_cheat_deaths[alvo_serial]) then --remove on 10.0 local t = last_events_cache [alvo_name] @@ -3288,12 +3288,12 @@ return print ("Parser Event Error -> Set to 16 DeathLogs and /reload", i, _death_event_amt) end - this_event [1] = 4 --> 4 = debuff aplication - this_event [2] = spellid --> spellid + this_event [1] = 4 --4 = debuff aplication + this_event [2] = spellid --spellid this_event [3] = stack_amount or 1 - this_event [4] = time --> parser time - this_event [5] = _UnitHealth (alvo_name) --> current unit heal - this_event [6] = who_name --> source name + this_event [4] = time --parser time + this_event [5] = _UnitHealth (alvo_name) --current unit heal + this_event [6] = who_name --source name this_event [7] = false this_event [8] = false this_event [9] = false @@ -3311,7 +3311,7 @@ elseif (in_out == "DEBUFF_UPTIME_OUT") then if (este_alvo.actived_at and este_alvo.actived) then este_alvo.uptime = este_alvo.uptime + _detalhes._tempo - este_alvo.actived_at - este_jogador.debuff_uptime = este_jogador.debuff_uptime + _tempo - este_alvo.actived_at --> token = actor misc object + este_jogador.debuff_uptime = este_jogador.debuff_uptime + _tempo - este_alvo.actived_at --token = actor misc object end este_alvo.activedamt = este_alvo.activedamt - 1 @@ -3328,20 +3328,20 @@ -- ~debuff function parser:add_debuff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, in_out) ------------------------------------------------------------------------------------------------ - --> early checks and fixes + --early checks and fixes _current_misc_container.need_refresh = true ------------------------------------------------------------------------------------------------ - --> get actors + --get actors local este_jogador = misc_cache [who_name] - if (not este_jogador) then --> pode ser um desconhecido ou um pet + if (not este_jogador) then --pode ser um desconhecido ou um pet este_jogador = _current_misc_container:PegarCombatente (who_serial, who_name, who_flags, true) misc_cache [who_name] = este_jogador end ------------------------------------------------------------------------------------------------ - --> build containers on the fly + --build containers on the fly if (not este_jogador.debuff_uptime) then este_jogador.debuff_uptime = 0 @@ -3350,12 +3350,12 @@ end ------------------------------------------------------------------------------------------------ - --> add amount + --add amount - --> update last event + --update last event este_jogador.last_event = _tempo - --> actor spells table + --actor spells table local spell = este_jogador.debuff_uptime_spells._ActorTable [spellid] if (not spell) then spell = este_jogador.debuff_uptime_spells:PegaHabilidade (spellid, true, "DEBUFF_UPTIME") @@ -3367,20 +3367,20 @@ function parser:add_buff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, in_out) ------------------------------------------------------------------------------------------------ - --> early checks and fixes + --early checks and fixes _current_misc_container.need_refresh = true ------------------------------------------------------------------------------------------------ - --> get actors + --get actors local este_jogador = misc_cache [who_name] - if (not este_jogador) then --> pode ser um desconhecido ou um pet + if (not este_jogador) then --pode ser um desconhecido ou um pet este_jogador = _current_misc_container:PegarCombatente (who_serial, who_name, who_flags, true) misc_cache [who_name] = este_jogador end ------------------------------------------------------------------------------------------------ - --> build containers on the fly + --build containers on the fly if (not este_jogador.buff_uptime) then este_jogador.buff_uptime = 0 @@ -3389,12 +3389,12 @@ end ------------------------------------------------------------------------------------------------ - --> add amount + --add amount - --> update last event + --update last event este_jogador.last_event = _tempo - --> actor spells table + --actor spells table local spell = este_jogador.buff_uptime_spells._ActorTable [spellid] if (not spell) then spell = este_jogador.buff_uptime_spells:PegaHabilidade (spellid, true, "BUFF_UPTIME") @@ -3404,7 +3404,7 @@ end ----------------------------------------------------------------------------------------------------------------------------------------- - --> ENERGY serach key: ~energy | + --ENERGY serach key: ~energy | ----------------------------------------------------------------------------------------------------------------------------------------- local PowerEnum = Enum and Enum.PowerType @@ -3492,8 +3492,8 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 [SPELL_POWER_FURY] = {file = [[Interface\PLAYERFRAME\UI-PlayerFrame-Deathknight-Blood-On]], coords = {0, 1, 0, 1}}, } - local AlternatePowerEnableFrame = CreateFrame ("frame") - local AlternatePowerMonitorFrame = CreateFrame ("frame") + local AlternatePowerEnableFrame = CreateFrame("frame") + local AlternatePowerMonitorFrame = CreateFrame("frame") AlternatePowerEnableFrame:RegisterEvent ("UNIT_POWER_BAR_SHOW") --AlternatePowerEnableFrame:RegisterEvent ("UNIT_POWER_BAR_HIDE") @@ -3501,9 +3501,9 @@ 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 + AlternatePowerMonitorFrame:RegisterEvent ("UNIT_POWER_UPDATE") -- 8.0 AlternatePowerEnableFrame.IsRunning = true elseif (AlternatePowerEnableFrame.IsRunning and (event == "ENCOUNTER_END" or event == "PLAYER_REGEN_ENABLED")) then -- and not InCombatLockdown() AlternatePowerMonitorFrame:UnregisterEvent ("UNIT_POWER_UPDATE") @@ -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 @@ -3524,9 +3524,9 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 local addPower = currentPower - power.last power.total = power.total + addPower - --> main actor + --main actor local este_jogador = energy_cache [actorName] - if (not este_jogador) then --> pode ser um desconhecido ou um pet + if (not este_jogador) then --pode ser um desconhecido ou um pet este_jogador, meu_dono, actorName = _current_energy_container:PegarCombatente (UnitGUID (unitID), actorName, 0x514, true) energy_cache [actorName] = este_jogador end @@ -3563,7 +3563,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 function parser:energize (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, amount, overpower, powertype, altpower) ------------------------------------------------------------------------------------------------ - --> early checks and fixes + --early checks and fixes if (not who_name) then who_name = "[*] "..spellname elseif (not alvo_name) then @@ -3571,14 +3571,14 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end ------------------------------------------------------------------------------------------------ - --> check if is energy or resource + --check if is energy or resource --Details:Dump({token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, amount, overpower, powertype, altpower}) - --> get resource type + --get resource type local is_resource, resource_amount, resource_id = resource_power_type [powertype], amount, powertype - --> check if is valid + --check if is valid if (not energy_types [powertype] and not is_resource) then return @@ -3594,17 +3594,17 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _current_energy_container.need_refresh = true ------------------------------------------------------------------------------------------------ - --> get actors + --get actors - --> main actor + --main actor local este_jogador, meu_dono = energy_cache [who_name] - if (not este_jogador) then --> pode ser um desconhecido ou um pet + if (not este_jogador) then --pode ser um desconhecido ou um pet este_jogador, meu_dono, who_name = _current_energy_container:PegarCombatente (who_serial, who_name, who_flags, true) este_jogador.powertype = powertype if (meu_dono) then meu_dono.powertype = powertype end - if (not meu_dono) then --> se n�o for um pet, adicionar no cache + if (not meu_dono) then --se n�o for um pet, adicionar no cache energy_cache [who_name] = este_jogador end end @@ -3613,7 +3613,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 este_jogador.powertype = powertype end - --> target + --target local jogador_alvo, alvo_dono = energy_cache [alvo_name] if (not jogador_alvo) then jogador_alvo, alvo_dono, alvo_name = _current_energy_container:PegarCombatente (alvo_serial, alvo_name, alvo_flags, true) @@ -3634,35 +3634,35 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 este_jogador.last_event = _tempo ------------------------------------------------------------------------------------------------ - --> amount add + --amount add if (not is_resource) then --amount = amount - overpower - --> add to targets + --add to targets este_jogador.targets [alvo_name] = (este_jogador.targets [alvo_name] or 0) + amount - --> add to combat total + --add to combat total _current_total [3] [powertype] = _current_total [3] [powertype] + amount if (este_jogador.grupo) then _current_gtotal [3] [powertype] = _current_gtotal [3] [powertype] + amount end - --> regen produced amount + --regen produced amount este_jogador.total = este_jogador.total + amount este_jogador.totalover = este_jogador.totalover + overpower - --> target regenerated amount + --target regenerated amount jogador_alvo.received = jogador_alvo.received + amount - --> owner + --owner if (meu_dono) then meu_dono.total = meu_dono.total + amount end - --> actor spells table + --actor spells table local spell = este_jogador.spells._ActorTable [spellid] if (not spell) then spell = este_jogador.spells:PegaHabilidade (spellid, true, token) @@ -3672,7 +3672,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 return spell_energy_func (spell, alvo_serial, alvo_name, alvo_flags, amount, who_name, powertype, overpower) else - --> is a resource + --is a resource este_jogador.resource = este_jogador.resource + resource_amount este_jogador.resource_type = resource_id end @@ -3681,43 +3681,43 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 ----------------------------------------------------------------------------------------------------------------------------------------- - --> MISC search key: ~cooldown | + --MISC search key: ~cooldown | ----------------------------------------------------------------------------------------------------------------------------------------- function parser:add_defensive_cooldown (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname) ------------------------------------------------------------------------------------------------ - --> early checks and fixes + --early checks and fixes _current_misc_container.need_refresh = true ------------------------------------------------------------------------------------------------ - --> get actors + --get actors - --> main actor + --main actor local este_jogador, meu_dono = misc_cache [who_name] - if (not este_jogador) then --> pode ser um desconhecido ou um pet + if (not este_jogador) then --pode ser um desconhecido ou um pet este_jogador, meu_dono, who_name = _current_misc_container:PegarCombatente (who_serial, who_name, who_flags, true) - if (not meu_dono) then --> se n�o for um pet, adicionar no cache + if (not meu_dono) then --se n�o for um pet, adicionar no cache misc_cache [who_name] = este_jogador end end ------------------------------------------------------------------------------------------------ - --> build containers on the fly + --build containers on the fly if (not este_jogador.cooldowns_defensive) then 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 + este_jogador.cooldowns_defensive_spells = container_habilidades:NovoContainer (container_misc) --cria o container das habilidades end ------------------------------------------------------------------------------------------------ - --> add amount + --add amount - --> actor cooldowns used + --actor cooldowns used este_jogador.cooldowns_defensive = este_jogador.cooldowns_defensive + 1 - --> combat totals + --combat totals _current_total [4].cooldowns_defensive = _current_total [4].cooldowns_defensive + 1 if (este_jogador.grupo) then @@ -3726,14 +3726,14 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if (who_name == alvo_name) then local damage_actor = damage_cache [who_serial] - if (not damage_actor) then --> pode ser um desconhecido ou um pet + if (not damage_actor) then --pode ser um desconhecido ou um pet damage_actor = _current_damage_container:PegarCombatente (who_serial, who_name, who_flags, true) - if (who_flags) then --> se n�o for um pet, adicionar no cache + if (who_flags) then --se n�o for um pet, adicionar no cache damage_cache [who_serial] = damage_actor end end - --> last events + --last events local t = last_events_cache [who_name] if (not t) then @@ -3743,12 +3743,12 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 local i = t.n local this_event = t [i] - this_event [1] = 1 --> true if this is a damage || false for healing || 1 for cooldown - this_event [2] = spellid --> spellid || false if this is a battle ress line - this_event [3] = 1 --> amount of damage or healing - this_event [4] = time --> parser time - this_event [5] = _UnitHealth (who_name) --> current unit heal - this_event [6] = who_name --> source name + this_event [1] = 1 --true if this is a damage || false for healing || 1 for cooldown + this_event [2] = spellid --spellid || false if this is a battle ress line + this_event [3] = 1 --amount of damage or healing + this_event [4] = time --parser time + this_event [5] = _UnitHealth (who_name) --current unit heal + this_event [6] = who_name --source name i = i + 1 if (i == _death_event_amt+1) then @@ -3763,21 +3763,21 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end - --> update last event + --update last event este_jogador.last_event = _tempo - --> actor targets + --actor targets este_jogador.cooldowns_defensive_targets [alvo_name] = (este_jogador.cooldowns_defensive_targets [alvo_name] or 0) + 1 - --> actor spells table + --actor spells table local spell = este_jogador.cooldowns_defensive_spells._ActorTable [spellid] if (not spell) then spell = este_jogador.cooldowns_defensive_spells:PegaHabilidade (spellid, true, token) end if (_hook_cooldowns) then - --> send event to registred functions - for _, func in _ipairs (_hook_cooldowns_container) do + --send event to registred functions + for _, func in _ipairs(_hook_cooldowns_container) do func (nil, token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname) end end @@ -3789,7 +3789,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 function parser:interrupt (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, extraSpellID, extraSpellName, extraSchool) ------------------------------------------------------------------------------------------------ - --> early checks and fixes + --early checks and fixes --quake affix from mythic+ if (spellid == 240448) then @@ -3810,19 +3810,19 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _current_misc_container.need_refresh = true ------------------------------------------------------------------------------------------------ - --> get actors + --get actors - --> main actor + --main actor local este_jogador, meu_dono = misc_cache [who_name] - if (not este_jogador) then --> pode ser um desconhecido ou um pet + if (not este_jogador) then --pode ser um desconhecido ou um pet este_jogador, meu_dono, who_name = _current_misc_container:PegarCombatente (who_serial, who_name, who_flags, true) - if (not meu_dono) then --> se n�o for um pet, adicionar no cache + if (not meu_dono) then --se n�o for um pet, adicionar no cache misc_cache [who_name] = este_jogador end end ------------------------------------------------------------------------------------------------ - --> build containers on the fly + --build containers on the fly if (not este_jogador.interrupt) then este_jogador.interrupt = _detalhes:GetOrderNumber(who_name) @@ -3832,35 +3832,35 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end ------------------------------------------------------------------------------------------------ - --> add amount + --add amount - --> actor interrupt amount + --actor interrupt amount este_jogador.interrupt = este_jogador.interrupt + 1 - --> combat totals + --combat totals _current_total [4].interrupt = _current_total [4].interrupt + 1 if (este_jogador.grupo) then _current_gtotal [4].interrupt = _current_gtotal [4].interrupt + 1 end - --> update last event + --update last event este_jogador.last_event = _tempo - --> spells interrupted + --spells interrupted este_jogador.interrompeu_oque [extraSpellID] = (este_jogador.interrompeu_oque [extraSpellID] or 0) + 1 - --> actor targets + --actor targets este_jogador.interrupt_targets [alvo_name] = (este_jogador.interrupt_targets [alvo_name] or 0) + 1 - --> actor spells table + --actor spells table local spell = este_jogador.interrupt_spells._ActorTable [spellid] if (not spell) then spell = este_jogador.interrupt_spells:PegaHabilidade (spellid, true, token) end spell_misc_func (spell, alvo_serial, alvo_name, alvo_flags, who_name, token, extraSpellID, extraSpellName) - --> verifica se tem dono e adiciona o interrupt para o dono + --verifica se tem dono e adiciona o interrupt para o dono if (meu_dono) then if (not meu_dono.interrupt) then @@ -3882,16 +3882,16 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 -- spells interrupted meu_dono.interrompeu_oque [extraSpellID] = (meu_dono.interrompeu_oque [extraSpellID] or 0) + 1 - --> pet interrupt + --pet interrupt if (_hook_interrupt) then - for _, func in _ipairs (_hook_interrupt_container) do + for _, func in _ipairs(_hook_interrupt_container) do func (nil, token, time, meu_dono.serial, meu_dono.nome, meu_dono.flag_original, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spelltype, extraSpellID, extraSpellName, extraSchool) end end else - --> player interrupt + --player interrupt if (_hook_interrupt) then - for _, func in _ipairs (_hook_interrupt_container) do + for _, func in _ipairs(_hook_interrupt_container) do func (nil, token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spelltype, extraSpellID, extraSpellName, extraSchool) end end @@ -3899,13 +3899,13 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end - --> search key: ~spellcast ~castspell ~cast + --search key: ~spellcast ~castspell ~cast function parser:spellcast (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype) ------------------------------------------------------------------------------------------------ - --> early checks and fixes + --early checks and fixes - --> only capture if is in combat + --only capture if is in combat if (not _in_combat) then return end @@ -3920,9 +3920,9 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end ------------------------------------------------------------------------------------------------ - --> get actors + --get actors - --> main actor + --main actor local este_jogador, meu_dono = misc_cache [who_serial] or misc_cache_pets [who_serial] or misc_cache [who_name], misc_cache_petsOwners [who_serial] --local este_jogador = misc_cache [who_name] @@ -3931,7 +3931,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 este_jogador, meu_dono, who_name = _current_misc_container:PegarCombatente (who_serial, who_name, who_flags, true) - if (meu_dono) then --> � um pet + if (meu_dono) then --� um pet if (who_serial ~= "") then misc_cache_pets [who_serial] = este_jogador misc_cache_petsOwners [who_serial] = meu_dono @@ -3949,7 +3949,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end ------------------------------------------------------------------------------------------------ - --> build containers on the fly + --build containers on the fly local spell_cast = este_jogador.spell_cast if (not spell_cast) then este_jogador.spell_cast = {[spellid] = 1} @@ -3958,13 +3958,13 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end ------------------------------------------------------------------------------------------------ - --> record cooldowns cast which can't track with buff applyed. + --record cooldowns cast which can't track with buff applyed. - --> foi um jogador que castou + --foi um jogador que castou if (raid_members_cache [who_serial]) then - --> check if is a cooldown :D + --check if is a cooldown :D if (defensive_cooldowns [spellid]) then - --> usou cooldown + --usou cooldown if (not alvo_name) then if (DetailsFramework.CooldownsDeffense [spellid]) then alvo_name = who_name @@ -3980,16 +3980,16 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end else - --> enemy successful casts (not interrupted) - if (_bit_band (who_flags, 0x00000040) ~= 0 and who_name) then --> byte 2 = 4 (enemy) - --> damager + --enemy successful casts (not interrupted) + if (_bit_band (who_flags, 0x00000040) ~= 0 and who_name) then --byte 2 = 4 (enemy) + --damager local este_jogador = damage_cache [who_serial] if (not este_jogador) then este_jogador = _current_damage_container:PegarCombatente (who_serial, who_name, who_flags, true) end if (este_jogador) then - --> actor spells table + --actor spells table local spell = este_jogador.spells._ActorTable [spellid] --line where the actor was nil if (not spell) then spell = este_jogador.spells:PegaHabilidade (spellid, true, token) @@ -4006,9 +4006,9 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 function parser:dispell (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, extraSpellID, extraSpellName, extraSchool, auraType) ------------------------------------------------------------------------------------------------ - --> early checks and fixes + --early checks and fixes - --> esta dando erro onde o nome � NIL, fazendo um fix para isso + --esta dando erro onde o nome � NIL, fazendo um fix para isso if (not who_name) then who_name = "[*] "..extraSpellName end @@ -4019,20 +4019,20 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _current_misc_container.need_refresh = true ------------------------------------------------------------------------------------------------ - --> get actors] + --get actors] local este_jogador, meu_dono = misc_cache [who_name] - if (not este_jogador) then --> pode ser um desconhecido ou um pet + if (not este_jogador) then --pode ser um desconhecido ou um pet este_jogador, meu_dono, who_name = _current_misc_container:PegarCombatente (who_serial, who_name, who_flags, true) - if (not meu_dono) then --> se n�o for um pet, adicionar no cache + if (not meu_dono) then --se n�o for um pet, adicionar no cache misc_cache [who_name] = este_jogador end end ------------------------------------------------------------------------------------------------ - --> build containers on the fly + --build containers on the fly if (not este_jogador.dispell) then - --> constr�i aqui a tabela dele + --constr�i aqui a tabela dele este_jogador.dispell = _detalhes:GetOrderNumber(who_name) este_jogador.dispell_targets = {} este_jogador.dispell_spells = container_habilidades:NovoContainer (container_misc) @@ -4040,10 +4040,10 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end ------------------------------------------------------------------------------------------------ - --> spell reflection + --spell reflection if (reflection_dispelid[spellid]) then - --> this aura could've been reflected to the caster after the dispel - --> save data about whom was dispelled by who and what spell it was + --this aura could've been reflected to the caster after the dispel + --save data about whom was dispelled by who and what spell it was reflection_dispels[alvo_serial] = reflection_dispels[alvo_serial] or {} reflection_dispels[alvo_serial][extraSpellID] = { who_serial = who_serial, @@ -4056,37 +4056,37 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end ------------------------------------------------------------------------------------------------ - --> add amount + --add amount - --> last event update + --last event update este_jogador.last_event = _tempo - --> total dispells in combat + --total dispells in combat _current_total [4].dispell = _current_total [4].dispell + 1 if (este_jogador.grupo) then _current_gtotal [4].dispell = _current_gtotal [4].dispell + 1 end - --> actor dispell amount + --actor dispell amount este_jogador.dispell = este_jogador.dispell + 1 - --> dispell what + --dispell what if (extraSpellID) then este_jogador.dispell_oque [extraSpellID] = (este_jogador.dispell_oque [extraSpellID] or 0) + 1 end - --> actor targets + --actor targets este_jogador.dispell_targets [alvo_name] = (este_jogador.dispell_targets [alvo_name] or 0) + 1 - --> actor spells table + --actor spells table local spell = este_jogador.dispell_spells._ActorTable [spellid] if (not spell) then spell = este_jogador.dispell_spells:PegaHabilidade (spellid, true, token) end spell_misc_func (spell, alvo_serial, alvo_name, alvo_flags, who_name, token, extraSpellID, extraSpellName) - --> verifica se tem dono e adiciona o interrupt para o dono + --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) @@ -4111,7 +4111,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 function parser:ress (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname) ------------------------------------------------------------------------------------------------ - --> early checks and fixes + --early checks and fixes if (_bit_band (who_flags, AFFILIATION_GROUP) == 0) then return @@ -4125,51 +4125,51 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _current_misc_container.need_refresh = true ------------------------------------------------------------------------------------------------ - --> get actors + --get actors - --> main actor + --main actor local este_jogador, meu_dono = misc_cache [who_name] - if (not este_jogador) then --> pode ser um desconhecido ou um pet + if (not este_jogador) then --pode ser um desconhecido ou um pet este_jogador, meu_dono, who_name = _current_misc_container:PegarCombatente (who_serial, who_name, who_flags, true) - if (not meu_dono) then --> se n�o for um pet, adicionar no cache + if (not meu_dono) then --se n�o for um pet, adicionar no cache misc_cache [who_name] = este_jogador end end ------------------------------------------------------------------------------------------------ - --> build containers on the fly + --build containers on the fly if (not este_jogador.ress) then 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 + este_jogador.ress_spells = container_habilidades:NovoContainer (container_misc) --cria o container das habilidades usadas para interromper end ------------------------------------------------------------------------------------------------ - --> add amount + --add amount - --> update last event + --update last event este_jogador.last_event = _tempo - --> combat ress total + --combat ress total _current_total [4].ress = _current_total [4].ress + 1 if (este_jogador.grupo) then _current_combat.totals_grupo[4].ress = _current_combat.totals_grupo[4].ress+1 end - --> add ress amount + --add ress amount este_jogador.ress = este_jogador.ress + 1 - --> add battle ress + --add battle ress if (_UnitAffectingCombat (who_name)) then - --> procura a �ltima morte do alvo na tabela do combate: + --procura a �ltima morte do alvo na tabela do combate: for i = 1, #_current_combat.last_events_tables do if (_current_combat.last_events_tables [i] [3] == alvo_name) then local deadLog = _current_combat.last_events_tables [i] [1] local jaTem = false - for _, evento in _ipairs (deadLog) do + for _, evento in _ipairs(deadLog) do if (evento [1] and not evento[3]) then jaTem = true end @@ -4190,17 +4190,17 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end if (_hook_battleress) then - for _, func in _ipairs (_hook_battleress_container) do + for _, func in _ipairs(_hook_battleress_container) do func (nil, token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname) end end end - --> actor targets + --actor targets este_jogador.ress_targets [alvo_name] = (este_jogador.ress_targets [alvo_name] or 0) + 1 - --> actor spells table + --actor spells table local spell = este_jogador.ress_spells._ActorTable [spellid] if (not spell) then spell = este_jogador.ress_spells:PegaHabilidade (spellid, true, token) @@ -4212,7 +4212,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 function parser:break_cc (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, extraSpellID, extraSpellName, extraSchool, auraType) ------------------------------------------------------------------------------------------------ - --> early checks and fixes + --early checks and fixes if (not cc_spell_list [spellid]) then return --print ("NO CC:", spellid, spellname, extraSpellID, extraSpellName) @@ -4227,11 +4227,11 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end if (not alvo_name) then - --> no target name, just quit + --no target name, just quit return elseif (not who_name) then - --> no actor name, use spell name instead + --no actor name, use spell name instead who_name = "[*] " .. spellname who_flags = 0xa48 who_serial = "" @@ -4240,21 +4240,21 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _current_misc_container.need_refresh = true ------------------------------------------------------------------------------------------------ - --> get actors + --get actors local este_jogador, meu_dono = misc_cache [who_name] - if (not este_jogador) then --> pode ser um desconhecido ou um pet + if (not este_jogador) then --pode ser um desconhecido ou um pet este_jogador, meu_dono, who_name = _current_misc_container:PegarCombatente (who_serial, who_name, who_flags, true) - if (not meu_dono) then --> se n�o for um pet, adicionar no cache + if (not meu_dono) then --se n�o for um pet, adicionar no cache misc_cache [who_name] = este_jogador end end ------------------------------------------------------------------------------------------------ - --> build containers on the fly + --build containers on the fly if (not este_jogador.cc_break) then - --> constr�i aqui a tabela dele + --constr�i aqui a tabela dele este_jogador.cc_break = _detalhes:GetOrderNumber(who_name) este_jogador.cc_break_targets = {} este_jogador.cc_break_spells = container_habilidades:NovoContainer (container_misc) @@ -4262,28 +4262,28 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end ------------------------------------------------------------------------------------------------ - --> add amount + --add amount - --> update last event + --update last event este_jogador.last_event = _tempo - --> combat cc break total + --combat cc break total _current_total [4].cc_break = _current_total [4].cc_break + 1 if (este_jogador.grupo) then _current_combat.totals_grupo[4].cc_break = _current_combat.totals_grupo[4].cc_break+1 end - --> add amount + --add amount este_jogador.cc_break = este_jogador.cc_break + 1 - --> broke what + --broke what este_jogador.cc_break_oque [spellid] = (este_jogador.cc_break_oque [spellid] or 0) + 1 - --> actor targets + --actor targets este_jogador.cc_break_targets [alvo_name] = (este_jogador.cc_break_targets [alvo_name] or 0) + 1 - --> actor spells table + --actor spells table local spell = este_jogador.cc_break_spells._ActorTable [extraSpellID] if (not spell) then spell = este_jogador.cc_break_spells:PegaHabilidade (extraSpellID, true, token) @@ -4295,22 +4295,22 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 function parser:dead (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags) ------------------------------------------------------------------------------------------------ - --> early checks and fixes + --early checks and fixes if (not alvo_name) then return end ------------------------------------------------------------------------------------------------ - --> build dead + --build dead local damageActor = _current_damage_container:GetActor(alvo_name) --check for outsiders if (_in_combat and alvo_flags and (not damageActor or (_bit_band (alvo_flags, 0x00000008) ~= 0 and not damageActor.grupo))) then - --> outsider death while in combat + --outsider death while in combat --rules for specific encounters - if (_current_encounter_id == 2412) then --> The Council of Blood --REMOVE ON v10.0 + if (_current_encounter_id == 2412) then --The Council of Blood --REMOVE ON v10.0 if (not Details.exp90temp.delete_damage_TCOB) then return @@ -4353,7 +4353,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end - --> frags + --frags if (_detalhes.only_pvp_frags and (_bit_band (alvo_flags, 0x00000400) == 0 or (_bit_band (alvo_flags, 0x00000040) == 0 and _bit_band (alvo_flags, 0x00000020) == 0))) then --byte 2 = 4 (HOSTILE) byte 3 = 4 (OBJECT_TYPE_PLAYER) return @@ -4367,14 +4367,14 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _current_combat.frags_need_refresh = true - --> player death + --player death elseif (not UnitIsFeignDeath (alvo_name)) then if ( - --> player in your group + --player in your group (_bit_band (alvo_flags, AFFILIATION_GROUP) ~= 0 or (damageActor and damageActor.grupo)) and - --> must be a player + --must be a player _bit_band (alvo_flags, OBJECT_TYPE_PLAYER) ~= 0 and - --> must be in combat + --must be in combat _in_combat ) then @@ -4385,23 +4385,23 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _current_misc_container.need_refresh = true - --> combat totals + --combat totals _current_total [4].dead = _current_total [4].dead + 1 _current_gtotal [4].dead = _current_gtotal [4].dead + 1 - --> main actor no container de misc que ir� armazenar a morte + --main actor no container de misc que ir� armazenar a morte local thisPlayer, meu_dono = misc_cache [alvo_name] - if (not thisPlayer) then --> pode ser um desconhecido ou um pet + if (not thisPlayer) then --pode ser um desconhecido ou um pet thisPlayer, meu_dono, who_name = _current_misc_container:PegarCombatente (alvo_serial, alvo_name, alvo_flags, true) - if (not meu_dono) then --> se n�o for um pet, adicionar no cache + if (not meu_dono) then --se n�o for um pet, adicionar no cache misc_cache [alvo_name] = thisPlayer end end - --> objeto da morte + --objeto da morte local esta_morte = {} - --> add events + --add events local t = last_events_cache [alvo_name] if (not t) then t = _current_combat:CreateLastEventsTable (alvo_name) @@ -4431,26 +4431,26 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if (thisPlayer.last_cooldown) then local t = {} - t [1] = 3 --> true if this is a damage || false for healing || 1 for cooldown usage || 2 for last cooldown - t [2] = thisPlayer.last_cooldown[2] --> spellid || false if this is a battle ress line - t [3] = 1 --> amount of damage or healing - t [4] = thisPlayer.last_cooldown[1] --> parser time - t [5] = 0 --> current unit heal - t [6] = alvo_name --> source name + t [1] = 3 --true if this is a damage || false for healing || 1 for cooldown usage || 2 for last cooldown + t [2] = thisPlayer.last_cooldown[2] --spellid || false if this is a battle ress line + t [3] = 1 --amount of damage or healing + t [4] = thisPlayer.last_cooldown[1] --parser time + t [5] = 0 --current unit heal + t [6] = alvo_name --source name esta_morte [#esta_morte+1] = t else local t = {} - t [1] = 3 --> true if this is a damage || false for healing || 1 for cooldown usage || 2 for last cooldown - t [2] = 0 --> spellid || false if this is a battle ress line - t [3] = 0 --> amount of damage or healing - t [4] = 0 --> parser time - t [5] = 0 --> current unit heal - t [6] = alvo_name --> source name + t [1] = 3 --true if this is a damage || false for healing || 1 for cooldown usage || 2 for last cooldown + t [2] = 0 --spellid || false if this is a battle ress line + t [3] = 0 --amount of damage or healing + t [4] = 0 --parser time + t [5] = 0 --current unit heal + t [6] = alvo_name --source name esta_morte [#esta_morte+1] = t end local decorrido = _GetTime() - _current_combat:GetStartTime() - local minutos, segundos = _math_floor (decorrido/60), _math_floor (decorrido%60) + local minutos, segundos = _math_floor(decorrido/60), _math_floor(decorrido%60) local maxHealth if (thisPlayer.arena_enemy) then @@ -4474,10 +4474,10 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _table_insert (_current_combat.last_events_tables, #_current_combat.last_events_tables+1, t) if (_hook_deaths) then - --> send event to registred functions + --send event to registred functions local deathTime = _GetTime() - _current_combat:GetStartTime() - for _, func in _ipairs (_hook_deaths_container) do + for _, func in _ipairs(_hook_deaths_container) do local copiedDeathTable = Details.CopyTable(t) local successful, errortext = pcall(func, nil, token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, copiedDeathTable, thisPlayer.last_cooldown, deathTime, maxHealth) if (not successful) then @@ -4489,7 +4489,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --check if this is a mythic+ run for overall deaths local mythicLevel = C_ChallengeMode and C_ChallengeMode.GetActiveKeystoneInfo() --classic wow doesn't not have C_ChallengeMode API if (mythicLevel and type (mythicLevel) == "number" and mythicLevel >= 2) then --several checks to be future proof - --> more checks for integrity + --more checks for integrity if (_detalhes.tabela_overall and _detalhes.tabela_overall.last_events_tables) then --this is a mythic dungeon run, add the death to overall data --need to adjust the time of death, since this will show all deaths in the mythic run @@ -4537,11 +4537,11 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 spelid = 8 end - return parser:spell_dmg (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spelid or 1, env_type, 00000003, amount, -1, 1) --> localize-me + return parser:spell_dmg (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spelid or 1, env_type, 00000003, amount, -1, 1) --localize-me end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> core +--core function parser:WipeSourceCache() wipe (monk_guard_talent) @@ -4559,7 +4559,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _detalhes.capture_schedules = {} function _detalhes:CaptureIsAllEnabled() - for _, _thisType in _ipairs (_detalhes.capture_types) do + for _, _thisType in _ipairs(_detalhes.capture_types) do if (not _detalhes.capture_real [_thisType]) then return false end @@ -4575,7 +4575,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end function _detalhes:CaptureRefresh() - for _, _thisType in _ipairs (_detalhes.capture_types) do + for _, _thisType in _ipairs(_detalhes.capture_types) do if (_detalhes.capture_current [_thisType]) then _detalhes:CaptureEnable (_thisType) else @@ -4595,11 +4595,11 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end if (real) then - --> hard switch + --hard switch _detalhes.capture_real [capture_type] = on_off _detalhes.capture_current [capture_type] = on_off else - --> soft switch + --soft switch _detalhes.capture_current [capture_type] = on_off if (time) then local schedule_id = math.random (1, 10000000) @@ -4624,7 +4624,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _detalhes.capture_current [capture_type] = _detalhes.capture_real [capture_type] _detalhes:CaptureRefresh() - for index, table in ipairs (_detalhes.capture_schedules) do + for index, table in ipairs(_detalhes.capture_schedules) do local id = table [2] if (schedule_id == id) then tremove (_detalhes.capture_schedules, index) @@ -4693,12 +4693,12 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end - --SPELL_DRAIN --> need research - --SPELL_LEECH --> need research - --SPELL_PERIODIC_DRAIN --> need research - --SPELL_PERIODIC_LEECH --> need research - --SPELL_DISPEL_FAILED --> need research - --SPELL_BUILDING_HEAL --> need research + --SPELL_DRAIN --need research + --SPELL_LEECH --need research + --SPELL_PERIODIC_DRAIN --need research + --SPELL_PERIODIC_LEECH --need research + --SPELL_DISPEL_FAILED --need research + --SPELL_BUILDING_HEAL --need research function _detalhes:CaptureEnable (capture_type) @@ -4786,7 +4786,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 function parser:SetParserFunction (token, func) if (parser.original_functions [token]) then - if (type (func) == "function") then + if (type(func) == "function") then parser [token] = func else parser [token] = parser.original_functions [token] @@ -4839,7 +4839,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 function parser:RefreshFunctions() for CLUE_ID, token in pairs (all_parser_tokens) do - if (token_list [CLUE_ID]) then --> not disabled + if (token_list [CLUE_ID]) then --not disabled token_list [CLUE_ID] = parser [token] end end @@ -4862,17 +4862,17 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 local eTable = _detalhes.encounter_table - --> finish the encounter + --finish the encounter local successful_ended = _detalhes.parser_functions:ENCOUNTER_END (eTable.id, eTable.name, eTable.diff, eTable.size, 0) if (successful_ended) then - --> we wiped + --we wiped _detalhes.wipe_called = true - --> cancel the on going captures schedules + --cancel the on going captures schedules _detalhes:CancelAllCaptureSchedules() - --> disable it + --disable it _detalhes:CaptureSet (false, "damage", false) _detalhes:CaptureSet (false, "energy", false) _detalhes:CaptureSet (false, "aura", false) @@ -4946,10 +4946,10 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end if (_detalhes.last_zone_type ~= zoneType) then - _detalhes:SendEvent ("ZONE_TYPE_CHANGED", nil, zoneType) + _detalhes:SendEvent("ZONE_TYPE_CHANGED", nil, zoneType) _detalhes.last_zone_type = zoneType - for index, instancia in ipairs (_detalhes.tabela_instancias) do + for index, instancia in ipairs(_detalhes.tabela_instancias) do if (instancia.ativa) then instancia:AdjustAlphaByContext(true) end @@ -4973,7 +4973,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _detalhes.time_type = _detalhes.time_type_original end - if (zoneType == "pvp") then --> battlegrounds + if (zoneType == "pvp") then --battlegrounds if (_detalhes.debug) then _detalhes:Msg ("(debug) zone type is now 'pvp'.") @@ -5025,7 +5025,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if (_detalhes.overall_clear_pvp) then _detalhes.tabela_historico:resetar_overall() end - --> reset spec cache if broadcaster requested + --reset spec cache if broadcaster requested if (_detalhes.streamer_config.reset_spec_cache) then wipe (_detalhes.cached_specs) end @@ -5039,7 +5039,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if ((zoneType == "raid" or zoneType == "party") and inInstance) then _detalhes:CheckForAutoErase (zoneMapID) - --> if the current raid is current tier raid, pre-load the storage database + --if the current raid is current tier raid, pre-load the storage database if (zoneType == "raid") then if (_detalhes.InstancesToStoreData [zoneMapID]) then _detalhes.ScheduleLoadStorage() @@ -5080,7 +5080,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 return end - --> leave the current combat when the encounter start, if is doing a mythic plus dungeons, check if the options allows to create a dedicated segment for the boss fight + --leave the current combat when the encounter start, if is doing a mythic plus dungeons, check if the options allows to create a dedicated segment for the boss fight if ((_in_combat and not _detalhes.tabela_vigente.is_boss) and (not _detalhes.MythicPlus.Started or _detalhes.mythic_plus.boss_dedicated_segment)) then _detalhes:SairDoCombate() end @@ -5137,7 +5137,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 local encounter_start_table = _detalhes:GetEncounterStartInfo (zoneMapID, encounterID) if (encounter_start_table) then if (encounter_start_table.delay) then - if (type (encounter_start_table.delay) == "function") then + if (type(encounter_start_table.delay) == "function") then local delay = encounter_start_table.delay() if (delay) then --_detalhes.encounter_table ["start"] = time() + delay @@ -5158,7 +5158,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _detalhes.encounter_table.index = boss_index end - _detalhes:SendEvent ("COMBAT_ENCOUNTER_START", nil, ...) + _detalhes:SendEvent("COMBAT_ENCOUNTER_START", nil, ...) end @@ -5172,7 +5172,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _current_encounter_id = nil - local _, instanceType = GetInstanceInfo() --> let's make sure it isn't a dungeon + local _, instanceType = GetInstanceInfo() --let's make sure it isn't a dungeon if (_detalhes.zone_type == "party" or instanceType == "party") then if (_detalhes.debug) then _detalhes:Msg ("(debug) the zone type is 'party', ignoring ENCOUNTER_END.") @@ -5208,11 +5208,11 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if ((_detalhes.tabela_vigente:GetEndTime() or 0) + 2 >= _detalhes.encounter_table ["end"]) then _detalhes.tabela_vigente:SetStartTime (_detalhes.encounter_table ["start"]) _detalhes.tabela_vigente:SetEndTime (_detalhes.encounter_table ["end"]) - _detalhes:RefreshMainWindow (-1, true) + _detalhes:RefreshMainWindow(-1, true) end end - _detalhes:SendEvent ("COMBAT_ENCOUNTER_END", nil, ...) + _detalhes:SendEvent("COMBAT_ENCOUNTER_END", nil, ...) _table_wipe (_detalhes.encounter_table) _table_wipe (bargastBuffs) --remove on 10.0 @@ -5246,14 +5246,14 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _detalhes:EntrarEmCombate() end - --> essa parte do solo mode ainda sera usada? - if (_detalhes.solo and _detalhes.PluginCount.SOLO > 0) then --> solo mode + --essa parte do solo mode ainda sera usada? + if (_detalhes.solo and _detalhes.PluginCount.SOLO > 0) then --solo mode local esta_instancia = _detalhes.tabela_instancias[_detalhes.solo] esta_instancia.atualizando = true end - for index, instancia in ipairs (_detalhes.tabela_instancias) do - if (instancia.ativa) then --> 1 = none, we doesn't need to call + for index, instancia in ipairs(_detalhes.tabela_instancias) do + if (instancia.ativa) then --1 = none, we doesn't need to call instancia:AdjustAlphaByContext(true) end end @@ -5302,8 +5302,8 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end - --> this function is guaranteed to run after a combat is done - --> can also run when the player leaves combat state (regen enabled) + --this function is guaranteed to run after a combat is done + --can also run when the player leaves combat state (regen enabled) function _detalhes:RunScheduledEventsAfterCombat (OnRegenEnabled) if (_detalhes.debug) then @@ -5350,8 +5350,8 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 collectgarbage() end - for index, instancia in ipairs (_detalhes.tabela_instancias) do - if (instancia.ativa) then --> 1 = none, we doesn't need to call + for index, instancia in ipairs(_detalhes.tabela_instancias) do + if (instancia.ativa) then --1 = none, we doesn't need to call instancia:AdjustAlphaByContext(true) end end @@ -5434,19 +5434,19 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end function _detalhes.parser_functions:CHALLENGE_MODE_START (...) - --> send mythic dungeon start event + --send mythic dungeon start event local zoneName, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceMapID, instanceGroupSize = GetInstanceInfo() if (difficultyID == 8) then - _detalhes:SendEvent ("COMBAT_MYTHICDUNGEON_START") + _detalhes:SendEvent("COMBAT_MYTHICDUNGEON_START") end end function _detalhes.parser_functions:CHALLENGE_MODE_COMPLETED (...) - --> send mythic dungeon end event + --send mythic dungeon end event local zoneName, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceMapID, instanceGroupSize = GetInstanceInfo() if (difficultyID == 8) then - _detalhes:SendEvent ("COMBAT_MYTHICDUNGEON_END") + _detalhes:SendEvent("COMBAT_MYTHICDUNGEON_END") end end @@ -5473,7 +5473,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 -- C_Timer.After (10, check_for_encounter_end) - --> playing alone, just finish the combat right now + --playing alone, just finish the combat right now if (not _IsInGroup() and not IsInRaid()) then _detalhes.tabela_vigente.playing_solo = true _detalhes:SairDoCombate() @@ -5554,37 +5554,37 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end - --> this is mostly triggered when the player enters in a dual against another player + --this is mostly triggered when the player enters in a dual against another player function _detalhes.parser_functions:UNIT_FACTION (unit) if (true) then - --> disable until figure out how to make this work properlly - --> at the moment this event is firing at bgs, arenas, etc making horde icons to show at random + --disable until figure out how to make this work properlly + --at the moment this event is firing at bgs, arenas, etc making horde icons to show at random return end - --> check if outdoors + --check if outdoors --unit was nil, nameplate might bug here, it should track after the event if (_detalhes.zone_type == "none" and unit) then local serial = UnitGUID (unit) - --> the serial is valid and isn't THE player and the serial is from a player? + --the serial is valid and isn't THE player and the serial is from a player? if (serial and serial ~= UnitGUID ("player") and serial:find ("Player")) then _detalhes.duel_candidates [serial] = GetTime() local playerName = _detalhes:GetCLName (unit) - --> check if the player is inside the current combat and flag the objects + --check if the player is inside the current combat and flag the objects if (playerName and _current_combat) then local enemyPlayer1 = _current_combat:GetActor (1, playerName) local enemyPlayer2 = _current_combat:GetActor (2, playerName) local enemyPlayer3 = _current_combat:GetActor (3, playerName) local enemyPlayer4 = _current_combat:GetActor (4, playerName) if (enemyPlayer1) then - --> set to show when the player is solo play + --set to show when the player is solo play enemyPlayer1.grupo = true enemyPlayer1.enemy = true if (IsInGroup()) then - --> broadcast the enemy to group members so they can "watch" the damage + --broadcast the enemy to group members so they can "watch" the damage end end @@ -5626,7 +5626,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if (not _detalhes.in_group) then _detalhes.in_group = IsInGroup() or IsInRaid() if (_detalhes.in_group) then - --> entrou num grupo + --entrou num grupo _detalhes:IniciarColetaDeLixo (true) _detalhes:WipePets() _detalhes:SchedulePetUpdate (1) @@ -5634,7 +5634,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _detalhes:CheckSwitchOnLogon() _detalhes:CheckVersion() - _detalhes:SendEvent ("GROUP_ONENTER") + _detalhes:SendEvent("GROUP_ONENTER") _detalhes:DispatchAutoRunCode ("on_groupchange") @@ -5646,23 +5646,23 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _detalhes.in_group = IsInGroup() or IsInRaid() if (not _detalhes.in_group) then - --> saiu do grupo + --saiu do grupo _detalhes:IniciarColetaDeLixo (true) _detalhes:WipePets() _detalhes:SchedulePetUpdate (1) _table_wipe (_detalhes.details_users) _detalhes:InstanceCall (_detalhes.AdjustAlphaByContext) _detalhes:CheckSwitchOnLogon() - _detalhes:SendEvent ("GROUP_ONLEAVE") + _detalhes:SendEvent("GROUP_ONLEAVE") _detalhes:DispatchAutoRunCode ("on_groupchange") wipe (_detalhes.trusted_characters) else - --> ainda esta no grupo + --ainda esta no grupo _detalhes:SchedulePetUpdate (2) - --> send char data + --send char data if (_detalhes.SendCharDataOnGroupChange and not _detalhes.SendCharDataOnGroupChange:IsCancelled()) then return end @@ -5696,7 +5696,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --check if the player is inside a battleground elseif (zoneType == "battleground") then if (Details.debug) then - Details:Msg ("(debug) timer is a battleground countdown.") + Details:Msg("(debug) timer is a battleground countdown.") end local _, timeSeconds = select (1, ...) @@ -5728,39 +5728,39 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 -- ~load local start_details = function() if (not _detalhes.gump) then - --> failed to load the framework + --failed to load the framework if (not _detalhes.instance_load_failed) then _detalhes:CreatePanicWarning() end - _detalhes.instance_load_failed.text:SetText ("Framework for Details! isn't loaded.\nIf you just updated the addon, please reboot the game client.\nWe apologize for the inconvenience and thank you for your comprehension.") + _detalhes.instance_load_failed.text:SetText("Framework for Details! isn't loaded.\nIf you just updated the addon, please reboot the game client.\nWe apologize for the inconvenience and thank you for your comprehension.") return end - --> cooltip + --cooltip if (not _G.GameCooltip) then _detalhes.popup = _G.GameCooltip else _detalhes.popup = _G.GameCooltip end - --> check group + --check group _detalhes.in_group = IsInGroup() or IsInRaid() - --> write into details object all basic keys and default profile + --write into details object all basic keys and default profile _detalhes:ApplyBasicKeys() - --> check if is first run, update keys for character and global data + --check if is first run, update keys for character and global data _detalhes:LoadGlobalAndCharacterData() - --> details updated and not reopened the game client + --details updated and not reopened the game client if (_detalhes.FILEBROKEN) then return end - --> load all the saved combats + --load all the saved combats _detalhes:LoadCombatTables() - --> load the profiles + --load the profiles _detalhes:LoadConfig() _detalhes:UpdateParserGears() @@ -5782,7 +5782,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end - local playerLogin = CreateFrame ("frame") + local playerLogin = CreateFrame("frame") playerLogin:RegisterEvent("PLAYER_LOGIN") playerLogin:SetScript("OnEvent", function() Details:StartMeUp() @@ -5790,7 +5790,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 function _detalhes.parser_functions:PET_BATTLE_OPENING_START (...) _detalhes.pet_battle = true - for index, instance in _ipairs (_detalhes.tabela_instancias) do + for index, instance in _ipairs(_detalhes.tabela_instancias) do if (instance.ativa) then if (_detalhes.debug) then _detalhes:Msg ("(debug) hidding windows for Pet Battle.") @@ -5802,7 +5802,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 function _detalhes.parser_functions:PET_BATTLE_CLOSE (...) _detalhes.pet_battle = false - for index, instance in _ipairs (_detalhes.tabela_instancias) do + for index, instance in _ipairs(_detalhes.tabela_instancias) do if (instance.ativa) then if (_detalhes.debug) then _detalhes:Msg ("(debug) Pet Battle finished, calling AdjustAlphaByContext().") @@ -5825,13 +5825,13 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end - _detalhes.listener:SetScript ("OnEvent", _detalhes.OnEvent) + _detalhes.listener:SetScript("OnEvent", _detalhes.OnEvent) - --> logout function ~save ~logout + --logout function ~save ~logout - local saver = CreateFrame ("frame", nil, UIParent) + 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")) @@ -5885,7 +5885,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end - --> leave combat start save tables + --leave combat start save tables if (_detalhes.in_combat and _detalhes.tabela_vigente) then tinsert (_detalhes_global.exit_log, "3 - Leaving current combat.") currentStep = "Leaving Current Combat" @@ -5906,7 +5906,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 return end - --> save the config + --save the config tinsert (_detalhes_global.exit_log, "6 - Saving Config.") currentStep = "Saving Config" xpcall (_detalhes.SaveConfig, saver_error) @@ -5915,7 +5915,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 currentStep = "Saving Profile" xpcall (_detalhes.SaveProfile, saver_error) - --> save the nicktag cache + --save the nicktag cache tinsert (_detalhes_global.exit_log, "8 - Saving nicktag cache.") local saveNicktabCache = function() @@ -5924,7 +5924,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 xpcall (saveNicktabCache, saver_error) end) - --> end + --end -- ~parserstart ~startparser ~cleu @@ -5939,7 +5939,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end - _detalhes.parser_frame:SetScript ("OnEvent", _detalhes.OnParserEvent) + _detalhes.parser_frame:SetScript("OnEvent", _detalhes.OnParserEvent) function _detalhes:UpdateParser() _tempo = _detalhes._tempo @@ -6165,26 +6165,26 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --serach key: ~cache function _detalhes:UpdateParserGears() - --> refresh combat tables + --refresh combat tables _current_combat = _detalhes.tabela_vigente _current_combat_cleu_events = _current_combat and _current_combat.cleu_events - --> last events pointer + --last events pointer last_events_cache = _current_combat.player_last_events _death_event_amt = _detalhes.deadlog_events - --> refresh total containers + --refresh total containers _current_total = _current_combat.totals _current_gtotal = _current_combat.totals_grupo - --> refresh actors containers + --refresh actors containers _current_damage_container = _current_combat [1] _current_heal_container = _current_combat [2] _current_energy_container = _current_combat [3] _current_misc_container = _current_combat [4] - --> refresh data capture options + --refresh data capture options _recording_self_buffs = _detalhes.RecordPlayerSelfBuffs --_recording_healing = _detalhes.RecordHealingDone --_recording_took_damage = _detalhes.RecordRealTimeTookDamage @@ -6249,14 +6249,14 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --serach key: ~api ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> details api functions +--details api functions - --> number of combat + --number of combat function _detalhes:GetCombatId() return _detalhes.combat_id end - --> if in combat + --if in combat function _detalhes:IsInCombat() return _in_combat end @@ -6265,19 +6265,19 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 return _detalhes.encounter_table.id and true or false end - --> get combat + --get combat function _detalhes:GetCombat (_combat) if (not _combat) then return _current_combat - elseif (_type (_combat) == "number") then - if (_combat == -1) then --> overall + elseif (_type(_combat) == "number") then + if (_combat == -1) then --overall return _detalhes.tabela_overall - elseif (_combat == 0) then --> current + elseif (_combat == 0) then --current return _current_combat else return _detalhes.tabela_historico.tabelas [_combat] end - elseif (_type (_combat) == "string") then + elseif (_type(_combat) == "string") then if (_combat == "overall") then return _detalhes.tabela_overall elseif (_combat == "current") then @@ -6292,20 +6292,20 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 return _detalhes:GetActor (_combat, 1, _actorname), _detalhes:GetActor (_combat, 2, _actorname), _detalhes:GetActor (_combat, 3, _actorname), _detalhes:GetActor (_combat, 4, _actorname) end - --> get player + --get player function _detalhes:GetPlayer (_actorname, _combat, _attribute) return _detalhes:GetActor (_combat, _attribute, _actorname) end - --> get an actor + --get an actor function _detalhes:GetActor (_combat, _attribute, _actorname) if (not _combat) then - _combat = "current" --> current combat + _combat = "current" --current combat end if (not _attribute) then - _attribute = 1 --> damage + _attribute = 1 --damage end if (not _actorname) then @@ -6328,7 +6328,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 return nil --_detalhes:NewError ("Combat overall doesn't have an actor called ".. _actorname) end - elseif (type (_combat) == "number") then + elseif (type(_combat) == "number") then local _combatOnHistoryTables = _detalhes.tabela_historico.tabelas [_combat] if (_combatOnHistoryTables) then local actor = _combatOnHistoryTables (_attribute, _actorname) @@ -6346,9 +6346,9 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> battleground parser +--battleground parser - _detalhes.pvp_parser_frame:SetScript ("OnEvent", function(self, event) + _detalhes.pvp_parser_frame:SetScript("OnEvent", function(self, event) self:ReadPvPData() end) @@ -6398,7 +6398,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 local guid = _UnitGUID (name) if (guid) then local flag - if (_detalhes.faction_id == faction) then --> is from the same faction + if (_detalhes.faction_id == faction) then --is from the same faction flag = 0x514 else flag = 0x548 @@ -6428,7 +6428,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 local guid = _UnitGUID (name) if (guid) then local flag - if (_detalhes.faction_id == faction) then --> is from the same faction + if (_detalhes.faction_id == faction) then --is from the same faction flag = 0x514 else flag = 0x548 diff --git a/core/plugins.lua b/core/plugins.lua index ba36b273..fb86d9b2 100644 --- a/core/plugins.lua +++ b/core/plugins.lua @@ -7,7 +7,7 @@ DETAILSPLUGIN_ALWAYSENABLED = 0x1 - --> consts + --consts local CONST_PLUGINWINDOW_MENU_WIDTH = 150 local CONST_PLUGINWINDOW_MENU_HEIGHT = 22 local CONST_PLUGINWINDOW_MENU_X = -5 @@ -16,7 +16,7 @@ local CONST_PLUGINWINDOW_HEIGHT = 600 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> details api functions +--details api functions function _detalhes:GetPlugin (PAN) --plugin absolute name return _detalhes.SoloTables.NameTable [PAN] or _detalhes.RaidTables.NameTable [PAN] or _detalhes.ToolBar.NameTable [PAN] or _detalhes.StatusBar.NameTable [PAN] or _detalhes.PluginsLocalizedNames [PAN] or _detalhes.PluginsGlobalNames [PAN] end @@ -40,7 +40,7 @@ local instance = self:GetPluginInstance() if (instance) then local w, h = instance:GetSize() - self.Frame:SetSize (w, h) + self.Frame:SetSize(w, h) end end @@ -83,7 +83,7 @@ saved_table.enabled = false plugin.__enabled = false - _detalhes:SendEvent ("PLUGIN_DISABLED", plugin) + _detalhes:SendEvent("PLUGIN_DISABLED", plugin) _detalhes:DelayOptionsRefresh() return true @@ -92,8 +92,8 @@ function _detalhes:CheckDefaultTable (current, default) for key, value in pairs (default) do - if (type (value) == "table") then - if (type (current [key]) ~= "table") then + if (type(value) == "table") then + if (type(current [key]) ~= "table") then current [key] = Details.CopyTable (value) else _detalhes:CheckDefaultTable (current [key], value) @@ -101,7 +101,7 @@ else if (current [key] == nil) then current [key] = value - --elseif (type (current [key]) ~= type (value)) then + --elseif (type(current [key]) ~= type (value)) then -- current [key] = value end end @@ -174,21 +174,21 @@ return _detalhes:NewError ("plugin doesn't have a Frame, please check case-sensitive member name: Frame") end - --> Install Plugin + --Install Plugin _detalhes.SoloTables.Plugins [#_detalhes.SoloTables.Plugins+1] = PluginObject _detalhes.SoloTables.Menu [#_detalhes.SoloTables.Menu+1] = {PluginName, PluginIcon, PluginObject, PluginAbsoluteName} _detalhes.SoloTables.NameTable [PluginAbsoluteName] = PluginObject - _detalhes:SendEvent ("INSTALL_OKEY", PluginObject) + _detalhes:SendEvent("INSTALL_OKEY", PluginObject) _detalhes.PluginCount.SOLO = _detalhes.PluginCount.SOLO + 1 elseif (PluginType == "RAID") then - --> Install Plugin + --Install Plugin _detalhes.RaidTables.Plugins [#_detalhes.RaidTables.Plugins+1] = PluginObject _detalhes.RaidTables.Menu [#_detalhes.RaidTables.Menu+1] = {PluginName, PluginIcon, PluginObject, PluginAbsoluteName} _detalhes.RaidTables.NameTable [PluginAbsoluteName] = PluginObject - _detalhes:SendEvent ("INSTALL_OKEY", PluginObject) + _detalhes:SendEvent("INSTALL_OKEY", PluginObject) _detalhes.PluginCount.RAID = _detalhes.PluginCount.RAID + 1 @@ -196,21 +196,21 @@ elseif (PluginType == "TOOLBAR") then - --> Install Plugin + --Install Plugin _detalhes.ToolBar.Plugins [#_detalhes.ToolBar.Plugins+1] = PluginObject _detalhes.ToolBar.Menu [#_detalhes.ToolBar.Menu+1] = {PluginName, PluginIcon, PluginObject, PluginAbsoluteName} _detalhes.ToolBar.NameTable [PluginAbsoluteName] = PluginObject - _detalhes:SendEvent ("INSTALL_OKEY", PluginObject) + _detalhes:SendEvent("INSTALL_OKEY", PluginObject) _detalhes.PluginCount.TOOLBAR = _detalhes.PluginCount.TOOLBAR + 1 elseif (PluginType == "STATUSBAR") then - --> Install Plugin + --Install Plugin _detalhes.StatusBar.Plugins [#_detalhes.StatusBar.Plugins+1] = PluginObject _detalhes.StatusBar.Menu [#_detalhes.StatusBar.Menu+1] = {PluginName, PluginIcon} _detalhes.StatusBar.NameTable [PluginAbsoluteName] = PluginObject - _detalhes:SendEvent ("INSTALL_OKEY", PluginObject) + _detalhes:SendEvent("INSTALL_OKEY", PluginObject) _detalhes.PluginCount.STATUSBAR = _detalhes.PluginCount.STATUSBAR + 1 end @@ -228,7 +228,7 @@ end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> internal functions +--internal functions _detalhes.PluginCount = { ["SOLO"] = 0, @@ -242,13 +242,13 @@ --self = frame __parent = plugin object local instance = _detalhes:GetInstance (self.__parent.instance_id) if (instance) then - self:SetParent (instance.baseframe) + self:SetParent(instance.baseframe) end - _detalhes:SendEvent ("SHOW", self.__parent) + _detalhes:SendEvent("SHOW", self.__parent) end local OnDisableFunction = function(self) - _detalhes:SendEvent ("HIDE", self.__parent) + _detalhes:SendEvent("HIDE", self.__parent) if (bit.band (self.__parent.__options, DETAILSPLUGIN_ALWAYSENABLED) == 0) then self.__parent.Enabled = false end @@ -284,11 +284,11 @@ PluginOptions = PluginOptions or 0x0 local NewPlugin = {__options = PluginOptions, __enabled = true, RegisterEvent = register_event_func, UnregisterEvent = unregister_event_func} - local Frame = CreateFrame ("Frame", FrameName, UIParent,"BackdropTemplate") + local Frame = CreateFrame("Frame", FrameName, UIParent,"BackdropTemplate") Frame:RegisterEvent ("PLAYER_LOGIN") Frame:RegisterEvent ("PLAYER_LOGOUT") - Frame:SetScript ("OnEvent", function(self, event, ...) + Frame:SetScript("OnEvent", function(self, event, ...) if (NewPlugin.OnEvent) then if (event == "PLAYER_LOGIN") then NewPlugin:OnEvent (self, "ADDON_LOADED", NewPlugin.Frame:GetName()) @@ -311,17 +311,17 @@ NewPlugin.Enabled = false end - --> default members + --default members if (PluginType == "STATUSBAR") then BuildDefaultStatusBarMembers (NewPlugin) end NewPlugin.Frame = Frame - Frame:SetScript ("OnShow", OnEnableFunction) - Frame:SetScript ("OnHide", OnDisableFunction) + Frame:SetScript("OnShow", OnEnableFunction) + Frame:SetScript("OnHide", OnDisableFunction) - --> temporary details event function + --temporary details event function NewPlugin.OnDetailsEvent = temp_event_function setmetatable (NewPlugin, _detalhes) @@ -334,11 +334,11 @@ template = template or 1 if (template == 2) then - local options_frame = CreateFrame ("frame", name, UIParent, "ButtonFrameTemplate,BackdropTemplate") + local options_frame = CreateFrame("frame", name, UIParent, "ButtonFrameTemplate,BackdropTemplate") tinsert (UISpecialFrames, name) - options_frame:SetSize (500, 200) + options_frame:SetSize(500, 200) - options_frame:SetScript ("OnMouseDown", function(self, button) + options_frame:SetScript("OnMouseDown", function(self, button) if (button == "RightButton") then if (self.moving) then self.moving = false @@ -350,7 +350,7 @@ self:StartMoving() end end) - options_frame:SetScript ("OnMouseUp", function(self) + options_frame:SetScript("OnMouseUp", function(self) if (self.moving) then self.moving = false self:StopMovingOrSizing() @@ -364,19 +364,19 @@ options_frame:Hide() - options_frame:SetPoint ("center", UIParent, "center") - --options_frame.TitleText:SetText (title) --10.0 fuck - --options_frame.portrait:SetTexture ([[Interface\CHARACTERFRAME\TEMPORARYPORTRAIT-FEMALE-BLOODELF]]) + options_frame:SetPoint("center", UIParent, "center") + --options_frame.TitleText:SetText(title) --10.0 fuck + --options_frame.portrait:SetTexture([[Interface\CHARACTERFRAME\TEMPORARYPORTRAIT-FEMALE-BLOODELF]]) return options_frame elseif (template == 1) then - local options_frame = CreateFrame ("frame", name, UIParent,"BackdropTemplate") + local options_frame = CreateFrame("frame", name, UIParent,"BackdropTemplate") tinsert (UISpecialFrames, name) - options_frame:SetSize (500, 200) + options_frame:SetSize(500, 200) - options_frame:SetScript ("OnMouseDown", function(self, button) + options_frame:SetScript("OnMouseDown", function(self, button) if (button == "RightButton") then if (self.moving) then self.moving = false @@ -388,7 +388,7 @@ self:StartMoving() end end) - options_frame:SetScript ("OnMouseUp", function(self) + options_frame:SetScript("OnMouseUp", function(self) if (self.moving) then self.moving = false self:StopMovingOrSizing() @@ -402,18 +402,18 @@ options_frame:Hide() - options_frame:SetPoint ("center", UIParent, "center") + options_frame:SetPoint("center", UIParent, "center") - options_frame:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, + options_frame:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, edgeFile = [[Interface\AddOns\Details\images\border_2]], edgeSize = 32, insets = {left = 1, right = 1, top = 1, bottom = 1}}) - options_frame:SetBackdropColor (0, 0, 0, .7) + options_frame:SetBackdropColor(0, 0, 0, .7) Details.gump:ApplyStandardBackdrop (options_frame) Details.gump:CreateTitleBar (options_frame, title) local bigdog = _detalhes.gump:NewImage (options_frame, [[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]], 110, 120, nil, {1, 0, 0, 1}, "backgroundBigDog", "$parentBackgroundBigDog") - bigdog:SetPoint ("bottomright", options_frame, "bottomright", -3, 0) + bigdog:SetPoint("bottomright", options_frame, "bottomright", -3, 0) bigdog:SetAlpha (.25) return options_frame @@ -422,12 +422,12 @@ function _detalhes:CreatePluginWindowContainer() - local f = CreateFrame ("frame", "DetailsPluginContainerWindow", UIParent,"BackdropTemplate") + local f = CreateFrame("frame", "DetailsPluginContainerWindow", UIParent,"BackdropTemplate") f:EnableMouse (true) f:SetMovable (true) - f:SetPoint ("center", UIParent, "center") - f:SetBackdrop (_detalhes.PluginDefaults and _detalhes.PluginDefaults.Backdrop or {bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1}) - f:SetBackdropColor (0, 0, 0, 0.3) + f:SetPoint("center", UIParent, "center") + f:SetBackdrop(_detalhes.PluginDefaults and _detalhes.PluginDefaults.Backdrop or {bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1}) + f:SetBackdropColor(0, 0, 0, 0.3) f:SetBackdropBorderColor(0, 0, 0, 1) local scaleBar = DetailsFramework:CreateScaleBar(f, Details.options_window) @@ -436,7 +436,7 @@ f:Hide() - --> members + --members f.MenuX = CONST_PLUGINWINDOW_MENU_X f.MenuY = CONST_PLUGINWINDOW_MENU_Y f.MenuButtonWidth = CONST_PLUGINWINDOW_MENU_WIDTH @@ -445,31 +445,31 @@ f.FrameHeight = CONST_PLUGINWINDOW_HEIGHT f.TitleHeight = 20 - --> store button references for the left menu + --store button references for the left menu f.MenuButtons = {} - --> store all plugins embed + --store all plugins embed f.EmbedPlugins = {} - --> lib window - f:SetSize (f.FrameWidth, f.FrameHeight) + --lib window + f:SetSize(f.FrameWidth, f.FrameHeight) local LibWindow = LibStub ("LibWindow-1.1") LibWindow.RegisterConfig (f, _detalhes.plugin_window_pos) LibWindow.RestorePosition (f) LibWindow.MakeDraggable (f) LibWindow.SavePosition (f) - --> menu background - local menuBackground = CreateFrame ("frame", "$parentMenuFrame", f,"BackdropTemplate") + --menu background + local menuBackground = CreateFrame("frame", "$parentMenuFrame", f,"BackdropTemplate") _detalhes:FormatBackground (menuBackground) local menuBackgroundTexture = menuBackground:CreateTexture("$parentBackgroundTexture", "background", nil, -2) menuBackgroundTexture:SetAllPoints() menuBackgroundTexture:SetColorTexture(0.2, 0.2, 0.2, .5) - --> statusbar - local statusBar = CreateFrame ("frame", nil, menuBackground,"BackdropTemplate") - statusBar:SetPoint ("topleft", menuBackground, "bottomleft", 0, 1) - statusBar:SetPoint ("topright", f, "bottomright", 0, 1) - statusBar:SetHeight (20) + --statusbar + local statusBar = CreateFrame("frame", nil, menuBackground,"BackdropTemplate") + statusBar:SetPoint("topleft", menuBackground, "bottomleft", 0, 1) + statusBar:SetPoint("topright", f, "bottomright", 0, 1) + statusBar:SetHeight(20) statusBar:SetAlpha (1) DetailsFramework:BuildStatusbarAuthorInfo (statusBar) DetailsFramework:ApplyStandardBackdrop (statusBar) @@ -478,73 +478,73 @@ extraDarkTexture:SetColorTexture(.2, .2, .2, .8) -- - local right_click_to_back = _detalhes.gump:CreateLabel (statusBar, "right click to close", 10, "gray") - right_click_to_back:SetPoint ("bottomright", statusBar, "bottomright", -1, 5) + local right_click_to_back = _detalhes.gump:CreateLabel(statusBar, "right click to close", 10, "gray") + right_click_to_back:SetPoint("bottomright", statusBar, "bottomright", -1, 5) right_click_to_back:SetAlpha (.4) - --> point - menuBackground:SetPoint ("topright", f, "topleft", -2, 0) - menuBackground:SetPoint ("bottomright", f, "bottomleft", -2, 0) - menuBackground:SetWidth (f.MenuButtonWidth + 6) + --point + menuBackground:SetPoint("topright", f, "topleft", -2, 0) + menuBackground:SetPoint("bottomright", f, "bottomleft", -2, 0) + menuBackground:SetWidth(f.MenuButtonWidth + 6) local bigdog = _detalhes.gump:NewImage (menuBackground, [[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]], 180*0.7, 200*0.7, "overlay", {0, 1, 0, 1}, "backgroundBigDog", "$parentBackgroundBigDog") - bigdog:SetPoint ("bottomleft", custom_window, "bottomleft", 0, 1) + bigdog:SetPoint("bottomleft", custom_window, "bottomleft", 0, 1) bigdog:SetAlpha (0.3) local gradientBelowTheLine = DetailsFramework:CreateTexture(menuBackground, {gradient = "vertical", fromColor = {0, 0, 0, 0.45}, toColor = "transparent"}, 1, 95, "artwork", {0, 1, 0, 1}, "dogGradient") gradientBelowTheLine:SetPoint("bottoms") - local bigdogRow = menuBackground:CreateTexture (nil, "artwork") - bigdogRow:SetPoint ("bottomleft", menuBackground, "bottomleft", 1, 1) - bigdogRow:SetPoint ("bottomright", menuBackground, "bottomright", -1, 1) - bigdogRow:SetHeight (20) + local bigdogRow = menuBackground:CreateTexture(nil, "artwork") + bigdogRow:SetPoint("bottomleft", menuBackground, "bottomleft", 1, 1) + bigdogRow:SetPoint("bottomright", menuBackground, "bottomright", -1, 1) + bigdogRow:SetHeight(20) bigdogRow:SetColorTexture (.5, .5, .5, .1) bigdogRow:Hide() -- - --> plugins menu title bar - local titlebar_plugins = CreateFrame ("frame", nil, menuBackground,"BackdropTemplate") + --plugins menu title bar + local titlebar_plugins = CreateFrame("frame", nil, menuBackground,"BackdropTemplate") PixelUtil.SetPoint (titlebar_plugins, "topleft", menuBackground, "topleft", 2, -3) PixelUtil.SetPoint (titlebar_plugins, "topright", menuBackground, "topright", -2, -3) - titlebar_plugins:SetHeight (f.TitleHeight) - titlebar_plugins:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) - titlebar_plugins:SetBackdropColor (.5, .5, .5, 1) - titlebar_plugins:SetBackdropBorderColor (0, 0, 0, 1) - --> title - local titleLabel = _detalhes.gump:NewLabel (titlebar_plugins, titlebar_plugins, nil, "titulo", "Plugins", "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255}) + titlebar_plugins:SetHeight(f.TitleHeight) + titlebar_plugins:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) + titlebar_plugins:SetBackdropColor(.5, .5, .5, 1) + titlebar_plugins:SetBackdropBorderColor(0, 0, 0, 1) + --title + local titleLabel = _detalhes.gump:NewLabel(titlebar_plugins, titlebar_plugins, nil, "titulo", "Plugins", "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255}) PixelUtil.SetPoint (titleLabel, "center", titlebar_plugins , "center", 0, 0) PixelUtil.SetPoint (titleLabel, "top", titlebar_plugins , "top", 0, -5) - --> plugins menu title bar - local titlebar_tools = CreateFrame ("frame", nil, menuBackground,"BackdropTemplate") - titlebar_tools:SetHeight (f.TitleHeight) - titlebar_tools:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) - titlebar_tools:SetBackdropColor (.5, .5, .5, 1) - titlebar_tools:SetBackdropBorderColor (0, 0, 0, 1) - --> title - local titleLabel = _detalhes.gump:NewLabel (titlebar_tools, titlebar_tools, nil, "titulo", "Tools", "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255}) + --plugins menu title bar + local titlebar_tools = CreateFrame("frame", nil, menuBackground,"BackdropTemplate") + titlebar_tools:SetHeight(f.TitleHeight) + titlebar_tools:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) + titlebar_tools:SetBackdropColor(.5, .5, .5, 1) + titlebar_tools:SetBackdropBorderColor(0, 0, 0, 1) + --title + local titleLabel = _detalhes.gump:NewLabel(titlebar_tools, titlebar_tools, nil, "titulo", "Tools", "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255}) PixelUtil.SetPoint (titleLabel, "center", titlebar_tools , "center", 0, 0) PixelUtil.SetPoint (titleLabel, "top", titlebar_tools , "top", 0, -5) - --> scripts - f:SetScript ("OnShow", function() + --scripts + f:SetScript("OnShow", function() --check if the window isn't out of screen C_Timer.After (1, function() local right = f:GetRight() if (right and right > GetScreenWidth() + 500) then f:ClearAllPoints() - f:SetPoint ("center", UIParent, "center", 0, 0) + f:SetPoint("center", UIParent, "center", 0, 0) LibWindow.SavePosition (f) _detalhes:Msg ("detected options panel out of screen, position has reset") end end) end) - f:SetScript ("OnHide", function() + f:SetScript("OnHide", function() end) - f:SetScript ("OnMouseDown", function(self, button) + f:SetScript("OnMouseDown", function(self, button) if (button == "RightButton") then f.ClosePlugin() end @@ -561,10 +561,10 @@ function f.OnMenuClick (_, _, pluginAbsName, callRefresh) - --> get the plugin + --get the plugin local pluginObject = _detalhes:GetPlugin (pluginAbsName) if (not pluginObject) then - for index, plugin in ipairs (f.EmbedPlugins) do + for index, plugin in ipairs(f.EmbedPlugins) do if (plugin.real_name == pluginAbsName) then pluginObject = plugin end @@ -576,62 +576,62 @@ end end - --> hide or show plugin windows - for index, plugin in ipairs (f.EmbedPlugins) do + --hide or show plugin windows + for index, plugin in ipairs(f.EmbedPlugins) do if (plugin ~= pluginObject) then - --> hide this plugin + --hide this plugin if (plugin.Frame:IsShown()) then plugin.Frame:Hide() end end end - --> re set the point of the frame within the main plugin window + --re set the point of the frame within the main plugin window f.RefreshFrame (pluginObject.__var_Frame) C_Timer.After (0.016, function() f.RefreshFrame (pluginObject.__var_Frame) end) - --> show the plugin window + --show the plugin window if (pluginObject.RefreshWindow and callRefresh) then DetailsFramework:QuickDispatch (pluginObject.RefreshWindow) end - --> highlight the plugin button on the menu - for index, button in ipairs (f.MenuButtons) do + --highlight the plugin button on the menu + for index, button in ipairs(f.MenuButtons) do button:Show() if (button.PluginAbsName == pluginAbsName) then - --> emphatizate this button + --emphatizate this button button:SetTemplate (_detalhes.gump:GetTemplate ("button", "DETAILS_PLUGINPANEL_BUTTONSELECTED_TEMPLATE")) else - --> make this button regular + --make this button regular button:SetTemplate (_detalhes.gump:GetTemplate ("button", "DETAILS_PLUGINPANEL_BUTTON_TEMPLATE")) end end - --> show the container + --show the container f:Show() return true end function f.CreatePluginMenuButton (pluginObject, isUtility) - --> create the button + --create the button local newButton = _detalhes.gump:CreateButton (f, f.OnMenuClick, f.MenuButtonWidth, f.MenuButtonHeight, pluginObject.__name, pluginObject.real_name, true) newButton.PluginAbsName = pluginObject.real_name newButton.PluginName = pluginObject.__name newButton.IsUtility = isUtility - --> add a template + --add a template newButton:SetTemplate (_detalhes.gump:GetTemplate ("button", "DETAILS_PLUGINPANEL_BUTTON_TEMPLATE")) - newButton:SetText (pluginObject.__name) + newButton:SetText(pluginObject.__name) newButton.textsize = 10 - --> set icon + --set icon newButton:SetIcon (pluginObject.__icon, nil, nil, nil, pluginObject.__iconcoords, pluginObject.__iconcolor, 4) - --> add it to menu table + --add it to menu table tinsert (f.MenuButtons, newButton) return newButton @@ -643,35 +643,35 @@ function f.RefreshFrame (frame) frame:EnableMouse (false) - frame:SetSize (f.FrameWidth, f.FrameHeight) - frame:SetScript ("OnMouseDown", nil) - frame:SetScript ("OnMouseUp", nil) - --frame:SetScript ("OnHide", on_hide) + frame:SetSize(f.FrameWidth, f.FrameHeight) + frame:SetScript("OnMouseDown", nil) + frame:SetScript("OnMouseUp", nil) + --frame:SetScript("OnHide", on_hide) frame:HookScript ("OnHide", on_hide) frame:ClearAllPoints() PixelUtil.SetPoint (frame, "topleft", f, "topleft", 0, 0) frame:Show() end - --> a plugin request to be embed into the main plugin window + --a plugin request to be embed into the main plugin window function f.EmbedPlugin(pluginObject, frame, isUtility) - --> check if the plugin has a frame + --check if the plugin has a frame if (not pluginObject.Frame) then f.DebugMsg ("plugin doesn't have a frame.") return end - --> create a button for this plugin + --create a button for this plugin local newMenuButtom = f.CreatePluginMenuButton(pluginObject, isUtility) - --> utility is true when the object isn't a real plugin, but instead a tool frame from the main addon being embed on this panel + --utility is true when the object isn't a real plugin, but instead a tool frame from the main addon being embed on this panel if (isUtility) then pluginObject.__var_Utility = true end pluginObject.__var_Frame = frame - --> sort buttons alphabetically, put utilities at the end + --sort buttons alphabetically, put utilities at the end table.sort (f.MenuButtons, function(t1, t2) if (t1.IsUtility and t2.IsUtility) then return t1.PluginName < t2.PluginName @@ -684,17 +684,17 @@ end end) - --> reset the buttons points + --reset the buttons points local addingTools = false for index, button in ipairs(f.MenuButtons) do button:ClearAllPoints() PixelUtil.SetPoint(button, "center", menuBackground, "center", 0, 0) if (button.IsUtility) then - --> add -20 to add a gap between plugins and utilities + --add -20 to add a gap between plugins and utilities if (not addingTools) then - --> add the header + --add the header addingTools = true PixelUtil.SetPoint (titlebar_tools, "topleft", menuBackground, "topleft", 2, f.MenuY + ( (index-1) * -f.MenuButtonHeight ) - index - 20) PixelUtil.SetPoint (titlebar_tools, "topright", menuBackground, "topright", -2, f.MenuY + ( (index-1) * -f.MenuButtonHeight ) - index - 20) @@ -706,9 +706,9 @@ end end - --> format the plugin main frame + --format the plugin main frame f.RefreshFrame (frame) - --> add the plugin to embed table + --add the plugin to embed table tinsert(f.EmbedPlugins, pluginObject) frame:SetParent(f) @@ -716,16 +716,16 @@ end function f.OpenPlugin (pluginObject) - --> just simulate a click on the menu button + --just simulate a click on the menu button f.OnMenuClick (_, _, pluginObject.real_name) end function f.ClosePlugin() - --> hide all embed plugins - for index, plugin in ipairs (f.EmbedPlugins) do + --hide all embed plugins + for index, plugin in ipairs(f.EmbedPlugins) do plugin.Frame:Hide() end - --> hide the main frame + --hide the main frame f:Hide() end @@ -741,20 +741,20 @@ function _detalhes:OpenPlugin (wildcard) local originalName = wildcard - if (type (wildcard) == "string") then + if (type(wildcard) == "string") then - --> check if passed a plugin absolute name + --check if passed a plugin absolute name local pluginObject = _detalhes:GetPlugin (wildcard) if (pluginObject) then f.OpenPlugin (pluginObject) return true end - --> check if passed a plugin name, remove spaces and make it lower case + --check if passed a plugin name, remove spaces and make it lower case wildcard = string.lower (wildcard) wildcard = wildcard:gsub ("%s", "") - for index, pluginInfoTable in ipairs (_detalhes.ToolBar.Menu) do + for index, pluginInfoTable in ipairs(_detalhes.ToolBar.Menu) do local pluginName = pluginInfoTable [1] pluginName = string.lower (pluginName) pluginName = pluginName:gsub ("%s", "") @@ -766,15 +766,15 @@ end end - --> check if passed a plugin object - elseif (type (wildcard) == "table") then + --check if passed a plugin object + elseif (type(wildcard) == "table") then if (wildcard.__name) then f.OpenPlugin (wildcard) return true end end - Details:Msg ("|cFFFF7700plugin not found|r:|cFFFFFF00", (originalName or wildcard), "|rcheck if it is enabled in the addons control panel.") --localize-me + Details:Msg("|cFFFF7700plugin not found|r:|cFFFFFF00", (originalName or wildcard), "|rcheck if it is enabled in the addons control panel.") --localize-me end diff --git a/core/plugins_raid.lua b/core/plugins_raid.lua index bdd04fb4..7503df24 100644 --- a/core/plugins_raid.lua +++ b/core/plugins_raid.lua @@ -6,7 +6,7 @@ local _ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> local pointers +--local pointers local _math_floor = math.floor --lua local local _cstr = string.format --lua local @@ -19,13 +19,13 @@ local CLASS_ICON_TCOORDS = CLASS_ICON_TCOORDS ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> constants +--constants local modo_raid = _detalhes._detalhes_props["MODO_RAID"] local modo_alone = _detalhes._detalhes_props["MODO_ALONE"] ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> internal functions +--internal functions function _detalhes.RaidTables:DisableRaidMode (instance) --free @@ -59,28 +59,28 @@ function _detalhes.RaidTables:EnableRaidMode (instance, plugin_name, from_cooltip, from_mode_menu) - --> check if came from cooltip + --check if came from cooltip if (from_cooltip) then self = _detalhes.RaidTables instance = plugin_name plugin_name = from_cooltip end - --> set the mode + --set the mode if (instance.modo == modo_alone) then instance:SoloMode (false) end instance.modo = modo_raid - --> hide rows, scrollbar - Details.FadeHandler.Fader (instance, 1, nil, "barras") + --hide rows, scrollbar + Details.FadeHandler.Fader(instance, 1, nil, "barras") if (instance.rolagem) then - instance:EsconderScrollBar (true) --> hida a scrollbar + instance:EsconderScrollBar (true) --hida a scrollbar end _detalhes:ResetaGump (instance) - instance:RefreshMainWindow (true) + instance:RefreshMainWindow(true) - --> get the plugin name + --get the plugin name --if the desired plugin isn't passed, try to get the latest used. if (not plugin_name) then @@ -124,7 +124,7 @@ function _detalhes.RaidTables:GetAvailablePlugins() local available = {} - for index, plugin in ipairs (self.Menu) do + for index, plugin in ipairs(self.Menu) do if (not self.PluginsInUse [ plugin [4] ] and plugin [3].__enabled) then -- 3 = plugin object 4 = absolute name tinsert (available, plugin) end @@ -212,10 +212,10 @@ self:SetInUse (plugin_name, instance:GetId()) plugin_object.instance_id = instance:GetId() - plugin_object.Frame:SetPoint ("TOPLEFT", instance.bgframe) + plugin_object.Frame:SetPoint("TOPLEFT", instance.bgframe) plugin_object.Frame:Show() instance:ChangeIcon (plugin_object.__icon)--; print (instance:GetId(),"icon",plugin_object.__icon) - _detalhes:SendEvent ("DETAILS_INSTANCE_CHANGEATTRIBUTE", nil, instance, instance.atributo, instance.sub_atributo) + _detalhes:SendEvent("DETAILS_INSTANCE_CHANGEATTRIBUTE", nil, instance, instance.atributo, instance.sub_atributo) if (update_menu) then GameCooltip:ExecFunc (instance.baseframe.cabecalho.atributo) @@ -238,7 +238,7 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> built in announcers +--built in announcers function _detalhes:SendMsgToChannel (msg, channel, towho) if (channel == "RAID" or channel == "PARTY") then @@ -249,10 +249,10 @@ elseif (channel == "BNET") then - if (type (towho) == "number") then + if (type(towho) == "number") then BNSendWhisper (towho, msg) - elseif (type (towho) == "string") then + elseif (type(towho) == "string") then --local BnetFriends = BNGetNumFriends() --for i = 1, BnetFriends do -- local presenceID, presenceName, battleTag, isBattleTagPresence, toonName, toonID, client, isOnline, lastOnline, isAFK, isDND, messageText, noteText, isRIDFriend, broadcastTime, canSoR = BNGetFriendInfo (i) @@ -531,13 +531,13 @@ channel = "INSTANCE_CHAT" end - elseif (where == 4) then --> observer + elseif (where == 4) then --observer if (zone ~= "raid" and zone ~= "party") then return end channel = "PRINT" - elseif (where == 5) then --> officers + elseif (where == 5) then --officers if (IsInGuild()) then channel = "OFFICER" end @@ -555,7 +555,7 @@ alvo_name = _detalhes:GetOnlyName (alvo_name) local msg - if (where == 4) then --> observer + if (where == 4) then --observer local _, class = _UnitClass (alvo_name) local class_color = "|cFFFFFFFF" @@ -575,14 +575,14 @@ for i = 1, _detalhes.announce_deaths.last_hits do for o = last, 1, -1 do local this_death = death_table [o] - if (type (this_death[1]) == "boolean" and this_death[1] and this_death[4]+5 > time) then + 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]) else spelllink = "[" .. _GetSpellInfo(this_death [2]) .. "]" end - spells = spelllink .. ": " .. _detalhes:ToK2 (_math_floor (this_death [3])) .. " " .. spells + spells = spelllink .. ": " .. _detalhes:ToK2 (_math_floor(this_death [3])) .. " " .. spells last = o-1 break end @@ -591,7 +591,7 @@ msg = msg .. " " .. spells - if (where == 4) then --> observer + if (where == 4) then --observer local minute, second = _detalhes:GetCombat():GetFormatedCombatTime() if (second < 10) then second = "0" .. second diff --git a/core/plugins_solo.lua b/core/plugins_solo.lua index 31e6dc6c..d16d5061 100644 --- a/core/plugins_solo.lua +++ b/core/plugins_solo.lua @@ -5,7 +5,7 @@ local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> local pointers +--local pointers local _pairs = pairs --lua locals local _math_floor = math.floor --lua locals @@ -16,15 +16,15 @@ local gump = _detalhes.gump --details local ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> constants +--constants local modo_alone = _detalhes._detalhes_props["MODO_ALONE"] local modo_grupo = _detalhes._detalhes_props["MODO_GROUP"] ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> internal functions +--internal functions - --> When a combat start + --When a combat start function _detalhes:UpdateSolo() local SoloInstance = _detalhes.tabela_instancias[_detalhes.solo] _detalhes.SoloTables.CombatIDLast = _detalhes.SoloTables.CombatID @@ -35,17 +35,17 @@ function _detalhes:CreateSoloCloseButton() local plugin, frame = self, self.Frame - local button = CreateFrame ("Button", nil, frame, "UIPanelCloseButton") + local button = CreateFrame("Button", nil, frame, "UIPanelCloseButton") - button:SetScript ("OnClick", function() + button:SetScript("OnClick", function() if (not button.close_confirmation) then button.close_confirmation = gump:CreateSimplePanel (button, 296, 60, "", plugin.real_name .. "CloseConfirmation") - button.close_confirmation:SetPoint ("center", frame, 0, 0) + button.close_confirmation:SetPoint("center", frame, 0, 0) _G [button.close_confirmation:GetName() .. "TitleBar"]:Hide() - local fade_background = button.close_confirmation:CreateTexture (nil, "background") - fade_background:SetPoint ("topleft", frame, 0, 0) - fade_background:SetPoint ("bottomright", frame, 0, 0) - fade_background:SetTexture (0, 0, 0, 0.7) + local fade_background = button.close_confirmation:CreateTexture(nil, "background") + fade_background:SetPoint("topleft", frame, 0, 0) + fade_background:SetPoint("bottomright", frame, 0, 0) + fade_background:SetTexture(0, 0, 0, 0.7) local close_func = function() local instance = plugin:GetPluginInstance() @@ -66,42 +66,42 @@ close_window:SetIcon ([[Interface\Buttons\UI-Panel-MinimizeButton-Up]], nil, nil, nil, {0.143125, 0.8653125, 0.1446875, 0.8653125}, nil, nil, 2) back_to_group_and_raid:SetIcon ([[Interface\AddOns\Details\images\modo_icones]], nil, nil, nil, {32/256, 32/256*2, 0, 1}, nil, nil, 2) - close_window:SetPoint ("topleft", 3, -4) - close_window:SetPoint ("bottomright", -3, 31) - back_to_group_and_raid:SetPoint ("topleft", 3, -31) - back_to_group_and_raid:SetPoint ("bottomright", -3, 4) + close_window:SetPoint("topleft", 3, -4) + close_window:SetPoint("bottomright", -3, 31) + back_to_group_and_raid:SetPoint("topleft", 3, -31) + back_to_group_and_raid:SetPoint("bottomright", -3, 4) end button.close_confirmation:Show() end) - button:SetWidth (20) - button:SetHeight (20) + button:SetWidth(20) + button:SetHeight(20) --button:GetNormalTexture():SetDesaturated (true) return button end - --> enable and disable Solo Mode for an Instance + --enable and disable Solo Mode for an Instance function _detalhes:SoloMode (show) if (show) then - --> salvar a janela normal - if (self.mostrando ~= "solo") then --> caso o addon tenha ligado ja no painel solo, n�o precisa rodar isso aqui + --salvar a janela normal + if (self.mostrando ~= "solo") then --caso o addon tenha ligado ja no painel solo, n�o precisa rodar isso aqui self:SaveMainWindowPosition() if (self.rolagem) then - self:EsconderScrollBar() --> hida a scrollbar + self:EsconderScrollBar() --hida a scrollbar end self.need_rolagem = false self.baseframe:EnableMouseWheel (false) - Details.FadeHandler.Fader (self, 1, nil, "barras") --> escondendo a janela da inst�ncia [inst�ncia [force hide [velocidade [hidar o que]]]] + Details.FadeHandler.Fader(self, 1, nil, "barras") --escondendo a janela da inst�ncia [inst�ncia [force hide [velocidade [hidar o que]]]] self.mostrando = "solo" end _detalhes.SoloTables.instancia = self - --> default plugin + --default plugin if (not _detalhes.SoloTables.built) then gump:PrepareSoloMode (self) end @@ -110,22 +110,22 @@ _detalhes.solo = self.meu_id --self:AtualizaSliderSolo (0) - if (not self.posicao.solo.w) then --> primeira vez que o solo mode � executado nessa inst�ncia - self.baseframe:SetWidth (300) - self.baseframe:SetHeight (300) + if (not self.posicao.solo.w) then --primeira vez que o solo mode � executado nessa inst�ncia + self.baseframe:SetWidth(300) + self.baseframe:SetHeight(300) self:SaveMainWindowPosition() else self:RestoreMainWindowPosition() local w, h = self:GetSize() if (w ~= 300 or h ~= 300) then - self.baseframe:SetWidth (300) - self.baseframe:SetHeight (300) + self.baseframe:SetWidth(300) + self.baseframe:SetHeight(300) self:SaveMainWindowPosition() end end local first_enabled_plugin, first_enabled_plugin_index - for index, plugin in ipairs (_detalhes.SoloTables.Plugins) do + for index, plugin in ipairs(_detalhes.SoloTables.Plugins) do if (plugin.__enabled) then first_enabled_plugin = plugin first_enabled_plugin_index = index @@ -153,7 +153,7 @@ end end - _detalhes.solo = nil --> destranca a janela solo para ser usada em outras inst�ncias + _detalhes.solo = nil --destranca a janela solo para ser usada em outras inst�ncias self.mostrando = "normal" self:RestoreMainWindowPosition() @@ -161,24 +161,24 @@ _detalhes:CancelWaitForPlugin() end - Details.FadeHandler.Fader (self, 1, nil, "barras") - Details.FadeHandler.Fader (self.scroll, 0) + Details.FadeHandler.Fader(self, 1, nil, "barras") + Details.FadeHandler.Fader(self.scroll, 0) if (self.need_rolagem) then self:MostrarScrollBar (true) else - --> precisa verificar se ele precisa a rolagem certo? + --precisa verificar se ele precisa a rolagem certo? self:ReajustaGump() end - --> calcula se existem barras, etc... - if (not self.rows_fit_in_window) then --> as barras n�o forma iniciadas ainda - self.rows_fit_in_window = _math_floor (self.baseframe.BoxBarrasAltura / self.row_height) + --calcula se existem barras, etc... + if (not self.rows_fit_in_window) then --as barras n�o forma iniciadas ainda + self.rows_fit_in_window = _math_floor(self.baseframe.BoxBarrasAltura / self.row_height) if (self.rows_created < self.rows_fit_in_window) then for i = #self.barras+1, self.rows_fit_in_window do - local nova_barra = gump:CriaNovaBarra (self, i, 30) --> cria nova barra - nova_barra.lineText1:SetText (Loc ["STRING_NEWROW"]) - nova_barra.statusbar:SetValue (100) + local nova_barra = gump:CriaNovaBarra (self, i, 30) --cria nova barra + nova_barra.lineText1:SetText(Loc ["STRING_NEWROW"]) + nova_barra.statusbar:SetValue(100) self.barras [i] = nova_barra end self.rows_created = #self.barras @@ -189,7 +189,7 @@ function _detalhes.SoloTables:EnableSoloMode (instance, plugin_name, from_cooltip) - --> check if came from cooltip + --check if came from cooltip if (from_cooltip) then self = _detalhes.SoloTables instance = plugin_name @@ -201,15 +201,15 @@ _detalhes.SoloTables:switch (nil, plugin_name) end - --> Build Solo Mode Tables and Functions + --Build Solo Mode Tables and Functions function gump:PrepareSoloMode (instancia) _detalhes.SoloTables.built = true - _detalhes.SoloTables.SpellCastTable = {} --> not used - _detalhes.SoloTables.TimeTable = {} --> not used + _detalhes.SoloTables.SpellCastTable = {} --not used + _detalhes.SoloTables.TimeTable = {} --not used - _detalhes.SoloTables.Mode = _detalhes.SoloTables.Mode or 1 --> solo mode + _detalhes.SoloTables.Mode = _detalhes.SoloTables.Mode or 1 --solo mode function _detalhes.SoloTables:GetActiveIndex() return _detalhes.SoloTables.Mode @@ -217,17 +217,17 @@ function _detalhes.SoloTables:switch (_, _switchTo) - --> just hide all + --just hide all if (not _switchTo) then - if (#_detalhes.SoloTables.Plugins > 0) then --> have at least one plugin + if (#_detalhes.SoloTables.Plugins > 0) then --have at least one plugin _detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode].Frame:Hide() end return end - --> if passed the absolute plugin name - if (type (_switchTo) == "string") then - for index, ptable in ipairs (_detalhes.SoloTables.Menu) do + --if passed the absolute plugin name + if (type(_switchTo) == "string") then + for index, ptable in ipairs(_detalhes.SoloTables.Menu) do if (ptable [3].__enabled and ptable [4] == _switchTo) then _switchTo = index break @@ -243,27 +243,27 @@ local ThisFrame = _detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode] if (not ThisFrame or not ThisFrame.__enabled) then - --> frame not found, try in few second again + --frame not found, try in few second again _detalhes.SoloTables.Mode = _switchTo _detalhes:WaitForSoloPlugin (instancia) return end - --> hide current frame + --hide current frame _detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode].Frame:Hide() - --> switch mode + --switch mode _detalhes.SoloTables.Mode = _switchTo - --> show and setpoint new frame + --show and setpoint new frame _detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode].Frame:Show() - _detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode].Frame:SetPoint ("TOPLEFT",_detalhes.SoloTables.instancia.bgframe) + _detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode].Frame:SetPoint("TOPLEFT",_detalhes.SoloTables.instancia.bgframe) _detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode].Frame:SetFrameLevel (20) _detalhes.SoloTables.instancia:ChangeIcon (_detalhes.SoloTables.Menu [_detalhes.SoloTables.Mode] [2]) _detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode].instance_id = _detalhes.SoloTables.instancia:GetId() - _detalhes:SendEvent ("DETAILS_INSTANCE_CHANGEATTRIBUTE", nil, _detalhes.SoloTables.instancia, _detalhes.SoloTables.instancia.atributo, _detalhes.SoloTables.instancia.sub_atributo) + _detalhes:SendEvent("DETAILS_INSTANCE_CHANGEATTRIBUTE", nil, _detalhes.SoloTables.instancia, _detalhes.SoloTables.instancia.atributo, _detalhes.SoloTables.instancia.sub_atributo) end @@ -278,16 +278,16 @@ for SpellId, DebuffTable in _pairs (SoloDebuffUptime) do if (DebuffTable.start) then - DebuffTable.duration = DebuffTable.duration + (_detalhes._tempo - DebuffTable.start) --> time do parser ser� igual ao time()? + DebuffTable.duration = DebuffTable.duration + (_detalhes._tempo - DebuffTable.start) --time do parser ser� igual ao time()? DebuffTable.start = nil end DebuffTable.Active = false end end - --> Buffs ter� em todos os Solo Modes + --Buffs ter� em todos os Solo Modes function _detalhes.SoloTables:CatchBuffs() - --> reset bufftables + --reset bufftables _detalhes.SoloTables.SoloBuffUptime = _detalhes.SoloTables.SoloBuffUptime or {} for spellname, BuffTable in _pairs (_detalhes.SoloTables.SoloBuffUptime) do @@ -310,7 +310,7 @@ BuffTable.droppedAmt = 0 end - --> catch buffs untracked yet + --catch buffs untracked yet for buffIndex = 1, 41 do local name = _UnitAura ("player", buffIndex) if (name) then diff --git a/core/plugins_statusbar.lua b/core/plugins_statusbar.lua index 92a38d40..e633b67f 100644 --- a/core/plugins_statusbar.lua +++ b/core/plugins_statusbar.lua @@ -13,17 +13,17 @@ local _ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> local pointers +--local pointers - local _math_floor = math.floor --> api local - local _ipairs = ipairs --> api local + local _math_floor = math.floor --api local + local _ipairs = ipairs --api local local UnitGroupRolesAssigned = DetailsFramework.UnitGroupRolesAssigned ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> status bar core functions +--status bar core functions - --> hida all micro frames + --hida all micro frames function _detalhes.StatusBar:Hide (instance, side) if (not side) then if (instance.StatusBar.center and instance.StatusBar.left and instance.StatusBar.right) then @@ -58,7 +58,7 @@ end end - --> create a plugin child for an instance + --create a plugin child for an instance function _detalhes.StatusBar:CreateStatusBarChildForInstance (instance, pluginName) local PluginObject = _detalhes.StatusBar.NameTable [pluginName] if (PluginObject) then @@ -72,21 +72,21 @@ return nil end - --> functions to set the three statusbar places: left, center and right + --functions to set the three statusbar places: left, center and right function _detalhes.StatusBar:SetCenterPlugin (instance, childObject, fromStartup) childObject.frame:Show() childObject.frame:ClearAllPoints() childObject.options.textAlign = 2 - if (instance.micro_displays_side == 2) then --> default - bottom - childObject.frame:SetPoint ("center", instance.baseframe.rodape.StatusBarCenterAnchor, "center") - elseif (instance.micro_displays_side == 1) then --> top side - childObject.frame:SetPoint ("center", instance.baseframe.cabecalho.StatusBarCenterAnchor, "center") + if (instance.micro_displays_side == 2) then --default - bottom + childObject.frame:SetPoint("center", instance.baseframe.rodape.StatusBarCenterAnchor, "center") + elseif (instance.micro_displays_side == 1) then --top side + childObject.frame:SetPoint("center", instance.baseframe.cabecalho.StatusBarCenterAnchor, "center") end childObject.text:ClearAllPoints() - childObject.text:SetPoint ("center", childObject.frame, "center", childObject.options.textXMod, childObject.options.textYMod) + childObject.text:SetPoint("center", childObject.frame, "center", childObject.options.textXMod, childObject.options.textYMod) instance.StatusBar.center = childObject childObject.anchor = "center" @@ -116,14 +116,14 @@ childObject.options.textAlign = 1 - if (instance.micro_displays_side == 2) then --> default - bottom - childObject.frame:SetPoint ("left", instance.baseframe.rodape.StatusBarLeftAnchor, "left") - elseif (instance.micro_displays_side == 1) then --> top side - childObject.frame:SetPoint ("left", instance.baseframe.cabecalho.StatusBarLeftAnchor, "left") + if (instance.micro_displays_side == 2) then --default - bottom + childObject.frame:SetPoint("left", instance.baseframe.rodape.StatusBarLeftAnchor, "left") + elseif (instance.micro_displays_side == 1) then --top side + childObject.frame:SetPoint("left", instance.baseframe.cabecalho.StatusBarLeftAnchor, "left") end childObject.text:ClearAllPoints() - childObject.text:SetPoint ("left", childObject.frame, "left", childObject.options.textXMod, childObject.options.textYMod) + childObject.text:SetPoint("left", childObject.frame, "left", childObject.options.textXMod, childObject.options.textYMod) instance.StatusBar.left = childObject childObject.anchor = "left" @@ -148,14 +148,14 @@ childObject.options.textAlign = 3 - if (instance.micro_displays_side == 2) then --> default - bottom - childObject.frame:SetPoint ("right", instance.baseframe.rodape.direita, "right", -20, 10) - elseif (instance.micro_displays_side == 1) then --> top side - childObject.frame:SetPoint ("right", instance.baseframe.cabecalho.StatusBarRightAnchor, "right") + if (instance.micro_displays_side == 2) then --default - bottom + childObject.frame:SetPoint("right", instance.baseframe.rodape.direita, "right", -20, 10) + elseif (instance.micro_displays_side == 1) then --top side + childObject.frame:SetPoint("right", instance.baseframe.cabecalho.StatusBarRightAnchor, "right") end childObject.text:ClearAllPoints() - childObject.text:SetPoint ("right", childObject.frame, "right", childObject.options.textXMod, childObject.options.textYMod) + childObject.text:SetPoint("right", childObject.frame, "right", childObject.options.textXMod, childObject.options.textYMod) instance.StatusBar.right = childObject childObject.anchor = "right" @@ -174,9 +174,9 @@ return true end - --> disable all plugin childs attached to an specified instance and reactive the childs taking the instance statusbar anchors + --disable all plugin childs attached to an specified instance and reactive the childs taking the instance statusbar anchors function _detalhes.StatusBar:ReloadAnchors (instance) - for _, child in _ipairs (instance.StatusBar) do + for _, child in _ipairs(instance.StatusBar) do child.frame:ClearAllPoints() child.frame:Hide() child.anchor = nil @@ -185,7 +185,7 @@ child:OnDisable() end end - --> enable only needed plugins + --enable only needed plugins if (instance.StatusBar.right) then _detalhes.StatusBar:SetRightPlugin (instance, instance.StatusBar.right) end @@ -203,19 +203,19 @@ - --> select a new plugin in for an instance anchor + --select a new plugin in for an instance anchor local ChoosePlugin = function(_, _, index, current_child, anchor) GameCooltip:Close() local byuser = false - if (type (index) == "table") then + if (type(index) == "table") then index, current_child, anchor = unpack (index) byuser = true end - if (index and index == -1) then --> hide + if (index and index == -1) then --hide _detalhes.StatusBar:ApplyOptions (current_child, "hidden", true) return else @@ -242,7 +242,7 @@ local chosenChild = nil --procura pra ver se ja tem uma criada - for _, child_created in _ipairs (instance.StatusBar) do + for _, child_created in _ipairs(instance.StatusBar) do if (child_created.mainPlugin == pluginMestre) then chosenChild = child_created break @@ -255,7 +255,7 @@ end instance.StatusBar [anchor] = chosenChild - --> copia os atributos do current para o chosen + --copia os atributos do current para o chosen local options_current = Details.CopyTable (current_child.options) if (chosenChild.anchor) then @@ -275,7 +275,7 @@ end function _detalhes.StatusBar:SetPlugin (instance, absolute_name, anchor) - if (absolute_name == -1) then --> none + if (absolute_name == -1) then --none anchor = string.lower (anchor) ChoosePlugin (nil, nil, -1, instance.StatusBar [anchor], anchor) else @@ -287,7 +287,7 @@ end end - --> on enter + --on enter local onEnterCooltipTexts = { {text = "|TInterface\\TUTORIALFRAME\\UI-TUTORIAL-FRAME:14:14:0:1:512:512:8:70:224:306|t " .. Loc ["STRING_PLUGIN_TOOLTIP_LEFTBUTTON"]}, {text = "|TInterface\\TUTORIALFRAME\\UI-TUTORIAL-FRAME:14:14:0:1:512:512:8:70:328:409|t " .. Loc ["STRING_PLUGIN_TOOLTIP_RIGHTBUTTON"]}} @@ -301,32 +301,32 @@ local instance = frame.child.instance - _detalhes.OnEnterMainWindow (instance) + _detalhes.OnEnterMainWindow(instance) - frame:SetBackdrop (on_enter_backdrop) - frame:SetBackdropColor (0.7, 0.7, 0.7, 0.6) + frame:SetBackdrop(on_enter_backdrop) + frame:SetBackdropColor(0.7, 0.7, 0.7, 0.6) GameCooltip:Reset() GameCooltip:AddFromTable (onEnterCooltipTexts) - GameCooltip:SetOption ("TextSize", 9) + GameCooltip:SetOption("TextSize", 9) GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], {.6, 0.1, 0, 0.64453125}, {1, 1, 1, 0.1}, true) - GameCooltip:SetOption ("ButtonHeightMod", -4) - GameCooltip:SetOption ("ButtonsYMod", -4) - GameCooltip:SetOption ("YSpacingMod", -4) - GameCooltip:SetOption ("FixedHeight", 46) + GameCooltip:SetOption("ButtonHeightMod", -4) + GameCooltip:SetOption("ButtonsYMod", -4) + GameCooltip:SetOption("YSpacingMod", -4) + GameCooltip:SetOption("FixedHeight", 46) GameCooltip:ShowCooltip (frame, "tooltip") return true end - --> on leave + --on leave local OnLeave = function(frame) - frame:SetBackdrop (nil) + frame:SetBackdrop(nil) - _detalhes.OnLeaveMainWindow (frame.child.instance) + _detalhes.OnLeaveMainWindow(frame.child.instance) _detalhes.popup:Hide() @@ -349,7 +349,7 @@ local current - for index, _name_and_icon in _ipairs (_detalhes.StatusBar.Menu) do + for index, _name_and_icon in _ipairs(_detalhes.StatusBar.Menu) do GameCooltip:AddMenu (1, ChoosePlugin, {index, frame.child, frame.child.anchor}, nil, nil, _name_and_icon [1], _name_and_icon [2], true) local pluginMestre = _detalhes.StatusBar.Plugins [index] @@ -362,18 +362,18 @@ if (current) then GameCooltip:SetLastSelected (1, current) else - GameCooltip:SetOption ("NoLastSelectedBar", true) + GameCooltip:SetOption("NoLastSelectedBar", true) end - GameCooltip:SetOption ("HeightAnchorMod", -12) + GameCooltip:SetOption("HeightAnchorMod", -12) GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], {.6, 0.1, 0, 0.64453125}, {1, 1, 1, 0.1}, true) GameCooltip:ShowCooltip (frame, "menu") end return true end - --> reset micro frames + --reset micro frames function _detalhes.StatusBar:Reset (instance) _detalhes.StatusBar:ApplyOptions (instance.StatusBar.left, "textcolor", {1, 0.82, 0, 1}) _detalhes.StatusBar:ApplyOptions (instance.StatusBar.center, "textcolor", {1, 0.82, 0, 1}) @@ -389,7 +389,7 @@ end function _detalhes.StatusBar:GetIndexFromAbsoluteName (AbsName) - for index, object in ipairs (_detalhes.StatusBar.Plugins) do + for index, object in ipairs(_detalhes.StatusBar.Plugins) do if (object.real_name == AbsName) then return index end @@ -467,39 +467,39 @@ end - --> build-in function for create a frame for an plugin child + --build-in function for create a frame for an plugin child function _detalhes.StatusBar:CreateChildFrame (instance, name, w, h) --local frame = _detalhes.gump:NewPanel (instance.baseframe.cabecalho.fechar, nil, name..instance:GetInstanceId(), nil, w or DEFAULT_CHILD_WIDTH, h or DEFAULT_CHILD_HEIGHT, false) local frame = _detalhes.gump:NewPanel (instance.baseframe, nil, name..instance:GetInstanceId(), nil, w or DEFAULT_CHILD_WIDTH, h or DEFAULT_CHILD_HEIGHT, false) frame:SetFrameLevel (instance.baseframe:GetFrameLevel()+4) --create widgets - local text = _detalhes.gump:NewLabel (frame, nil, "$parentText", "text", "0") - text:SetPoint ("right", frame, "right", 0, 0) - text:SetJustifyH ("right") + local text = _detalhes.gump:NewLabel(frame, nil, "$parentText", "text", "0") + text:SetPoint("right", frame, "right", 0, 0) + text:SetJustifyH("right") _detalhes:SetFontSize (text, 9.8) - frame:SetHook ("OnEnter", OnEnter) - frame:SetHook ("OnLeave", OnLeave) - frame:SetHook ("OnMouseUp", OnMouseUp) + frame:SetHook("OnEnter", OnEnter) + frame:SetHook("OnLeave", OnLeave) + frame:SetHook("OnMouseUp", OnMouseUp) return frame end - --> built-in function for create an table for the plugin child + --built-in function for create an table for the plugin child function _detalhes.StatusBar:CreateChildTable (instance, mainObject, frame) local _table = {} - --> treat as a class + --treat as a class setmetatable (_table, mainObject) - --> default members + --default members _table.instance = instance _table.frame = frame _table.text = frame.text _table.mainPlugin = mainObject - --> options table + --options table _table.options = instance.StatusBar.options [mainObject.real_name] if (not _table.options) then _table.options = { @@ -519,10 +519,10 @@ _detalhes.StatusBar:ReloadAnchors (instance) - --> table reference on frame widget + --table reference on frame widget frame.frame.child = _table - --> adds this new child to parent child container + --adds this new child to parent child container mainObject.childs [#mainObject.childs+1] = _table return _table @@ -557,7 +557,7 @@ end child.options.textColor = value - local r, g, b, a = _detalhes.gump:ParseColors (child.options.textColor) + local r, g, b, a = _detalhes.gump:ParseColors(child.options.textColor) child.text:SetTextColor (r, g, b, a) elseif (option == "textsize") then @@ -605,17 +605,17 @@ end ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> BUILT-IN DPS PLUGIN +--BUILT-IN DPS PLUGIN do - --> Create the plugin Object [1] = frame name on _G [2] options [3] plugin type + --Create the plugin Object [1] = frame name on _G [2] options [3] plugin type local PDps = _detalhes:NewPluginObject ("Details_StatusBarDps", DETAILSPLUGIN_ALWAYSENABLED, "STATUSBAR") --[[ Note: Declare all functions using : not . if you use . make sure to ignore first parameter and move all parameters 1 position to right ]] -- handle event "COMBAT_PLAYER_ENTER" function PDps:PlayerEnterCombat() - for index, child in _ipairs (PDps.childs) do + for index, child in _ipairs(PDps.childs) do if (child.enabled and child.instance:GetSegment() == 0) then child.tick = _detalhes:ScheduleRepeatingTimer ("PluginDpsUpdate", 1, child) end @@ -624,7 +624,7 @@ do -- handle event "COMBAT_PLAYER_LEAVE" function PDps:PlayerLeaveCombat() - for index, child in _ipairs (PDps.childs) do + for index, child in _ipairs(PDps.childs) do if (child.tick) then _detalhes:CancelTimer (child.tick) child.tick = nil @@ -634,7 +634,7 @@ do -- handle event "DETAILS_INSTANCE_CHANGESEGMENT" function PDps:ChangeSegment (instance, segment) - for index, child in _ipairs (PDps.childs) do + for index, child in _ipairs(PDps.childs) do if (child.enabled and child.instance == instance) then _detalhes:PluginDpsUpdate (child) end @@ -643,9 +643,9 @@ do --handle event "DETAILS_DATA_RESET" function PDps:DataReset() - for index, child in _ipairs (PDps.childs) do + for index, child in _ipairs(PDps.childs) do if (child.enabled) then - child.text:SetText ("0") + child.text:SetText("0") end end end @@ -657,55 +657,55 @@ do --still a little buggy, working on function _detalhes:PluginDpsUpdate (child) - --> showing is the combat table which is current shown on instance + --showing is the combat table which is current shown on instance if (child.instance.showing) then --GetCombatTime() return the time length of combat local combatTime = child.instance.showing:GetCombatTime() if (combatTime < 1) then - return child.text:SetText ("0") + return child.text:SetText("0") end --GetTotal (attribute, sub attribute, onlyGroup) return the total of requested attribute local total = child.instance.showing:GetTotal (child.instance.atributo, child.instance.sub_atributo, true) - local dps = _math_floor (total / combatTime) + local dps = _math_floor(total / combatTime) local textStyle = child.options.textStyle if (textStyle == 1) then - child.text:SetText (_detalhes:ToK (dps)) + child.text:SetText(_detalhes:ToK (dps)) elseif (textStyle == 2) then - child.text:SetText (_detalhes:comma_value (dps)) + child.text:SetText(_detalhes:comma_value (dps)) else - child.text:SetText (dps) + child.text:SetText(dps) end end end - --> Create Plugin Frames + --Create Plugin Frames function PDps:CreateChildObject (instance) - --> create main frame and widgets - --> a statusbar frame is made of a panel with a member called 'text' which is a label + --create main frame and widgets + --a statusbar frame is made of a panel with a member called 'text' which is a label local myframe = _detalhes.StatusBar:CreateChildFrame (instance, "DetailsStatusBarDps", DEFAULT_CHILD_WIDTH, DEFAULT_CHILD_HEIGHT) local new_child = _detalhes.StatusBar:CreateChildTable (instance, PDps, myframe) return new_child end - --> Handle events (must have, we'll use direct call to functions) + --Handle events (must have, we'll use direct call to functions) function PDps:OnDetailsEvent (event) return end - --> Install + --Install -- _detalhes:InstallPlugin ( Plugin Type | Plugin Display Name | Plugin Icon | Plugin Object | Plugin Real Name ) local install = _detalhes:InstallPlugin ("STATUSBAR", Loc ["STRING_PLUGIN_PDPSNAME"], "Interface\\Icons\\Achievement_brewery_3", PDps, "DETAILS_STATUSBAR_PLUGIN_PDPS") - if (type (install) == "table" and install.error) then + if (type(install) == "table" and install.error) then print (install.errortext) return end - --> Register needed events + --Register needed events -- here we are redirecting the event to an specified function, otherwise events need to be handle inside "PDps:OnDetailsEvent (event)" _detalhes:RegisterEvent (PDps, "DETAILS_INSTANCE_CHANGESEGMENT", PDps.ChangeSegment) _detalhes:RegisterEvent (PDps, "DETAILS_DATA_RESET", PDps.DataReset) @@ -714,17 +714,17 @@ do end ----------> BUILT-IN SEGMENT PLUGIN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +---------BUILT-IN SEGMENT PLUGIN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- do - --> Create the plugin Object + --Create the plugin Object local PSegment = _detalhes:NewPluginObject ("Details_Segmenter", DETAILSPLUGIN_ALWAYSENABLED, "STATUSBAR") - --> Handle events (must have) + --Handle events (must have) function PSegment:OnDetailsEvent (event) return end - --> initialize and reset 'can_schedule' variable + --initialize and reset 'can_schedule' variable function PSegment:NewCombat() PSegment.can_schedule = 1 PSegment:Change() @@ -734,41 +734,41 @@ do PSegment:Change() end - --> on 'can_schedule' timeout, re-run the Change() function + --on 'can_schedule' timeout, re-run the Change() function function PSegment:SchduleGetName() PSegment:Change() end function PSegment:Change() - for index, child in _ipairs (PSegment.childs) do + for index, child in _ipairs(PSegment.childs) do if (child.enabled and child.instance:IsEnabled()) then child.options.segmentType = child.options.segmentType or 2 if (not child.instance.showing) then - return child.text:SetText (Loc ["STRING_EMPTY_SEGMENT"]) + return child.text:SetText(Loc ["STRING_EMPTY_SEGMENT"]) end - if (child.instance.segmento == -1) then --> overall - child.text:SetText (Loc ["STRING_OVERALL"]) + if (child.instance.segmento == -1) then --overall + child.text:SetText(Loc ["STRING_OVERALL"]) - elseif (child.instance.segmento == 0) then --> combate atual + elseif (child.instance.segmento == 0) then --combate atual if (child.options.segmentType == 1) then - child.text:SetText (Loc ["STRING_CURRENT"]) + child.text:SetText(Loc ["STRING_CURRENT"]) else local name = _detalhes.tabela_vigente:GetCombatName (true) if (name and name ~= Loc ["STRING_UNKNOW"]) then if (child.options.segmentType == 2) then - child.text:SetText (name) + child.text:SetText(name) elseif (child.options.segmentType == 3) then - child.text:SetText (name) + child.text:SetText(name) end else - child.text:SetText (Loc ["STRING_CURRENT"]) + child.text:SetText(Loc ["STRING_CURRENT"]) if (_detalhes.in_combat and PSegment.can_schedule <= 2) then PSegment:ScheduleTimer ("SchduleGetName", 2) PSegment.can_schedule = PSegment.can_schedule + 1 @@ -777,24 +777,24 @@ do end end - else --> alguma tabela do hist�rico + else --alguma tabela do hist�rico if (child.options.segmentType == 1) then - child.text:SetText (Loc ["STRING_FIGHTNUMBER"] .. child.instance.segmento) + child.text:SetText(Loc ["STRING_FIGHTNUMBER"] .. child.instance.segmento) else local name = child.instance.showing:GetCombatName (true) if (name ~= Loc ["STRING_UNKNOW"]) then if (child.options.segmentType == 2) then - child.text:SetText (name) + child.text:SetText(name) elseif (child.options.segmentType == 3) then - child.text:SetText (name .. " #" .. child.instance.segmento) + child.text:SetText(name .. " #" .. child.instance.segmento) end else if (child.options.segmentType == 2) then - child.text:SetText (Loc ["STRING_UNKNOW"]) + child.text:SetText(Loc ["STRING_UNKNOW"]) elseif (child.options.segmentType == 3) then - child.text:SetText (Loc ["STRING_UNKNOW"] .. " #" .. child.instance.segmento) + child.text:SetText(Loc ["STRING_UNKNOW"] .. " #" .. child.instance.segmento) end end end @@ -805,14 +805,14 @@ do function PSegment:ExtraOptions() - --> all widgets need to be placed on a table + --all widgets need to be placed on a table local widgets = {} - --> reference of extra window for custom options + --reference of extra window for custom options local window = _G.DetailsStatusBarOptions2.MyObject - --> build all your widgets ----------------------------------------------------------------------------------------------------------------------------- - _detalhes.gump:NewLabel (window, nil, "$parentSegmentOptionLabel", "segmentOptionLabel", Loc ["STRING_PLUGIN_SEGMENTTYPE"]) - window.segmentOptionLabel:SetPoint (10, -15) + --build all your widgets ----------------------------------------------------------------------------------------------------------------------------- + _detalhes.gump:NewLabel(window, nil, "$parentSegmentOptionLabel", "segmentOptionLabel", Loc ["STRING_PLUGIN_SEGMENTTYPE"]) + window.segmentOptionLabel:SetPoint(10, -15) local onSelectSegmentType = function(_, child, thistype) child.options.segmentType = thistype @@ -826,25 +826,25 @@ do } _detalhes.gump:NewDropDown (window, nil, "$parentSegmentTypeDropdown", "segmentTypeDropdown", 200, 20, function() return segmentTypes end, 1) -- func, default - window.segmentTypeDropdown:SetPoint ("left", window.segmentOptionLabel, "right", 2) + window.segmentTypeDropdown:SetPoint("left", window.segmentOptionLabel, "right", 2) ----------------------------------------------------------------------------------------------------------------------------- - --> now we insert all widgets created on widgets table + --now we insert all widgets created on widgets table table.insert (widgets, window.segmentOptionLabel) table.insert (widgets, window.segmentTypeDropdown) - --> after first call we replace this function with widgets table + --after first call we replace this function with widgets table PSegment.ExtraOptions = widgets end - --> ExtraOptionsOnOpen is called when options are opened and plugin have custom options - --> here we setup options widgets for get the values of clicked child and also for tell options window what child we are configuring + --ExtraOptionsOnOpen is called when options are opened and plugin have custom options + --here we setup options widgets for get the values of clicked child and also for tell options window what child we are configuring function PSegment:ExtraOptionsOnOpen (child) _G.DetailsStatusBarOptions2SegmentTypeDropdown.MyObject:SetFixedParameter (child) _G.DetailsStatusBarOptions2SegmentTypeDropdown.MyObject:Select (child.options.segmentType, true) end - --> Create Plugin Frames (must have) + --Create Plugin Frames (must have) function PSegment:CreateChildObject (instance) local myframe = _detalhes.StatusBar:CreateChildFrame (instance, "DetailsPSegmentInstance" .. instance:GetInstanceId(), DEFAULT_CHILD_WIDTH, DEFAULT_CHILD_HEIGHT) local new_child = _detalhes.StatusBar:CreateChildTable (instance, PSegment, myframe) @@ -852,26 +852,26 @@ do return new_child end - --> Install + --Install local install = _detalhes:InstallPlugin ("STATUSBAR", Loc ["STRING_PLUGIN_PSEGMENTNAME"], "Interface\\Icons\\inv_misc_enchantedscroll", PSegment, "DETAILS_STATUSBAR_PLUGIN_PSEGMENT") - if (type (install) == "table" and install.error) then + if (type(install) == "table" and install.error) then print (install.errortext) return end - --> Register needed events + --Register needed events _detalhes:RegisterEvent (PSegment, "DETAILS_INSTANCE_CHANGESEGMENT", PSegment.OnSegmentChange) _detalhes:RegisterEvent (PSegment, "DETAILS_DATA_RESET", PSegment.Change) _detalhes:RegisterEvent (PSegment, "COMBAT_PLAYER_ENTER", PSegment.NewCombat) end ----------> BUILT-IN ATTRIBUTE PLUGIN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +---------BUILT-IN ATTRIBUTE PLUGIN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- do - --> Create the plugin Object + --Create the plugin Object local PAttribute = _detalhes:NewPluginObject ("Details_Attribute", DETAILSPLUGIN_ALWAYSENABLED, "STATUSBAR") - --> Handle events (must have) + --Handle events (must have) function PAttribute:OnDetailsEvent (event) return end @@ -881,10 +881,10 @@ do instance, attribute, subAttribute = self.instance, self.instance.atributo, self.instance.sub_atributo end - for index, child in _ipairs (PAttribute.childs) do + for index, child in _ipairs(PAttribute.childs) do if (child.instance == instance and child.enabled and child.instance:IsEnabled()) then local sName = child.instance:GetInstanceAttributeText() - child.text:SetText (sName) + child.text:SetText(sName) end end end @@ -893,32 +893,32 @@ do self:Change() end - --> Create Plugin Frames (must have) + --Create Plugin Frames (must have) function PAttribute:CreateChildObject (instance) local myframe = _detalhes.StatusBar:CreateChildFrame (instance, "DetailsPAttributeInstance" .. instance:GetInstanceId(), DEFAULT_CHILD_WIDTH, DEFAULT_CHILD_HEIGHT) local new_child = _detalhes.StatusBar:CreateChildTable (instance, PAttribute, myframe) return new_child end - --> Install + --Install local install = _detalhes:InstallPlugin ("STATUSBAR", Loc ["STRING_PLUGIN_PATTRIBUTENAME"], "Interface\\Icons\\inv_misc_emberclothbolt", PAttribute, "DETAILS_STATUSBAR_PLUGIN_PATTRIBUTE") - if (type (install) == "table" and install.error) then + if (type(install) == "table" and install.error) then print (install.errortext) return end - --> Register needed events + --Register needed events _detalhes:RegisterEvent (PAttribute, "DETAILS_INSTANCE_CHANGEATTRIBUTE", PAttribute.Change) end ----------> BUILT-IN CLOCK PLUGIN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +---------BUILT-IN CLOCK PLUGIN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- do - --> Create the plugin Object + --Create the plugin Object local Clock = _detalhes:NewPluginObject ("Details_Clock", DETAILSPLUGIN_ALWAYSENABLED, "STATUSBAR") - --> Handle events --must have this function + --Handle events --must have this function function Clock:OnDetailsEvent (event) return end @@ -939,7 +939,7 @@ do --1 sec tick function _detalhes:ClockPluginTick (force) - for index, child in _ipairs (Clock.childs) do + for index, child in _ipairs(Clock.childs) do local instance = child.instance if (child.enabled and instance:IsEnabled()) then if (instance.showing and ( (instance.segmento ~= -1) or (instance.segmento == -1 and not _detalhes.in_combat) or force) ) then @@ -947,12 +947,12 @@ do local timeType = child.options.timeType if (timeType == 1) then local combatTime = instance.showing:GetCombatTime() - local minutos, segundos = _math_floor (combatTime/60), _math_floor (combatTime%60) - child.text:SetText (minutos .. "m " .. segundos .. "s") + local minutos, segundos = _math_floor(combatTime/60), _math_floor(combatTime%60) + child.text:SetText(minutos .. "m " .. segundos .. "s") elseif (timeType == 2) then local combatTime = instance.showing:GetCombatTime() - child.text:SetText (combatTime .. "s") + child.text:SetText(combatTime .. "s") elseif (timeType == 3) then @@ -970,9 +970,9 @@ do local currentCombatTime = instance.showing:GetCombatTime() if (lastFight) then - child.text:SetText (currentCombatTime - lastFight:GetCombatTime() .. "s") + child.text:SetText(currentCombatTime - lastFight:GetCombatTime() .. "s") else - child.text:SetText (currentCombatTime .. "s") + child.text:SetText(currentCombatTime .. "s") end end @@ -983,25 +983,25 @@ do --on reset function Clock:DataReset() - for index, child in _ipairs (Clock.childs) do + for index, child in _ipairs(Clock.childs) do if (child.enabled and child.instance:IsEnabled()) then - child.text:SetText ("0m 0s") + child.text:SetText("0m 0s") end end end - --> this is a fixed member, put all your widgets for custom options inside this function - --> if ExtraOptions isn't preset, secondary options box will be hided and only default options will be show + --this is a fixed member, put all your widgets for custom options inside this function + --if ExtraOptions isn't preset, secondary options box will be hided and only default options will be show function Clock:ExtraOptions() - --> all widgets need to be placed on a table + --all widgets need to be placed on a table local widgets = {} - --> reference of extra window for custom options + --reference of extra window for custom options local window = _G.DetailsStatusBarOptions2.MyObject - --> build all your widgets ----------------------------------------------------------------------------------------------------------------------------- - _detalhes.gump:NewLabel (window, nil, "$parentClockTypeLabel", "ClockTypeLabel", Loc ["STRING_PLUGIN_CLOCKTYPE"]) - window.ClockTypeLabel:SetPoint (10, -15) + --build all your widgets ----------------------------------------------------------------------------------------------------------------------------- + _detalhes.gump:NewLabel(window, nil, "$parentClockTypeLabel", "ClockTypeLabel", Loc ["STRING_PLUGIN_CLOCKTYPE"]) + window.ClockTypeLabel:SetPoint(10, -15) local onSelectClockType = function(_, child, thistype) child.options.timeType = thistype @@ -1013,59 +1013,59 @@ do {value = 3, label = Loc ["STRING_PLUGIN_TIMEDIFF"], onclick = onSelectClockType}} _detalhes.gump:NewDropDown (window, nil, "$parentClockTypeDropdown", "ClockTypeDropdown", 200, 20, function() return clockTypes end, 1) -- func, default - window.ClockTypeDropdown:SetPoint ("left", window.ClockTypeLabel, "right", 2) + window.ClockTypeDropdown:SetPoint("left", window.ClockTypeLabel, "right", 2) ----------------------------------------------------------------------------------------------------------------------------- - --> now we insert all widgets created on widgets table + --now we insert all widgets created on widgets table table.insert (widgets, window.ClockTypeLabel) table.insert (widgets, window.ClockTypeDropdown) - --> after first call we replace this function with widgets table + --after first call we replace this function with widgets table Clock.ExtraOptions = widgets end - --> ExtraOptionsOnOpen is called when options are opened and plugin have custom options - --> here we setup options widgets for get the values of clicked child and also for tell options window what child we are configuring + --ExtraOptionsOnOpen is called when options are opened and plugin have custom options + --here we setup options widgets for get the values of clicked child and also for tell options window what child we are configuring function Clock:ExtraOptionsOnOpen (child) _G.DetailsStatusBarOptions2ClockTypeDropdown.MyObject:SetFixedParameter (child) _G.DetailsStatusBarOptions2ClockTypeDropdown.MyObject:Select (child.options.timeType, true) end - --> Create Plugin Frames + --Create Plugin Frames function Clock:CreateChildObject (instance) local myframe = _detalhes.StatusBar:CreateChildFrame (instance, "DetailsClockInstance"..instance:GetInstanceId(), DEFAULT_CHILD_WIDTH, DEFAULT_CHILD_HEIGHT) - --> we place custom frame, widgets inside this function - --local texture = myframe:CreateTexture (nil, "overlay") - --texture:SetTexture ("Interface\\AddOns\\Details\\images\\clock") - --texture:SetPoint ("right", myframe.text.widget, "left") + --we place custom frame, widgets inside this function + --local texture = myframe:CreateTexture(nil, "overlay") + --texture:SetTexture("Interface\\AddOns\\Details\\images\\clock") + --texture:SetPoint("right", myframe.text.widget, "left") --myframe.texture = texture local new_child = _detalhes.StatusBar:CreateChildTable (instance, Clock, myframe) - --> default text - new_child.text:SetText ("0m 0s") + --default text + new_child.text:SetText("0m 0s") - --> some changes from default options + --some changes from default options if (new_child.options.textXMod == 0) then new_child.options.textXMod = 6 end - --> here we are adding a new option member + --here we are adding a new option member new_child.options.timeType = new_child.options.timeType or 1 return new_child end - --> Install + --Install local install = _detalhes:InstallPlugin ("STATUSBAR", Loc ["STRING_PLUGIN_CLOCKNAME"], "Interface\\Icons\\Achievement_BG_grab_cap_flagunderXseconds", Clock, "DETAILS_STATUSBAR_PLUGIN_CLOCK") - if (type (install) == "table" and install.error) then + if (type(install) == "table" and install.error) then print (install.errortext) return end - --> Register needed events + --Register needed events _detalhes:RegisterEvent (Clock, "COMBAT_PLAYER_ENTER", Clock.PlayerEnterCombat) _detalhes:RegisterEvent (Clock, "COMBAT_PLAYER_LEAVE", Clock.PlayerLeaveCombat) _detalhes:RegisterEvent (Clock, "DETAILS_INSTANCE_CHANGESEGMENT", _detalhes.ClockPluginTickOnSegment) @@ -1074,17 +1074,17 @@ do end ----------> BUILT-IN THREAT PLUGIN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +---------BUILT-IN THREAT PLUGIN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- do - local _UnitDetailedThreatSituation = UnitDetailedThreatSituation --> wow api - local _cstr = string.format --> lua api - local _math_abs = math.abs --> lua api + local _UnitDetailedThreatSituation = UnitDetailedThreatSituation --wow api + local _cstr = string.format --lua api + local _math_abs = math.abs --lua api - --> Create the plugin Object + --Create the plugin Object local Threat = _detalhes:NewPluginObject ("Details_TargetThreat", DETAILSPLUGIN_ALWAYSENABLED, "STATUSBAR") - --> Handle events + --Handle events function Threat:OnDetailsEvent (event) return end @@ -1106,32 +1106,32 @@ do end function _detalhes:ThreatPluginTick() - for index, child in _ipairs (Threat.childs) do + for index, child in _ipairs(Threat.childs) do local instance = child.instance if (child.enabled and instance:IsEnabled()) then -- atualiza a threat if (not DetailsFramework.IsClassicWow()) then local isTanking, status, threatpct, rawthreatpct, threatvalue = _UnitDetailedThreatSituation ("player", "target") if (threatpct) then - child.text:SetText (_math_floor (threatpct).."%") + child.text:SetText(_math_floor(threatpct).."%") if (Threat.isTank) then child.text:SetTextColor (_math_abs (threatpct-100)*0.01, threatpct*0.01, 0, 1) else child.text:SetTextColor (threatpct*0.01, _math_abs (threatpct-100)*0.01, 0, 1) end else - child.text:SetText ("0%") + child.text:SetText("0%") child.text:SetTextColor (1, 1, 1, 1) end else - child.text:SetText ("0%") + child.text:SetText("0%") child.text:SetTextColor (1, 1, 1, 1) end end end end - --> Create Plugin Frames + --Create Plugin Frames function Threat:CreateChildObject (instance) local myframe = _detalhes.StatusBar:CreateChildFrame (instance, "DetailsThreatInstance"..instance:GetInstanceId(), DEFAULT_CHILD_WIDTH, DEFAULT_CHILD_HEIGHT) @@ -1139,39 +1139,39 @@ do local new_child = _detalhes.StatusBar:CreateChildTable (instance, Threat, myframe) myframe.widget:RegisterEvent ("PLAYER_TARGET_CHANGED") - myframe.widget:SetScript ("OnEvent", function() + myframe.widget:SetScript("OnEvent", function() _detalhes:ThreatPluginTick() end) return new_child end - --> Install + --Install local install = _detalhes:InstallPlugin ("STATUSBAR", Loc ["STRING_PLUGIN_THREATNAME"], "Interface\\Icons\\Ability_Hunter_ResistanceIsFutile", Threat, "DETAILS_STATUSBAR_PLUGIN_THREAT") - if (type (install) == "table" and install.error) then + if (type(install) == "table" and install.error) then print (install.errortext) return end - --> Register needed events + --Register needed events _detalhes:RegisterEvent (Threat, "COMBAT_PLAYER_ENTER", Threat.PlayerEnterCombat) _detalhes:RegisterEvent (Threat, "COMBAT_PLAYER_LEAVE", Threat.PlayerLeaveCombat) end ----------> BUILT-IN PFS PLUGIN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +---------BUILT-IN PFS PLUGIN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- do - --> Create the plugin Object + --Create the plugin Object local PFps = _detalhes:NewPluginObject ("Details_Statusbar_Fps", DETAILSPLUGIN_ALWAYSENABLED, "STATUSBAR") - --> Handle events (must have) + --Handle events (must have) function PFps:OnDetailsEvent (event) return end function PFps:UpdateFps() - self.text:SetText (_math_floor (GetFramerate()) .. " fps") + self.text:SetText(_math_floor(GetFramerate()) .. " fps") end function PFps:OnDisable() @@ -1189,28 +1189,28 @@ do return new_child end - --> Install + --Install local install = _detalhes:InstallPlugin ("STATUSBAR", Loc ["STRING_PLUGIN_FPS"], "Interface\\Icons\\Spell_Shadow_MindTwisting", PFps, "DETAILS_STATUSBAR_PLUGIN_PFPS") - if (type (install) == "table" and install.error) then + if (type(install) == "table" and install.error) then print (install.errortext) return end end ----------> BUILT-IN LATENCY PLUGIN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +---------BUILT-IN LATENCY PLUGIN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- do - --> Create the plugin Object + --Create the plugin Object local PLatency = _detalhes:NewPluginObject ("Details_Statusbar_Latency", DETAILSPLUGIN_ALWAYSENABLED, "STATUSBAR") - --> Handle events (must have) + --Handle events (must have) function PLatency:OnDetailsEvent (event) return end function PLatency:UpdateLatency() local _, _, _, lagWorld = GetNetStats() - self.text:SetText (_math_floor (lagWorld) .. " ms") + self.text:SetText(_math_floor(lagWorld) .. " ms") end function PLatency:OnDisable() @@ -1228,24 +1228,24 @@ do return new_child end - --> Install + --Install local install = _detalhes:InstallPlugin ("STATUSBAR", Loc ["STRING_PLUGIN_LATENCY"], "Interface\\FriendsFrame\\PlusManz-BattleNet", PLatency, "DETAILS_STATUSBAR_PLUGIN_PLATENCY") - if (type (install) == "table" and install.error) then + if (type(install) == "table" and install.error) then print (install.errortext) return end end ----------> BUILT-IN DURABILITY PLUGIN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +---------BUILT-IN DURABILITY PLUGIN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- do local _GetInventoryItemDurability = GetInventoryItemDurability - --> Create the plugin Object + --Create the plugin Object local PDurability = _detalhes:NewPluginObject ("Details_Statusbar_Latency", DETAILSPLUGIN_ALWAYSENABLED, "STATUSBAR") - --> Handle events (must have) + --Handle events (must have) function PDurability:OnDetailsEvent (event) return end @@ -1262,12 +1262,12 @@ do end if (items == 0) then - self.text:SetText (Loc ["STRING_UPTADING"]) + self.text:SetText(Loc ["STRING_UPTADING"]) return self:ScheduleTimer ("UpdateDurability", 5, self) end percent = percent / items - self.text:SetText (_math_floor (percent) .. "%") + self.text:SetText(_math_floor(percent) .. "%") end function PDurability:OnDisable() @@ -1293,24 +1293,24 @@ do local myframe = _detalhes.StatusBar:CreateChildFrame (instance, "DetailsPDurabilityInstance" .. instance:GetInstanceId(), DEFAULT_CHILD_WIDTH, DEFAULT_CHILD_HEIGHT) local new_child = _detalhes.StatusBar:CreateChildTable (instance, PDurability, myframe) - local texture = myframe:CreateTexture (nil, "overlay") - texture:SetTexture ("Interface\\AddOns\\Details\\images\\icons") - texture:SetPoint ("right", myframe.text.widget, "left", -2, -1) - texture:SetWidth (10) - texture:SetHeight (10) + local texture = myframe:CreateTexture(nil, "overlay") + texture:SetTexture("Interface\\AddOns\\Details\\images\\icons") + texture:SetPoint("right", myframe.text.widget, "left", -2, -1) + texture:SetWidth(10) + texture:SetHeight(10) texture:SetTexCoord (0.216796875, 0.26171875, 0.0078125, 0.052734375) myframe.texture = texture - myframe.widget:SetScript ("OnEvent", function() + myframe.widget:SetScript("OnEvent", function() new_child:UpdateDurability() end) return new_child end - --> Install + --Install local install = _detalhes:InstallPlugin ("STATUSBAR", Loc ["STRING_PLUGIN_DURABILITY"], "Interface\\ICONS\\INV_Chest_Chain_10", PDurability, "DETAILS_STATUSBAR_PLUGIN_PDURABILITY") - if (type (install) == "table" and install.error) then + if (type(install) == "table" and install.error) then print (install.errortext) return end @@ -1318,18 +1318,18 @@ do end ----------> BUILT-IN GOLD PLUGIN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +---------BUILT-IN GOLD PLUGIN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- do - --> Create the plugin Object + --Create the plugin Object local PGold = _detalhes:NewPluginObject ("Details_Statusbar_Gold", DETAILSPLUGIN_ALWAYSENABLED, "STATUSBAR") - --> Handle events (must have) + --Handle events (must have) function PGold:OnDetailsEvent (event) return end function PGold:GoldPluginTick() - for index, child in _ipairs (PGold.childs) do + for index, child in _ipairs(PGold.childs) do local instance = child.instance if (child.enabled and instance:IsEnabled()) then child:UpdateGold() @@ -1338,7 +1338,7 @@ do end function PGold:UpdateGold() - self.text:SetText (_math_floor (GetMoney() / 100 / 100)) + self.text:SetText(_math_floor(GetMoney() / 100 / 100)) end function PGold:OnEnable() @@ -1349,16 +1349,16 @@ do local myframe = _detalhes.StatusBar:CreateChildFrame (instance, "DetailsPGoldInstance" .. instance:GetInstanceId(), DEFAULT_CHILD_WIDTH, DEFAULT_CHILD_HEIGHT) local new_child = _detalhes.StatusBar:CreateChildTable (instance, PGold, myframe) - local texture = myframe:CreateTexture (nil, "overlay") - texture:SetTexture ("Interface\\MONEYFRAME\\UI-GoldIcon") - texture:SetPoint ("right", myframe.text.widget, "left") - texture:SetWidth (12) - texture:SetHeight (12) + local texture = myframe:CreateTexture(nil, "overlay") + texture:SetTexture("Interface\\MONEYFRAME\\UI-GoldIcon") + texture:SetPoint("right", myframe.text.widget, "left") + texture:SetWidth(12) + texture:SetHeight(12) myframe.texture = texture 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 @@ -1368,21 +1368,21 @@ do return new_child end - --> Install + --Install local install = _detalhes:InstallPlugin ("STATUSBAR", Loc ["STRING_PLUGIN_GOLD"], "Interface\\Icons\\INV_Ore_Gold_01", PGold, "DETAILS_STATUSBAR_PLUGIN_PGold") - if (type (install) == "table" and install.error) then + if (type(install) == "table" and install.error) then print (install.errortext) return end end ----------> BUILT-IN TIME PLUGIN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +---------BUILT-IN TIME PLUGIN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- do - --> Create the plugin Object + --Create the plugin Object local PTime = _detalhes:NewPluginObject ("Details_Statusbar_Time", DETAILSPLUGIN_ALWAYSENABLED, "STATUSBAR") - --> Handle events (must have) + --Handle events (must have) function PTime:OnDetailsEvent (event) return end @@ -1390,9 +1390,9 @@ do function PTime:UpdateClock() if (self.options.timeType == 1) then - self.text:SetText (date ("%I:%M %p")) + self.text:SetText(date ("%I:%M %p")) elseif (self.options.timeType == 2) then - self.text:SetText (date ("%H:%M")) + self.text:SetText(date ("%H:%M")) end end @@ -1408,14 +1408,14 @@ do function PTime:ExtraOptions() - --> all widgets need to be placed on a table + --all widgets need to be placed on a table local widgets = {} - --> reference of extra window for custom options + --reference of extra window for custom options local window = _G.DetailsStatusBarOptions2.MyObject - --> build all your widgets ----------------------------------------------------------------------------------------------------------------------------- - _detalhes.gump:NewLabel (window, _, "$parentTimeTypeLabel", "TimeTypeLabel", Loc ["STRING_PLUGIN_CLOCKTYPE"]) - window.TimeTypeLabel:SetPoint (10, -15) + --build all your widgets ----------------------------------------------------------------------------------------------------------------------------- + _detalhes.gump:NewLabel(window, _, "$parentTimeTypeLabel", "TimeTypeLabel", Loc ["STRING_PLUGIN_CLOCKTYPE"]) + window.TimeTypeLabel:SetPoint(10, -15) local onSelectClockType = function(_, child, thistype) child.options.timeType = thistype @@ -1427,25 +1427,25 @@ do } _detalhes.gump:NewDropDown (window, _, "$parentTimeTypeDropdown", "TimeTypeDropdown", 200, 20, function() return clockTypes end, 1) -- func, default - window.TimeTypeDropdown:SetPoint ("left", window.TimeTypeLabel, "right", 2) + window.TimeTypeDropdown:SetPoint("left", window.TimeTypeLabel, "right", 2) ----------------------------------------------------------------------------------------------------------------------------- - --> now we insert all widgets created on widgets table + --now we insert all widgets created on widgets table table.insert (widgets, window.TimeTypeLabel) table.insert (widgets, window.TimeTypeDropdown) - --> after first call we replace this function with widgets table + --after first call we replace this function with widgets table PTime.ExtraOptions = widgets end - --> ExtraOptionsOnOpen is called when options are opened and plugin have custom options - --> here we setup options widgets for get the values of clicked child and also for tell options window what child we are configuring + --ExtraOptionsOnOpen is called when options are opened and plugin have custom options + --here we setup options widgets for get the values of clicked child and also for tell options window what child we are configuring function PTime:ExtraOptionsOnOpen (child) _G.DetailsStatusBarOptions2TimeTypeDropdown.MyObject:SetFixedParameter (child) _G.DetailsStatusBarOptions2TimeTypeDropdown.MyObject:Select (child.options.timeType, true) end - --> Create Plugin Frames (must have) + --Create Plugin Frames (must have) function PTime:CreateChildObject (instance) local myframe = _detalhes.StatusBar:CreateChildFrame (instance, "DetailsPTimeInstance" .. instance:GetInstanceId(), DEFAULT_CHILD_WIDTH, DEFAULT_CHILD_HEIGHT) local new_child = _detalhes.StatusBar:CreateChildTable (instance, PTime, myframe) @@ -1453,20 +1453,20 @@ do return new_child end - --> Install + --Install local install = _detalhes:InstallPlugin ("STATUSBAR", Loc ["STRING_PLUGIN_TIME"], "Interface\\Icons\\Spell_Shadow_LastingAfflictions", PTime, "DETAILS_STATUSBAR_PLUGIN_PTIME") - if (type (install) == "table" and install.error) then + if (type(install) == "table" and install.error) then print (install.errortext) return end end ----------> default options panel ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +---------default options panel ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local window = _detalhes.gump:NewPanel (UIParent, nil, "DetailsStatusBarOptions", nil, 300, 180) tinsert (UISpecialFrames, "DetailsStatusBarOptions") -window:SetPoint ("center", UIParent, "center") +window:SetPoint("center", UIParent, "center") window.locked = false window.close_with_right = true window.child = nil @@ -1474,23 +1474,23 @@ window.instance = nil window:SetFrameStrata ("FULLSCREEN") DetailsFramework:ApplyStandardBackdrop(window) ---window:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16, edgeFile = [[Interface\AddOns\Details\images\border_2]], edgeSize=12}) ---window:SetBackdropColor (0, 0, 0, 0.9) +--window:SetBackdrop({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16, edgeFile = [[Interface\AddOns\Details\images\border_2]], edgeSize=12}) +--window:SetBackdropColor(0, 0, 0, 0.9) local extraWindow = _detalhes.gump:NewPanel (window, nil, "DetailsStatusBarOptions2", "extra", 300, 180) -extraWindow:SetPoint ("left", window, "right") +extraWindow:SetPoint("left", window, "right") extraWindow.close_with_right = true extraWindow.locked = false extraWindow:Hide() DetailsFramework:ApplyStandardBackdrop(extraWindow) -extraWindow:SetHook ("OnHide", function() +extraWindow:SetHook("OnHide", function() window:Hide() end) ---> text style - _detalhes.gump:NewLabel (window, _, "$parentTextStyleLabel", "textstyle", Loc ["STRING_PLUGINOPTIONS_TEXTSTYLE"]) - window.textstyle:SetPoint (10, -15) +--text style + _detalhes.gump:NewLabel(window, _, "$parentTextStyleLabel", "textstyle", Loc ["STRING_PLUGINOPTIONS_TEXTSTYLE"]) + window.textstyle:SetPoint(10, -15) local onSelectTextStyle = function(_, child, style) @@ -1514,14 +1514,14 @@ end) {value = 3, label = Loc ["STRING_PLUGINOPTIONS_NOFORMAT"] .. " (105500)", onclick = onSelectTextStyle}} _detalhes.gump:NewDropDown (window, _, "$parentTextStyleDropdown", "textstyleDropdown", 200, 20, function() return textStyle end, 1) -- func, default - window.textstyleDropdown:SetPoint ("left", window.textstyle, "right", 2) + window.textstyleDropdown:SetPoint("left", window.textstyle, "right", 2) ---> text color - _detalhes.gump:NewLabel (window, _, "$parentTextColorLabel", "textcolor", Loc ["STRING_PLUGINOPTIONS_TEXTCOLOR"]) - window.textcolor:SetPoint (10, -35) +--text color + _detalhes.gump:NewLabel(window, _, "$parentTextColorLabel", "textcolor", Loc ["STRING_PLUGINOPTIONS_TEXTCOLOR"]) + window.textcolor:SetPoint(10, -35) local selectedColor = function() local r, g, b, a = ColorPickerFrame:GetColorRGB() - window.textcolortexture:SetTexture (r, g, b, a) + window.textcolortexture:SetTexture(r, g, b, a) --_detalhes.StatusBar:ApplyOptions (window.child, "textcolor", {r, g, b, a}) local color = {r, g, b, a} @@ -1531,7 +1531,7 @@ end) end local canceledColor = function() local r, g, b, a = unpack (ColorPickerFrame.previousValues) - window.textcolortexture:SetTexture (r, g, b, a) + window.textcolortexture:SetTexture(r, g, b, a) local color = {r, g, b, a} _detalhes.StatusBar:ApplyOptions (window.instance.StatusBar.left, "textcolor", color) _detalhes.StatusBar:ApplyOptions (window.instance.StatusBar.center, "textcolor", color) @@ -1543,35 +1543,35 @@ end) ColorPickerFrame.opacityFunc = nil ColorPickerFrame.hasOpacity = false ColorPickerFrame.previousValues = window.child.options.textColor - ColorPickerFrame:SetParent (window.widget) + ColorPickerFrame:SetParent(window.widget) ColorPickerFrame:SetColorRGB (unpack (window.child.options.textColor)) ColorPickerFrame:Show() end _detalhes.gump:NewImage (window, nil, 160, 16, nil, nil, "textcolortexture", "$parentTextColorTexture") - window.textcolortexture:SetPoint ("left", window.textcolor, "right", 2) - window.textcolortexture:SetTexture (1, 1, 1) + window.textcolortexture:SetPoint("left", window.textcolor, "right", 2) + window.textcolortexture:SetTexture(1, 1, 1) _detalhes.gump:NewButton (window, _, "$parentTextColorButton", "textcolorbutton", 160, 20, colorpick) - window.textcolorbutton:SetPoint ("left", window.textcolor, "right", 2) + window.textcolorbutton:SetPoint("left", window.textcolor, "right", 2) --window.textcolorbutton:InstallCustomTexture() ---> text size - _detalhes.gump:NewLabel (window, _, "$parentFontSizeLabel", "fonsizeLabel", Loc ["STRING_PLUGINOPTIONS_TEXTSIZE"]) - window.fonsizeLabel:SetPoint (10, -55) +--text size + _detalhes.gump:NewLabel(window, _, "$parentFontSizeLabel", "fonsizeLabel", Loc ["STRING_PLUGINOPTIONS_TEXTSIZE"]) + window.fonsizeLabel:SetPoint(10, -55) -- _detalhes.gump:NewSlider (window, _, "$parentSliderFontSize", "fonsizeSlider", 170, 20, 7, 20, 1, 1) - window.fonsizeSlider:SetPoint ("left", window.fonsizeLabel, "right", 2) + 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) _detalhes.StatusBar:ApplyOptions (window.instance.StatusBar.right, "textsize", amount) end) ---> text font +--text font local onSelectFont = function(_, child, fontName) --_detalhes.StatusBar:ApplyOptions (child, "textface", fontName) @@ -1590,41 +1590,41 @@ end) return fontTable end - _detalhes.gump:NewLabel (window, _, "$parentFontFaceLabel", "fontfaceLabel", Loc ["STRING_PLUGINOPTIONS_FONTFACE"]) - window.fontfaceLabel:SetPoint (10, -75) + _detalhes.gump:NewLabel(window, _, "$parentFontFaceLabel", "fontfaceLabel", Loc ["STRING_PLUGINOPTIONS_FONTFACE"]) + window.fontfaceLabel:SetPoint(10, -75) -- _detalhes.gump:NewDropDown (window, _, "$parentFontDropdown", "fontDropdown", 170, 20, buildFontMenu, nil) - window.fontDropdown:SetPoint ("left", window.fontfaceLabel, "right", 2) + window.fontDropdown:SetPoint("left", window.fontfaceLabel, "right", 2) window:Hide() ---> align mod X - _detalhes.gump:NewLabel (window, _, "$parentAlignXLabel", "alignXLabel", Loc ["STRING_PLUGINOPTIONS_TEXTALIGN_X"]) - window.alignXLabel:SetPoint (10, -115) +--align mod X + _detalhes.gump:NewLabel(window, _, "$parentAlignXLabel", "alignXLabel", Loc ["STRING_PLUGINOPTIONS_TEXTALIGN_X"]) + window.alignXLabel:SetPoint(10, -115) -- _detalhes.gump:NewSlider (window, _, "$parentSliderAlignX", "alignXSlider", 160, 20, -20, 20, 1, 0) - window.alignXSlider:SetPoint ("left", window.alignXLabel, "right", 2) + 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) ---> align modY - _detalhes.gump:NewLabel (window, _, "$parentAlignYLabel", "alignYLabel", Loc ["STRING_PLUGINOPTIONS_TEXTALIGN_Y"]) - window.alignYLabel:SetPoint (10, -135) +--align modY + _detalhes.gump:NewLabel(window, _, "$parentAlignYLabel", "alignYLabel", Loc ["STRING_PLUGINOPTIONS_TEXTALIGN_Y"]) + window.alignYLabel:SetPoint(10, -135) -- _detalhes.gump:NewSlider (window, _, "$parentSliderAlignY", "alignYSlider", 160, 20, -10, 10, 1, 0) - window.alignYSlider:SetPoint ("left", window.alignYLabel, "right", 2) + 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) ---> right click to close +--right click to close local c = window:CreateRightClickLabel ("short") - c:SetPoint ("bottomleft", window, "bottomleft", 8, 5) + c:SetPoint("bottomleft", window, "bottomleft", 8, 5) ---> open options +--open options function _detalhes.StatusBar:OpenOptionsForChild (child) window.child = child @@ -1635,22 +1635,22 @@ end) _G.DetailsStatusBarOptionsTextColorTexture:SetColorTexture (child.options.textColor[1], child.options.textColor[2], child.options.textColor[3], child.options.textColor[4]) _G.DetailsStatusBarOptionsSliderFontSize.MyObject:SetFixedParameter (child) - _G.DetailsStatusBarOptionsSliderFontSize.MyObject:SetValue (child.options.textSize) + _G.DetailsStatusBarOptionsSliderFontSize.MyObject:SetValue(child.options.textSize) _G.DetailsStatusBarOptionsFontDropdown.MyObject:SetFixedParameter (child) _G.DetailsStatusBarOptionsFontDropdown.MyObject:Select (child.options.textFace) _G.DetailsStatusBarOptionsSliderAlignX.MyObject:SetFixedParameter (child) - _G.DetailsStatusBarOptionsSliderAlignX.MyObject:SetValue (child.options.textXMod) + _G.DetailsStatusBarOptionsSliderAlignX.MyObject:SetValue(child.options.textXMod) _G.DetailsStatusBarOptionsSliderAlignY.MyObject:SetFixedParameter (child) - _G.DetailsStatusBarOptionsSliderAlignY.MyObject:SetValue (child.options.textYMod) + _G.DetailsStatusBarOptionsSliderAlignY.MyObject:SetValue(child.options.textYMod) _G.DetailsStatusBarOptions:Show() if (child.ExtraOptions) then - if (type (child.ExtraOptions) == "function") then + if (type(child.ExtraOptions) == "function") then child.ExtraOptions() end diff --git a/core/plugins_toolbar.lua b/core/plugins_toolbar.lua index 2fef2465..fd6ab687 100644 --- a/core/plugins_toolbar.lua +++ b/core/plugins_toolbar.lua @@ -6,53 +6,53 @@ local _ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> local pointers +--local pointers -- none ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> details api functions +--details api functions - --> create a button which will be displayed on tooltip + --create a button which will be displayed on tooltip function _detalhes.ToolBar:NewPluginToolbarButton (func, icon, pluginname, tooltip, w, h, framename, menu_function) - --> random name if nameless + --random name if nameless if (not framename) then framename = "DetailsToolbarButton" .. math.random (1, 100000) end - --> create button from template - local button = CreateFrame ("button", framename, _detalhes.listener, "DetailsToolbarButton") + --create button from template + local button = CreateFrame("button", framename, _detalhes.listener, "DetailsToolbarButton") - --> sizes + --sizes if (w) then - button:SetWidth (w) + button:SetWidth(w) end if (h) then - button:SetHeight (h) + button:SetHeight(h) end button.x = 0 button.y = 0 - --> tooltip and function on click + --tooltip and function on click button.tooltip = tooltip button.menu = menu_function - button:SetScript ("OnClick", func) + button:SetScript("OnClick", func) - --> textures - button:SetNormalTexture (icon) - button:SetPushedTexture (icon) + --textures + button:SetNormalTexture(icon) + button:SetPushedTexture(icon) button:SetDisabledTexture (icon) - button:SetHighlightTexture (icon, "ADD") + button:SetHighlightTexture(icon, "ADD") button.__icon = icon button.__name = pluginname - --> blizzard built-in animation - --local FourCornerAnimeFrame = CreateFrame ("frame", framename.."Blink", button) --, "IconIntroAnimTemplate" --stop using 'IconIntroAnimTemplate' as older versions of the game doesn't have it - --FourCornerAnimeFrame:SetPoint ("center", button) - --FourCornerAnimeFrame:SetWidth (w or 14) - --FourCornerAnimeFrame:SetHeight (w or 14) - --FourCornerAnimeFrame.glow:SetScript ("OnFinished", nil) + --blizzard built-in animation + --local FourCornerAnimeFrame = CreateFrame("frame", framename.."Blink", button) --, "IconIntroAnimTemplate" --stop using 'IconIntroAnimTemplate' as older versions of the game doesn't have it + --FourCornerAnimeFrame:SetPoint("center", button) + --FourCornerAnimeFrame:SetWidth(w or 14) + --FourCornerAnimeFrame:SetHeight(w or 14) + --FourCornerAnimeFrame.glow:SetScript("OnFinished", nil) --button.blink = FourCornerAnimeFrame _detalhes.ToolBar.AllButtons [#_detalhes.ToolBar.AllButtons+1] = button @@ -60,12 +60,12 @@ return button end - --> show your plugin icon on tooltip + --show your plugin icon on tooltip function _detalhes:ShowToolbarIcon (Button, Effect) local LastIcon - --> get the lower number instance + --get the lower number instance local lower_instance = _detalhes:GetLowerInstanceNumber() if (not lower_instance) then return @@ -74,7 +74,7 @@ local instance = _detalhes:GetInstance (lower_instance) if (#_detalhes.ToolBar.Shown > 0) then - --> already shown + --already shown if (_detalhes:tableIN (_detalhes.ToolBar.Shown, Button)) then return end @@ -84,7 +84,7 @@ end _detalhes.ToolBar.Shown [#_detalhes.ToolBar.Shown+1] = Button - Button:SetPoint ("left", LastIcon.widget or LastIcon, "right", Button.x, Button.y) + Button:SetPoint("left", LastIcon.widget or LastIcon, "right", Button.x, Button.y) Button:Show() @@ -95,7 +95,7 @@ end if (Effect) then - if (type (Effect) == "string") then + if (type(Effect) == "string") then if (Effect == "blink") then --Button.blink.glow:Play() --.blink and .glow doesn't exists anymore due to removal of the template 'IconIntroAnimTemplate' elseif (Effect == "star") then @@ -111,46 +111,46 @@ return true end - --> hide your plugin icon from toolbar + --hide your plugin icon from toolbar function _detalhes:HideToolbarIcon (Button) local index = _detalhes:tableIN (_detalhes.ToolBar.Shown, Button) if (not index) then - --> current not shown + --current not shown return end Button:Hide() table.remove (_detalhes.ToolBar.Shown, index) - --> reorganize icons + --reorganize icons _detalhes.ToolBar:ReorganizeIcons (true) end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> internal functions +--internal functions do - local PluginDescPanel = CreateFrame ("frame", "DetailsPluginDescPanel", UIParent) + local PluginDescPanel = CreateFrame("frame", "DetailsPluginDescPanel", UIParent) PluginDescPanel:SetFrameStrata ("tooltip") PluginDescPanel:Hide() - PluginDescPanel:SetWidth (205) + PluginDescPanel:SetWidth(205) PluginDescPanel.BackdropTable = {} - local background = PluginDescPanel:CreateTexture (nil, "artwork") - background:SetPoint ("topleft", 0, 0) - background:SetPoint ("bottomright", 0, 0) + local background = PluginDescPanel:CreateTexture(nil, "artwork") + background:SetPoint("topleft", 0, 0) + background:SetPoint("bottomright", 0, 0) PluginDescPanel.background = background - local icon, title, desc = PluginDescPanel:CreateTexture (nil, "overlay"), PluginDescPanel:CreateFontString (nil, "overlay", "GameFontNormal"), PluginDescPanel:CreateFontString (nil, "overlay", "GameFontNormal") - icon:SetPoint ("topleft", 10, -10) - icon:SetSize (16, 16) - title:SetPoint ("left", icon, "right", 2, 0) - desc:SetPoint ("topleft", 13, -30) - desc:SetWidth (180) - desc:SetJustifyH ("left") - _detalhes:SetFontColor (desc, "white") + local icon, title, desc = PluginDescPanel:CreateTexture(nil, "overlay"), PluginDescPanel:CreateFontString (nil, "overlay", "GameFontNormal"), PluginDescPanel:CreateFontString (nil, "overlay", "GameFontNormal") + icon:SetPoint("topleft", 10, -10) + icon:SetSize(16, 16) + title:SetPoint("left", icon, "right", 2, 0) + desc:SetPoint("topleft", 13, -30) + desc:SetWidth(180) + desc:SetJustifyH("left") + _detalhes:SetFontColor(desc, "white") PluginDescPanel.icon = icon PluginDescPanel.title = title @@ -161,7 +161,7 @@ end local lower_instance = _detalhes:GetLowerInstanceNumber() if (lower_instance) then - _detalhes.OnEnterMainWindow (_detalhes:GetInstance (lower_instance), button, 3) + _detalhes.OnEnterMainWindow(_detalhes:GetInstance (lower_instance), button, 3) end if (button.tooltip) then @@ -171,13 +171,13 @@ 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 if (not GameCooltipFrame1:IsMouseOver() and not button:IsMouseOver()) then GameCooltip2:Hide() - button:SetScript ("OnUpdate", nil) + button:SetScript("OnUpdate", nil) return end next_check = 0.8 @@ -186,7 +186,7 @@ end --disable the hider menu if the cooltip is required in another place hooksecurefunc (GameCooltip2, "ShowCooltip", function() - button:SetScript ("OnUpdate", nil) + button:SetScript("OnUpdate", nil) end) return @@ -196,13 +196,13 @@ end local plugin_object = _detalhes:GetPlugin (button.__name) local f = DetailsPluginDescPanel - f.icon:SetTexture (button.__icon) - f.title:SetText (button.__name) - f.desc:SetText (plugin_object:GetPluginDescription()) + f.icon:SetTexture(button.__icon) + f.title:SetText(button.__name) + f.desc:SetText(plugin_object:GetPluginDescription()) _detalhes:SetFontSize (f.desc, _detalhes.font_sizes.menus) _detalhes:SetFontFace (f.desc, _detalhes.font_faces.menus) - --f.background:SetTexture (_detalhes.tooltip.menus_bg_texture) + --f.background:SetTexture(_detalhes.tooltip.menus_bg_texture) f.background:SetTexCoord (unpack (_detalhes.tooltip.menus_bg_coords)) f.background:SetVertexColor (unpack (_detalhes.tooltip.menus_bg_color)) --f.background:SetDesaturated (true) @@ -213,12 +213,12 @@ end f.BackdropTable.edgeSize = 1 --_detalhes.tooltip_backdrop.edgeSize f.BackdropTable.tileSize = _detalhes.tooltip_backdrop.tileSize - f:SetBackdrop (f.BackdropTable) - local r, g, b, a = _detalhes.gump:ParseColors (_detalhes.tooltip_border_color) - f:SetBackdropBorderColor (r, g, b, a) + f:SetBackdrop(f.BackdropTable) + local r, g, b, a = _detalhes.gump:ParseColors(_detalhes.tooltip_border_color) + f:SetBackdropBorderColor(r, g, b, a) - f:SetHeight (40 + f.desc:GetStringHeight()) - f:SetPoint ("bottom", button, "top", 0, 10) + f:SetHeight(40 + f.desc:GetStringHeight()) + f:SetPoint("bottom", button, "top", 0, 10) f:Show() --SharedMedia:Fetch ("font", "Friz Quadrata TT") @@ -229,7 +229,7 @@ end local lower_instance = _detalhes:GetLowerInstanceNumber() if (lower_instance) then - _detalhes.OnLeaveMainWindow (_detalhes:GetInstance (lower_instance), button, 3) + _detalhes.OnLeaveMainWindow(_detalhes:GetInstance (lower_instance), button, 3) end if (button.tooltip) then @@ -239,7 +239,7 @@ end _detalhes:RegisterEvent (_detalhes.ToolBar, "DETAILS_INSTANCE_OPEN", "OnInstanceOpen") _detalhes:RegisterEvent (_detalhes.ToolBar, "DETAILS_INSTANCE_CLOSE", "OnInstanceClose") - _detalhes.ToolBar.Enabled = true --> must have this member or wont receive the event + _detalhes.ToolBar.Enabled = true --must have this member or wont receive the event _detalhes.ToolBar.__enabled = true function _detalhes.ToolBar:OnInstanceOpen() @@ -250,11 +250,11 @@ end end function _detalhes.ToolBar:ReorganizeIcons (just_refresh) - --> get the lower number instance + --get the lower number instance local lower_instance = _detalhes:GetLowerInstanceNumber() if (not lower_instance) then - for _, ThisButton in ipairs (_detalhes.ToolBar.Shown) do + for _, ThisButton in ipairs(_detalhes.ToolBar.Shown) do ThisButton:Hide() end return diff --git a/core/timemachine.lua b/core/timemachine.lua index 4c82e548..46bde8db 100644 --- a/core/timemachine.lua +++ b/core/timemachine.lua @@ -5,7 +5,7 @@ local _ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> local pointers +--local pointers local _table_insert = table.insert --lua local local _ipairs = ipairs --lua local @@ -18,25 +18,25 @@ local timeMachine = _detalhes.timeMachine --details local ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> constants +--constants local _tempo = _time() ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> core +--core timeMachine.ligada = false local calc_for_pvp = function(self) for tipo, tabela in _pairs (self.tabelas) do - for nome, jogador in _ipairs (tabela) do + for nome, jogador in _ipairs(tabela) do if (jogador) then - if (jogador.last_event+3 > _tempo) then --> okey o jogador esta dando dps - if (jogador.on_hold) then --> o dps estava pausado, retornar a ativa + if (jogador.last_event+3 > _tempo) then --okey o jogador esta dando dps + if (jogador.on_hold) then --o dps estava pausado, retornar a ativa jogador:HoldOn (false) end else - if (not jogador.on_hold) then --> n�o ta pausado, precisa por em pausa - --> verifica se esta castando alguma coisa que leve + que 3 segundos + if (not jogador.on_hold) then --n�o ta pausado, precisa por em pausa + --verifica se esta castando alguma coisa que leve + que 3 segundos jogador:HoldOn (true) end end @@ -47,15 +47,15 @@ local calc_for_pve = function(self) for tipo, tabela in _pairs (self.tabelas) do - for nome, jogador in _ipairs (tabela) do + for nome, jogador in _ipairs(tabela) do if (jogador) then - if (jogador.last_event+10 > _tempo) then --> okey o jogador esta dando dps - if (jogador.on_hold) then --> o dps estava pausado, retornar a ativa + if (jogador.last_event+10 > _tempo) then --okey o jogador esta dando dps + if (jogador.on_hold) then --o dps estava pausado, retornar a ativa jogador:HoldOn (false) end else - if (not jogador.on_hold) then --> n�o ta pausado, precisa por em pausa - --> verifica se esta castando alguma coisa que leve + que 10 segundos + if (not jogador.on_hold) then --n�o ta pausado, precisa por em pausa + --verifica se esta castando alguma coisa que leve + que 10 segundos jogador:HoldOn (true) end end @@ -79,10 +79,10 @@ function timeMachine:Ligar() self.atualizador = self:ScheduleRepeatingTimer ("Core", 1) self.ligada = true - self.tabelas = {{}, {}} --> 1 dano 2 cura + self.tabelas = {{}, {}} --1 dano 2 cura local danos = _detalhes.tabela_vigente[1]._ActorTable - for _, jogador in _ipairs (danos) do + for _, jogador in _ipairs(danos) do if (jogador.dps_started) then jogador:RegistrarNaTimeMachine() end @@ -101,7 +101,7 @@ function timeMachine:Reiniciar() table.wipe (self.tabelas[1]) table.wipe (self.tabelas[2]) - self.tabelas = {{}, {}} --> 1 dano 2 cura + self.tabelas = {{}, {}} --1 dano 2 cura end function _detalhes:DesregistrarNaTimeMachine() @@ -130,10 +130,10 @@ end function _detalhes:ManutencaoTimeMachine() - for tipo, tabela in _ipairs (timeMachine.tabelas) do + for tipo, tabela in _ipairs(timeMachine.tabelas) do local t = {} local removed = 0 - for index, jogador in _ipairs (tabela) do + for index, jogador in _ipairs(tabela) do if (jogador) then t [#t+1] = jogador jogador.timeMachine = #t @@ -153,14 +153,14 @@ function _detalhes:Tempo() if (self.pvp) then - --> pvp timer - if (self.end_time) then --> o tempo do jogador esta trancado + --pvp timer + if (self.end_time) then --o tempo do jogador esta trancado local t = self.end_time - self.start_time if (t < 3) then t = 3 end return t - elseif (self.on_hold) then --> o tempo esta em pausa + elseif (self.on_hold) then --o tempo esta em pausa local t = self.delay - self.start_time if (t < 3) then t = 3 @@ -183,14 +183,14 @@ return t end else - --> pve timer - if (self.end_time) then --> o tempo do jogador esta trancado + --pve timer + if (self.end_time) then --o tempo do jogador esta trancado local t = self.end_time - self.start_time if (t < 10) then t = 10 end return t - elseif (self.on_hold) then --> o tempo esta em pausa + elseif (self.on_hold) then --o tempo esta em pausa local t = self.delay - self.start_time if (t < 10) then t = 10 @@ -231,19 +231,19 @@ self.end_time = _tempo end - --> diz se o dps deste jogador esta em pausa + --diz se o dps deste jogador esta em pausa function _detalhes:HoldOn (pausa) if (pausa == nil) then return self.on_hold --retorna se o dps esta aberto ou fechado para este jogador - elseif (pausa) then --> true - colocar como inativo - self.delay = _math_floor (self.last_event) --_tempo - 10 + elseif (pausa) then --true - colocar como inativo + self.delay = _math_floor(self.last_event) --_tempo - 10 if (self.delay < self.start_time) then self.delay = self.start_time end self.on_hold = true - else --> false - retornar a atividade + else --false - retornar a atividade local diff = _tempo - self.delay - 1 if (diff > 0) then self.start_time = self.start_time + diff diff --git a/core/util.lua b/core/util.lua index 7c4c6ad7..fa6cff0b 100644 --- a/core/util.lua +++ b/core/util.lua @@ -4,7 +4,7 @@ local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) local _ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> local pointers +--local pointers local upper = string.upper --lua local local _ipairs = ipairs --lua local @@ -32,7 +32,7 @@ local gump = _detalhes.gump --details local ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> fade handler +--fade handler Details.FadeHandler = { frames = {} @@ -204,13 +204,13 @@ elseif (upper(animationType) == "OUT") then --show the frame - if (frame:GetAlpha() == 1 and not frame.hidden and not frame.fading_in) then --> ja esta na tela + if (frame:GetAlpha() == 1 and not frame.hidden and not frame.fading_in) then --ja esta na tela return - elseif (frame.fading_out) then --> j� ta com fading out + elseif (frame.fading_out) then --j� ta com fading out return end - if (frame.fading_in) then --> se tiver uma anima��o de hidar em andamento se for true + if (frame.fading_in) then --se tiver uma anima��o de hidar em andamento se for true frame.fading_in = false end @@ -286,9 +286,9 @@ end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> details api functions +--details api functions - --> get the npc id from guid + --get the npc id from guid function _detalhes:GetNpcIdFromGuid (guid) local NpcId = _select ( 6, _strsplit ( "-", guid ) ) if (NpcId) then @@ -298,7 +298,7 @@ end function _detalhes:GetSourceFromNpcId (npcId) - for index, container in ipairs (_detalhes.tabela_vigente) do + for index, container in ipairs(_detalhes.tabela_vigente) do if (index <= 4) then local t = container._ActorTable for i = 1, #t do @@ -335,7 +335,7 @@ return playername, playerclass, deathtime, deathcombattime, deathtimestring, playermaxhealth, deathevents, lastcooldown end - --> get the fractional number representing the alphabetical letter + --get the fractional number representing the alphabetical letter function _detalhes:GetOrderNumber(who_name) --local name = upper (who_name .. "zz") --local byte1 = _math_abs (_string_byte (name, 2)-91)/1000000 @@ -345,7 +345,7 @@ --/script print (tonumber (4/1000000)) - 4e-006 --0.000004 - --> set all table keys to lower + --set all table keys to lower local temptable = {} function _detalhes:LowerizeKeys (_table) for key, value in _pairs (_table) do @@ -360,7 +360,7 @@ --krKR by @yuk6196 (http://wow.curseforge.com/profiles/yuk6196) function _detalhes:UseEastAsianNumericalSystem() - --> try to auto detect the language + --try to auto detect the language local symbol_1K, symbol_10K, symbol_1B if (LibStub("AceLocale-3.0"):NewLocale ("Details", "koKR")) then --Korea symbol_1K, symbol_10K, symbol_1B = "천", "만", "억" @@ -370,15 +370,15 @@ symbol_1K, symbol_10K, symbol_1B = "千", "萬", "億" end - --> override, force details! to use symbols for a specific language. - --> usage: _detalhes:SetNumericalSystemOverride (language) language can be: "kr", "cn", "tw" + --override, force details! to use symbols for a specific language. + --usage: _detalhes:SetNumericalSystemOverride (language) language can be: "kr", "cn", "tw" - --> just in case the user mess up something - if (type (_detalhes.numerical_system_symbols) ~= "string") then + --just in case the user mess up something + if (type(_detalhes.numerical_system_symbols) ~= "string") then _detalhes.numerical_system_symbols = "auto" end - --> do the override + --do the override if (_detalhes.numerical_system_symbols ~= "auto") then local locale = string.lower (_detalhes.numerical_system_symbols) @@ -392,8 +392,8 @@ end if (not symbol_1K) then - --> if a english client is trying to use east asian numeral system and there is no override, let's just use the chinese as default. - --> if the user is from kr or tw and want to use english client, an override must be used. + --if a english client is trying to use east asian numeral system and there is no override, let's just use the chinese as default. + --if the user is from kr or tw and want to use english client, an override must be used. symbol_1K, symbol_10K, symbol_1B = "千", "万", "亿" end @@ -414,7 +414,7 @@ elseif (numero > 999999) then return _string_format ("%.2f", numero/10000) .. symbol_10K elseif (numero > 99999) then - return _math_floor (numero/10000) .. symbol_10K + return _math_floor(numero/10000) .. symbol_10K elseif (numero > 9999) then return _string_format ("%.1f", (numero/10000)) .. symbol_10K elseif (numero > 999) then @@ -423,7 +423,7 @@ return _string_format ("%.1f", numero) end - --> short numbers no numbers after comma + --short numbers no numbers after comma function _detalhes:ToK0 (numero) if (numero > 100000000) then return _string_format ("%.0f", numero/100000000) .. symbol_1B @@ -452,7 +452,7 @@ elseif (numero > 999999) then return _string_format ("%.2f", numero/10000) .. symbol_10K elseif (numero > 99999) then - return _math_floor (numero/10000) .. symbol_10K + return _math_floor(numero/10000) .. symbol_10K elseif (numero > 9999) then return _string_format ("%.1f", (numero/10000)) .. symbol_10K elseif (numero > 999) then @@ -461,7 +461,7 @@ return _string_format ("%.1f", numero) end - --> short numbers no numbers after comma + --short numbers no numbers after comma function _detalhes:ToK0Min (numero) if (numero > 100000000) then return _string_format ("%.0f", numero/100000000) .. symbol_1B @@ -473,7 +473,7 @@ return _string_format ("%.0f", numero) end - --> short numbers no numbers after comma + --short numbers no numbers after comma function _detalhes:ToKReport (numero) if (numero > 100000000) then return _string_format ("%.2f", numero/100000000) .. symbol_1B @@ -486,7 +486,7 @@ end function _detalhes:Format (n, custom) - n = _math_floor (n) + n = _math_floor(n) if (custom) then if (n > 99999999) then return _string_format (custom, n/100000000) .. symbol_1B @@ -502,15 +502,15 @@ end end - --> no changes + --no changes function _detalhes:NoToK (numero) - return _math_floor (numero) + return _math_floor(numero) end -- thanks http://richard.warburton.it function _detalhes:comma_value (n) if (not n) then return "0" end - n = _math_floor (n) + n = _math_floor(n) if (n == 0) then return "0" end @@ -536,7 +536,7 @@ end function _detalhes:UseWestNumericalSystem() - --> short numbers + --short numbers function _detalhes:ToK (numero) if (numero > 999999999) then return format ("%.2f", numero/1000000000) .. "B" @@ -555,7 +555,7 @@ elseif (numero > 999999) then return _string_format ("%.2f", numero/1000000) .. "M" elseif (numero > 99999) then - return _math_floor (numero/1000) .. "K" + return _math_floor(numero/1000) .. "K" elseif (numero > 999) then return _string_format ("%.1f", (numero/1000)) .. "K" end @@ -563,7 +563,7 @@ return _string_format ("%.0f", numero) end - --> short numbers no numbers after comma + --short numbers no numbers after comma function _detalhes:ToK0 (numero) if (numero > 999999999) then return format ("%.2f", numero/1000000000) .. "B" @@ -590,7 +590,7 @@ if (numero > 999999) then return _string_format ("%.2f", numero/1000000) .. "m" elseif (numero > 99999) then - return _math_floor (numero/1000) .. "k" + return _math_floor(numero/1000) .. "k" elseif (numero > 999) then return _string_format ("%.1f", (numero/1000)) .. "k" end @@ -598,7 +598,7 @@ return _string_format ("%.0f", numero) end - --> short numbers no numbers after comma + --short numbers no numbers after comma function _detalhes:ToK0Min (numero) if (numero > 1000000) then return _string_format ("%.0f", numero/1000000) .. "m" @@ -609,7 +609,7 @@ return _string_format ("%.0f", numero) end - --> short numbers no numbers after comma + --short numbers no numbers after comma function _detalhes:ToKReport (numero) if (numero > 1000000) then return _string_format ("%.2f", numero/1000000) .. "M" @@ -621,7 +621,7 @@ end function _detalhes:Format (n, custom) - n = _math_floor (n) + n = _math_floor(n) if (custom) then if (n > 999999) then return _string_format (custom, n/1000000) .. "M" @@ -635,15 +635,15 @@ end end - --> no changes + --no changes function _detalhes:NoToK (numero) - return _math_floor (numero) + return _math_floor(numero) end -- thanks http://richard.warburton.it function _detalhes:comma_value (n) if (not n) then return "0" end - n = _math_floor (n) + n = _math_floor(n) if (n == 0) then return "0" end @@ -669,7 +669,7 @@ -- end - --> load western as default, the proper method is loaded within the profile + --load western as default, the proper method is loaded within the profile _detalhes:UseWestNumericalSystem() function _detalhes:GetCurrentToKFunction() @@ -677,7 +677,7 @@ end ------------------------------------------------------------------------------------------------------------ ---> numerical system +--numerical system function _detalhes:SetNumericalSystemOverride (language) if (not language) then @@ -720,7 +720,7 @@ --------end of ToK functions---- - --> replacing data for custom texts + --replacing data for custom texts _detalhes.string = {} local function_cache = {} @@ -731,7 +731,7 @@ return arguments_cache [tonumber(i)] end local run_function = function(str) - --> cache functions + --cache functions local func, errortext = function_cache [str] if (not func) then func = loadstring (str) @@ -763,7 +763,7 @@ return (str:gsub ("{data(%d+)}", replace_arg):gsub ("{func(.-)}", run_function)) end - --> remove a index from a hash table + --remove a index from a hash table function _detalhes:tableRemove (tabela, indexName) local newtable = {} for hash, value in _pairs (tabela) do @@ -774,9 +774,9 @@ return newtable end - --> return if the numeric table have an object + --return if the numeric table have an object function _detalhes:tableIN (tabela, objeto) - for index, valor in _ipairs (tabela) do + for index, valor in _ipairs(tabela) do if (valor == objeto) then return index end @@ -784,7 +784,7 @@ return false end - --> reverse numerical table + --reverse numerical table function _detalhes:reverse_table (t) local new = {} local index = 1 @@ -810,7 +810,7 @@ function _detalhes.table.copy (t1, t2) for key, value in pairs (t2) do - if (type (value) == "table") then + if (type(value) == "table") then t1 [key] = Details.CopyTable (value) else t1 [key] = value @@ -821,7 +821,7 @@ function _detalhes.table.deploy (t1, t2) for key, value in pairs (t2) do - if (type (value) == "table") then + if (type(value) == "table") then t1 [key] = t1 [key] or {} _detalhes.table.deploy (t1 [key], t2 [key]) elseif (t1 [key] == nil) then @@ -832,7 +832,7 @@ function _detalhes.table.overwrite (t1, t2) for key, value in pairs (t2) do - if (type (value) == "table") then + if (type(value) == "table") then t1 [key] = t1 [key] or {} _detalhes.table.overwrite (t1 [key], t2 [key]) else @@ -858,18 +858,18 @@ local tpe = type (value) - if (type (key) == "function") then + if (type(key) == "function") then key = "#function#" - elseif (type (key) == "table") then + elseif (type(key) == "table") then key = "#table#" end - if (type (key) ~= "string" and type (key) ~= "number") then + if (type(key) ~= "string" and type (key) ~= "number") then key = "unknown?" end if (tpe == "table") then - if (type (key) == "number") then + if (type(key) == "number") then s = s .. space .. "[" .. key .. "] = |cFFa9ffa9table {|r\n" else s = s .. space .. "[\"" .. key .. "\"] = |cFFa9ffa9table {|r\n" @@ -916,13 +916,13 @@ if (value < 50) then r = 255 else - r = _math_floor ( 255 - (value * 2 - 100) * 255 / 100) + r = _math_floor( 255 - (value * 2 - 100) * 255 / 100) end if (value > 50) then g = 255 else - g = _math_floor ( (value * 2) * 255 / 100) + g = _math_floor( (value * 2) * 255 / 100) end if (inverted) then @@ -932,19 +932,19 @@ end end - --> unpack more than 1 table + --unpack more than 1 table -- http://www.dzone.com/snippets/lua-unpack-multiple-tables function _detalhes:unpacks (...) local values = {} for i = 1, select ('#', ...) do - for _, value in _ipairs (select (i, ...)) do + for _, value in _ipairs(select (i, ...)) do values[ #values + 1] = value end end return unpack (values) end - --> trim http://lua-users.org/wiki/StringTrim + --trim http://lua-users.org/wiki/StringTrim function _detalhes:trim (s) local from = s:match"^%s*()" return from > #s and "" or s:match(".*%S", from) @@ -1011,18 +1011,18 @@ do end end - --> scale + --scale function _detalhes:Scale (rangeMin, rangeMax, scaleMin, scaleMax, x) return 1 + (x - rangeMin) * (scaleMax - scaleMin) / (rangeMax - rangeMin) end - --> font color - function _detalhes:SetFontColor (fontString, r, g, b, a) - r, g, b, a = gump:ParseColors (r, g, b, a) + --font color + function _detalhes:SetFontColor(fontString, r, g, b, a) + r, g, b, a = gump:ParseColors(r, g, b, a) fontString:SetTextColor (r, g, b, a) end - --> font size + --font size function _detalhes:SetFontSize (fontString, ...) local fonte, _, flags = fontString:GetFont() fontString:SetFont (fonte, _math_max (...), flags) @@ -1032,7 +1032,7 @@ end return size end - --> font face + --font face function _detalhes:SetFontFace (fontString, fontface) local _, size, flags = fontString:GetFont() fontString:SetFont (fontface, size, flags) @@ -1042,11 +1042,11 @@ end return fontface end - --> font outline + --font outline function _detalhes:SetFontOutline (fontString, outline) local fonte, size = fontString:GetFont() if (outline) then - if (type (outline) == "boolean" and outline) then + if (type(outline) == "boolean" and outline) then outline = "OUTLINE" elseif (outline == 1) then outline = "OUTLINE" @@ -1081,7 +1081,7 @@ end end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> internal functions +--internal functions function _detalhes:HealthTick() if (UnitExists ("boss1") and IsInRaid() and IsInInstance()) then @@ -1095,7 +1095,7 @@ end end end - --> is in combat yet? + --is in combat yet? function _detalhes:EstaEmCombate() _detalhes:TimeDataTick() @@ -1180,7 +1180,7 @@ end for i = 1, instancia.rows_created, 1 do local barra = instancia.barras[i] local red, green, blue, alpha = barra.textura:GetVertexColor() - local grayscale = (red*0.03+green+blue) / 3 --> grayscale lightness method + local grayscale = (red*0.03+green+blue) / 3 --grayscale lightness method gump:GradientEffect ( barra.textura, "texture", red, green, blue, alpha, grayscale, grayscale, grayscale, alpha, 1) end end @@ -1192,18 +1192,18 @@ end if (self.HaveGradientEffect) then local done = false - for index, ThisGradient in _ipairs (self.gradientes) do + for index, ThisGradient in _ipairs(self.gradientes) do if (not ThisGradient.done) then - local percent = _math_min ((_GetTime() - ThisGradient.TimeStart) / ThisGradient.Duration * 100, 100) + local percent = _math_min((_GetTime() - ThisGradient.TimeStart) / ThisGradient.Duration * 100, 100) local red_now = ThisGradient.StartRed + (percent * ThisGradient.OnePercentRed) local green_now = ThisGradient.StartGreen + (percent * ThisGradient.OnePercentGreen) local blue_now = ThisGradient.StartBlue + (percent * ThisGradient.OnePercentBlue) local alpha_now = ThisGradient.StartAlpha + (percent * ThisGradient.OnePercentAlpha) if (ThisGradient.ObjectType == "frame") then - ThisGradient.Object:SetBackdropColor (red_now, green_now, blue_now, alpha_now) + ThisGradient.Object:SetBackdropColor(red_now, green_now, blue_now, alpha_now) elseif (ThisGradient.ObjectType == "texture") then ThisGradient.Object:SetVertexColor (red_now, green_now, blue_now, alpha_now) end @@ -1242,23 +1242,23 @@ end end if (not self.HaveGradientEffect) then - self:SetScript ("OnUpdate", nil) + self:SetScript("OnUpdate", nil) end end function gump:GradientEffect (Object, ObjectType, StartRed, StartGreen, StartBlue, StartAlpha, EndRed, EndGreen, EndBlue, EndAlpha, Duration, EndFunction, FuncParam) - if (type (StartRed) == "table" and type (StartGreen) == "table") then + if (type(StartRed) == "table" and type (StartGreen) == "table") then Duration, EndFunction = StartBlue, StartAlpha EndRed, EndGreen, EndBlue, EndAlpha = unpack (StartGreen) StartRed, StartGreen, StartBlue, StartAlpha = unpack (StartRed) - elseif (type (StartRed) == "table") then + elseif (type(StartRed) == "table") then EndRed, EndGreen, EndBlue, EndAlpha, Duration, EndFunction = StartGreen, StartBlue, StartAlpha, EndRed, EndGreen, EndBlue StartRed, StartGreen, StartBlue, StartAlpha = unpack (StartRed) - elseif (type (EndRed) == "table") then + elseif (type(EndRed) == "table") then Duration, EndFunction = EndGreen, EndBlue EndRed, EndGreen, EndBlue, EndAlpha = unpack (EndRed) end @@ -1324,12 +1324,12 @@ end GradientFrameControl.HaveGradientEffect = true if (not GradientFrameControl:GetScript ("OnUpdate")) then - GradientFrameControl:SetScript ("OnUpdate", frame_task) + GradientFrameControl:SetScript("OnUpdate", frame_task) end end - --> work around to solve the UI Frame Flashes + --work around to solve the UI Frame Flashes local onFinish = function(self) if (self.showWhenDone) then self.frame:SetAlpha (1) @@ -1358,10 +1358,10 @@ end fadeIn:Stop() fadeOut:Stop() - fadeIn:SetDuration (fadeInTime or 1) + fadeIn:SetDuration(fadeInTime or 1) fadeIn:SetEndDelay (flashInHoldTime or 0) - fadeOut:SetDuration (fadeOutTime or 1) + fadeOut:SetDuration(fadeOutTime or 1) fadeOut:SetEndDelay (flashOutHoldTime or 0) FlashAnimation.duration = flashDuration @@ -1380,13 +1380,13 @@ end local FlashAnimation = frame:CreateAnimationGroup() - FlashAnimation.fadeOut = FlashAnimation:CreateAnimation ("Alpha") --> fade out anime + FlashAnimation.fadeOut = FlashAnimation:CreateAnimation("Alpha") --fade out anime FlashAnimation.fadeOut:SetOrder (1) FlashAnimation.fadeOut:SetFromAlpha (0) FlashAnimation.fadeOut:SetToAlpha (1) - FlashAnimation.fadeIn = FlashAnimation:CreateAnimation ("Alpha") --> fade in anime + FlashAnimation.fadeIn = FlashAnimation:CreateAnimation("Alpha") --fade in anime FlashAnimation.fadeIn:SetOrder (2) FlashAnimation.fadeIn:SetFromAlpha (0) FlashAnimation.fadeIn:SetToAlpha (1) @@ -1395,15 +1395,15 @@ end FlashAnimation.frame = frame FlashAnimation.onFinishFunc = onFinishFunc - FlashAnimation:SetScript ("OnLoop", onLoopFunc) - FlashAnimation:SetScript ("OnFinished", onFinish) + FlashAnimation:SetScript("OnLoop", onLoopFunc) + FlashAnimation:SetScript("OnFinished", onFinish) frame.Flash = flash frame.Stop = stop end - --> todo: remove the function creation everytime this function run. + --todo: remove the function creation everytime this function run. @@ -1437,23 +1437,23 @@ end a = a + 1 --throw an error if called - if (type (frame) == "table") then + if (type(frame) == "table") then - if (frame.meu_id) then --> ups, � uma inst�ncia - if (parametros == "barras") then --> hida todas as barras da inst�ncia + if (frame.meu_id) then --ups, � uma inst�ncia + if (parametros == "barras") then --hida todas as barras da inst�ncia if (velocidade) then for i = 1, frame.rows_created, 1 do - Details.FadeHandler.Fader (frame.barras[i], tipo, velocidade) + Details.FadeHandler.Fader(frame.barras[i], tipo, velocidade) end return else velocidade = velocidade or 0.3 for i = 1, frame.rows_created, 1 do - Details.FadeHandler.Fader (frame.barras[i], tipo, 0.3+(i/10)) + Details.FadeHandler.Fader(frame.barras[i], tipo, 0.3+(i/10)) end return end - elseif (parametros == "hide_barras") then --> hida todas as barras da inst�ncia + elseif (parametros == "hide_barras") then --hida todas as barras da inst�ncia for i = 1, frame.rows_created, 1 do local esta_barra = frame.barras[i] if (esta_barra.fading_in or esta_barra.fading_out) then @@ -1476,25 +1476,25 @@ end velocidade = velocidade or 0.3 - --> esse ALL aqui pode dar merda com as inst�ncias n�o ativadas - if (frame == "all") then --> todas as inst�ncias - for _, instancia in _ipairs (_detalhes.tabela_instancias) do - if (parametros == "barras") then --> hida todas as barras da inst�ncia + --esse ALL aqui pode dar merda com as inst�ncias n�o ativadas + if (frame == "all") then --todas as inst�ncias + for _, instancia in _ipairs(_detalhes.tabela_instancias) do + if (parametros == "barras") then --hida todas as barras da inst�ncia for i = 1, instancia.rows_created, 1 do - Details.FadeHandler.Fader (instancia.barras[i], tipo, velocidade+(i/10)) + Details.FadeHandler.Fader(instancia.barras[i], tipo, velocidade+(i/10)) end end end elseif (upper (tipo) == "IN") then - if (frame:GetAlpha() == 0 and frame.hidden and not frame.fading_out) then --> ja esta escondida + if (frame:GetAlpha() == 0 and frame.hidden and not frame.fading_out) then --ja esta escondida return - elseif (frame.fading_in) then --> ja esta com uma anima��o, se for true + elseif (frame.fading_in) then --ja esta com uma anima��o, se for true return end - if (frame.fading_out) then --> se tiver uma anima��o de aparecer em andamento se for true + if (frame.fading_out) then --se tiver uma anima��o de aparecer em andamento se for true frame.fading_out = false end @@ -1504,15 +1504,15 @@ end frame.fadeInfo.finishedFunc = fade_IN_finished_func frame.fadeInfo.finishedArg1 = frame - elseif (upper (tipo) == "OUT") then --> aparecer + elseif (upper (tipo) == "OUT") then --aparecer - if (frame:GetAlpha() == 1 and not frame.hidden and not frame.fading_in) then --> ja esta na tela + if (frame:GetAlpha() == 1 and not frame.hidden and not frame.fading_in) then --ja esta na tela return - elseif (frame.fading_out) then --> j� ta com fading out + elseif (frame.fading_out) then --j� ta com fading out return end - if (frame.fading_in) then --> se tiver uma anima��o de hidar em andamento se for true + if (frame.fading_in) then --se tiver uma anima��o de hidar em andamento se for true frame.fading_in = false end @@ -1523,7 +1523,7 @@ end frame.fadeInfo.finishedFunc = fade_OUT_finished_func frame.fadeInfo.finishedArg1 = frame - elseif (tipo == 0) then --> for�a o frame a ser mostrado + elseif (tipo == 0) then --for�a o frame a ser mostrado frame.hidden = false frame.faded = false frame.fading_out = false @@ -1531,7 +1531,7 @@ end frame:Show() frame:SetAlpha (1) - elseif (tipo == 1) then --> for�a o frame a ser hidado + elseif (tipo == 1) then --for�a o frame a ser hidado frame.hidden = true frame.faded = true frame.fading_out = false @@ -1539,14 +1539,14 @@ end frame:SetAlpha (0) frame:Hide() - elseif (tipo == -1) then --> apenas da fade sem hidar - if (frame:GetAlpha() == 0 and frame.hidden and not frame.fading_out) then --> ja esta escondida + elseif (tipo == -1) then --apenas da fade sem hidar + if (frame:GetAlpha() == 0 and frame.hidden and not frame.fading_out) then --ja esta escondida return - elseif (frame.fading_in) then --> ja esta com uma anima��o, se for true + elseif (frame.fading_in) then --ja esta com uma anima��o, se for true return end - if (frame.fading_out) then --> se tiver uma anima��o de aparecer em andamento se for true + if (frame.fading_out) then --se tiver uma anima��o de aparecer em andamento se for true frame.fading_out = false end @@ -1562,7 +1562,7 @@ end frame:Show() if (currentApha < value) then - if (frame.fading_in) then --> se tiver uma anima��o de hidar em andamento se for true + if (frame.fading_in) then --se tiver uma anima��o de hidar em andamento se for true frame.fading_in = false frame.fadeInfo.finishedFunc = nil end @@ -1573,7 +1573,7 @@ end frame.fadeInfo.finishedArg1 = frame else - if (frame.fading_out) then --> se tiver uma anima��o de hidar em andamento se for true + if (frame.fading_out) then --se tiver uma anima��o de hidar em andamento se for true frame.fading_out = false frame.fadeInfo.finishedFunc = nil end @@ -1584,7 +1584,7 @@ end frame.fadeInfo.finishedArg1 = frame end - elseif (upper (tipo) == "ALPHA") then --> setando um alpha determinado + elseif (upper (tipo) == "ALPHA") then --setando um alpha determinado if (frame.fading_in or frame.fading_out) then frame.fadeInfo.finishedFunc = nil -- _UIFrameFadeIn (frame, velocidade, frame:GetAlpha(), frame:GetAlpha()) @@ -1601,19 +1601,19 @@ end function _detalhes:name_space (barra) --if (barra.icone_secundario_ativo) then -- local tamanho = barra:GetWidth()-barra.lineText4:GetStringWidth()-16-barra:GetHeight() - -- barra.lineText1:SetSize (tamanho-2, 15) + -- barra.lineText1:SetSize(tamanho-2, 15) --else - barra.lineText1:SetSize (barra:GetWidth()-barra.lineText4:GetStringWidth()-18, 15) + barra.lineText1:SetSize(barra:GetWidth()-barra.lineText4:GetStringWidth()-18, 15) --end end function _detalhes:name_space_info (barra) if (barra.icone_secundario_ativo) then local tamanho = barra:GetWidth()-barra.lineText4:GetStringWidth()-16-barra:GetHeight() - barra.lineText1:SetSize (tamanho-10, 15) + barra.lineText1:SetSize(tamanho-10, 15) else local tamanho = barra:GetWidth()-barra.lineText4:GetStringWidth()-16 - barra.lineText1:SetSize (tamanho-10, 15) + barra.lineText1:SetSize(tamanho-10, 15) end end @@ -1621,10 +1621,10 @@ end local texto_direita_tamanho = barra.lineText4:GetStringWidth() local tamanho = barra:GetWidth()-texto_direita_tamanho-16 if (separador) then - barra.lineText1:SetSize (tamanho+separador, 10) - barra.lineText4:SetSize (texto_direita_tamanho+15, 10) + barra.lineText1:SetSize(tamanho+separador, 10) + barra.lineText4:SetSize(texto_direita_tamanho+15, 10) else - barra.lineText1:SetSize (tamanho-10, 15) - barra.lineText4:SetSize (texto_direita_tamanho+5, 15) + barra.lineText1:SetSize(tamanho-10, 15) + barra.lineText4:SetSize(texto_direita_tamanho+5, 15) end end diff --git a/core/windows.lua b/core/windows.lua index e273e5b4..438498ec 100644 --- a/core/windows.lua +++ b/core/windows.lua @@ -4,8 +4,8 @@ local libwindow = LibStub("LibWindow-1.1") ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> local pointers - +--local pointers + local _math_floor = math.floor --lua local local _type = type --lua local local _math_abs = math.abs --lua local @@ -14,16 +14,16 @@ local _ipairs = ipairs --lua local local _UIParent = UIParent --wow api local - + local gump = _detalhes.gump --details local local _ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> constants +--constants local end_window_spacement = 0 - ---> settings + +--settings local animation_speed = 33 local animation_speed_hightravel_trigger = 5 @@ -31,80 +31,80 @@ local animation_speed_lowtravel_minspeed = 0.33 local animation_func_left local animation_func_right - - gump:NewColor ("DETAILS_API_ICON", .5, .4, .3, 1) - gump:NewColor ("DETAILS_STATISTICS_ICON", .8, .8, .8, 1) - + + gump:NewColor("DETAILS_API_ICON", .5, .4, .3, 1) + gump:NewColor("DETAILS_STATISTICS_ICON", .8, .8, .8, 1) + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> core +--core function _detalhes:AnimarSplit (barra, goal) barra.inicio = barra.split.barra:GetValue() barra.fim = goal barra.proximo_update = 0 barra.tem_animacao = true - barra:SetScript ("OnUpdate", self.FazerAnimacaoSplit) + barra:SetScript("OnUpdate", self.FazerAnimacaoSplit) end function _detalhes:FazerAnimacaoSplit (elapsed) local velocidade = 0.8 - + if (self.fim > self.inicio) then self.inicio = self.inicio+velocidade - self.split.barra:SetValue (self.inicio) + self.split.barra:SetValue(self.inicio) + + self.split.div:SetPoint("left", self.split.barra, "left", self.split.barra:GetValue()* (self.split.barra:GetWidth()/100) - 4, 0) - self.split.div:SetPoint ("left", self.split.barra, "left", self.split.barra:GetValue()* (self.split.barra:GetWidth()/100) - 4, 0) - if (self.inicio+1 >= self.fim) then self.tem_animacao = false - self:SetScript ("OnUpdate", nil) + self:SetScript("OnUpdate", nil) end else self.inicio = self.inicio-velocidade - self.split.barra:SetValue (self.inicio) - - self.split.div:SetPoint ("left", self.split.barra, "left", self.split.barra:GetValue()* (self.split.barra:GetWidth()/100) - 4, 0) - + self.split.barra:SetValue(self.inicio) + + self.split.div:SetPoint("left", self.split.barra, "left", self.split.barra:GetValue()* (self.split.barra:GetWidth()/100) - 4, 0) + if (self.inicio-1 <= self.fim) then self.tem_animacao = false - self:SetScript ("OnUpdate", nil) + self:SetScript("OnUpdate", nil) end end self.proximo_update = 0 end - - + + function _detalhes:PerformAnimations (amt_barras) if (self.bars_sort_direction == 2) then - - for i = _math_min (self.rows_fit_in_window, amt_barras) - 1, 1, -1 do + + for i = _math_min(self.rows_fit_in_window, amt_barras) - 1, 1, -1 do local row = self.barras [i] local row_proxima = self.barras [i-1] - + if (row_proxima and not row.animacao_ignorar) then local v = row.statusbar.value local v_proxima = row_proxima.statusbar.value - + if (v_proxima > v) then if (row.animacao_fim >= v_proxima) then - row:SetValue (v_proxima) + row:SetValue(v_proxima) else - row:SetValue (row.animacao_fim) - row_proxima.statusbar:SetValue (row.animacao_fim) + row:SetValue(row.animacao_fim) + row_proxima.statusbar:SetValue(row.animacao_fim) end end end end - + for i = 1, self.rows_fit_in_window -1 do local row = self.barras [i] if (row.animacao_ignorar) then row.animacao_ignorar = nil if (row.tem_animacao) then row.tem_animacao = false - row:SetScript ("OnUpdate", nil) + row:SetScript("OnUpdate", nil) end else if (row.animacao_fim ~= row.animacao_fim2) then @@ -117,29 +117,29 @@ for i = 2, self.rows_fit_in_window do local row = self.barras [i] local row_proxima = self.barras [i+1] - + if (row_proxima and not row.animacao_ignorar) then local v = row.statusbar.value local v_proxima = row_proxima.statusbar.value - + if (v_proxima > v) then if (row.animacao_fim >= v_proxima) then - row:SetValue (v_proxima) + row:SetValue(v_proxima) else - row:SetValue (row.animacao_fim) - row_proxima.statusbar:SetValue (row.animacao_fim) + row:SetValue(row.animacao_fim) + row_proxima.statusbar:SetValue(row.animacao_fim) end end end end - + for i = 2, self.rows_fit_in_window do local row = self.barras [i] if (row.animacao_ignorar) then row.animacao_ignorar = nil if (row.tem_animacao) then row.tem_animacao = false - row:SetScript ("OnUpdate", nil) + row:SetScript("OnUpdate", nil) end else if (row.animacao_fim ~= row.animacao_fim2) then @@ -149,56 +149,56 @@ end end end - + end - - --> simple left and right animations by delta time + + --simple left and right animations by delta time local animation_left_simple = function(self, deltaTime) self.inicio = self.inicio - (animation_speed * deltaTime) - self:SetValue (self.inicio) + self:SetValue(self.inicio) if (self.inicio-1 <= self.fim) then self.tem_animacao = false - self:SetScript ("OnUpdate", nil) - end - end - - 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 - self.tem_animacao = false - self:SetScript ("OnUpdate", nil) - end - end - - --> animation with acceleration - local animation_left_with_accel = function(self, deltaTime) - local distance = self.inicio - self.fim - - -- DefaultSpeed * max of ( min of (Distance / TriggerSpeed , MaxSpeed) , LowSpeed ) - local calcAnimationSpeed = animation_speed * _math_max (_math_min (distance/animation_speed_hightravel_trigger, animation_speed_hightravel_maxspeed), animation_speed_lowtravel_minspeed) - - self.inicio = self.inicio - (calcAnimationSpeed * deltaTime) - self:SetValue (self.inicio) - if (self.inicio-0.1 <= self.fim) then - self.tem_animacao = false - self:SetScript ("OnUpdate", nil) - end - end - - 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) - - self.inicio = self.inicio + (calcAnimationSpeed * deltaTime) - self:SetValue (self.inicio) - if (self.inicio+0.1 >= self.fim) then - self.tem_animacao = false - self:SetScript ("OnUpdate", nil) + self:SetScript("OnUpdate", nil) end end - --> initiate with defaults + 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 + self.tem_animacao = false + self:SetScript("OnUpdate", nil) + end + end + + --animation with acceleration + local animation_left_with_accel = function(self, deltaTime) + local distance = self.inicio - self.fim + + -- DefaultSpeed * max of ( min of (Distance / TriggerSpeed , MaxSpeed) , LowSpeed ) + local calcAnimationSpeed = animation_speed * _math_max (_math_min(distance/animation_speed_hightravel_trigger, animation_speed_hightravel_maxspeed), animation_speed_lowtravel_minspeed) + + self.inicio = self.inicio - (calcAnimationSpeed * deltaTime) + self:SetValue(self.inicio) + if (self.inicio-0.1 <= self.fim) then + self.tem_animacao = false + self:SetScript("OnUpdate", nil) + end + end + + 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) + + self.inicio = self.inicio + (calcAnimationSpeed * deltaTime) + self:SetValue(self.inicio) + if (self.inicio+0.1 >= self.fim) then + self.tem_animacao = false + self:SetScript("OnUpdate", nil) + end + end + + --initiate with defaults animation_func_left = animation_left_simple animation_func_right = animation_right_simple @@ -206,14 +206,14 @@ esta_barra.inicio = esta_barra.statusbar.value esta_barra.fim = fim esta_barra.tem_animacao = true - + if (esta_barra.fim > esta_barra.inicio) then - esta_barra:SetScript ("OnUpdate", animation_func_right) + esta_barra:SetScript("OnUpdate", animation_func_right) else - esta_barra:SetScript ("OnUpdate", animation_func_left) + esta_barra:SetScript("OnUpdate", animation_func_left) end end - + function _detalhes:RefreshAnimationFunctions() if (_detalhes.streamer_config.use_animation_accel) then animation_func_left = animation_left_with_accel @@ -223,28 +223,28 @@ animation_func_left = animation_left_simple animation_func_right = animation_right_simple end - + animation_speed = _detalhes.animation_speed animation_speed_hightravel_trigger = _detalhes.animation_speed_triggertravel animation_speed_hightravel_maxspeed = _detalhes.animation_speed_maxtravel animation_speed_lowtravel_minspeed = _detalhes.animation_speed_mintravel end - + --deprecated function _detalhes:FazerAnimacao_Esquerda (deltaTime) self.inicio = self.inicio - (animation_speed * deltaTime) - self:SetValue (self.inicio) + self:SetValue(self.inicio) if (self.inicio-1 <= self.fim) then self.tem_animacao = false - self:SetScript ("OnUpdate", nil) + self:SetScript("OnUpdate", nil) end end function _detalhes:FazerAnimacao_Direita (deltaTime) self.inicio = self.inicio + (animation_speed * deltaTime) - self:SetValue (self.inicio) + self:SetValue(self.inicio) if (self.inicio+0.1 >= self.fim) then self.tem_animacao = false - self:SetScript ("OnUpdate", nil) + self:SetScript("OnUpdate", nil) end end @@ -253,17 +253,17 @@ if (not _x) then return end - + local _w, _h = self:GetRealSize() - + local metade_largura = _w/2 local metade_altura = _h/2 - + local statusbar_y_mod = 0 if (not self.show_statusbar) then statusbar_y_mod = 14 * self.baseframe:GetScale() end - + if (not self.ponto1) then self.ponto1 = {x = _x - metade_largura, y = _y + metade_altura + (statusbar_y_mod*-1)} --topleft self.ponto2 = {x = _x - metade_largura, y = _y - metade_altura + statusbar_y_mod} --bottomleft @@ -281,58 +281,58 @@ end end - + -------------------------------------------------------------------------------------------------------- - --> LibWindow-1.1 by Mikk http://www.wowace.com/profiles/mikk/ - --> this is the restore function from Libs\LibWindow-1.1\LibWindow-1.1.lua. - --> we can't schedule a new save after restoring, we save it inside the instance without frame references and always attach to UIparent. + --LibWindow-1.1 by Mikk http://www.wowace.com/profiles/mikk/ + --this is the restore function from Libs\LibWindow-1.1\LibWindow-1.1.lua. + --we can't schedule a new save after restoring, we save it inside the instance without frame references and always attach to UIparent. function _detalhes:RestoreLibWindow() local frame = self.baseframe if (frame) then if (self.libwindow.x) then - + local x = self.libwindow.x local y = self.libwindow.y local point = self.libwindow.point local s = self.libwindow.scale - + if s then (frame.lw11origSetScale or frame.SetScale)(frame,s) else s = frame:GetScale() end - + if not x or not y then -- nothing stored in config yet, smack it in the center x=0; y=0; point="CENTER" end x = x/s y = y/s - + frame:ClearAllPoints() if not point and y==0 then -- errr why did i do this check again? must have been a reason, but i can't remember it =/ point="CENTER" end - - --> Details: using UIParent always in order to not break the positioning when using AddonSkin with ElvUI. + + --Details: using UIParent always in order to not break the positioning when using AddonSkin with ElvUI. if not point then -- we have position, but no point, which probably means we're going from data stored by the addon itself before LibWindow was added to it. It was PROBABLY topleft->bottomleft anchored. Most do it that way. frame:SetPoint("TOPLEFT", UIParent, "BOTTOMLEFT", x, y) --frame:SetPoint("TOPLEFT", frame:GetParent(), "BOTTOMLEFT", x, y) -- make it compute a better attachpoint (on next update) --_detalhes:ScheduleTimer ("SaveLibWindow", 0.05, self) return end - + frame:SetPoint(point, UIParent, point, x, y) - + end end end - - --> LibWindow-1.1 by Mikk http://www.wowace.com/profiles/mikk/ - --> this is the save function from Libs\LibWindow-1.1\LibWindow-1.1.lua. - --> we need to make it save inside the instance object without frame references and also we must always use UIParent due to embed settings for ElvUI and LUI. - + + --LibWindow-1.1 by Mikk http://www.wowace.com/profiles/mikk/ + --this is the save function from Libs\LibWindow-1.1\LibWindow-1.1.lua. + --we need to make it save inside the instance object without frame references and also we must always use UIParent due to embed settings for ElvUI and LUI. + function _detalhes:SaveLibWindow() local frame = self.baseframe if (frame) then @@ -340,7 +340,7 @@ if (not left) then return _detalhes:ScheduleTimer ("SaveLibWindow", 0.05, self) end - --> Details: we are always using UIParent here or the addon break when using Embeds. + --Details: we are always using UIParent here or the addon break when using Embeds. local parent = UIParent --local parent = frame:GetParent() or nilParent -- No, this won't work very well with frames that aren't parented to nil or UIParent local s = frame:GetScale() @@ -359,7 +359,7 @@ x = (left+right)/2 - pwidth/2; point=""; end - + if bottom < (pheight-top) and bottom < abs((bottom+top)/2 - pheight/2) then y = bottom; point="BOTTOM"..point; @@ -370,57 +370,57 @@ y = (bottom+top)/2 - pheight/2; -- point=""..point; end - + if point=="" then point = "CENTER" end - + ---------------------------------------- - --> save inside the instance object + --save inside the instance object self.libwindow.x = x self.libwindow.y = y self.libwindow.point = point self.libwindow.scale = s end end - - --> end for libwindow-1.1 + + --end for libwindow-1.1 -------------------------------------------------------------------------------------------------------- - + function _detalhes:SaveMainWindowSize() - + local baseframe_width = self.baseframe:GetWidth() if (not baseframe_width) then return _detalhes:ScheduleTimer ("SaveMainWindowSize", 1, self) end local baseframe_height = self.baseframe:GetHeight() - - --> calc position + + --calc position local _x, _y = self:GetPositionOnScreen() if (not _x) then return _detalhes:ScheduleTimer ("SaveMainWindowSize", 1, self) end - - --> save the position + + --save the position local _w = baseframe_width local _h = baseframe_height - + local mostrando = self.mostrando - + self.posicao[mostrando].x = _x self.posicao[mostrando].y = _y self.posicao[mostrando].w = _w self.posicao[mostrando].h = _h - - --> update the 4 points for window groups + + --update the 4 points for window groups local metade_largura = _w/2 local metade_altura = _h/2 - + local statusbar_y_mod = 0 if (not self.show_statusbar) then statusbar_y_mod = 14 * self.baseframe:GetScale() end - + if (not self.ponto1) then self.ponto1 = {x = _x - metade_largura, y = _y + metade_altura + (statusbar_y_mod*-1)} --topleft self.ponto2 = {x = _x - metade_largura, y = _y - metade_altura + statusbar_y_mod} --bottomleft @@ -436,54 +436,54 @@ self.ponto4.x = _x + metade_largura self.ponto4.y = _y + metade_altura + (statusbar_y_mod*-1) end - - self.baseframe.BoxBarrasAltura = self.baseframe:GetHeight() - end_window_spacement --> espa�o para o final da janela - + + self.baseframe.BoxBarrasAltura = self.baseframe:GetHeight() - end_window_spacement --espa�o para o final da janela + return {altura = self.baseframe:GetHeight(), largura = self.baseframe:GetWidth(), x = _x, y = _y} end function _detalhes:SaveMainWindowPosition (instance) - + if (instance) then self = instance end local mostrando = self.mostrando - - --> get sizes + + --get sizes local baseframe_width = self.baseframe:GetWidth() if (not baseframe_width) then return _detalhes:ScheduleTimer ("SaveMainWindowPosition", 1, self) end local baseframe_height = self.baseframe:GetHeight() - - --> calc position + + --calc position local _x, _y = self:GetPositionOnScreen() if (not _x) then return _detalhes:ScheduleTimer ("SaveMainWindowPosition", 1, self) end - + if (self.mostrando ~= "solo") then self:SaveLibWindow() end - --> save the position + --save the position local _w = baseframe_width local _h = baseframe_height - + self.posicao[mostrando].x = _x self.posicao[mostrando].y = _y self.posicao[mostrando].w = _w self.posicao[mostrando].h = _h - - --> update the 4 points for window groups + + --update the 4 points for window groups local metade_largura = _w/2 local metade_altura = _h/2 - + local statusbar_y_mod = 0 if (not self.show_statusbar) then statusbar_y_mod = 14 * self.baseframe:GetScale() end - + if (not self.ponto1) then self.ponto1 = {x = _x - metade_largura, y = _y + metade_altura + (statusbar_y_mod*-1)} --topleft self.ponto2 = {x = _x - metade_largura, y = _y - metade_altura + statusbar_y_mod} --bottomleft @@ -499,67 +499,67 @@ self.ponto4.x = _x + metade_largura self.ponto4.y = _y + metade_altura + (statusbar_y_mod*-1) end - - self.baseframe.BoxBarrasAltura = self.baseframe:GetHeight() - end_window_spacement --> espa�o para o final da janela + + self.baseframe.BoxBarrasAltura = self.baseframe:GetHeight() - end_window_spacement --espa�o para o final da janela return {altura = self.baseframe:GetHeight(), largura = self.baseframe:GetWidth(), x = _x, y = _y} end function _detalhes:RestoreMainWindowPosition (pre_defined) - + if (not pre_defined and self.libwindow.x and self.mostrando == "normal" and not _detalhes.instances_no_libwindow) then local s = self.window_scale - self.baseframe:SetScale (s) - self.rowframe:SetScale (s) - - self.baseframe:SetWidth (self.posicao[self.mostrando].w) - self.baseframe:SetHeight (self.posicao[self.mostrando].h) - + self.baseframe:SetScale(s) + self.rowframe:SetScale(s) + + self.baseframe:SetWidth(self.posicao[self.mostrando].w) + self.baseframe:SetHeight(self.posicao[self.mostrando].h) + self:RestoreLibWindow() - self.baseframe.BoxBarrasAltura = self.baseframe:GetHeight() - end_window_spacement --> espa�o para o final da janela + self.baseframe.BoxBarrasAltura = self.baseframe:GetHeight() - end_window_spacement --espa�o para o final da janela return end - + local s = self.window_scale - self.baseframe:SetScale (s) - self.rowframe:SetScale (s) - - local _scale = self.baseframe:GetEffectiveScale() + self.baseframe:SetScale(s) + self.rowframe:SetScale(s) + + local _scale = self.baseframe:GetEffectiveScale() local _UIscale = _UIParent:GetScale() - + local novo_x = self.posicao[self.mostrando].x*_UIscale/_scale local novo_y = self.posicao[self.mostrando].y*_UIscale/_scale - - if (pre_defined and pre_defined.x) then --> overwrite + + if (pre_defined and pre_defined.x) then --overwrite novo_x = pre_defined.x*_UIscale/_scale novo_y = pre_defined.y*_UIscale/_scale self.posicao[self.mostrando].w = pre_defined.largura self.posicao[self.mostrando].h = pre_defined.altura - + elseif (pre_defined and not pre_defined.x) then _detalhes:Msg ("invalid pre_defined table for resize, please rezise the window manually.") end - self.baseframe:SetWidth (self.posicao[self.mostrando].w) - self.baseframe:SetHeight (self.posicao[self.mostrando].h) - + self.baseframe:SetWidth(self.posicao[self.mostrando].w) + self.baseframe:SetHeight(self.posicao[self.mostrando].h) + self.baseframe:ClearAllPoints() - self.baseframe:SetPoint ("CENTER", _UIParent, "CENTER", novo_x, novo_y) + self.baseframe:SetPoint("CENTER", _UIParent, "CENTER", novo_x, novo_y) end function _detalhes:RestoreMainWindowPositionNoResize (pre_defined, x, y) - + x = x or 0 y = y or 0 - local _scale = self.baseframe:GetEffectiveScale() + local _scale = self.baseframe:GetEffectiveScale() local _UIscale = _UIParent:GetScale() local novo_x = self.posicao[self.mostrando].x*_UIscale/_scale local novo_y = self.posicao[self.mostrando].y*_UIscale/_scale - - if (pre_defined) then --> overwrite + + if (pre_defined) then --overwrite novo_x = pre_defined.x*_UIscale/_scale novo_y = pre_defined.y*_UIscale/_scale self.posicao[self.mostrando].w = pre_defined.largura @@ -567,81 +567,81 @@ end self.baseframe:ClearAllPoints() - self.baseframe:SetPoint ("CENTER", _UIParent, "CENTER", novo_x + x, novo_y + y) - self.baseframe.BoxBarrasAltura = self.baseframe:GetHeight() - end_window_spacement --> espa�o para o final da janela + self.baseframe:SetPoint("CENTER", _UIParent, "CENTER", novo_x + x, novo_y + y) + self.baseframe.BoxBarrasAltura = self.baseframe:GetHeight() - end_window_spacement --espa�o para o final da janela end - + function _detalhes:CreatePositionTable() local t = {pos_table = true} - + if (self.libwindow) then t.x = self.libwindow.x t.y = self.libwindow.y t.scale = self.libwindow.scale t.point = self.libwindow.point end - - --> old way to save positions + + --old way to save positions t.x_legacy = self.posicao.normal.x t.y_legacy = self.posicao.normal.y - - --> size + + --size t.w = self.posicao.normal.w t.h = self.posicao.normal.h - + return t end - + function _detalhes:RestorePositionFromPositionTable (t) if (not t.pos_table) then return end - + if (t.x) then self.libwindow.x = t.x self.libwindow.y = t.y self.libwindow.scale = t.scale self.libwindow.point = t.point end - + self.posicao.normal.x = t.x_legacy self.posicao.normal.y = t.y_legacy - + self.posicao.normal.w = t.w self.posicao.normal.h = t.h - + return self:RestoreMainWindowPosition() end function _detalhes:ResetaGump (instancia, tipo, segmento) - if (not instancia or _type (instancia) == "boolean") then + if (not instancia or _type(instancia) == "boolean") then segmento = tipo tipo = instancia instancia = self end - - if (tipo and tipo == 0x1) then --> entrando em combate - if (instancia.segmento == -1) then --> esta mostrando a tabela overall + + if (tipo and tipo == 0x1) then --entrando em combate + if (instancia.segmento == -1) then --esta mostrando a tabela overall return end end - + if (segmento and instancia.segmento ~= segmento) then return end - instancia.barraS = {nil, nil} --> zera o iterator - instancia.rows_showing = 0 --> resetou, ent�o n�o esta mostranho nenhuma barra - - for i = 1, instancia.rows_created, 1 do --> limpa a refer�ncia do que estava sendo mostrado na barra + instancia.barraS = {nil, nil} --zera o iterator + instancia.rows_showing = 0 --resetou, ent�o n�o esta mostranho nenhuma barra + + for i = 1, instancia.rows_created, 1 do --limpa a refer�ncia do que estava sendo mostrado na barra local esta_barra= instancia.barras[i] esta_barra.minha_tabela = nil esta_barra.animacao_fim = 0 esta_barra.animacao_fim2 = 0 end - + if (instancia.rolagem) then - instancia:EsconderScrollBar() --> hida a scrollbar + instancia:EsconderScrollBar() --hida a scrollbar end instancia.need_rolagem = false instancia.bar_mod = nil @@ -649,22 +649,22 @@ end function _detalhes:ReajustaGump() - - if (self.mostrando == "normal") then --> somente alterar o tamanho das barras se tiver mostrando o gump normal - + + if (self.mostrando == "normal") then --somente alterar o tamanho das barras se tiver mostrando o gump normal + if (not self.baseframe.isStretching and self.stretchToo and #self.stretchToo > 0) then if (self.eh_horizontal or self.eh_tudo or (self.verticalSnap and not self.eh_vertical)) then - for _, instancia in _ipairs (self.stretchToo) do - instancia.baseframe:SetWidth (self.baseframe:GetWidth()) + for _, instancia in _ipairs(self.stretchToo) do + instancia.baseframe:SetWidth(self.baseframe:GetWidth()) local mod = (self.baseframe:GetWidth() - instancia.baseframe._place.largura) / 2 instancia:RestoreMainWindowPositionNoResize (instancia.baseframe._place, mod, nil) instancia:BaseFrameSnap() end end if ( (self.eh_vertical or self.eh_tudo or not self.eh_horizontal) and (not self.verticalSnap or self.eh_vertical)) then - for _, instancia in _ipairs (self.stretchToo) do - if (instancia.baseframe) then --> esta criada - instancia.baseframe:SetHeight (self.baseframe:GetHeight()) + for _, instancia in _ipairs(self.stretchToo) do + if (instancia.baseframe) then --esta criada + instancia.baseframe:SetHeight(self.baseframe:GetHeight()) local mod if (self.eh_vertical) then mod = (self.baseframe:GetHeight() - instancia.baseframe._place.altura) / 2 @@ -678,171 +678,171 @@ end elseif (self.baseframe.isStretching and self.stretchToo and #self.stretchToo > 0) then if (self.baseframe.stretch_direction == "top") then - for _, instancia in _ipairs (self.stretchToo) do - instancia.baseframe:SetHeight (self.baseframe:GetHeight()) + for _, instancia in _ipairs(self.stretchToo) do + instancia.baseframe:SetHeight(self.baseframe:GetHeight()) local mod = (self.baseframe:GetHeight() - (instancia.baseframe._place.altura or instancia.baseframe:GetHeight())) / 2 instancia:RestoreMainWindowPositionNoResize (instancia.baseframe._place, nil, mod) end elseif (self.baseframe.stretch_direction == "bottom") then - for _, instancia in _ipairs (self.stretchToo) do - instancia.baseframe:SetHeight (self.baseframe:GetHeight()) + for _, instancia in _ipairs(self.stretchToo) do + instancia.baseframe:SetHeight(self.baseframe:GetHeight()) local mod = (self.baseframe:GetHeight() - instancia.baseframe._place.altura) / 2 mod = mod * -1 instancia:RestoreMainWindowPositionNoResize (instancia.baseframe._place, nil, mod) end end end - + if (self.stretch_button_side == 2) then self:StretchButtonAnchor (2) end - - --> reajusta o freeze + + --reajusta o freeze if (self.freezed) then _detalhes:Freeze (self) end - + -- -4 difere a precis�o de quando a barra ser� adicionada ou apagada da barra self.baseframe.BoxBarrasAltura = (self.baseframe:GetHeight()) - end_window_spacement local T = self.rows_fit_in_window - if (not T) then --> primeira vez que o gump esta sendo reajustado - T = _math_floor (self.baseframe.BoxBarrasAltura / self.row_height) + if (not T) then --primeira vez que o gump esta sendo reajustado + T = _math_floor(self.baseframe.BoxBarrasAltura / self.row_height) end - - --> reajustar o local do rel�gio + + --reajustar o local do rel�gio local meio = self.baseframe:GetWidth() / 2 local novo_local = meio - 25 - - self.rows_fit_in_window = _math_floor ( self.baseframe.BoxBarrasAltura / self.row_height) - --> verifica se precisa criar mais barras - if (self.rows_fit_in_window > #self.barras) then--> verifica se precisa criar mais barras + self.rows_fit_in_window = _math_floor( self.baseframe.BoxBarrasAltura / self.row_height) + + --verifica se precisa criar mais barras + if (self.rows_fit_in_window > #self.barras) then--verifica se precisa criar mais barras for i = #self.barras+1, self.rows_fit_in_window, 1 do - gump:CreateNewLine(self, i) --> cria nova barra + gump:CreateNewLine(self, i) --cria nova barra end self.rows_created = #self.barras end - - --> faz um cache do tamanho das barras + + --faz um cache do tamanho das barras self.cached_bar_width = self.barras[1] and self.barras[1]:GetWidth() or 0 - - --> seta a largura das barras + + --seta a largura das barras if (self.bar_mod and self.bar_mod ~= 0) then for index = 1, self.rows_fit_in_window do - self.barras [index]:SetWidth (self.baseframe:GetWidth()+self.bar_mod) + self.barras [index]:SetWidth(self.baseframe:GetWidth()+self.bar_mod) end else for index = 1, self.rows_fit_in_window do - self.barras [index]:SetWidth (self.baseframe:GetWidth()+self.row_info.space.right) + self.barras [index]:SetWidth(self.baseframe:GetWidth()+self.row_info.space.right) end end - --> verifica se precisa esconder ou mostrar alguma barra + --verifica se precisa esconder ou mostrar alguma barra local A = self.barraS[1] - if (not A) then --> primeira vez que o resize esta sendo usado, no caso no startup do addon ou ao criar uma nova inst�ncia - --> hida as barras n�o usadas + if (not A) then --primeira vez que o resize esta sendo usado, no caso no startup do addon ou ao criar uma nova inst�ncia + --hida as barras n�o usadas for i = 1, self.rows_created, 1 do - Details.FadeHandler.Fader (self.barras [i], 1) + Details.FadeHandler.Fader(self.barras [i], 1) self.barras [i].on = false end return end - + local X = self.rows_showing local C = self.rows_fit_in_window - --> novo iterator - local barras_diff = C - T --> aqui pega a quantidade de barras, se aumentou ou diminuiu - if (barras_diff > 0) then --> ganhou barras_diff novas barras - local fim_iterator = self.barraS[2] --> posi��o atual - fim_iterator = fim_iterator+barras_diff --> nova posi��o - local excedeu_iterator = fim_iterator - X --> total que ta sendo mostrado - fim do iterator - if (excedeu_iterator > 0) then --> extrapolou - fim_iterator = X --> seta o fim do iterator pra ser na ultima barra - self.barraS[2] = fim_iterator --> fim do iterator setado - + --novo iterator + local barras_diff = C - T --aqui pega a quantidade de barras, se aumentou ou diminuiu + if (barras_diff > 0) then --ganhou barras_diff novas barras + local fim_iterator = self.barraS[2] --posi��o atual + fim_iterator = fim_iterator+barras_diff --nova posi��o + local excedeu_iterator = fim_iterator - X --total que ta sendo mostrado - fim do iterator + if (excedeu_iterator > 0) then --extrapolou + fim_iterator = X --seta o fim do iterator pra ser na ultima barra + self.barraS[2] = fim_iterator --fim do iterator setado + local inicio_iterator = self.barraS[1] - if (inicio_iterator-excedeu_iterator > 0) then --> se as barras que sobraram preenchem o inicio do iterator - inicio_iterator = inicio_iterator-excedeu_iterator --> pega o novo valor do iterator + if (inicio_iterator-excedeu_iterator > 0) then --se as barras que sobraram preenchem o inicio do iterator + inicio_iterator = inicio_iterator-excedeu_iterator --pega o novo valor do iterator self.barraS[1] = inicio_iterator else - self.barraS[1] = 1 --> se ganhou mais barras pra cima, ignorar elas e mover o iterator para a poci��o inicial + self.barraS[1] = 1 --se ganhou mais barras pra cima, ignorar elas e mover o iterator para a poci��o inicial end else - --> se n�o extrapolou esta okey e esta mostrando a quantidade de barras correta + --se n�o extrapolou esta okey e esta mostrando a quantidade de barras correta self.barraS[2] = fim_iterator end - + for index = T+1, C do local barra = self.barras[index] if (barra) then if (index <= X) then - --Details.FadeHandler.Fader (barra, 0) - Details.FadeHandler.Fader (barra, "out") + --Details.FadeHandler.Fader(barra, 0) + Details.FadeHandler.Fader(barra, "out") else --if (self.baseframe.isStretching or self.auto_resize) then - Details.FadeHandler.Fader (barra, 1) + Details.FadeHandler.Fader(barra, 1) --else - -- Details.FadeHandler.Fader (barra, 1) + -- Details.FadeHandler.Fader(barra, 1) --end end end end - - elseif (barras_diff < 0) then --> perdeu barras_diff barras - local fim_iterator = self.barraS[2] --> posi��o atual - if (not (fim_iterator == X and fim_iterator < C)) then --> calcula primeiro as barras que foram perdidas s�o barras que n�o estavam sendo usadas - --> perdi X barras, diminui X posi��es no iterator + + elseif (barras_diff < 0) then --perdeu barras_diff barras + local fim_iterator = self.barraS[2] --posi��o atual + if (not (fim_iterator == X and fim_iterator < C)) then --calcula primeiro as barras que foram perdidas s�o barras que n�o estavam sendo usadas + --perdi X barras, diminui X posi��es no iterator local perdeu = _math_abs (barras_diff) - - if (fim_iterator == X) then --> se o iterator tiver na ultima posi��o + + if (fim_iterator == X) then --se o iterator tiver na ultima posi��o perdeu = perdeu - (C - X) end - + fim_iterator = fim_iterator - perdeu - + if (fim_iterator < C) then fim_iterator = C end - + self.barraS[2] = fim_iterator - + for index = T, C+1, -1 do local barra = self.barras[index] if (barra) then if (self.baseframe.isStretching or self.auto_resize) then - Details.FadeHandler.Fader (barra, 1) - else - --Details.FadeHandler.Fader (barra, "in", 0.1) - Details.FadeHandler.Fader (barra, 1) + Details.FadeHandler.Fader(barra, 1) + else + --Details.FadeHandler.Fader(barra, "in", 0.1) + Details.FadeHandler.Fader(barra, 1) end end end end end - if (X <= C) then --> desligar a rolagem + if (X <= C) then --desligar a rolagem if (self.rolagem and not self.baseframe.isStretching) then self:EsconderScrollBar() end self.need_rolagem = false - else --> ligar ou atualizar a rolagem + else --ligar ou atualizar a rolagem if (not self.rolagem and not self.baseframe.isStretching) then self:MostrarScrollBar() end self.need_rolagem = true end - - --> verificar o tamanho dos nomes + + --verificar o tamanho dos nomes local whichRowLine = 1 for i = self.barraS[1], self.barraS[2], 1 do local esta_barra = self.barras [whichRowLine] local tabela = esta_barra.minha_tabela - - if (tabela) then --> a barra esta mostrando alguma coisa - - if (tabela._custom) then + + if (tabela) then --a barra esta mostrando alguma coisa + + if (tabela._custom) then tabela (esta_barra, self) elseif (tabela._refresh_window) then tabela:_refresh_window (esta_barra, self) @@ -851,107 +851,107 @@ end end - + whichRowLine = whichRowLine+1 end - - --> for�a o pr�ximo refresh + + --for�a o pr�ximo refresh self.showing[self.atributo].need_refresh = true - end - end - ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> panels - ---> cooltip presets - local preset3_backdrop = {bgFile = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]], edgeFile = [[Interface\AddOns\Details\images\border_3]], tile=true, - edgeSize = 16, tileSize = 64, insets = {left = 3, right = 3, top = 4, bottom = 4}} - - _detalhes.cooltip_preset3_backdrop = preset3_backdrop - - local white_table = {1, 1, 1, 1} - local black_table = {0, 0, 0, 1} - local gray_table = {0.37, 0.37, 0.37, 0.95} - - local preset2_backdrop = {bgFile = [[Interface\AddOns\Details\images\background]], edgeFile = [[Interface\Buttons\WHITE8X8]], tile=true, - edgeSize = 1, tileSize = 64, insets = {left = 0, right = 0, top = 0, bottom = 0}} - _detalhes.cooltip_preset2_backdrop = preset2_backdrop - - --"Details BarBorder 3" - function _detalhes:CooltipPreset (preset) - local GameCooltip = GameCooltip - - GameCooltip:Reset() - - if (preset == 1) then - GameCooltip:SetOption ("TextFont", "Friz Quadrata TT") - GameCooltip:SetOption ("TextColor", "orange") - GameCooltip:SetOption ("TextSize", 12) - GameCooltip:SetOption ("ButtonsYMod", -4) - GameCooltip:SetOption ("YSpacingMod", -4) - GameCooltip:SetOption ("IgnoreButtonAutoHeight", true) - GameCooltip:SetColor (1, 0.5, 0.5, 0.5, 0.5) - - elseif (preset == 2) then - GameCooltip:SetOption ("TextFont", "Friz Quadrata TT") - GameCooltip:SetOption ("TextColor", "orange") - GameCooltip:SetOption ("TextSize", 12) - GameCooltip:SetOption ("FixedWidth", 220) - GameCooltip:SetOption ("ButtonsYMod", -4) - GameCooltip:SetOption ("YSpacingMod", -4) - GameCooltip:SetOption ("IgnoreButtonAutoHeight", true) - GameCooltip:SetColor (1, 0, 0, 0, 0) - - GameCooltip:SetOption ("LeftBorderSize", -5) - GameCooltip:SetOption ("RightBorderSize", 5) - - GameCooltip:SetBackdrop (1, preset2_backdrop, gray_table, black_table) - - elseif (preset == 2.1) then - GameCooltip:SetOption ("TextFont", "Friz Quadrata TT") - GameCooltip:SetOption ("TextColor", "orange") - GameCooltip:SetOption ("TextSize", 10) - GameCooltip:SetOption ("FixedWidth", 220) - GameCooltip:SetOption ("ButtonsYMod", 0) - GameCooltip:SetOption ("YSpacingMod", -4) - GameCooltip:SetOption ("IgnoreButtonAutoHeight", true) - GameCooltip:SetColor (1, 0, 0, 0, 0) - - GameCooltip:SetBackdrop (1, preset2_backdrop, gray_table, black_table) - - elseif (preset == 3) then - GameCooltip:SetOption ("TextFont", "Friz Quadrata TT") - GameCooltip:SetOption ("TextColor", "orange") - GameCooltip:SetOption ("TextSize", 12) - GameCooltip:SetOption ("FixedWidth", 220) - GameCooltip:SetOption ("ButtonsYMod", -4) - GameCooltip:SetOption ("YSpacingMod", -4) - GameCooltip:SetOption ("IgnoreButtonAutoHeight", true) - GameCooltip:SetColor (1, 0.5, 0.5, 0.5, 0.5) - - GameCooltip:SetBackdrop (1, preset3_backdrop, nil, white_table) - end end ---> yes no panel +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--panels + +--cooltip presets + local preset3_backdrop = {bgFile = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]], edgeFile = [[Interface\AddOns\Details\images\border_3]], tile=true, + edgeSize = 16, tileSize = 64, insets = {left = 3, right = 3, top = 4, bottom = 4}} + + _detalhes.cooltip_preset3_backdrop = preset3_backdrop + + local white_table = {1, 1, 1, 1} + local black_table = {0, 0, 0, 1} + local gray_table = {0.37, 0.37, 0.37, 0.95} + + local preset2_backdrop = {bgFile = [[Interface\AddOns\Details\images\background]], edgeFile = [[Interface\Buttons\WHITE8X8]], tile=true, + edgeSize = 1, tileSize = 64, insets = {left = 0, right = 0, top = 0, bottom = 0}} + _detalhes.cooltip_preset2_backdrop = preset2_backdrop + + --"Details BarBorder 3" + function _detalhes:CooltipPreset (preset) + local GameCooltip = GameCooltip + + GameCooltip:Reset() + + if (preset == 1) then + GameCooltip:SetOption("TextFont", "Friz Quadrata TT") + GameCooltip:SetOption("TextColor", "orange") + GameCooltip:SetOption("TextSize", 12) + GameCooltip:SetOption("ButtonsYMod", -4) + GameCooltip:SetOption("YSpacingMod", -4) + GameCooltip:SetOption("IgnoreButtonAutoHeight", true) + GameCooltip:SetColor (1, 0.5, 0.5, 0.5, 0.5) + + elseif (preset == 2) then + GameCooltip:SetOption("TextFont", "Friz Quadrata TT") + GameCooltip:SetOption("TextColor", "orange") + GameCooltip:SetOption("TextSize", 12) + GameCooltip:SetOption("FixedWidth", 220) + GameCooltip:SetOption("ButtonsYMod", -4) + GameCooltip:SetOption("YSpacingMod", -4) + GameCooltip:SetOption("IgnoreButtonAutoHeight", true) + GameCooltip:SetColor (1, 0, 0, 0, 0) + + GameCooltip:SetOption("LeftBorderSize", -5) + GameCooltip:SetOption("RightBorderSize", 5) + + GameCooltip:SetBackdrop(1, preset2_backdrop, gray_table, black_table) + + elseif (preset == 2.1) then + GameCooltip:SetOption("TextFont", "Friz Quadrata TT") + GameCooltip:SetOption("TextColor", "orange") + GameCooltip:SetOption("TextSize", 10) + GameCooltip:SetOption("FixedWidth", 220) + GameCooltip:SetOption("ButtonsYMod", 0) + GameCooltip:SetOption("YSpacingMod", -4) + GameCooltip:SetOption("IgnoreButtonAutoHeight", true) + GameCooltip:SetColor (1, 0, 0, 0, 0) + + GameCooltip:SetBackdrop(1, preset2_backdrop, gray_table, black_table) + + elseif (preset == 3) then + GameCooltip:SetOption("TextFont", "Friz Quadrata TT") + GameCooltip:SetOption("TextColor", "orange") + GameCooltip:SetOption("TextSize", 12) + GameCooltip:SetOption("FixedWidth", 220) + GameCooltip:SetOption("ButtonsYMod", -4) + GameCooltip:SetOption("YSpacingMod", -4) + GameCooltip:SetOption("IgnoreButtonAutoHeight", true) + GameCooltip:SetColor (1, 0.5, 0.5, 0.5, 0.5) + + GameCooltip:SetBackdrop(1, preset3_backdrop, nil, white_table) + + end + end + +--yes no panel do _detalhes.yesNo = _detalhes.gump:NewPanel (UIParent, _, "DetailsYesNoWindow", _, 500, 80) - _detalhes.yesNo:SetPoint ("center", UIParent, "center") - _detalhes.gump:NewLabel (_detalhes.yesNo, _, "$parentAsk", "ask", "") - _detalhes.yesNo ["ask"]:SetPoint ("center", _detalhes.yesNo, "center", 0, 25) - _detalhes.yesNo ["ask"]:SetWidth (480) - _detalhes.yesNo ["ask"]:SetJustifyH ("center") - _detalhes.yesNo ["ask"]:SetHeight (22) + _detalhes.yesNo:SetPoint("center", UIParent, "center") + _detalhes.gump:NewLabel(_detalhes.yesNo, _, "$parentAsk", "ask", "") + _detalhes.yesNo ["ask"]:SetPoint("center", _detalhes.yesNo, "center", 0, 25) + _detalhes.yesNo ["ask"]:SetWidth(480) + _detalhes.yesNo ["ask"]:SetJustifyH("center") + _detalhes.yesNo ["ask"]:SetHeight(22) _detalhes.gump:NewButton (_detalhes.yesNo, _, "$parentNo", "no", 100, 30, function() _detalhes.yesNo:Hide() end, nil, nil, nil, Loc ["STRING_NO"]) _detalhes.gump:NewButton (_detalhes.yesNo, _, "$parentYes", "yes", 100, 30, nil, nil, nil, nil, Loc ["STRING_YES"]) - _detalhes.yesNo ["no"]:SetPoint (10, -45) - _detalhes.yesNo ["yes"]:SetPoint (390, -45) + _detalhes.yesNo ["no"]:SetPoint(10, -45) + _detalhes.yesNo ["yes"]:SetPoint(390, -45) _detalhes.yesNo ["no"]:InstallCustomTexture() _detalhes.yesNo ["yes"]:InstallCustomTexture() - _detalhes.yesNo ["yes"]:SetHook ("OnMouseUp", function() _detalhes.yesNo:Hide() end) + _detalhes.yesNo ["yes"]:SetHook("OnMouseUp", function() _detalhes.yesNo:Hide() end) function _detalhes:Ask (msg, func, ...) _detalhes.yesNo ["ask"].text = msg local p1, p2 = ... @@ -960,279 +960,279 @@ end _detalhes.yesNo:Hide() end - ---> cria o frame de wait for plugin + +--cria o frame de wait for plugin function _detalhes:CreateWaitForPlugin() - - local WaitForPluginFrame = CreateFrame ("frame", "DetailsWaitForPluginFrame" .. self.meu_id, UIParent,"BackdropTemplate") - local WaitTexture = WaitForPluginFrame:CreateTexture (nil, "overlay") - WaitTexture:SetTexture ("Interface\\CHARACTERFRAME\\Disconnect-Icon") + + local WaitForPluginFrame = CreateFrame("frame", "DetailsWaitForPluginFrame" .. self.meu_id, UIParent,"BackdropTemplate") + local WaitTexture = WaitForPluginFrame:CreateTexture(nil, "overlay") + WaitTexture:SetTexture("Interface\\CHARACTERFRAME\\Disconnect-Icon") WaitTexture:SetWidth(64/2) WaitTexture:SetHeight(64/2) --WaitTexture:SetDesaturated(true) --WaitTexture:SetVertexColor(1, 1, 1, 0.3) WaitForPluginFrame.wheel = WaitTexture local RotateAnimGroup = WaitForPluginFrame:CreateAnimationGroup() - local rotate = RotateAnimGroup:CreateAnimation ("Alpha") - --rotate:SetDegrees (360) - --rotate:SetDuration (5) + local rotate = RotateAnimGroup:CreateAnimation("Alpha") + --rotate:SetDegrees(360) + --rotate:SetDuration(5) rotate:SetFromAlpha(0.8) rotate:SetToAlpha(1) --RotateAnimGroup:SetLooping ("repeat") rotate:SetTarget(WaitTexture) - + local bgpanel = gump:NewPanel (WaitForPluginFrame, WaitForPluginFrame, "DetailsWaitFrameBG"..self.meu_id, nil, 120, 30, false, false, false) - bgpanel:SetPoint ("center", WaitForPluginFrame, "center") - bgpanel:SetBackdrop ({bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background"}) - bgpanel:SetBackdropColor (.2, .2, .2, 1) - - local label = gump:NewLabel (bgpanel, bgpanel, nil, nil, Loc ["STRING_WAITPLUGIN"]) + bgpanel:SetPoint("center", WaitForPluginFrame, "center") + bgpanel:SetBackdrop({bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background"}) + bgpanel:SetBackdropColor(.2, .2, .2, 1) + + local label = gump:NewLabel(bgpanel, bgpanel, nil, nil, Loc ["STRING_WAITPLUGIN"]) label.color = "white" - label:SetPoint ("center", WaitForPluginFrame, "center") - label:SetJustifyH ("left") + label:SetPoint("center", WaitForPluginFrame, "center") + label:SetJustifyH("left") label:Hide() WaitTexture:SetPoint("right", label.widget, "topleft", 12, -7) WaitForPluginFrame:Hide() self.wait_for_plugin_created = true - + function self:WaitForPlugin() - + self:ChangeIcon ([[Interface\GossipFrame\ActiveQuestIcon]]) - + --if (WaitForPluginFrame:IsShown() and WaitForPluginFrame:GetParent() == self.baseframe) then -- self.waiting_pid = self:ScheduleTimer ("ExecDelayedPlugin1", 5, self) --end - - WaitForPluginFrame:SetParent (self.baseframe) - WaitForPluginFrame:SetAllPoints (self.baseframe) + + WaitForPluginFrame:SetParent(self.baseframe) + WaitForPluginFrame:SetAllPoints(self.baseframe) bgpanel:ClearAllPoints() bgpanel:SetPoint("topleft", self.baseframe, 0, 0) bgpanel:SetPoint("bottomright", self.baseframe, 0, 0) --local size = math.max (self.baseframe:GetHeight()* 0.35, 100) - --WaitForPluginFrame.wheel:SetWidth (size) - --WaitForPluginFrame.wheel:SetHeight (size) + --WaitForPluginFrame.wheel:SetWidth(size) + --WaitForPluginFrame.wheel:SetHeight(size) WaitForPluginFrame:Show() label:Show() bgpanel:Show() RotateAnimGroup:Play() - + self.waiting_raid_plugin = true - + self.waiting_pid = self:ScheduleTimer ("ExecDelayedPlugin1", 5, self) end - + function self:CancelWaitForPlugin() - RotateAnimGroup:Stop() - WaitForPluginFrame:Hide() - label:Hide() - bgpanel:Hide() - end - - function self:ExecDelayedPlugin1() - - self.waiting_raid_plugin = nil - self.waiting_pid = nil - RotateAnimGroup:Stop() WaitForPluginFrame:Hide() label:Hide() bgpanel:Hide() - + end + + function self:ExecDelayedPlugin1() + + self.waiting_raid_plugin = nil + self.waiting_pid = nil + + RotateAnimGroup:Stop() + WaitForPluginFrame:Hide() + label:Hide() + bgpanel:Hide() + if (self.meu_id == _detalhes.solo) then _detalhes.SoloTables:switch (nil, _detalhes.SoloTables.Mode) - + elseif (self.modo == _detalhes._detalhes_props["MODO_RAID"]) then _detalhes.RaidTables:EnableRaidMode (self) - + end end end - + do - local WaitForPluginFrame = CreateFrame ("frame", "DetailsWaitForPluginFrame", UIParent,"BackdropTemplate") - local WaitTexture = WaitForPluginFrame:CreateTexture (nil, "overlay") - WaitTexture:SetTexture ("Interface\\UNITPOWERBARALT\\Mechanical_Circular_Frame") - WaitTexture:SetPoint ("center", WaitForPluginFrame) - WaitTexture:SetWidth (180) - WaitTexture:SetHeight (180) + local WaitForPluginFrame = CreateFrame("frame", "DetailsWaitForPluginFrame", UIParent,"BackdropTemplate") + local WaitTexture = WaitForPluginFrame:CreateTexture(nil, "overlay") + WaitTexture:SetTexture("Interface\\UNITPOWERBARALT\\Mechanical_Circular_Frame") + WaitTexture:SetPoint("center", WaitForPluginFrame) + WaitTexture:SetWidth(180) + WaitTexture:SetHeight(180) WaitForPluginFrame.wheel = WaitTexture local RotateAnimGroup = WaitForPluginFrame:CreateAnimationGroup() - local rotate = RotateAnimGroup:CreateAnimation ("Rotation") - rotate:SetDegrees (360) - rotate:SetDuration (60) + local rotate = RotateAnimGroup:CreateAnimation("Rotation") + rotate:SetDegrees(360) + rotate:SetDuration(60) RotateAnimGroup:SetLooping ("repeat") - + local bgpanel = gump:NewPanel (UIParent, UIParent, "DetailsWaitFrameBG", nil, 120, 30, false, false, false) - bgpanel:SetPoint ("center", WaitForPluginFrame, "center") - bgpanel:SetBackdrop ({bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background"}) - bgpanel:SetBackdropColor (.2, .2, .2, 1) - - local label = gump:NewLabel (UIParent, UIParent, nil, nil, Loc ["STRING_WAITPLUGIN"]) --> localize-me + bgpanel:SetPoint("center", WaitForPluginFrame, "center") + bgpanel:SetBackdrop({bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background"}) + bgpanel:SetBackdropColor(.2, .2, .2, 1) + + local label = gump:NewLabel(UIParent, UIParent, nil, nil, Loc ["STRING_WAITPLUGIN"]) --localize-me label.color = "silver" - label:SetPoint ("center", WaitForPluginFrame, "center") - label:SetJustifyH ("center") + label:SetPoint("center", WaitForPluginFrame, "center") + label:SetJustifyH("center") label:Hide() WaitForPluginFrame:Hide() - + function _detalhes:WaitForSoloPlugin (instancia) - + instancia:ChangeIcon ([[Interface\GossipFrame\ActiveQuestIcon]]) - + if (WaitForPluginFrame:IsShown() and WaitForPluginFrame:GetParent() == instancia.baseframe) then return _detalhes:ScheduleTimer ("ExecDelayedPlugin", 5, instancia) end - - WaitForPluginFrame:SetParent (instancia.baseframe) - WaitForPluginFrame:SetAllPoints (instancia.baseframe) - local size = math.max (instancia.baseframe:GetHeight()* 0.35, 100) - WaitForPluginFrame.wheel:SetWidth (size) - WaitForPluginFrame.wheel:SetHeight (size) + + WaitForPluginFrame:SetParent(instancia.baseframe) + WaitForPluginFrame:SetAllPoints(instancia.baseframe) + local size = math.max (instancia.baseframe:GetHeight()* 0.35, 100) + WaitForPluginFrame.wheel:SetWidth(size) + WaitForPluginFrame.wheel:SetHeight(size) WaitForPluginFrame:Show() label:Show() bgpanel:Show() RotateAnimGroup:Play() - + return _detalhes:ScheduleTimer ("ExecDelayedPlugin", 5, instancia) end - + function _detalhes:CancelWaitForPlugin() RotateAnimGroup:Stop() WaitForPluginFrame:Hide() label:Hide() bgpanel:Hide() end - + function _detalhes:ExecDelayedPlugin (instancia) RotateAnimGroup:Stop() WaitForPluginFrame:Hide() label:Hide() bgpanel:Hide() - + if (instancia.meu_id == _detalhes.solo) then _detalhes.SoloTables:switch (nil, _detalhes.SoloTables.Mode) - + elseif (instancia.meu_id == _detalhes.raid) then _detalhes.RaidTables:switch (nil, _detalhes.RaidTables.Mode) - + end end end ---> feedback window +--feedback window function _detalhes:OpenFeedbackWindow() - + if (not _G.DetailsFeedbackPanel) then - + gump:CreateSimplePanel (UIParent, 340, 300, Loc ["STRING_FEEDBACK_SEND_FEEDBACK"], "DetailsFeedbackPanel") local panel = _G.DetailsFeedbackPanel - - local label = gump:CreateLabel (panel, Loc ["STRING_FEEDBACK_PREFERED_SITE"]) - label:SetPoint ("topleft", panel, "topleft", 15, -60) - + + local label = gump:CreateLabel(panel, Loc ["STRING_FEEDBACK_PREFERED_SITE"]) + label:SetPoint("topleft", panel, "topleft", 15, -60) + local wowi = gump:NewImage (panel, [[Interface\AddOns\Details\images\icons2]], 101, 34, "artwork", {0/512, 101/512, 163/512, 200/512}) local curse = gump:NewImage (panel, [[Interface\AddOns\Details\images\icons2]], 101, 34, "artwork", {0/512, 101/512, 201/512, 242/512}) local mmoc = gump:NewImage (panel, [[Interface\AddOns\Details\images\icons2]], 101, 34, "artwork", {0/512, 101/512, 243/512, 285/512}) wowi:SetDesaturated (true) curse:SetDesaturated (true) mmoc:SetDesaturated (true) - - wowi:SetPoint ("topleft", panel, "topleft", 17, -100) - curse:SetPoint ("topleft", panel, "topleft", 17, -160) - mmoc:SetPoint ("topleft", panel, "topleft", 17, -220) - - local wowi_title = gump:CreateLabel (panel, "Wow Interface:", nil, nil, "GameFontNormal") - local wowi_desc = gump:CreateLabel (panel, Loc ["STRING_FEEDBACK_WOWI_DESC"], nil, "silver") - wowi_desc:SetWidth (202) - - wowi_title:SetPoint ("topleft", wowi, "topright", 5, 0) - wowi_desc:SetPoint ("topleft", wowi_title, "bottomleft", 0, -1) + + wowi:SetPoint("topleft", panel, "topleft", 17, -100) + curse:SetPoint("topleft", panel, "topleft", 17, -160) + mmoc:SetPoint("topleft", panel, "topleft", 17, -220) + + local wowi_title = gump:CreateLabel(panel, "Wow Interface:", nil, nil, "GameFontNormal") + local wowi_desc = gump:CreateLabel(panel, Loc ["STRING_FEEDBACK_WOWI_DESC"], nil, "silver") + wowi_desc:SetWidth(202) + + wowi_title:SetPoint("topleft", wowi, "topright", 5, 0) + wowi_desc:SetPoint("topleft", wowi_title, "bottomleft", 0, -1) -- - local curse_title = gump:CreateLabel (panel, "Curse:", nil, nil, "GameFontNormal") - local curse_desc = gump:CreateLabel (panel, Loc ["STRING_FEEDBACK_CURSE_DESC"], nil, "silver") - curse_desc:SetWidth (202) - - curse_title:SetPoint ("topleft", curse, "topright", 5, 0) - curse_desc:SetPoint ("topleft", curse_title, "bottomleft", 0, -1) + local curse_title = gump:CreateLabel(panel, "Curse:", nil, nil, "GameFontNormal") + local curse_desc = gump:CreateLabel(panel, Loc ["STRING_FEEDBACK_CURSE_DESC"], nil, "silver") + curse_desc:SetWidth(202) + + curse_title:SetPoint("topleft", curse, "topright", 5, 0) + curse_desc:SetPoint("topleft", curse_title, "bottomleft", 0, -1) -- - local mmoc_title = gump:CreateLabel (panel, "MMO-Champion:", nil, nil, "GameFontNormal") - local mmoc_desc = gump:CreateLabel (panel, Loc ["STRING_FEEDBACK_MMOC_DESC"], nil, "silver") - mmoc_desc:SetWidth (202) - - mmoc_title:SetPoint ("topleft", mmoc, "topright", 5, 0) - mmoc_desc:SetPoint ("topleft", mmoc_title, "bottomleft", 0, -1) - + local mmoc_title = gump:CreateLabel(panel, "MMO-Champion:", nil, nil, "GameFontNormal") + local mmoc_desc = gump:CreateLabel(panel, Loc ["STRING_FEEDBACK_MMOC_DESC"], nil, "silver") + mmoc_desc:SetWidth(202) + + mmoc_title:SetPoint("topleft", mmoc, "topright", 5, 0) + mmoc_desc:SetPoint("topleft", mmoc_title, "bottomleft", 0, -1) + local on_enter = function(self, capsule) capsule.image:SetDesaturated (false) end local on_leave = function(self, capsule) capsule.image:SetDesaturated (true) end - + local on_click = function(_, _, website) if (website == 1) then _detalhes:CopyPaste ([[http://www.wowinterface.com/downloads/addcomment.php?action=addcomment&fileid=23056]]) - + elseif (website == 2) then _detalhes:CopyPaste ([[http://www.curse.com/addons/wow/details]]) - + elseif (website == 3) then _detalhes:CopyPaste ([[http://www.mmo-champion.com/threads/1480721-New-damage-meter-%28Details!%29-need-help-with-tests-and-feedbacks]]) - + end end local wowi_button = gump:CreateButton (panel, on_click, 103, 34, "", 1) - wowi_button:SetPoint ("topleft", wowi, "topleft", -1, 0) + wowi_button:SetPoint("topleft", wowi, "topleft", -1, 0) wowi_button:InstallCustomTexture (nil, nil, nil, nil, true) wowi_button.image = wowi - wowi_button:SetHook ("OnEnter", on_enter) - wowi_button:SetHook ("OnLeave", on_leave) - + wowi_button:SetHook("OnEnter", on_enter) + wowi_button:SetHook("OnLeave", on_leave) + local curse_button = gump:CreateButton (panel, on_click, 103, 34, "", 2) - curse_button:SetPoint ("topleft", curse, "topleft", -1, 0) + curse_button:SetPoint("topleft", curse, "topleft", -1, 0) curse_button:InstallCustomTexture (nil, nil, nil, nil, true) curse_button.image = curse - curse_button:SetHook ("OnEnter", on_enter) - curse_button:SetHook ("OnLeave", on_leave) - + curse_button:SetHook("OnEnter", on_enter) + curse_button:SetHook("OnLeave", on_leave) + local mmoc_button = gump:CreateButton (panel, on_click, 103, 34, "", 3) - mmoc_button:SetPoint ("topleft", mmoc, "topleft", -1, 0) + mmoc_button:SetPoint("topleft", mmoc, "topleft", -1, 0) mmoc_button:InstallCustomTexture (nil, nil, nil, nil, true) mmoc_button.image = mmoc - mmoc_button:SetHook ("OnEnter", on_enter) - mmoc_button:SetHook ("OnLeave", on_leave) - + mmoc_button:SetHook("OnEnter", on_enter) + mmoc_button:SetHook("OnLeave", on_leave) + end - + _G.DetailsFeedbackPanel:Show() - + end - --> interface menu - local f = CreateFrame ("frame", "DetailsInterfaceOptionsPanel", UIParent,"BackdropTemplate") + --interface menu + local f = CreateFrame("frame", "DetailsInterfaceOptionsPanel", UIParent,"BackdropTemplate") f.name = "Details" - f.logo = f:CreateTexture (nil, "overlay") - f.logo:SetPoint ("center", f, "center", 0, 0) - f.logo:SetPoint ("top", f, "top", 25, 56) - f.logo:SetTexture ([[Interface\AddOns\Details\images\logotipo]]) - f.logo:SetSize (256, 128) + f.logo = f:CreateTexture(nil, "overlay") + f.logo:SetPoint("center", f, "center", 0, 0) + f.logo:SetPoint("top", f, "top", 25, 56) + f.logo:SetTexture([[Interface\AddOns\Details\images\logotipo]]) + f.logo:SetSize(256, 128) --InterfaceOptions_AddCategory (f) - - --> open options panel - f.options_button = CreateFrame ("button", nil, f) - f.options_button:SetText (Loc ["STRING_INTERFACE_OPENOPTIONS"]) - 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) + + --open options panel + f.options_button = CreateFrame("button", nil, f) + f.options_button:SetText(Loc ["STRING_INTERFACE_OPENOPTIONS"]) + 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) local lower_instance = _detalhes:GetLowerInstanceNumber() if (not lower_instance) then - --> no window opened? + --no window opened? local instance1 = _detalhes.tabela_instancias [1] if (instance1) then instance1:Enable() @@ -1248,71 +1248,71 @@ end _detalhes:OpenOptionsWindow (_detalhes:GetInstance (lower_instance)) end) - --> create new window - f.new_window_button = CreateFrame ("button", nil, f) - 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) + --create new window + f.new_window_button = CreateFrame("button", nil, f) + 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) _detalhes:CriarInstancia (_, true) end) ---> update details version window +--update details version window function _detalhes:OpenUpdateWindow() - + if (not _G.DetailsUpdateDialog) then - local updatewindow_frame = CreateFrame ("frame", "DetailsUpdateDialog", UIParent, "ButtonFrameTemplate") + local updatewindow_frame = CreateFrame("frame", "DetailsUpdateDialog", UIParent, "ButtonFrameTemplate") updatewindow_frame:SetFrameStrata ("LOW") tinsert (UISpecialFrames, "DetailsUpdateDialog") - updatewindow_frame:SetPoint ("center", UIParent, "center") - updatewindow_frame:SetSize (512, 200) - --updatewindow_frame.portrait:SetTexture ([[Interface\CHARACTERFRAME\TEMPORARYPORTRAIT-FEMALE-GNOME]]) - - --updatewindow_frame.TitleText:SetText ("A New Version Is Available!") --10.0 fuck + updatewindow_frame:SetPoint("center", UIParent, "center") + updatewindow_frame:SetSize(512, 200) + --updatewindow_frame.portrait:SetTexture([[Interface\CHARACTERFRAME\TEMPORARYPORTRAIT-FEMALE-GNOME]]) + + --updatewindow_frame.TitleText:SetText("A New Version Is Available!") --10.0 fuck updatewindow_frame.midtext = updatewindow_frame:CreateFontString (nil, "artwork", "GameFontNormal") - updatewindow_frame.midtext:SetText ("Good news everyone!\nA new version has been forged and is waiting to be looted.") - updatewindow_frame.midtext:SetPoint ("topleft", updatewindow_frame, "topleft", 10, -90) - updatewindow_frame.midtext:SetJustifyH ("center") - updatewindow_frame.midtext:SetWidth (370) - - updatewindow_frame.gnoma = updatewindow_frame:CreateTexture (nil, "artwork") - updatewindow_frame.gnoma:SetPoint ("topright", updatewindow_frame, "topright", -3, -59) - updatewindow_frame.gnoma:SetTexture ("Interface\\AddOns\\Details\\images\\icons2") - updatewindow_frame.gnoma:SetSize (105*1.05, 107*1.05) + updatewindow_frame.midtext:SetText("Good news everyone!\nA new version has been forged and is waiting to be looted.") + updatewindow_frame.midtext:SetPoint("topleft", updatewindow_frame, "topleft", 10, -90) + updatewindow_frame.midtext:SetJustifyH("center") + updatewindow_frame.midtext:SetWidth(370) + + updatewindow_frame.gnoma = updatewindow_frame:CreateTexture(nil, "artwork") + updatewindow_frame.gnoma:SetPoint("topright", updatewindow_frame, "topright", -3, -59) + updatewindow_frame.gnoma:SetTexture("Interface\\AddOns\\Details\\images\\icons2") + updatewindow_frame.gnoma:SetSize(105*1.05, 107*1.05) updatewindow_frame.gnoma:SetTexCoord (0.2021484375, 0, 0.7919921875, 1) - + local editbox = _detalhes.gump:NewTextEntry (updatewindow_frame, nil, "$parentTextEntry", "text", 387, 14) - editbox:SetPoint (20, -136) + editbox:SetPoint(20, -136) editbox:SetAutoFocus (false) - editbox:SetHook ("OnEditFocusGained", function() + editbox:SetHook("OnEditFocusGained", function() editbox.text = "http://www.curse.com/addons/wow/details" editbox:HighlightText() end) - editbox:SetHook ("OnEditFocusLost", function() + editbox:SetHook("OnEditFocusLost", function() editbox.text = "http://www.curse.com/addons/wow/details" editbox:HighlightText() end) - editbox:SetHook ("OnChar", function() + editbox:SetHook("OnChar", function() editbox.text = "http://www.curse.com/addons/wow/details" editbox:HighlightText() end) editbox.text = "http://www.curse.com/addons/wow/details" - - updatewindow_frame.close = CreateFrame ("Button", "DetailsUpdateDialogCloseButton", updatewindow_frame) - 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 = CreateFrame("Button", "DetailsUpdateDialogCloseButton", updatewindow_frame) + updatewindow_frame.close:SetPoint("bottomleft", updatewindow_frame, "bottomleft", 8, 4) + updatewindow_frame.close:SetText("Close") + + updatewindow_frame.close:SetScript("OnClick", function(self) DetailsUpdateDialog:Hide() editbox:ClearFocus() end) - - updatewindow_frame:SetScript ("OnHide", function() + + updatewindow_frame:SetScript("OnHide", function() editbox:ClearFocus() end) - + function _detalhes:UpdateDialogSetFocus() DetailsUpdateDialog:Show() DetailsUpdateDialogTextEntry.MyObject:SetFocus() @@ -1320,33 +1320,33 @@ end _detalhes:ScheduleTimer ("UpdateDialogSetFocus", 1) end - end - + end - ---> minimap icon and hotcorner + + +--minimap icon and hotcorner function _detalhes:RegisterMinimap() - + local LDB = LibStub ("LibDataBroker-1.1", true) local LDBIcon = LDB and LibStub ("LibDBIcon-1.0", true) - + if LDB then local databroker = LDB:NewDataObject ("Details", { type = "data source", icon = [[Interface\AddOns\Details\images\minimap]], text = "0", - + HotCornerIgnore = true, - + OnClick = function(self, button) - + if (button == "LeftButton") then if (IsControlKeyDown()) then _detalhes:ToggleWindows() return end - --> 1 = open options panel + --1 = open options panel if (_detalhes.minimap.onclick_what_todo == 1) then if (_G.DetailsOptionsWindow) then @@ -1364,15 +1364,15 @@ else _detalhes:OpenOptionsWindow (_detalhes:GetInstance (lower_instance)) end - - --> 2 = reset data + + --2 = reset data elseif (_detalhes.minimap.onclick_what_todo == 2) then _detalhes.tabela_historico:resetar() - - --> 3 = show hide windows + + --3 = show hide windows elseif (_detalhes.minimap.onclick_what_todo == 3) then local opened = _detalhes:GetOpenedWindowsAmount() - + if (opened == 0) then _detalhes:ReabrirTodasInstancias() else @@ -1384,53 +1384,53 @@ --minimap menu GameTooltip:Hide() local GameCooltip = GameCooltip - + GameCooltip:Reset() GameCooltip:SetType ("menu") - GameCooltip:SetOption ("ButtonsYMod", -5) - GameCooltip:SetOption ("HeighMod", 5) - GameCooltip:SetOption ("TextSize", 10) + GameCooltip:SetOption("ButtonsYMod", -5) + GameCooltip:SetOption("HeighMod", 5) + GameCooltip:SetOption("TextSize", 10) --344 427 200 268 0.0009765625 --0.672851, 0.833007, 0.391601, 0.522460 - + --GameCooltip:SetBannerImage (1, [[Interface\AddOns\Details\images\icons]], 83*.5, 68*.5, {"bottomleft", "topleft", 1, -4}, {0.672851, 0.833007, 0.391601, 0.522460}, nil) --GameCooltip:SetBannerImage (2, "Interface\\PetBattles\\Weather-Windy", 512*.35, 128*.3, {"bottomleft", "topleft", -25, -4}, {0, 1, 1, 0}) --GameCooltip:SetBannerText (1, "Mini Map Menu", {"left", "right", 2, -5}, "white", 10) - - --> reset + + --reset GameCooltip:AddMenu (1, _detalhes.tabela_historico.resetar, true, nil, nil, Loc ["STRING_ERASE_DATA"], nil, true) GameCooltip:AddIcon ([[Interface\COMMON\VOICECHAT-MUTED]], 1, 1, 14, 14) - + GameCooltip:AddLine ("$div") - - --> nova instancia + + --nova instancia GameCooltip:AddMenu (1, _detalhes.CriarInstancia, true, nil, nil, Loc ["STRING_MINIMAPMENU_NEWWINDOW"], nil, true) --GameCooltip:AddIcon ([[Interface\Buttons\UI-AttributeButton-Encourage-Up]], 1, 1, 10, 10, 4/16, 12/16, 4/16, 12/16) GameCooltip:AddIcon ([[Interface\AddOns\Details\images\icons]], 1, 1, 12, 11, 462/512, 473/512, 1/512, 11/512) - - --> reopen all windows + + --reopen all windows GameCooltip:AddMenu (1, _detalhes.ReabrirTodasInstancias, true, nil, nil, Loc ["STRING_MINIMAPMENU_REOPENALL"], nil, true) GameCooltip:AddIcon ([[Interface\Buttons\UI-MicroStream-Green]], 1, 1, 14, 14, 0.1875, 0.8125, 0.84375, 0.15625) - --> close all windows + --close all windows GameCooltip:AddMenu (1, _detalhes.ShutDownAllInstances, true, nil, nil, Loc ["STRING_MINIMAPMENU_CLOSEALL"], nil, true) GameCooltip:AddIcon ([[Interface\Buttons\UI-MicroStream-Red]], 1, 1, 14, 14, 0.1875, 0.8125, 0.15625, 0.84375) GameCooltip:AddLine ("$div") - - --> lock + + --lock GameCooltip:AddMenu (1, _detalhes.TravasInstancias, true, nil, nil, Loc ["STRING_MINIMAPMENU_LOCK"], nil, true) GameCooltip:AddIcon ([[Interface\PetBattles\PetBattle-LockIcon]], 1, 1, 14, 14, 0.0703125, 0.9453125, 0.0546875, 0.9453125) - + GameCooltip:AddMenu (1, _detalhes.DestravarInstancias, true, nil, nil, Loc ["STRING_MINIMAPMENU_UNLOCK"], nil, true) GameCooltip:AddIcon ([[Interface\PetBattles\PetBattle-LockIcon]], 1, 1, 14, 14, 0.0703125, 0.9453125, 0.0546875, 0.9453125, "gray") - + GameCooltip:AddLine ("$div") - - --> disable minimap icon + + --disable minimap icon local disable_minimap = function() _detalhes.minimap.hide = not value - + LDBIcon:Refresh ("Details", _detalhes.minimap) if (_detalhes.minimap.hide) then LDBIcon:Hide ("Details") @@ -1440,15 +1440,15 @@ end GameCooltip:AddMenu (1, disable_minimap, true, nil, nil, Loc ["STRING_MINIMAPMENU_HIDEICON"], nil, true) GameCooltip:AddIcon ([[Interface\Buttons\UI-Panel-HideButton-Disabled]], 1, 1, 14, 14, 7/32, 24/32, 8/32, 24/32, "gray") - + -- - - GameCooltip:SetBackdrop (1, _detalhes.tooltip_backdrop, nil, _detalhes.tooltip_border_color) + + GameCooltip:SetBackdrop(1, _detalhes.tooltip_backdrop, nil, _detalhes.tooltip_border_color) GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], {.6, 0.1, 0.64453125, 0}, {.8, .8, .8, 0.2}, true) - + GameCooltip:SetOwner (self, "topright", "bottomleft") GameCooltip:ShowCooltip() - + end end, @@ -1465,19 +1465,19 @@ tooltip:AddLine ("|cFFCFCFCFctrl + left click|r: show/hide windows") end, }) - + if (databroker and not LDBIcon:IsRegistered ("Details")) then LDBIcon:Register ("Details", databroker, self.minimap) end - + _detalhes.databroker = databroker - + end end - + 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 @@ -1487,17 +1487,17 @@ else _detalhes:OpenOptionsWindow (_detalhes:GetInstance (lower_instance)) end - + elseif (_detalhes.hotcorner_topleft.onclick_what_todo == 2) then _detalhes.tabela_historico:resetar() 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) @@ -1507,46 +1507,46 @@ _detalhes:OpenOptionsWindow (_detalhes:GetInstance (lower_instance)) end end - + local tooltip_hotcorner = function() GameTooltip:AddLine ("Details!", 1, 1, 1, 1) if (_detalhes.hotcorner_topleft.onclick_what_todo == 1) then GameTooltip:AddLine ("|cFF00FF00Left Click:|r open options panel.", 1, 1, 1, 1) - + elseif (_detalhes.hotcorner_topleft.onclick_what_todo == 2) then GameTooltip:AddLine ("|cFF00FF00Left Click:|r clear all segments.", 1, 1, 1, 1) - + end end - + if (_G.HotCorners) then _G.HotCorners:RegisterHotCornerButton ( - --> absolute name + --absolute name "Details", - --> corner - "TOPLEFT", - --> config table + --corner + "TOPLEFT", + --config table _detalhes.hotcorner_topleft, - --> frame _G name - "DetailsLeftCornerButton", - --> icon - [[Interface\AddOns\Details\images\minimap]], - --> tooltip + --frame _G name + "DetailsLeftCornerButton", + --icon + [[Interface\AddOns\Details\images\minimap]], + --tooltip tooltip_hotcorner, - --> click function - on_click_on_hotcorner_button, - --> menus - nil, - --> quick click + --click function + on_click_on_hotcorner_button, + --menus + nil, + --quick click { - {func = quickclick_func1, name = "Details! - Reset Data"}, + {func = quickclick_func1, name = "Details! - Reset Data"}, {func = quickclick_func2, name = "Details! - Open Options"} }, - --> onenter + --onenter nil, - --> onleave + --onleave nil, - --> is install + --is install true ) end @@ -1564,7 +1564,7 @@ function _detalhes:InitializeAPIWindow() DetailsAPI2Frame.__iconcoords = {449/512, 480/512, 62/512, 83/512} DetailsAPI2Frame.__iconcolor = "DETAILS_API_ICON" DetailsPluginContainerWindow.EmbedPlugin(DetailsAPI2Frame, DetailsAPI2Frame, true) - + function DetailsAPI2Frame.RefreshWindow() _detalhes.OpenAPI() end @@ -1582,51 +1582,51 @@ end function Details:LoadFramesForBroadcastTools() - --> event tracker - --> if enabled and not loaded, load it + --event tracker + --if enabled and not loaded, load it if (_detalhes.event_tracker.enabled and not _detalhes.Broadcaster_EventTrackerLoaded) then Details:CreateEventTrackerFrame(UIParent, "DetailsEventTracker") end - - --> if enabled and loaded, refresh and show + + --if enabled and loaded, refresh and show if (_detalhes.event_tracker.enabled and _detalhes.Broadcaster_EventTrackerLoaded) then _detalhes:UpdateEventTrackerFrame() _G.DetailsEventTracker:Show() end - - --> if not enabled but loaded, hide it + + --if not enabled but loaded, hide it if (not _detalhes.event_tracker.enabled and _detalhes.Broadcaster_EventTrackerLoaded) then _G.DetailsEventTracker:Hide() end - - --> current dps + + --current dps local bIsEnabled = _detalhes.realtime_dps_meter.enabled and (_detalhes.realtime_dps_meter.arena_enabled or _detalhes.realtime_dps_meter.mythic_dungeon_enabled) - - --> if enabled and not loaded, load it + + --if enabled and not loaded, load it if (bIsEnabled and not _detalhes.Broadcaster_CurrentDpsLoaded) then Details:CreateCurrentDpsFrame(UIParent, "DetailsCurrentDpsMeter") end - - --> if enabled, check if can show + + --if enabled, check if can show if (bIsEnabled and _detalhes.Broadcaster_CurrentDpsLoaded) then if (_detalhes.realtime_dps_meter.mythic_dungeon_enabled) then local zoneName, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceMapID, instanceGroupSize = GetInstanceInfo() if (difficultyID == 8) then - --> player is inside a mythic dungeon + --player is inside a mythic dungeon _G.DetailsCurrentDpsMeter:StartForMythicDungeon() end end - - if (_detalhes.realtime_dps_meter.arena_enabled) then + + if (_detalhes.realtime_dps_meter.arena_enabled) then local zoneName, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceMapID, instanceGroupSize = GetInstanceInfo() if (instanceType == "arena") then - --> player is inside an arena + --player is inside an arena _G.DetailsCurrentDpsMeter:StartForArenaMatch() end end end - - --> if not enabled but loaded, hide it + + --if not enabled but loaded, hide it if (not bIsEnabled and _detalhes.Broadcaster_CurrentDpsLoaded) then _G.DetailsCurrentDpsMeter:Hide() end @@ -1634,15 +1634,15 @@ end function _detalhes:FormatBackground (f) - f:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) - f:SetBackdropColor (.5, .5, .5, .5) - f:SetBackdropBorderColor (0, 0, 0, 1) - + f:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) + f:SetBackdropColor(.5, .5, .5, .5) + f:SetBackdropBorderColor(0, 0, 0, 1) + if (not f.__background) then - f.__background = f:CreateTexture (nil, "background") + f.__background = f:CreateTexture(nil, "background") end - - f.__background:SetTexture ([[Interface\AddOns\Details\images\background]], true) + + f.__background:SetTexture([[Interface\AddOns\Details\images\background]], true) f.__background:SetAlpha (0.7) f.__background:SetVertexColor (0.27, 0.27, 0.27) f.__background:SetVertTile (true) @@ -1660,7 +1660,7 @@ function Details.ShowCopyValueFrame(textToShow) tinsert(UISpecialFrames, "DetailsCopyValueFrame") frame.editBox = CreateFrame("editbox", nil, frame) - frame.editBox:SetPoint ("topleft", frame, "topleft") + frame.editBox:SetPoint("topleft", frame, "topleft") frame.editBox:SetAutoFocus(false) frame.editBox:SetFontObject("GameFontHighlightSmall") frame.editBox:SetAllPoints() diff --git a/frames/anime.lua b/frames/anime.lua index f3529faf..a0600ca0 100644 --- a/frames/anime.lua +++ b/frames/anime.lua @@ -13,7 +13,7 @@ function _detalhes:PlayGlow (frame) --PlaySound ("LFG_Rewards", "master") end ---> WatchFrame copy, got removed on WoD +--WatchFrame copy, got removed on WoD local function DetailsTutorialAlertFrame_OnFinishSlideIn (frame) frame.ScrollChild.Shine:Show(); frame.ScrollChild.IconShine:Show(); @@ -85,40 +85,40 @@ function _detalhes.PlayBestDamageOnGuild (damage) damage = damage or 100000000 - --> create the main frame - local DetailsNewDamageRecord = CreateFrame ("frame", "DetailsNewDamageRecordAnimationFrame", UIParent) - DetailsNewDamageRecord:SetPoint ("CENTER", UIParent, "CENTER", 0, -200) - DetailsNewDamageRecord:SetSize (300, 300) + --create the main frame + local DetailsNewDamageRecord = CreateFrame("frame", "DetailsNewDamageRecordAnimationFrame", UIParent) + DetailsNewDamageRecord:SetPoint("CENTER", UIParent, "CENTER", 0, -200) + DetailsNewDamageRecord:SetSize(300, 300) - --> single animation group + --single animation group local MainAnimationGroup = DetailsNewDamageRecord:CreateAnimationGroup ("DetailsNewDamageRecordAnimationGroup") MainAnimationGroup:SetLooping ("NONE") - --> widgets: + --widgets: ---------------------------------------------- - local BaseTexture = DetailsNewDamageRecord:CreateTexture ("BaseTextureTexture", "ARTWORK") - BaseTexture:SetTexture ([[Interface\ACHIEVEMENTFRAME\UI-Achievement-Alert-Background-Mini]]) + local BaseTexture = DetailsNewDamageRecord:CreateTexture("BaseTextureTexture", "ARTWORK") + BaseTexture:SetTexture([[Interface\ACHIEVEMENTFRAME\UI-Achievement-Alert-Background-Mini]]) BaseTexture:SetDrawLayer ("ARTWORK", -5) - BaseTexture:SetPoint ("center", DetailsNewDamageRecord, "center", 0, 0) - BaseTexture:SetSize (256, 64) + BaseTexture:SetPoint("center", DetailsNewDamageRecord, "center", 0, 0) + BaseTexture:SetSize(256, 64) BaseTexture:SetVertexColor (0.99999779462814, 0.99999779462814, 0.99999779462814, 0.99999779462814) - --> animations for BaseTexture + --animations for BaseTexture - BaseTexture.alpha = MainAnimationGroup:CreateAnimation ("ALPHA") + BaseTexture.alpha = MainAnimationGroup:CreateAnimation("ALPHA") BaseTexture.alpha:SetTarget (BaseTexture) BaseTexture.alpha:SetOrder (1) - BaseTexture.alpha:SetDuration (0.14869952201843) + BaseTexture.alpha:SetDuration(0.14869952201843) BaseTexture.alpha:SetStartDelay (0) BaseTexture.alpha:SetEndDelay (0) BaseTexture.alpha:SetFromAlpha (0) BaseTexture.alpha:SetToAlpha (1) - BaseTexture.alpha = MainAnimationGroup:CreateAnimation ("ALPHA") + BaseTexture.alpha = MainAnimationGroup:CreateAnimation("ALPHA") BaseTexture.alpha:SetTarget (BaseTexture) BaseTexture.alpha:SetOrder (2) - BaseTexture.alpha:SetDuration (1) + BaseTexture.alpha:SetDuration(1) BaseTexture.alpha:SetStartDelay (5) BaseTexture.alpha:SetEndDelay (0) BaseTexture.alpha:SetFromAlpha (1) @@ -126,11 +126,11 @@ function _detalhes.PlayBestDamageOnGuild (damage) ---------------------------------------------- - local BigFlash = DetailsNewDamageRecord:CreateTexture ("BigFlashTexture", "OVERLAY") - BigFlash:SetTexture ([[Interface\ACHIEVEMENTFRAME\UI-Achievement-Alert-Glow]]) + local BigFlash = DetailsNewDamageRecord:CreateTexture("BigFlashTexture", "OVERLAY") + BigFlash:SetTexture([[Interface\ACHIEVEMENTFRAME\UI-Achievement-Alert-Glow]]) BigFlash:SetDrawLayer ("OVERLAY", 0) - BigFlash:SetPoint ("center", DetailsNewDamageRecord, "center", -2, 2) - BigFlash:SetSize (314, 100) + BigFlash:SetPoint("center", DetailsNewDamageRecord, "center", -2, 2) + BigFlash:SetSize(314, 100) BigFlash:SetDesaturated (false) BigFlash:SetTexCoord (0.0010000000149012, 0.77400001525879, 0.0010000000149012, 0.65800003051758) if (0 ~= 0) then @@ -138,22 +138,22 @@ function _detalhes.PlayBestDamageOnGuild (damage) end BigFlash:SetVertexColor (0.96470373868942, 0.98823314905167, 0.99999779462814, 0.99999779462814) BigFlash:SetAlpha (1) - BigFlash:SetBlendMode ("ADD") + BigFlash:SetBlendMode("ADD") - --> animations for BigFlash + --animations for BigFlash - BigFlash.alpha = MainAnimationGroup:CreateAnimation ("ALPHA") + BigFlash.alpha = MainAnimationGroup:CreateAnimation("ALPHA") BigFlash.alpha:SetTarget (BigFlash) BigFlash.alpha:SetOrder (1) - BigFlash.alpha:SetDuration (0.11600000411272) + BigFlash.alpha:SetDuration(0.11600000411272) BigFlash.alpha:SetStartDelay (0) BigFlash.alpha:SetEndDelay (0) BigFlash.alpha:SetFromAlpha (0) BigFlash.alpha:SetToAlpha (1) - BigFlash.alpha = MainAnimationGroup:CreateAnimation ("ALPHA") + BigFlash.alpha = MainAnimationGroup:CreateAnimation("ALPHA") BigFlash.alpha:SetTarget (BigFlash) BigFlash.alpha:SetOrder (2) - BigFlash.alpha:SetDuration (0.31600001454353) + BigFlash.alpha:SetDuration(0.31600001454353) BigFlash.alpha:SetStartDelay (0) BigFlash.alpha:SetEndDelay (0) BigFlash.alpha:SetFromAlpha (1) @@ -161,11 +161,11 @@ function _detalhes.PlayBestDamageOnGuild (damage) ---------------------------------------------- - local FlashSwipe = DetailsNewDamageRecord:CreateTexture ("FlashSwipeTexture", "OVERLAY") - FlashSwipe:SetTexture ([[Interface\ACHIEVEMENTFRAME\UI-Achievement-Alert-Glow]]) + local FlashSwipe = DetailsNewDamageRecord:CreateTexture("FlashSwipeTexture", "OVERLAY") + FlashSwipe:SetTexture([[Interface\ACHIEVEMENTFRAME\UI-Achievement-Alert-Glow]]) FlashSwipe:SetDrawLayer ("OVERLAY", 7) - FlashSwipe:SetPoint ("center", DetailsNewDamageRecord, "center", -99, 0) - FlashSwipe:SetSize (100, 57) + FlashSwipe:SetPoint("center", DetailsNewDamageRecord, "center", -99, 0) + FlashSwipe:SetSize(100, 57) FlashSwipe:SetDesaturated (false) FlashSwipe:SetTexCoord (0.78199996948242, 0.91900001525879, 0.0010000000149012, 0.2760000038147) if (0 ~= 0) then @@ -173,29 +173,29 @@ function _detalhes.PlayBestDamageOnGuild (damage) end FlashSwipe:SetVertexColor (0.86666476726532, 0.54117530584335, 0, 0.99999779462814) FlashSwipe:SetAlpha (1) - FlashSwipe:SetBlendMode ("ADD") + FlashSwipe:SetBlendMode("ADD") - --> animations for FlashSwipe + --animations for FlashSwipe - FlashSwipe.alpha = MainAnimationGroup:CreateAnimation ("ALPHA") + FlashSwipe.alpha = MainAnimationGroup:CreateAnimation("ALPHA") FlashSwipe.alpha:SetTarget (FlashSwipe) FlashSwipe.alpha:SetOrder (1) - FlashSwipe.alpha:SetDuration (0.31600001454353) + FlashSwipe.alpha:SetDuration(0.31600001454353) FlashSwipe.alpha:SetStartDelay (0.20000000298023) FlashSwipe.alpha:SetEndDelay (0) FlashSwipe.alpha:SetFromAlpha (0) FlashSwipe.alpha:SetToAlpha (0.501051902771) - FlashSwipe.translation = MainAnimationGroup:CreateAnimation ("TRANSLATION") + FlashSwipe.translation = MainAnimationGroup:CreateAnimation("TRANSLATION") FlashSwipe.translation:SetTarget (FlashSwipe) FlashSwipe.translation:SetOrder (1) - FlashSwipe.translation:SetDuration (0.81599998474121) + FlashSwipe.translation:SetDuration(0.81599998474121) FlashSwipe.translation:SetStartDelay (0.20000000298023) FlashSwipe.translation:SetEndDelay (0) FlashSwipe.translation:SetOffset (200, 0) - FlashSwipe.alpha = MainAnimationGroup:CreateAnimation ("ALPHA") + FlashSwipe.alpha = MainAnimationGroup:CreateAnimation("ALPHA") FlashSwipe.alpha:SetTarget (FlashSwipe) FlashSwipe.alpha:SetOrder (1) - FlashSwipe.alpha:SetDuration (0.31600001454353) + FlashSwipe.alpha:SetDuration(0.31600001454353) FlashSwipe.alpha:SetStartDelay (0.69999998807907) FlashSwipe.alpha:SetEndDelay (0) FlashSwipe.alpha:SetFromAlpha (0.501051902771) @@ -203,11 +203,11 @@ function _detalhes.PlayBestDamageOnGuild (damage) ---------------------------------------------- - local Portrait = DetailsNewDamageRecord:CreateTexture ("PortraitTexture", "OVERLAY") - Portrait:SetTexture ([[Interface\ARCHEOLOGY\ARCH-FLAREEFFECT]]) + local Portrait = DetailsNewDamageRecord:CreateTexture("PortraitTexture", "OVERLAY") + Portrait:SetTexture([[Interface\ARCHEOLOGY\ARCH-FLAREEFFECT]]) Portrait:SetDrawLayer ("OVERLAY", -5) - Portrait:SetPoint ("center", DetailsNewDamageRecord, "center", 3, 0) - Portrait:SetSize (246, 44) + Portrait:SetPoint("center", DetailsNewDamageRecord, "center", 3, 0) + Portrait:SetSize(246, 44) Portrait:SetDesaturated (false) Portrait:SetTexCoord (0.051753740310669, 0.81701484680176, 0.086334381103516, 0.25102617263794) if (0 ~= 0) then @@ -215,22 +215,22 @@ function _detalhes.PlayBestDamageOnGuild (damage) end Portrait:SetVertexColor (0.99999779462814, 0.99999779462814, 0.99999779462814, 0.99999779462814) Portrait:SetAlpha (1) - Portrait:SetBlendMode ("BLEND") + Portrait:SetBlendMode("BLEND") - --> animations for Portrait + --animations for Portrait - Portrait.alpha = MainAnimationGroup:CreateAnimation ("ALPHA") + Portrait.alpha = MainAnimationGroup:CreateAnimation("ALPHA") Portrait.alpha:SetTarget (Portrait) Portrait.alpha:SetOrder (1) - Portrait.alpha:SetDuration (0.41600000858307) + Portrait.alpha:SetDuration(0.41600000858307) Portrait.alpha:SetStartDelay (0) Portrait.alpha:SetEndDelay (0) Portrait.alpha:SetFromAlpha (0) Portrait.alpha:SetToAlpha (1) - Portrait.scale = MainAnimationGroup:CreateAnimation ("SCALE") + Portrait.scale = MainAnimationGroup:CreateAnimation("SCALE") Portrait.scale:SetTarget (Portrait) Portrait.scale:SetOrder (1) - Portrait.scale:SetDuration (0.21600000560284) + Portrait.scale:SetDuration(0.21600000560284) Portrait.scale:SetStartDelay (0) Portrait.scale:SetEndDelay (0) @@ -243,10 +243,10 @@ function _detalhes.PlayBestDamageOnGuild (damage) end Portrait.scale:SetOrigin ("center", 0, 0) - Portrait.alpha = MainAnimationGroup:CreateAnimation ("ALPHA") + Portrait.alpha = MainAnimationGroup:CreateAnimation("ALPHA") Portrait.alpha:SetTarget (Portrait) Portrait.alpha:SetOrder (2) - Portrait.alpha:SetDuration (1) + Portrait.alpha:SetDuration(1) Portrait.alpha:SetStartDelay (4.7000002861023) Portrait.alpha:SetEndDelay (0) Portrait.alpha:SetFromAlpha (1) @@ -254,11 +254,11 @@ function _detalhes.PlayBestDamageOnGuild (damage) ---------------------------------------------- - local DamageIcon = DetailsNewDamageRecord:CreateTexture ("DamageIconTexture", "OVERLAY") - DamageIcon:SetTexture ([[Interface\LFGFRAME\UI-LFG-ICON-ROLES]]) + local DamageIcon = DetailsNewDamageRecord:CreateTexture("DamageIconTexture", "OVERLAY") + DamageIcon:SetTexture([[Interface\LFGFRAME\UI-LFG-ICON-ROLES]]) DamageIcon:SetDrawLayer ("OVERLAY", 2) - DamageIcon:SetPoint ("center", DetailsNewDamageRecord, "center", -97, 1) - DamageIcon:SetSize (32, 32) + DamageIcon:SetPoint("center", DetailsNewDamageRecord, "center", -97, 1) + DamageIcon:SetSize(32, 32) DamageIcon:SetDesaturated (false) DamageIcon:SetTexCoord (0.27200000762939, 0.51899997711182, 0.25837841033936, 0.51399997711182) if (0 ~= 0) then @@ -266,22 +266,22 @@ function _detalhes.PlayBestDamageOnGuild (damage) end DamageIcon:SetVertexColor (0.99999779462814, 0.99999779462814, 0.99999779462814, 0.99999779462814) DamageIcon:SetAlpha (1) - DamageIcon:SetBlendMode ("BLEND") + DamageIcon:SetBlendMode("BLEND") - --> animations for DamageIcon + --animations for DamageIcon - DamageIcon.alpha = MainAnimationGroup:CreateAnimation ("ALPHA") + DamageIcon.alpha = MainAnimationGroup:CreateAnimation("ALPHA") DamageIcon.alpha:SetTarget (DamageIcon) DamageIcon.alpha:SetOrder (1) - DamageIcon.alpha:SetDuration (0.51599997282028) + DamageIcon.alpha:SetDuration(0.51599997282028) DamageIcon.alpha:SetStartDelay (0) DamageIcon.alpha:SetEndDelay (0) DamageIcon.alpha:SetFromAlpha (0) DamageIcon.alpha:SetToAlpha (1) - DamageIcon.alpha = MainAnimationGroup:CreateAnimation ("ALPHA") + DamageIcon.alpha = MainAnimationGroup:CreateAnimation("ALPHA") DamageIcon.alpha:SetTarget (DamageIcon) DamageIcon.alpha:SetOrder (2) - DamageIcon.alpha:SetDuration (1) + DamageIcon.alpha:SetDuration(1) DamageIcon.alpha:SetStartDelay (4.5999999046326) DamageIcon.alpha:SetEndDelay (0) DamageIcon.alpha:SetFromAlpha (1) @@ -291,36 +291,36 @@ function _detalhes.PlayBestDamageOnGuild (damage) local NewDamageRecord = DetailsNewDamageRecord:CreateFontString ("NewDamageRecordFontString", "OVERLAY") NewDamageRecord:SetFont ([=[Fonts\FRIZQT__.TTF]=], 12, "OUTLINE") - NewDamageRecord:SetText ("Damage Record!") + NewDamageRecord:SetText("Damage Record!") NewDamageRecord:SetDrawLayer ("OVERLAY", 0) - NewDamageRecord:SetPoint ("center", DetailsNewDamageRecord, "center", 18, 7) - NewDamageRecord:SetSize (181, 20) + NewDamageRecord:SetPoint("center", DetailsNewDamageRecord, "center", 18, 7) + NewDamageRecord:SetSize(181, 20) NewDamageRecord:SetTextColor (1, 1, 1) NewDamageRecord:SetAlpha (1) - NewDamageRecord:SetJustifyH ("CENTER") + NewDamageRecord:SetJustifyH("CENTER") - --> animations for NewDamageRecord + --animations for NewDamageRecord - NewDamageRecord.alpha = MainAnimationGroup:CreateAnimation ("ALPHA") + NewDamageRecord.alpha = MainAnimationGroup:CreateAnimation("ALPHA") NewDamageRecord.alpha:SetTarget (NewDamageRecord) NewDamageRecord.alpha:SetOrder (1) - NewDamageRecord.alpha:SetDuration (0.016000000759959) + NewDamageRecord.alpha:SetDuration(0.016000000759959) NewDamageRecord.alpha:SetStartDelay (0) NewDamageRecord.alpha:SetEndDelay (0) NewDamageRecord.alpha:SetFromAlpha (0) NewDamageRecord.alpha:SetToAlpha (0) - NewDamageRecord.alpha = MainAnimationGroup:CreateAnimation ("ALPHA") + NewDamageRecord.alpha = MainAnimationGroup:CreateAnimation("ALPHA") NewDamageRecord.alpha:SetTarget (NewDamageRecord) NewDamageRecord.alpha:SetOrder (2) - NewDamageRecord.alpha:SetDuration (0.51599997282028) + NewDamageRecord.alpha:SetDuration(0.51599997282028) NewDamageRecord.alpha:SetStartDelay (0.40000000596046) NewDamageRecord.alpha:SetEndDelay (4.0999999046326) NewDamageRecord.alpha:SetFromAlpha (0) NewDamageRecord.alpha:SetToAlpha (1) - NewDamageRecord.alpha = MainAnimationGroup:CreateAnimation ("ALPHA") + NewDamageRecord.alpha = MainAnimationGroup:CreateAnimation("ALPHA") NewDamageRecord.alpha:SetTarget (NewDamageRecord) NewDamageRecord.alpha:SetOrder (3) - NewDamageRecord.alpha:SetDuration (1) + NewDamageRecord.alpha:SetDuration(1) NewDamageRecord.alpha:SetStartDelay (0.10000000149012) NewDamageRecord.alpha:SetEndDelay (0) NewDamageRecord.alpha:SetFromAlpha (1) @@ -330,42 +330,42 @@ function _detalhes.PlayBestDamageOnGuild (damage) local DamageAmount = DetailsNewDamageRecord:CreateFontString ("DamageAmountFontString", "OVERLAY") DamageAmount:SetFont ([=[Fonts\FRIZQT__.TTF]=], 12, "THICKOUTLINE") - DamageAmount:SetText (_detalhes:comma_value (damage)) + DamageAmount:SetText(_detalhes:comma_value (damage)) DamageAmount:SetDrawLayer ("OVERLAY", 0) - DamageAmount:SetPoint ("center", DetailsNewDamageRecord, "center", 18, -7) - DamageAmount:SetSize (100, 20) + DamageAmount:SetPoint("center", DetailsNewDamageRecord, "center", 18, -7) + DamageAmount:SetSize(100, 20) DamageAmount:SetTextColor (1, 1, 1) DamageAmount:SetAlpha (1) - DamageAmount:SetJustifyH ("CENTER") + DamageAmount:SetJustifyH("CENTER") - --> animations for DamageAmount + --animations for DamageAmount - DamageAmount.alpha = MainAnimationGroup:CreateAnimation ("ALPHA") + DamageAmount.alpha = MainAnimationGroup:CreateAnimation("ALPHA") DamageAmount.alpha:SetTarget (DamageAmount) DamageAmount.alpha:SetOrder (1) - DamageAmount.alpha:SetDuration (0.016000000759959) + DamageAmount.alpha:SetDuration(0.016000000759959) DamageAmount.alpha:SetStartDelay (0) DamageAmount.alpha:SetEndDelay (0) DamageAmount.alpha:SetFromAlpha (0) DamageAmount.alpha:SetToAlpha (0) - DamageAmount.alpha = MainAnimationGroup:CreateAnimation ("ALPHA") + DamageAmount.alpha = MainAnimationGroup:CreateAnimation("ALPHA") DamageAmount.alpha:SetTarget (DamageAmount) DamageAmount.alpha:SetOrder (2) - DamageAmount.alpha:SetDuration (0.51599997282028) + DamageAmount.alpha:SetDuration(0.51599997282028) DamageAmount.alpha:SetStartDelay (0.40000000596046) DamageAmount.alpha:SetEndDelay (0) DamageAmount.alpha:SetFromAlpha (0) DamageAmount.alpha:SetToAlpha (1) - DamageAmount.alpha = MainAnimationGroup:CreateAnimation ("ALPHA") + DamageAmount.alpha = MainAnimationGroup:CreateAnimation("ALPHA") DamageAmount.alpha:SetTarget (DamageAmount) DamageAmount.alpha:SetOrder (3) - DamageAmount.alpha:SetDuration (1.0160000324249) + DamageAmount.alpha:SetDuration(1.0160000324249) DamageAmount.alpha:SetStartDelay (4.2000002861023) DamageAmount.alpha:SetEndDelay (0) DamageAmount.alpha:SetFromAlpha (1) DamageAmount.alpha:SetToAlpha (0) - --> test the animation + --test the animation MainAnimationGroup:Play() diff --git a/frames/fw_mods.lua b/frames/fw_mods.lua index 680fbf54..d3b41d5a 100644 --- a/frames/fw_mods.lua +++ b/frames/fw_mods.lua @@ -21,7 +21,7 @@ function gump:NewLabel2 (parent, container, member, text, font, size, color) if (member) then container [member] = newFontString end - newFontString:SetText (text) + newFontString:SetText(text) if (size) then _detalhes:SetFontSize (newFontString, size) @@ -31,7 +31,7 @@ function gump:NewLabel2 (parent, container, member, text, font, size, color) newFontString:SetTextColor (unpack (color)) end - newFontString:SetJustifyH ("LEFT") + newFontString:SetJustifyH("LEFT") return newFontString end @@ -48,13 +48,13 @@ function gump:NewDetailsButton (parent, container, instancia, func, param1, para local new_button if (ischeck) then - new_button = CreateFrame ("CheckButton", FrameName, parent, inherits) + new_button = CreateFrame("CheckButton", FrameName, parent, inherits) else - new_button = CreateFrame ("Button", FrameName, parent) + new_button = CreateFrame("Button", FrameName, parent) end - new_button:SetWidth (w) - new_button:SetHeight (h) + new_button:SetWidth(w) + new_button:SetHeight(h) if (not pic_down and pic_up) then pic_down = pic_up @@ -66,32 +66,32 @@ function gump:NewDetailsButton (parent, container, instancia, func, param1, para pic_highlight = pic_up end - new_button:SetNormalTexture (pic_up) - new_button:SetPushedTexture (pic_down) + new_button:SetNormalTexture(pic_up) + new_button:SetPushedTexture(pic_down) new_button:SetDisabledTexture (pic_disabled) - new_button:SetHighlightTexture (pic_highlight, "ADD") + new_button:SetHighlightTexture(pic_highlight, "ADD") local new_text = new_button:CreateFontString (nil, "OVERLAY", "GameFontNormal") - new_text:SetPoint ("center", new_button, "center") + new_text:SetPoint("center", new_button, "center") new_button.text = new_text - new_button.supportFrame = CreateFrame ("frame", nil, new_button) - new_button.supportFrame:SetPoint ("topleft", new_button, "topleft") - new_button.supportFrame:SetPoint ("bottomright", new_button, "bottomright") + new_button.supportFrame = CreateFrame("frame", nil, new_button) + new_button.supportFrame:SetPoint("topleft", new_button, "topleft") + new_button.supportFrame:SetPoint("bottomright", new_button, "bottomright") new_button.supportFrame:SetFrameLevel (new_button:GetFrameLevel()+1) - new_button.supportFrame.disable_overlay = new_button.supportFrame:CreateTexture (nil, "overlay") - new_button.supportFrame.disable_overlay:SetTexture ("Interface\\AddOns\\Details\\images\\button_disable_overlay") - new_button.supportFrame.disable_overlay:SetPoint ("topleft", new_button.supportFrame, "topleft") - new_button.supportFrame.disable_overlay:SetPoint ("bottomright", new_button.supportFrame, "bottomright") + new_button.supportFrame.disable_overlay = new_button.supportFrame:CreateTexture(nil, "overlay") + new_button.supportFrame.disable_overlay:SetTexture("Interface\\AddOns\\Details\\images\\button_disable_overlay") + new_button.supportFrame.disable_overlay:SetPoint("topleft", new_button.supportFrame, "topleft") + new_button.supportFrame.disable_overlay:SetPoint("bottomright", new_button.supportFrame, "bottomright") new_button.supportFrame.disable_overlay:Hide() local rightFunction = options.rightFunc - new_button:SetScript ("OnDisable", function() + new_button:SetScript("OnDisable", function() new_button.supportFrame.disable_overlay:Show() end) - new_button:SetScript ("OnEnable", function() + new_button:SetScript("OnEnable", function() new_button.supportFrame.disable_overlay:Hide() end) @@ -106,7 +106,7 @@ function gump:NewDetailsButton (parent, container, instancia, func, param1, para new_button.enter = false - new_button:SetScript ("OnMouseDown", function(self, button) + new_button:SetScript("OnMouseDown", function(self, button) if (not self:IsEnabled()) then return end @@ -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 @@ -181,7 +181,7 @@ function gump:NewDetailsButton (parent, container, instancia, func, param1, para new_button.tooltip = nil - new_button:SetScript ("OnEnter", function() + new_button:SetScript("OnEnter", function() new_button.enter = true @@ -203,7 +203,7 @@ function gump:NewDetailsButton (parent, container, instancia, func, param1, para end end) - new_button:SetScript ("OnLeave", function() + new_button:SetScript("OnLeave", function() new_button.enter = false @@ -221,10 +221,10 @@ function gump:NewDetailsButton (parent, container, instancia, func, param1, para end) function new_button:ChangeIcon (icon1, icon2, icon3, icon4) - new_button:SetNormalTexture (icon1) - new_button:SetPushedTexture (icon2) + new_button:SetNormalTexture(icon1) + new_button:SetPushedTexture(icon2) new_button:SetDisabledTexture (icon3) - new_button:SetHighlightTexture (icon4, "ADD") + new_button:SetHighlightTexture(icon4, "ADD") end function new_button:InstallCustomTexture (texture, rect) @@ -233,17 +233,17 @@ function gump:NewDetailsButton (parent, container, instancia, func, param1, para new_button:SetDisabledTexture("") new_button:SetHighlightTexture("") texture = texture or "Interface\\AddOns\\Details\\images\\default_button" - new_button.texture = new_button:CreateTexture (nil, "background") + new_button.texture = new_button:CreateTexture(nil, "background") if (not rect) then - new_button.texture:SetAllPoints (new_button) + new_button.texture:SetAllPoints(new_button) else - new_button.texture:SetPoint ("topleft", new_button, "topleft", rect.x1, rect.y1) - new_button.texture:SetPoint ("bottomright", new_button, "bottomright", rect.x2, rect.y2) + new_button.texture:SetPoint("topleft", new_button, "topleft", rect.x1, rect.y1) + new_button.texture:SetPoint("bottomright", new_button, "bottomright", rect.x2, rect.y2) end new_button.texture:SetTexCoord (0, 1, 0, 0.24609375) - new_button.texture:SetTexture (texture) + new_button.texture:SetTexture(texture) end new_button.textColor = {} @@ -260,21 +260,21 @@ local EditBoxBackdrop = { function gump:NewTextBox (parent, container, member, func, param1, param2, w, h, options) - local editbox = CreateFrame ("EditBox", "DetailsEditBox1", parent) + local editbox = CreateFrame("EditBox", "DetailsEditBox1", parent) container [member] = editbox options = options or {} editbox:SetAutoFocus (false) editbox:SetFontObject (GameFontHighlightSmall) - editbox:SetWidth (w) - editbox:SetHeight (h) + editbox:SetWidth(w) + editbox:SetHeight(h) editbox:SetJustifyH("CENTER") editbox:EnableMouse (true) - editbox:SetBackdrop (EditBoxBackdrop) - editbox:SetBackdropColor (0, 0, 0, 0.5) - editbox:SetBackdropBorderColor (0.3, 0.3, 0.30, 0.80) - editbox:SetText ("") --localize-me + editbox:SetBackdrop(EditBoxBackdrop) + editbox:SetBackdropColor(0, 0, 0, 0.5) + editbox:SetBackdropBorderColor(0.3, 0.3, 0.30, 0.80) + editbox:SetText("") --localize-me editbox.perdeu_foco = nil @@ -284,15 +284,15 @@ function gump:NewTextBox (parent, container, member, func, param1, param2, w, h, editbox.tab_on_enter = options.TabOnEnterPress editbox.space = options.MySpace - gump:NewLabel (editbox, editbox, nil, "label", "", "GameFontHighlightSmall") + gump:NewLabel(editbox, editbox, nil, "label", "", "GameFontHighlightSmall") editbox ["label"]: SetPoint ("right", editbox, "left", -2, 0) editbox.label:SetTextColor (.8, .8, .8, 1) function editbox:SetPointAndSpace (MyAnchor, SnapTo, HisAnchor, x, y, Width) - if (type (MyAnchor) == "boolean" and MyAnchor and editbox.space) then + if (type(MyAnchor) == "boolean" and MyAnchor and editbox.space) then local textWidth = editbox ["label"]:GetStringWidth()+2 - editbox:SetWidth (editbox.space - textWidth - 15) + editbox:SetWidth(editbox.space - textWidth - 15) return elseif (not editbox.space and not Width) then @@ -304,23 +304,23 @@ function gump:NewTextBox (parent, container, member, func, param1, param2, w, h, if (editbox.space) then editbox ["label"]:ClearAllPoints() editbox:ClearAllPoints() - editbox ["label"]:SetPoint (MyAnchor, SnapTo, HisAnchor, x, y) - editbox:SetPoint ("left", editbox["label"].widget, "right", 2, 0) + editbox ["label"]:SetPoint(MyAnchor, SnapTo, HisAnchor, x, y) + editbox:SetPoint("left", editbox["label"].widget, "right", 2, 0) local textWidth = editbox ["label"]:GetStringWidth()+2 - editbox:SetWidth (editbox.space - textWidth - 15) + editbox:SetWidth(editbox.space - textWidth - 15) end end function editbox:SetLabelText (text) if (text) then - editbox ["label"]:SetText (text) + editbox ["label"]:SetText(text) else - editbox ["label"]:SetText ("") + editbox ["label"]:SetText("") end if (editbox.space) then - editbox:SetPointAndSpace (true) --> refresh + editbox:SetPointAndSpace (true) --refresh end end @@ -337,10 +337,10 @@ function gump:NewTextBox (parent, container, member, func, param1, param2, w, h, func (param1, param2, texto, editbox, byScript) end else - editbox:SetText ("") + editbox:SetText("") editbox.text = "" end - editbox.perdeu_foco = true --> isso aqui pra quando estiver editando e clicar em outra caixa + editbox.perdeu_foco = true --isso aqui pra quando estiver editando e clicar em outra caixa editbox:ClearFocus() if (editbox.tab_on_enter and editbox.next) then @@ -352,9 +352,9 @@ function gump:NewTextBox (parent, container, member, func, param1, param2, w, h, EnterPress (byScript) end - editbox:SetScript ("OnEnterPressed", EnterPress) + editbox:SetScript("OnEnterPressed", EnterPress) - editbox:SetScript ("OnEscapePressed", function() + editbox:SetScript("OnEscapePressed", function() editbox:SetText("") editbox.text = "" editbox.perdeu_foco = true @@ -365,10 +365,10 @@ function gump:NewTextBox (parent, container, member, func, param1, param2, w, h, end end) - editbox:SetScript ("OnEnter", function() + editbox:SetScript("OnEnter", function() editbox.mouse_over = true if (editbox:IsEnabled()) then - editbox:SetBackdropBorderColor (0.5, 0.5, 0.5, 1) + editbox:SetBackdropBorderColor(0.5, 0.5, 0.5, 1) end if (editbox.tooltip) then GameCooltip:Reset() @@ -384,7 +384,7 @@ function gump:NewTextBox (parent, container, member, func, param1, param2, w, h, end end) - editbox:SetScript ("OnLeave", function() + editbox:SetScript("OnLeave", function() editbox.mouse_over = false if (editbox:IsEnabled()) then editbox:SetBackdropBorderColor(0.3, 0.3, 0.3, 0.8) @@ -408,7 +408,7 @@ function gump:NewTextBox (parent, container, member, func, param1, param2, w, h, end) - editbox:SetScript ("OnEditFocusGained", function() + editbox:SetScript("OnEditFocusGained", function() if (editbox.label) then editbox.label:SetTextColor (1, 1, 1, 1) end @@ -417,7 +417,7 @@ function gump:NewTextBox (parent, container, member, func, param1, param2, w, h, end end) - editbox:SetScript ("OnEditFocusLost", function() + editbox:SetScript("OnEditFocusLost", function() if (editbox:IsShown()) then if (editbox.perdeu_foco == nil) then @@ -428,7 +428,7 @@ function gump:NewTextBox (parent, container, member, func, param1, param2, w, h, func (param1, param2, texto, editbox, nil) end else - editbox:SetText ("") + editbox:SetText("") end else editbox.perdeu_foco = nil @@ -444,19 +444,19 @@ 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 end) - editbox:SetScript ("OnTabPressed", function() + editbox:SetScript("OnTabPressed", function() if (editbox.next) then EnterPress() editbox.next:SetFocus() @@ -491,20 +491,20 @@ end function gump:NewScrollBar2 (master, slave, x, y) - local slider_gump = CreateFrame ("Slider", master:GetName() and master:GetName() .. "SliderGump" or "DetailsSliderGump" .. math.random (1, 10000000), master) + local slider_gump = CreateFrame("Slider", master:GetName() and master:GetName() .. "SliderGump" or "DetailsSliderGump" .. math.random (1, 10000000), master) slider_gump.scrollMax = 560 --default - tamanho da janela de fundo -- ///// SLIDER ///// - slider_gump:SetPoint ("TOPLEFT", master, "TOPRIGHT", x, y) + slider_gump:SetPoint("TOPLEFT", master, "TOPRIGHT", x, y) slider_gump.ativo = true - slider_gump.bg = slider_gump:CreateTexture (nil, "BACKGROUND") - slider_gump.bg:SetAllPoints (true) - slider_gump.bg:SetTexture (0, 0, 0, 0) + slider_gump.bg = slider_gump:CreateTexture(nil, "BACKGROUND") + slider_gump.bg:SetAllPoints(true) + slider_gump.bg:SetTexture(0, 0, 0, 0) --coisinha do meio - slider_gump.thumb = slider_gump:CreateTexture (nil, "OVERLAY") - slider_gump.thumb:SetTexture ("Interface\\Buttons\\UI-ScrollBar-Knob") - slider_gump.thumb:SetSize (29, 30) + slider_gump.thumb = slider_gump:CreateTexture(nil, "OVERLAY") + slider_gump.thumb:SetTexture("Interface\\Buttons\\UI-ScrollBar-Knob") + slider_gump.thumb:SetSize(29, 30) slider_gump:SetThumbTexture (slider_gump.thumb) slider_gump:SetOrientation ("VERTICAL") @@ -513,29 +513,29 @@ function gump:NewScrollBar2 (master, slave, x, y) slider_gump:SetValue(0) slider_gump.ultimo = 0 - local botao_cima = CreateFrame ("Button", slider_gump:GetName() .. "UpButton", master) + local botao_cima = CreateFrame("Button", slider_gump:GetName() .. "UpButton", master) - botao_cima:SetWidth (29) - botao_cima:SetHeight (32) - botao_cima:SetNormalTexture ([[Interface\Buttons\Arrow-Up-Up]]) - botao_cima:SetPushedTexture ([[Interface\Buttons\Arrow-Up-Down]]) + botao_cima:SetWidth(29) + botao_cima:SetHeight(32) + botao_cima:SetNormalTexture([[Interface\Buttons\Arrow-Up-Up]]) + botao_cima:SetPushedTexture([[Interface\Buttons\Arrow-Up-Down]]) botao_cima:SetDisabledTexture ([[Interface\Buttons\Arrow-Up-Disabled]]) botao_cima:Show() botao_cima:Disable() - botao_cima:SetPoint ("BOTTOM", slider_gump, "TOP", 0, -12) + botao_cima:SetPoint("BOTTOM", slider_gump, "TOP", 0, -12) botao_cima.x = 0 botao_cima.y = -12 - local botao_baixo = CreateFrame ("Button", slider_gump:GetName() .. "DownButton", master) - botao_baixo:SetPoint ("TOP", slider_gump, "BOTTOM", 0, 12) + local botao_baixo = CreateFrame("Button", slider_gump:GetName() .. "DownButton", master) + botao_baixo:SetPoint("TOP", slider_gump, "BOTTOM", 0, 12) botao_baixo.x = 0 botao_baixo.y = 12 - botao_baixo:SetWidth (29) - botao_baixo:SetHeight (32) - botao_baixo:SetNormalTexture ([[Interface\Buttons\Arrow-Down-Up]]) - botao_baixo:SetPushedTexture ([[Interface\Buttons\Arrow-Down-Down]]) + botao_baixo:SetWidth(29) + botao_baixo:SetHeight(32) + botao_baixo:SetNormalTexture([[Interface\Buttons\Arrow-Down-Up]]) + botao_baixo:SetPushedTexture([[Interface\Buttons\Arrow-Down-Down]]) botao_baixo:SetDisabledTexture ([[Interface\Buttons\Arrow-Down-Disabled]]) botao_baixo:Show() botao_baixo:Disable() @@ -544,7 +544,7 @@ function gump:NewScrollBar2 (master, slave, x, y) master.cima = botao_cima master.slider = slider_gump - botao_baixo:SetScript ("OnMouseDown", function(self) + botao_baixo:SetScript("OnMouseDown", function(self) if (not slider_gump:IsEnabled()) then return end @@ -552,70 +552,70 @@ function gump:NewScrollBar2 (master, slave, x, y) local current = slider_gump:GetValue() local minValue, maxValue = slider_gump:GetMinMaxValues() if (current+5 < maxValue) then - slider_gump:SetValue (current+5) + slider_gump:SetValue(current+5) else - slider_gump:SetValue (maxValue) + slider_gump:SetValue(maxValue) end 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 local current = slider_gump:GetValue() local minValue, maxValue = slider_gump:GetMinMaxValues() if (current+2 < maxValue) then - slider_gump:SetValue (current+2) + slider_gump:SetValue(current+2) else - slider_gump:SetValue (maxValue) + slider_gump:SetValue(maxValue) end end end) end) - botao_baixo:SetScript ("OnMouseUp", function(self) + botao_baixo:SetScript("OnMouseUp", function(self) self.precionado = false - self:SetScript ("OnUpdate", nil) + self:SetScript("OnUpdate", nil) end) - botao_cima:SetScript ("OnMouseDown", function(self) + botao_cima:SetScript("OnMouseDown", function(self) if (not slider_gump:IsEnabled()) then return end local current = slider_gump:GetValue() if (current-5 > 0) then - slider_gump:SetValue (current-5) + slider_gump:SetValue(current-5) else - slider_gump:SetValue (0) + slider_gump:SetValue(0) end 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 local current = slider_gump:GetValue() if (current-2 > 0) then - slider_gump:SetValue (current-2) + slider_gump:SetValue(current-2) else - slider_gump:SetValue (0) + slider_gump:SetValue(0) end end end) end) - botao_cima:SetScript ("OnMouseUp", function(self) + botao_cima:SetScript("OnMouseUp", function(self) self.precionado = false - self:SetScript ("OnUpdate", nil) + 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) + --isso aqui pra quando o slider ativar, o scroll fica na posi��o zero + 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 @@ -660,22 +660,22 @@ function gump:NewScrollBar2 (master, slave, x, y) --baixo local minValue, maxValue = slider_gump:GetMinMaxValues() if (current + (master.wheel_jump or 20) < maxValue) then - slider_gump:SetValue (current + (master.wheel_jump or 20)) + slider_gump:SetValue(current + (master.wheel_jump or 20)) else - slider_gump:SetValue (maxValue) + slider_gump:SetValue(maxValue) end elseif (delta > 0) then --cima if (current + (master.wheel_jump or 20) > 0) then - slider_gump:SetValue (current - (master.wheel_jump or 20)) + slider_gump:SetValue(current - (master.wheel_jump or 20)) else - slider_gump:SetValue (0) + slider_gump:SetValue(0) end end end) function slider_gump:Altura (h) - self:SetHeight (h) + self:SetHeight(h) end function slider_gump:Update (desativar) @@ -705,11 +705,11 @@ function gump:NewScrollBar2 (master, slave, x, y) end function slider_gump:cimaPoint (x, y) - botao_cima:SetPoint ("BOTTOM", slider_gump, "TOP", x, (y)-12) + botao_cima:SetPoint("BOTTOM", slider_gump, "TOP", x, (y)-12) end function slider_gump:baixoPoint (x, y) - botao_baixo:SetPoint ("TOP", slider_gump, "BOTTOM", x, (y)+12) + botao_baixo:SetPoint("TOP", slider_gump, "BOTTOM", x, (y)+12) end return slider_gump diff --git a/frames/window_api.lua b/frames/window_api.lua index e9a766bf..897a8db9 100644 --- a/frames/window_api.lua +++ b/frames/window_api.lua @@ -28,7 +28,7 @@ function Details:CreateAPI2Frame() local Api2Frame = _G.DetailsAPI2Frame Api2Frame:SetFrameStrata ("FULLSCREEN") - Api2Frame:SetPoint ("center") + Api2Frame:SetPoint("center") DetailsFramework:ApplyStandardBackdrop (Api2Frame, false, 1.2) --store @@ -43,14 +43,14 @@ function Details:CreateAPI2Frame() local onSelectAPI = function(self) local apiName = apiFunctionNames [self.index] if (not apiName) then - Details:Msg ("API name not found:", apiName) + Details:Msg("API name not found:", apiName) return end --fill the box in the right with information about the API local apiInfo = api [self.index] if (not apiInfo) then - Details:Msg ("API information for api not found", apiName) + Details:Msg("API information for api not found", apiName) return end @@ -62,7 +62,7 @@ function Details:CreateAPI2Frame() --update the copy line text box local parameters = "" - for parameterIndex, parameterInfo in ipairs (apiInfo.parameters) do + for parameterIndex, parameterInfo in ipairs(apiInfo.parameters) do if (parameterInfo.required) then parameters = parameters .. parameterInfo.name .. ", " end @@ -70,7 +70,7 @@ function Details:CreateAPI2Frame() parameters = parameters:gsub (", $", "") local returnValues = "local " - for returnIndex, returnInfo in ipairs (apiInfo.returnValues) do + for returnIndex, returnInfo in ipairs(apiInfo.returnValues) do returnValues = returnValues .. returnInfo.name .. ", " end returnValues = returnValues:gsub (", $", "") @@ -130,29 +130,29 @@ function Details:CreateAPI2Frame() local apiName = data [index] if (apiName) then local line = self:GetLine (i) - line.text:SetText (apiName) + line.text:SetText(apiName) line.index = index if (currentSelected == index) then - line:SetBackdropColor (unpack (backdropColorSelected)) + line:SetBackdropColor(unpack (backdropColorSelected)) else - line:SetBackdropColor (unpack (backdropColor)) + line:SetBackdropColor(unpack (backdropColor)) end end end end - for apiIndex, apiDesc in ipairs (api) do + for apiIndex, apiDesc in ipairs(api) do tinsert (apiFunctionNames, apiDesc.name) end local api2ScrollMenu = DetailsFramework:CreateScrollBox (Api2Frame, "$parentApi2MenuScroll", apiMenuScrollRefresh, apiFunctionNames, scrollWidth, scrollHeight, lineAmount, lineHeight) DetailsFramework:ReskinSlider(api2ScrollMenu) - api2ScrollMenu:SetPoint ("topleft", Api2Frame, "topleft", 10, yStart) + api2ScrollMenu:SetPoint("topleft", Api2Frame, "topleft", 10, yStart) Api2Frame.scrollMenu = api2ScrollMenu local lineOnEnter = function(self) - self:SetBackdropColor (unpack (backdropColorOnEnter)) + self:SetBackdropColor(unpack (backdropColorOnEnter)) local apiName = apiFunctionNames [self.index] if (not apiName) then @@ -173,9 +173,9 @@ function Details:CreateAPI2Frame() local lineOnLeave = function(self) if (currentSelected == self.index) then - self:SetBackdropColor (unpack (backdropColorSelected)) + self:SetBackdropColor(unpack (backdropColorSelected)) else - self:SetBackdropColor (unpack (backdropColor)) + self:SetBackdropColor(unpack (backdropColor)) end GameCooltip2:Hide() @@ -184,21 +184,21 @@ function Details:CreateAPI2Frame() --create lines for i = 1, lineAmount do 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) + local line = CreateFrame("button", "$parentLine" .. index, self, "BackdropTemplate") + line:SetPoint("topleft", self, "topleft", 1, -((index-1)*(lineHeight+1)) - 1) + line:SetSize(scrollWidth - 2, lineHeight) line.index = index - line:SetScript ("OnEnter", lineOnEnter) - line:SetScript ("OnLeave", lineOnLeave) + line:SetScript("OnEnter", lineOnEnter) + line:SetScript("OnLeave", lineOnLeave) - line:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - line:SetBackdropColor (unpack (backdropColor)) + line:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + line:SetBackdropColor(unpack (backdropColor)) - line.text = DetailsFramework:CreateLabel (line) - line.text:SetPoint ("left", line, "left", 2, 0) + line.text = DetailsFramework:CreateLabel(line) + line.text:SetPoint("left", line, "left", 2, 0) - line:SetScript ("OnMouseDown", onSelectAPI) + line:SetScript("OnMouseDown", onSelectAPI) return line end) @@ -207,43 +207,43 @@ function Details:CreateAPI2Frame() --info box local infoWidth = panelWidth - xAnchorPoint - 10 --api name - Api2Frame.ApiFunctionName = DetailsFramework:CreateLabel (Api2Frame, "", 14, "orange") - Api2Frame.ApiFunctionName:SetPoint ("topleft", Api2Frame, "topleft", xAnchorPoint, yStart) + Api2Frame.ApiFunctionName = DetailsFramework:CreateLabel(Api2Frame, "", 14, "orange") + Api2Frame.ApiFunctionName:SetPoint("topleft", Api2Frame, "topleft", xAnchorPoint, yStart) --api desc - Api2Frame.ApiFunctionDesc = DetailsFramework:CreateLabel (Api2Frame) - Api2Frame.ApiFunctionDesc:SetPoint ("topleft", Api2Frame.ApiFunctionName, "bottomleft", 0, -2) + Api2Frame.ApiFunctionDesc = DetailsFramework:CreateLabel(Api2Frame) + Api2Frame.ApiFunctionDesc:SetPoint("topleft", Api2Frame.ApiFunctionName, "bottomleft", 0, -2) Api2Frame.ApiFunctionDesc.width = infoWidth Api2Frame.ApiFunctionDesc.height = 22 Api2Frame.ApiFunctionDesc.valign = "top" --api func to copy - local apiCopyString = DetailsFramework:CreateLabel (Api2Frame, "Copy String", 12, "orange") - apiCopyString:SetPoint ("topleft", Api2Frame.ApiFunctionDesc, "bottomleft", 0, -20) + local apiCopyString = DetailsFramework:CreateLabel(Api2Frame, "Copy String", 12, "orange") + apiCopyString:SetPoint("topleft", Api2Frame.ApiFunctionDesc, "bottomleft", 0, -20) Api2Frame.ApiCopy = DetailsFramework:CreateTextEntry (Api2Frame, function() end, infoWidth, 20) - Api2Frame.ApiCopy:SetPoint ("topleft", apiCopyString, "bottomleft", 0, -2) + Api2Frame.ApiCopy:SetPoint("topleft", apiCopyString, "bottomleft", 0, -2) Api2Frame.ApiCopy:SetTemplate (DetailsFramework:GetTemplate ("button", "DETAILS_CUSTOMDISPLAY_CODE_BOX")) --parameters local parametersYStart = yStart - 110 - local parametersString = DetailsFramework:CreateLabel (Api2Frame, "Parameters", 12, "orange") - parametersString:SetPoint ("topleft", Api2Frame, "topleft", xAnchorPoint, parametersYStart) + local parametersString = DetailsFramework:CreateLabel(Api2Frame, "Parameters", 12, "orange") + parametersString:SetPoint("topleft", Api2Frame, "topleft", xAnchorPoint, parametersYStart) parametersYStart = parametersYStart - 20 local space1, space2, space3 = 150, 300, 450 - local parametersHeader = CreateFrame ("frame", nil, Api2Frame, "BackdropTemplate") - parametersHeader:SetSize (infoWidth, 20) - parametersHeader:SetPoint ("topleft", Api2Frame, "topleft", xAnchorPoint, parametersYStart) - parametersHeader:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - parametersHeader:SetBackdropColor (unpack (backdropColor)) - parametersHeader.name = DetailsFramework:CreateLabel (parametersHeader, "Name", 12, "yellow") - parametersHeader.typeData = DetailsFramework:CreateLabel (parametersHeader, "Type", 12, "yellow") - parametersHeader.required = DetailsFramework:CreateLabel (parametersHeader, "Is Required", 12, "yellow") - parametersHeader.default = DetailsFramework:CreateLabel (parametersHeader, "Default Value", 12, "yellow") - parametersHeader.name:SetPoint ("left", parametersHeader, "left", 2, 0) - parametersHeader.typeData:SetPoint ("left", parametersHeader, "left", space1, 0) - parametersHeader.required:SetPoint ("left", parametersHeader, "left", space2, 0) - parametersHeader.default:SetPoint ("left", parametersHeader, "left", space3, 0) + local parametersHeader = CreateFrame("frame", nil, Api2Frame, "BackdropTemplate") + parametersHeader:SetSize(infoWidth, 20) + parametersHeader:SetPoint("topleft", Api2Frame, "topleft", xAnchorPoint, parametersYStart) + parametersHeader:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + parametersHeader:SetBackdropColor(unpack (backdropColor)) + parametersHeader.name = DetailsFramework:CreateLabel(parametersHeader, "Name", 12, "yellow") + parametersHeader.typeData = DetailsFramework:CreateLabel(parametersHeader, "Type", 12, "yellow") + parametersHeader.required = DetailsFramework:CreateLabel(parametersHeader, "Is Required", 12, "yellow") + parametersHeader.default = DetailsFramework:CreateLabel(parametersHeader, "Default Value", 12, "yellow") + parametersHeader.name:SetPoint("left", parametersHeader, "left", 2, 0) + parametersHeader.typeData:SetPoint("left", parametersHeader, "left", space1, 0) + parametersHeader.required:SetPoint("left", parametersHeader, "left", space2, 0) + parametersHeader.default:SetPoint("left", parametersHeader, "left", space3, 0) local parameterOnEnter = function(self) GameCooltip2:Preset(2) @@ -257,87 +257,87 @@ function Details:CreateAPI2Frame() GameCooltip2:AddLine (apiInfo.parameters [self.index].desc) GameCooltip2:ShowCooltip() - self:SetBackdropColor (unpack (backdropColorOnEnter)) + self:SetBackdropColor(unpack (backdropColorOnEnter)) end local parameterOnLeave = function(self) GameCooltip2:Hide() - self:SetBackdropColor (unpack (backdropColor)) + self:SetBackdropColor(unpack (backdropColor)) end for i = 1, parametersAmount do local parameterLine = {} - local f = CreateFrame ("frame", nil, Api2Frame, "BackdropTemplate") - f:SetSize (infoWidth, 20) - f:SetScript ("OnEnter", parameterOnEnter) - f:SetScript ("OnLeave", parameterOnLeave) - f:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - f:SetBackdropColor (unpack (backdropColor)) + local f = CreateFrame("frame", nil, Api2Frame, "BackdropTemplate") + f:SetSize(infoWidth, 20) + f:SetScript("OnEnter", parameterOnEnter) + f:SetScript("OnLeave", parameterOnLeave) + f:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + f:SetBackdropColor(unpack (backdropColor)) f:Hide() - f.name = DetailsFramework:CreateLabel (f) - f.typeData = DetailsFramework:CreateLabel (f) - f.required = DetailsFramework:CreateLabel (f) - f.default = DetailsFramework:CreateLabel (f) + f.name = DetailsFramework:CreateLabel(f) + f.typeData = DetailsFramework:CreateLabel(f) + f.required = DetailsFramework:CreateLabel(f) + f.default = DetailsFramework:CreateLabel(f) - f:SetPoint ("topleft", Api2Frame, "topleft", xAnchorPoint, parametersYStart + (-i * 20)) + f:SetPoint("topleft", Api2Frame, "topleft", xAnchorPoint, parametersYStart + (-i * 20)) - f.name:SetPoint ("left", f, "left", 2, 0) - f.typeData:SetPoint ("left", f, "left", space1, 0) - f.required:SetPoint ("left", f, "left", space2, 0) - f.default:SetPoint ("left", f, "left", space3, 0) + f.name:SetPoint("left", f, "left", 2, 0) + f.typeData:SetPoint("left", f, "left", space1, 0) + f.required:SetPoint("left", f, "left", space2, 0) + f.default:SetPoint("left", f, "left", space3, 0) tinsert (parametersLines, f) end --return value box local returnYStart = yStart - 260 - local returnString = DetailsFramework:CreateLabel (Api2Frame, "Return Values", 12, "orange") - returnString:SetPoint ("topleft", Api2Frame, "topleft", xAnchorPoint, returnYStart) + local returnString = DetailsFramework:CreateLabel(Api2Frame, "Return Values", 12, "orange") + returnString:SetPoint("topleft", Api2Frame, "topleft", xAnchorPoint, returnYStart) returnYStart = returnYStart - 20 local space1 = 200 - local returnHeader = CreateFrame ("frame", nil, Api2Frame, "BackdropTemplate") - returnHeader:SetSize (infoWidth, 20) - returnHeader:SetPoint ("topleft", Api2Frame, "topleft", xAnchorPoint, returnYStart) - returnHeader:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - returnHeader:SetBackdropColor (unpack (backdropColor)) - returnHeader.name = DetailsFramework:CreateLabel (returnHeader, "Name", 12, "yellow") - returnHeader.typeData = DetailsFramework:CreateLabel (returnHeader, "Type", 12, "yellow") - returnHeader.name:SetPoint ("left", returnHeader, "left", 2, 0) - returnHeader.typeData:SetPoint ("left", returnHeader, "left", space1, 0) + local returnHeader = CreateFrame("frame", nil, Api2Frame, "BackdropTemplate") + returnHeader:SetSize(infoWidth, 20) + returnHeader:SetPoint("topleft", Api2Frame, "topleft", xAnchorPoint, returnYStart) + returnHeader:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + returnHeader:SetBackdropColor(unpack (backdropColor)) + returnHeader.name = DetailsFramework:CreateLabel(returnHeader, "Name", 12, "yellow") + returnHeader.typeData = DetailsFramework:CreateLabel(returnHeader, "Type", 12, "yellow") + returnHeader.name:SetPoint("left", returnHeader, "left", 2, 0) + returnHeader.typeData:SetPoint("left", returnHeader, "left", space1, 0) local returnOnEnter = function(self) - self:SetBackdropColor (unpack (backdropColorOnEnter)) + self:SetBackdropColor(unpack (backdropColorOnEnter)) end local returnOnLeave = function(self) - self:SetBackdropColor (unpack (backdropColor)) + self:SetBackdropColor(unpack (backdropColor)) end for i = 1, returnAmount do local parameterLine = {} - local f = CreateFrame ("frame", nil, Api2Frame, "BackdropTemplate") - f:SetSize (infoWidth, 20) - f:SetScript ("OnEnter", returnOnEnter) - f:SetScript ("OnLeave", returnOnLeave) - f:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - f:SetBackdropColor (unpack (backdropColor)) + local f = CreateFrame("frame", nil, Api2Frame, "BackdropTemplate") + f:SetSize(infoWidth, 20) + f:SetScript("OnEnter", returnOnEnter) + f:SetScript("OnLeave", returnOnLeave) + f:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + f:SetBackdropColor(unpack (backdropColor)) f:Hide() - f.name = DetailsFramework:CreateLabel (f) - f.typeData = DetailsFramework:CreateLabel (f) + f.name = DetailsFramework:CreateLabel(f) + f.typeData = DetailsFramework:CreateLabel(f) - f.desc = DetailsFramework:CreateLabel (f, "", 10, "gray") + f.desc = DetailsFramework:CreateLabel(f, "", 10, "gray") f.desc.width = infoWidth f.desc.height = 60 f.desc.valign = "top" - f:SetPoint ("topleft", Api2Frame, "topleft", xAnchorPoint, returnYStart + (-i * 20)) + f:SetPoint("topleft", Api2Frame, "topleft", xAnchorPoint, returnYStart + (-i * 20)) - f.name:SetPoint ("left", f, "left", 2, 0) - f.typeData:SetPoint ("left", f, "left", space1, 0) + f.name:SetPoint("left", f, "left", 2, 0) + f.typeData:SetPoint("left", f, "left", space1, 0) - f.desc:SetPoint ("topleft", f.name, "bottomleft", 0, -5) + f.desc:SetPoint("topleft", f.name, "bottomleft", 0, -5) tinsert (returnLines, f) end diff --git a/frames/window_benchmark.lua b/frames/window_benchmark.lua index 13dc23b5..e0988372 100644 --- a/frames/window_benchmark.lua +++ b/frames/window_benchmark.lua @@ -7,7 +7,7 @@ local Details = _G.Details local DF = _G.DetailsFramework local libwindow = LibStub("LibWindow-1.1") ---> this function isn't in use +--this function isn't in use function Details.OpenDpsBenchmark() --main frame @@ -16,15 +16,15 @@ local libwindow = LibStub("LibWindow-1.1") local _ = nil --declaration - local f = CreateFrame ("frame", "DetailsBenchmark", UIParent,"BackdropTemplate") - f:SetSize (800, 600) - f:SetPoint ("left", UIParent, "left") + local f = CreateFrame("frame", "DetailsBenchmark", UIParent,"BackdropTemplate") + f:SetSize(800, 600) + f:SetPoint("left", UIParent, "left") f:SetFrameStrata ("LOW") f:EnableMouse (true) f:SetMovable (true) - f:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - f:SetBackdropColor (0, 0, 0, 0.9) - f:SetBackdropBorderColor (0, 0, 0, 1) + f:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + f:SetBackdropColor(0, 0, 0, 0.9) + f:SetBackdropBorderColor(0, 0, 0, 1) --register to libwindow local LibWindow = LibStub ("LibWindow-1.1") @@ -34,32 +34,32 @@ local libwindow = LibStub("LibWindow-1.1") LibWindow.SavePosition (f) --titlebar - f.TitleBar = CreateFrame ("frame", "$parentTitleBar", f,"BackdropTemplate") - f.TitleBar:SetPoint ("topleft", f, "topleft", 2, -3) - f.TitleBar:SetPoint ("topright", f, "topright", -2, -3) - f.TitleBar:SetHeight (20) - f.TitleBar:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - f.TitleBar:SetBackdropColor (.2, .2, .2, 1) - f.TitleBar:SetBackdropBorderColor (0, 0, 0, 1) + f.TitleBar = CreateFrame("frame", "$parentTitleBar", f,"BackdropTemplate") + f.TitleBar:SetPoint("topleft", f, "topleft", 2, -3) + f.TitleBar:SetPoint("topright", f, "topright", -2, -3) + f.TitleBar:SetHeight(20) + f.TitleBar:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + f.TitleBar:SetBackdropColor(.2, .2, .2, 1) + f.TitleBar:SetBackdropBorderColor(0, 0, 0, 1) --close button - f.Close = CreateFrame ("button", "$parentCloseButton", f,"BackdropTemplate") - f.Close:SetPoint ("right", f.TitleBar, "right", -2, 0) - f.Close:SetSize (16, 16) - f.Close:SetNormalTexture (_detalhes.gump.folder .. "icons") - f.Close:SetHighlightTexture (_detalhes.gump.folder .. "icons") - f.Close:SetPushedTexture (_detalhes.gump.folder .. "icons") + f.Close = CreateFrame("button", "$parentCloseButton", f,"BackdropTemplate") + f.Close:SetPoint("right", f.TitleBar, "right", -2, 0) + f.Close:SetSize(16, 16) + f.Close:SetNormalTexture(_detalhes.gump.folder .. "icons") + f.Close:SetHighlightTexture(_detalhes.gump.folder .. "icons") + f.Close:SetPushedTexture(_detalhes.gump.folder .. "icons") f.Close:GetNormalTexture():SetTexCoord (0, 16/128, 0, 1) f.Close:GetHighlightTexture():SetTexCoord (0, 16/128, 0, 1) f.Close:GetPushedTexture():SetTexCoord (0, 16/128, 0, 1) f.Close:SetAlpha (0.7) - f.Close:SetScript ("OnClick", function() f:Hide() end) + f.Close:SetScript("OnClick", function() f:Hide() end) --title f.Title = f.TitleBar:CreateFontString ("$parentTitle", "overlay", "GameFontNormal") - f.Title:SetPoint ("center", f.TitleBar, "center") + f.Title:SetPoint("center", f.TitleBar, "center") f.Title:SetTextColor (.8, .8, .8, 1) - f.Title:SetText ("Details! Benchmark") + f.Title:SetText("Details! Benchmark") DF:InstallTemplate ("font", "DETAILS_BENCHMARK_NORMAL", {color = "white", size = 10, font = "Friz Quadrata TT"}) @@ -89,14 +89,14 @@ local libwindow = LibStub("LibWindow-1.1") end end function f.StartUpdateOnTick() - f:SetScript ("OnUpdate", f.UpdateOnTick) + f:SetScript("OnUpdate", f.UpdateOnTick) end --events 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() @@ -126,12 +126,12 @@ local libwindow = LibStub("LibWindow-1.1") --summary block --declaration - local summaryFrame = CreateFrame ("frame", "$parentSummaryFrame", f,"BackdropTemplate") - summaryFrame:SetPoint ("topleft", f, "topleft", unpack (f.FrameLocations.summary)) - summaryFrame:SetSize (unpack (f.FrameSizes.default)) - summaryFrame:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - summaryFrame:SetBackdropColor (0, 0, 0, 0.9) - summaryFrame:SetBackdropBorderColor (0, 0, 0, 1) + local summaryFrame = CreateFrame("frame", "$parentSummaryFrame", f,"BackdropTemplate") + summaryFrame:SetPoint("topleft", f, "topleft", unpack (f.FrameLocations.summary)) + summaryFrame:SetSize(unpack (f.FrameSizes.default)) + summaryFrame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + summaryFrame:SetBackdropColor(0, 0, 0, 0.9) + summaryFrame:SetBackdropBorderColor(0, 0, 0, 1) --time to test string and dropdown local build_time_list = function() @@ -146,18 +146,18 @@ local libwindow = LibStub("LibWindow-1.1") return t end - summaryFrame.TimeToTestLabel = DF:CreateLabel (summaryFrame, "Amount of Time", normal_text_template) + summaryFrame.TimeToTestLabel = DF:CreateLabel(summaryFrame, "Amount of Time", normal_text_template) summaryFrame.TimeToTestDropdown = DF:CreateDropDown (summaryFrame, build_time_list, default, 150, 20, _, _, options_dropdown_template) --description string and text entry - summaryFrame.DescriptionLabel = DF:CreateLabel (summaryFrame, "Description", normal_text_template) + summaryFrame.DescriptionLabel = DF:CreateLabel(summaryFrame, "Description", normal_text_template) summaryFrame.DescriptionEntry = DF:CreateTextEntry (summaryFrame, function()end, 120, 20, nil, _, nil, options_dropdown_template) --DPS Amount string - summaryFrame.DPSLabel = DF:CreateLabel (summaryFrame, "100K", normal_text_template) + summaryFrame.DPSLabel = DF:CreateLabel(summaryFrame, "100K", normal_text_template) --TIME ELAPSED string - summaryFrame.TimeElapsedLabel = DF:CreateLabel (summaryFrame, "01:00", normal_text_template) + summaryFrame.TimeElapsedLabel = DF:CreateLabel(summaryFrame, "01:00", normal_text_template) --boss simulation string and dropdown local build_bosssimulation_list, default = function() @@ -166,40 +166,40 @@ local libwindow = LibStub("LibWindow-1.1") } return t end - summaryFrame.BossSimulationLabel = DF:CreateLabel (summaryFrame, "Boss Simulation", normal_text_template) + summaryFrame.BossSimulationLabel = DF:CreateLabel(summaryFrame, "Boss Simulation", normal_text_template) summaryFrame.BossSimulationDropdown = DF:CreateDropDown (summaryFrame, build_bosssimulation_list, default, 150, 20, _, _, options_dropdown_template) --boss records line with a tooltip importing data from the storage - summaryFrame.BossRecordsFrame = CreateFrame ("frame", nil, summaryFrame,"BackdropTemplate") - summaryFrame.BossRecordsFrame:SetSize (f.FrameSizes.default[1]-20, 20) - summaryFrame.BossRecordsFrame:SetBackdropColor (0, 0, 0, 0.3) - summaryFrame.BossRecordsFrame:SetScript ("OnEnter", function() + summaryFrame.BossRecordsFrame = CreateFrame("frame", nil, summaryFrame,"BackdropTemplate") + summaryFrame.BossRecordsFrame:SetSize(f.FrameSizes.default[1]-20, 20) + summaryFrame.BossRecordsFrame:SetBackdropColor(0, 0, 0, 0.3) + summaryFrame.BossRecordsFrame:SetScript("OnEnter", function() end) - summaryFrame.BossRecordsFrame:SetScript ("OnLeave", function() + summaryFrame.BossRecordsFrame:SetScript("OnLeave", function() end) --set the points do local x, y = 10, -10 - summaryFrame.TimeToTestLabel:SetPoint ("topleft", summaryFrame, "topleft", x, y) - summaryFrame.TimeToTestDropdown:SetPoint ("topleft", summaryFrame.TimeToTestLabel, "bottomleft", 0, -2) + summaryFrame.TimeToTestLabel:SetPoint("topleft", summaryFrame, "topleft", x, y) + summaryFrame.TimeToTestDropdown:SetPoint("topleft", summaryFrame.TimeToTestLabel, "bottomleft", 0, -2) --y = y - 40 - summaryFrame.DescriptionLabel:SetPoint ("topleft", summaryFrame, "topleft", x+160, y) - summaryFrame.DescriptionEntry:SetPoint ("topleft", summaryFrame.DescriptionLabel, "bottomleft", 0, -2) + summaryFrame.DescriptionLabel:SetPoint("topleft", summaryFrame, "topleft", x+160, y) + summaryFrame.DescriptionEntry:SetPoint("topleft", summaryFrame.DescriptionLabel, "bottomleft", 0, -2) y = y - 40 - summaryFrame.DPSLabel:SetPoint ("topleft", summaryFrame, "topleft", x, y) - summaryFrame.TimeElapsedLabel:SetPoint ("topleft", summaryFrame, "topleft", x + 100, y) + summaryFrame.DPSLabel:SetPoint("topleft", summaryFrame, "topleft", x, y) + summaryFrame.TimeElapsedLabel:SetPoint("topleft", summaryFrame, "topleft", x + 100, y) y = y - 40 - summaryFrame.BossSimulationLabel:SetPoint ("topleft", summaryFrame, "topleft", x, y) - summaryFrame.BossSimulationDropdown:SetPoint ("topleft", summaryFrame.BossSimulationLabel, "bottomleft", 0, -2) + summaryFrame.BossSimulationLabel:SetPoint("topleft", summaryFrame, "topleft", x, y) + summaryFrame.BossSimulationDropdown:SetPoint("topleft", summaryFrame.BossSimulationLabel, "bottomleft", 0, -2) y = y - 40 - summaryFrame.BossRecordsFrame:SetPoint ("topleft", summaryFrame, "topleft", 0, 0) + summaryFrame.BossRecordsFrame:SetPoint("topleft", summaryFrame, "topleft", 0, 0) end @@ -208,12 +208,12 @@ local libwindow = LibStub("LibWindow-1.1") --spells block --declaration - local spellsFrame = CreateFrame ("frame", "$parentSpellsFrame", f,"BackdropTemplate") - spellsFrame:SetPoint ("topleft", f, "topleft", unpack (f.FrameLocations.spells)) - spellsFrame:SetSize (unpack (f.FrameSizes.default)) - spellsFrame:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - spellsFrame:SetBackdropColor (0, 0, 0, 0.9) - spellsFrame:SetBackdropBorderColor (0, 0, 0, 1) + local spellsFrame = CreateFrame("frame", "$parentSpellsFrame", f,"BackdropTemplate") + spellsFrame:SetPoint("topleft", f, "topleft", unpack (f.FrameLocations.spells)) + spellsFrame:SetSize(unpack (f.FrameSizes.default)) + spellsFrame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + spellsFrame:SetBackdropColor(0, 0, 0, 0.9) + spellsFrame:SetBackdropBorderColor(0, 0, 0, 1) --header with the string titles: --Spell Icon | DPS | Damage | Casts | Criticals | Highest Damage @@ -227,12 +227,12 @@ local libwindow = LibStub("LibWindow-1.1") --auras block --declaration - local aurasFrame = CreateFrame ("frame", "$parentAurasFrame", f,"BackdropTemplate") - aurasFrame:SetPoint ("topleft", f, "topleft", unpack (f.FrameLocations.auras)) - aurasFrame:SetSize (unpack (f.FrameSizes.default)) - aurasFrame:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - aurasFrame:SetBackdropColor (0, 0, 0, 0.9) - aurasFrame:SetBackdropBorderColor (0, 0, 0, 1) + local aurasFrame = CreateFrame("frame", "$parentAurasFrame", f,"BackdropTemplate") + aurasFrame:SetPoint("topleft", f, "topleft", unpack (f.FrameLocations.auras)) + aurasFrame:SetSize(unpack (f.FrameSizes.default)) + aurasFrame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + aurasFrame:SetBackdropColor(0, 0, 0, 0.9) + aurasFrame:SetBackdropBorderColor(0, 0, 0, 1) --will be 9 blocks? @@ -244,12 +244,12 @@ local libwindow = LibStub("LibWindow-1.1") --history block --declaration - local historyFrame = CreateFrame ("frame", "$parentHistoryFrame", f,"BackdropTemplate") - historyFrame:SetPoint ("topleft", f, "topleft", unpack (f.FrameLocations.history)) - historyFrame:SetSize (unpack (f.FrameSizes.default)) - historyFrame:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - historyFrame:SetBackdropColor (0, 0, 0, 0.9) - historyFrame:SetBackdropBorderColor (0, 0, 0, 1) + local historyFrame = CreateFrame("frame", "$parentHistoryFrame", f,"BackdropTemplate") + historyFrame:SetPoint("topleft", f, "topleft", unpack (f.FrameLocations.history)) + historyFrame:SetSize(unpack (f.FrameSizes.default)) + historyFrame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + historyFrame:SetBackdropColor(0, 0, 0, 0.9) + historyFrame:SetBackdropBorderColor(0, 0, 0, 1) --header with the string titles: --Spec | ILevel | DPS | Time | Talents | Crit | Haste | Versatility | Mastery | Int | Description diff --git a/frames/window_bookmark.lua b/frames/window_bookmark.lua index f083a8c3..9cd5a90d 100644 --- a/frames/window_bookmark.lua +++ b/frames/window_bookmark.lua @@ -4,7 +4,7 @@ local Details = _G.Details local DF = _G.DetailsFramework local Loc = _G.LibStub("AceLocale-3.0"):GetLocale("Details") ---> config bookmarks +--config bookmarks function Details:OpenBookmarkConfig() if (not _G.DetailsBookmarkManager) then @@ -42,10 +42,10 @@ function Details:OpenBookmarkConfig() Details:MontaAtributosOption (Details:GetInstance(1), select_attribute) GameCooltip:SetColor (1, cooltip_color) GameCooltip:SetColor (2, cooltip_color) - GameCooltip:SetOption ("HeightAnchorMod", -7) - GameCooltip:SetOption ("TextSize", Details.font_sizes.menus) - GameCooltip:SetBackdrop (1, Details.tooltip_backdrop, nil, Details.tooltip_border_color) - GameCooltip:SetBackdrop (2, Details.tooltip_backdrop, nil, Details.tooltip_border_color) + GameCooltip:SetOption("HeightAnchorMod", -7) + GameCooltip:SetOption("TextSize", Details.font_sizes.menus) + GameCooltip:SetBackdrop(1, Details.tooltip_backdrop, nil, Details.tooltip_border_color) + GameCooltip:SetBackdrop(2, Details.tooltip_backdrop, nil, Details.tooltip_border_color) GameCooltip:ShowCooltip() end @@ -53,32 +53,32 @@ 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) - self:SetBackdropColor (1, 1, 1, 0.9) - capsule.icon:SetBlendMode ("ADD") + self:SetBackdropColor(1, 1, 1, 0.9) + capsule.icon:SetBlendMode("ADD") end local set_onleave = function(self, capsule) - self:SetBackdropColor (0, 0, 0, 0.5) - capsule.icon:SetBlendMode ("BLEND") + self:SetBackdropColor(0, 0, 0, 0.5) + capsule.icon:SetBlendMode("BLEND") end for i = 1, 40 do local clear = DF:CreateButton (panel, clear_func, 16, 16, nil, i, nil, [[Interface\Glues\LOGIN\Glues-CheckBox-Check]]) if (i%2 ~= 0) then --impar - clear:SetPoint (15, (( i*10 ) * -1) - 35) --left + clear:SetPoint(15, (( i*10 ) * -1) - 35) --left else --par local o = i-1 - clear:SetPoint (250, (( o*10 ) * -1) - 35) --right + clear:SetPoint(250, (( o*10 ) * -1) - 35) --right end local set = DF:CreateButton (panel, set_att, 16, 16, nil, i) - set:SetPoint ("left", clear, "right") - set:SetPoint ("right", clear, "right", 180, 0) - set:SetBackdrop (button_backdrop) - set:SetBackdropColor (0, 0, 0, 0.5) - set:SetHook ("OnEnter", set_onenter) - set:SetHook ("OnLeave", set_onleave) + set:SetPoint("left", clear, "right") + set:SetPoint("right", clear, "right", 180, 0) + set:SetBackdrop(button_backdrop) + set:SetBackdropColor(0, 0, 0, 0.5) + set:SetHook("OnEnter", set_onenter) + set:SetHook("OnLeave", set_onleave) --set:InstallCustomTexture (nil, nil, nil, nil, true) set:SetTemplate (DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) @@ -88,10 +88,10 @@ function Details:OpenBookmarkConfig() set.bg = bg_texture local icon = DF:CreateImage (set, nil, 16, 16, nil, nil, "icon") - icon:SetPoint ("left", clear, "right", 4, 0) + icon:SetPoint("left", clear, "right", 4, 0) - local label = DF:CreateLabel (set, "") - label:SetPoint ("left", icon, "right", 2, 0) + local label = DF:CreateLabel(set, "") + label:SetPoint("left", icon, "right", 2, 0) tinsert (panel.blocks, {icon = icon, label = label, bg = set.bg, button = set}) end @@ -106,9 +106,9 @@ function Details:OpenBookmarkConfig() local bookmark = bookmarks [i] local this_block = panel.blocks [i] if (bookmark and bookmark.atributo and bookmark.sub_atributo) then - if (bookmark.atributo == 5) then --> custom + if (bookmark.atributo == 5) then --custom local CustomObject = Details.custom [bookmark.sub_atributo] - if (not CustomObject) then --> ele j� foi deletado + if (not CustomObject) then --ele j� foi deletado this_block.label.text = "-- x -- x --" this_block.icon.texture = "Interface\\ICONS\\Ability_DualWield" this_block.icon.texcoord = normal_coords diff --git a/frames/window_brokertexteditor.lua b/frames/window_brokertexteditor.lua index fae48876..327b158a 100644 --- a/frames/window_brokertexteditor.lua +++ b/frames/window_brokertexteditor.lua @@ -18,18 +18,18 @@ function Details:OpenBrokerTextEditor() local titleBar = DF:CreateTitleBar (panel, "Broker Text Editor") local textentry = DF:NewSpecialLuaEditorEntry (panel, 650, 270, "editbox", "$parentEntry", true) - textentry:SetPoint ("topleft", panel, "topleft", 2, -25) + textentry:SetPoint("topleft", panel, "topleft", 2, -25) DF:ApplyStandardBackdrop(textentry) DF:ReskinSlider(textentry.scroll) - textentry.editbox:SetScript ("OnTextChanged", function() + textentry.editbox:SetScript("OnTextChanged", function() local text = panel.editbox:GetText() Details.data_broker_text = text Details:BrokerTick() if (_G.DetailsOptionsWindow) then local dataBrokerString = _G["DetailsOptionsWindowTab" .. tabIndex].widget_list_by_type.textentry[1] - dataBrokerString:SetText (Details.data_broker_text) + dataBrokerString:SetText(Details.data_broker_text) end end) @@ -55,7 +55,7 @@ function Details:OpenBrokerTextEditor() end local d = DF:NewDropDown (panel, _, "$parentTextOptionsDropdown", "TextOptionsDropdown", 150, 20, buildAddMenu, 1) - d:SetPoint ("topright", panel, "topright", -12, -25) + d:SetPoint("topright", panel, "topright", -12, -25) d:SetTemplate(DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) local optiontable = {"{dmg}", "{dps}", "{dpos}", "{ddiff}", "{heal}", "{hps}", "{hpos}", "{hdiff}", "{time}"} @@ -64,7 +64,7 @@ function Details:OpenBrokerTextEditor() textentry.editbox:Insert (optiontable [option_selected]) end, nil, nil, nil, "<-") - add_button:SetPoint ("right", d, "left", -2, 0) + add_button:SetPoint("right", d, "left", -2, 0) add_button:SetTemplate(DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) @@ -178,8 +178,8 @@ function Details:OpenBrokerTextEditor() end local color_button = DF:NewColorPickButton (panel, "$parentButton5", nil, color_func) - color_button:SetSize (80, 20) - color_button:SetPoint ("topright", panel, "topright", -12, -102) + color_button:SetSize(80, 20) + color_button:SetPoint("topright", panel, "topright", -12, -102) color_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_COLOR_TOOLTIP"] color_button:SetTemplate(DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) @@ -188,7 +188,7 @@ function Details:OpenBrokerTextEditor() Details.data_broker_text = text if (_G.DetailsOptionsWindow) then local dataBrokerString = _G["DetailsOptionsWindowTab" .. tabIndex].widget_list_by_type.textentry[1] - dataBrokerString:SetText (Details.data_broker_text) + dataBrokerString:SetText(Details.data_broker_text) end Details:BrokerTick() panel:Hide() @@ -196,17 +196,17 @@ function Details:OpenBrokerTextEditor() local ok_button = DF:NewButton (panel, nil, "$parentButtonOk", nil, 80, 20, done, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_DONE"], 1) ok_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_DONE_TOOLTIP"] - ok_button:SetPoint ("topright", panel, "topright", -12, -174) + ok_button:SetPoint("topright", panel, "topright", -12, -174) ok_button:SetTemplate(DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) - local reset_button = DF:NewButton (panel, nil, "$parentDefaultOk", nil, 80, 20, function() textentry.editbox:SetText ("") end, nil, nil, nil, "Reset", 1) + local reset_button = DF:NewButton (panel, nil, "$parentDefaultOk", nil, 80, 20, function() textentry.editbox:SetText("") end, nil, nil, nil, "Reset", 1) reset_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_RESET_TOOLTIP"] - reset_button:SetPoint ("topright", panel, "topright", -100, -152) + reset_button:SetPoint("topright", panel, "topright", -100, -152) reset_button:SetTemplate(DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) - local cancel_button = DF:NewButton (panel, nil, "$parentDefaultCancel", nil, 80, 20, function() textentry.editbox:SetText (panel.default_text); done(); end, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_CANCEL"], 1) + local cancel_button = DF:NewButton (panel, nil, "$parentDefaultCancel", nil, 80, 20, function() textentry.editbox:SetText(panel.default_text); done(); end, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_CANCEL"], 1) cancel_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_CANCEL_TOOLTIP"] - cancel_button:SetPoint ("topright", panel, "topright", -100, -174) + cancel_button:SetPoint("topright", panel, "topright", -100, -174) cancel_button:SetTemplate(DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) end @@ -215,7 +215,7 @@ function Details:OpenBrokerTextEditor() local text = Details.data_broker_text:gsub ("||", "|") panel.default_text = text - panel.editbox:SetText (text) + panel.editbox:SetText(text) panel:Show() end \ No newline at end of file diff --git a/frames/window_cdtracker.lua b/frames/window_cdtracker.lua index 63e00477..a967ce10 100644 --- a/frames/window_cdtracker.lua +++ b/frames/window_cdtracker.lua @@ -42,7 +42,7 @@ function Details.CooldownTracking.DisableTracker() end ---> Library Open Raid Callbacks +--Library Open Raid Callbacks --callback on the event 'CooldownListUpdate', this is triggered when a player in the group sent the list of cooldowns --@unitId: which unit got updated --@unitCooldows: a table with [spellId] = cooldownInfo @@ -100,10 +100,10 @@ end end ---> Frames +--Frames --hide all bars created function Details.CooldownTracking.HideAllBars() - for _, bar in ipairs (DetailsOnlineCDTrackerScreenPanel.bars) do + for _, bar in ipairs(DetailsOnlineCDTrackerScreenPanel.bars) do bar:ClearAllPoints() bar:Hide() @@ -210,7 +210,7 @@ end end end ---> update cooldown frames based on the amount of players in the group or raid +--update cooldown frames based on the amount of players in the group or raid function Details.CooldownTracking.RefreshCooldownFrames() local screenPanel = DetailsOnlineCDTrackerScreenPanel @@ -333,7 +333,7 @@ end end ---> Options panel +--Options panel --initialize the cooldown options window and embed it to Details! options panel function Details:InitializeCDTrackerWindow() diff --git a/frames/window_classcolor.lua b/frames/window_classcolor.lua index c2263544..e72ba5b3 100644 --- a/frames/window_classcolor.lua +++ b/frames/window_classcolor.lua @@ -4,7 +4,7 @@ local Details = _G.Details local DF = _G.DetailsFramework local Loc = _G.LibStub("AceLocale-3.0"):GetLocale("Details") ---> config class colors +--config class colors function Details:OpenClassColorsConfig() if (not _G.DetailsClassColorManager) then DF:CreateSimplePanel (UIParent, 300, 425, Loc ["STRING_OPTIONS_CLASSCOLOR_MODIFY"], "DetailsClassColorManager") @@ -13,8 +13,8 @@ function Details:OpenClassColorsConfig() DF:ApplyStandardBackdrop(panel) panel:SetBackdropColor(.1, .1, .1, .9) - local upper_panel = CreateFrame ("frame", nil, panel,"BackdropTemplate") - upper_panel:SetAllPoints (panel) + local upper_panel = CreateFrame("frame", nil, panel,"BackdropTemplate") + upper_panel:SetAllPoints(panel) upper_panel:SetFrameLevel (panel:GetFrameLevel()+3) local y = -50 @@ -24,7 +24,7 @@ function Details:OpenClassColorsConfig() Details.class_colors [self.MyObject.my_class][1] = r Details.class_colors [self.MyObject.my_class][2] = g Details.class_colors [self.MyObject.my_class][3] = b - Details:RefreshMainWindow (-1, true) + Details:RefreshMainWindow(-1, true) end local set_color = function(self, button, class, index) @@ -40,7 +40,7 @@ function Details:OpenClassColorsConfig() Details.class_colors [self.MyObject.my_class][1] = r Details.class_colors [self.MyObject.my_class][2] = g Details.class_colors [self.MyObject.my_class][3] = b - Details:RefreshMainWindow (-1, true) + Details:RefreshMainWindow(-1, true) end local on_enter = function(self, capsule) @@ -86,8 +86,8 @@ function Details:OpenClassColorsConfig() button.my_icon = icon button.my_texture = backgroundTexture button.my_class = className - button:SetHook ("OnEnter", on_enter) - button:SetHook ("OnLeave", on_leave) + button:SetHook("OnEnter", on_enter) + button:SetHook("OnLeave", on_leave) button:SetClickFunction (reset_color, nil, nil, "RightClick") panel.buttons [className] = button end diff --git a/frames/window_copy.lua b/frames/window_copy.lua index 9e03936c..2d5b93f7 100644 --- a/frames/window_copy.lua +++ b/frames/window_copy.lua @@ -3,19 +3,19 @@ do local _detalhes = _G._detalhes local DetailsFrameWork = _detalhes.gump local _ ---> panel +--panel function _detalhes:CreateCopyPasteWindow() - local panel = CreateFrame ("frame", "DetailsCopy", UIParent, "ButtonFrameTemplate") - panel:SetSize (512, 148) + local panel = CreateFrame("frame", "DetailsCopy", UIParent, "ButtonFrameTemplate") + panel:SetSize(512, 148) tinsert (UISpecialFrames, "DetailsCopy") panel:SetFrameStrata ("TOOLTIP") - panel:SetPoint ("center", UIParent, "center") + panel:SetPoint("center", UIParent, "center") panel.locked = false panel:SetToplevel (true) panel:SetMovable (true) - panel:SetScript ("OnMouseDown", function(self, button) + panel:SetScript("OnMouseDown", function(self, button) if (self.isMoving) then return end @@ -26,7 +26,7 @@ do self.isMoving = true end end) - panel:SetScript ("OnMouseUp", function(self, button) + panel:SetScript("OnMouseUp", function(self, button) if (self.isMoving and button == "LeftButton") then self:StopMovingOrSizing() self.isMoving = nil @@ -34,19 +34,19 @@ do end) DetailsFrameWork:NewImage (panel, "Interface\\AddOns\\Details\\images\\copy", 512, 128, "overlay", nil, "background", "$parentBackGround") - panel.background:SetPoint (0, -25) + panel.background:SetPoint(0, -25) - --> title - --panel.TitleText:SetText ("Paste & Copy") --10.0 fuck - --panel.portrait:SetTexture ([[Interface\CHARACTERFRAME\TEMPORARYPORTRAIT-FEMALE-BLOODELF]]) + --title + --panel.TitleText:SetText("Paste & Copy") --10.0 fuck + --panel.portrait:SetTexture([[Interface\CHARACTERFRAME\TEMPORARYPORTRAIT-FEMALE-BLOODELF]]) DetailsFrameWork:NewTextEntry (panel, _, "$parentTextEntry", "text", 476, 14) - panel.text:SetPoint (20, -127) - panel.text:SetHook ("OnEditFocusLost", function() panel:Hide() end) - panel.text:SetHook ("OnChar", function() panel:Hide() end) + panel.text:SetPoint(20, -127) + panel.text:SetHook("OnEditFocusLost", function() panel:Hide() end) + panel.text:SetHook("OnChar", function() panel:Hide() end) - DetailsFrameWork:NewLabel (panel, _, _, "desc", "paste on your web browser address bar", "OptionsFontHighlightSmall", 12) - panel.desc:SetPoint (340, -78) + DetailsFrameWork:NewLabel(panel, _, _, "desc", "paste on your web browser address bar", "OptionsFontHighlightSmall", 12) + panel.desc:SetPoint(340, -78) panel.desc.width = 150 panel.desc.height = 25 panel.desc.align = "|" diff --git a/frames/window_currentdps.lua b/frames/window_currentdps.lua index 2eacc8d9..71cf1424 100644 --- a/frames/window_currentdps.lua +++ b/frames/window_currentdps.lua @@ -17,9 +17,9 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel) local DF = _detalhes.gump local f = DF:CreateSimplePanel (UIParent, 700, 400, "Details! Arena Damage Bar Options", "DetailsCurrentRealDPSOptions") - f:SetPoint ("center", UIParent, "center") - f:SetScript ("OnMouseDown", nil) - f:SetScript ("OnMouseUp", nil) + f:SetPoint("center", UIParent, "center") + f:SetScript("OnMouseDown", nil) + f:SetScript("OnMouseUp", nil) --scale bar local scaleBar = DF:CreateScaleBar(f, _detalhes.realtime_dps_meter.options_frame) @@ -51,7 +51,7 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel) local testUsing = "arena" --mythicdungeon - --> frame strata options + --frame strata options local set_frame_strata = function(_, _, strata) Details.realtime_dps_meter.frame_settings.strata = strata Details:UpdateTheRealCurrentDPSFrame(testUsing) @@ -63,7 +63,7 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel) strataTable [4] = {value = "HIGH", label = "HIGH", onclick = set_frame_strata} strataTable [5] = {value = "DIALOG", label = "DIALOG", onclick = set_frame_strata} - --> font options + --font options local set_font_shadow= function(_, _, shadow) Details.realtime_dps_meter.font_shadow = shadow Details:UpdateTheRealCurrentDPSFrame(testUsing) @@ -91,7 +91,7 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel) end end - --> options table + --options table local options = { {type = "label", get = function() return "Frame Settings:" end, text_template = DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")}, @@ -289,17 +289,17 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel) DF:BuildMenu (f, options, 7, -50, 500, true, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template) - f:SetScript ("OnHide" , function() + f:SetScript("OnHide" , function() if (DetailsCurrentDpsMeter) then - --> check if can hide the main frame as well - --> we force show the main frame for the user see the frame while editing the options + --check if can hide the main frame as well + --we force show the main frame for the user see the frame while editing the options local zoneName, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceMapID, instanceGroupSize = GetInstanceInfo() if ((instanceType ~= "party" and difficultyID ~= 8) and instanceType ~= "arena") then DetailsCurrentDpsMeter:Hide() end end - --> reopen the options panel + --reopen the options panel if (f.FromOptionsPanel) then C_Timer.After (0.2, function() Details:OpenOptionsWindow(Details:GetInstance(1)) @@ -310,17 +310,17 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel) C_Timer.After(1, lockCallback) end - --> check if the frame was been created + --check if the frame was been created if (not DetailsCurrentDpsMeter) then Details:CreateCurrentDpsFrame(UIParent, "DetailsCurrentDpsMeter") end - --> show the options + --show the options DetailsCurrentRealDPSOptions:Show() DetailsCurrentRealDPSOptions:RefreshOptions() DetailsCurrentRealDPSOptions.FromOptionsPanel = from_options_panel - --> start the frame for viewing while editing the options + --start the frame for viewing while editing the options DetailsCurrentDpsMeter:StartForArenaMatch() end @@ -333,17 +333,17 @@ function Details:CreateCurrentDpsFrame(parent, name) green_team_color = Details.class_colors.ARENA_GREEN --{.5, 1, .5, 1} yellow_team_color = Details.class_colors.ARENA_YELLOW --{1, 1, .5, 1} - --> some constants + --some constants local header_size = 12 --title bar size local spacing_vertical = -6 --vertical space between the group anchor and the group dps - --> main farame - local f = CreateFrame ("frame", name, parent or UIParent, "BackdropTemplate") - f:SetPoint ("top", UIParent, "top", 0, -110) - f:SetSize (_detalhes.realtime_dps_meter.frame_settings.width, _detalhes.realtime_dps_meter.frame_settings.height) + --main farame + local f = CreateFrame("frame", name, parent or UIParent, "BackdropTemplate") + f:SetPoint("top", UIParent, "top", 0, -110) + f:SetSize(_detalhes.realtime_dps_meter.frame_settings.width, _detalhes.realtime_dps_meter.frame_settings.height) - f:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}) - f:SetBackdropColor (unpack (_detalhes.realtime_dps_meter.frame_settings.backdrop_color)) + f:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}) + f:SetBackdropColor(unpack (_detalhes.realtime_dps_meter.frame_settings.backdrop_color)) f:EnableMouse (true) f:SetMovable (true) f:SetClampedToScreen (true) @@ -404,7 +404,7 @@ function Details:CreateCurrentDpsFrame(parent, name) end end) - --> arena dps bars + --arena dps bars --code for the dps bars shown in arenas --frame to support the two bars, one for the dps and another for heal @@ -463,26 +463,26 @@ function Details:CreateCurrentDpsFrame(parent, name) rightOrnamentTexture:SetSize(32, 32) rightOrnamentTexture:SetAlpha(0.6) - --> title bar + --title bar local TitleString = f:CreateFontString (nil, "overlay", "GameFontNormal") - TitleString:SetPoint ("top", f, "top", 0, -5) - TitleString:SetText ("Details! Arena Real Time DPS Tracker") + TitleString:SetPoint("top", f, "top", 0, -5) + TitleString:SetText("Details! Arena Real Time DPS Tracker") DF:SetFontSize (TitleString, 9) - local TitleBackground = f:CreateTexture (nil, "artwork") - TitleBackground:SetTexture ([[Interface\Tooltips\UI-Tooltip-Background]]) + local TitleBackground = f:CreateTexture(nil, "artwork") + TitleBackground:SetTexture([[Interface\Tooltips\UI-Tooltip-Background]]) TitleBackground:SetVertexColor (.1, .1, .1, .9) TitleBackground:SetVertexColor (.1, .1, .1, 0) - TitleBackground:SetPoint ("topleft", f, "topleft") - TitleBackground:SetPoint ("topright", f, "topright") - TitleBackground:SetHeight (header_size) + TitleBackground:SetPoint("topleft", f, "topleft") + TitleBackground:SetPoint("topright", f, "topright") + TitleBackground:SetHeight(header_size) - --> labels for arena + --labels for arena local labelPlayerTeam_DPS = barFrame.splitBar:CreateFontString(nil, "overlay", "GameFontNormal") local labelYellowTeam_DPS = barFrame.splitBar:CreateFontString(nil, "overlay", "GameFontNormal") - labelPlayerTeam_DPS:SetText ("0") - labelYellowTeam_DPS:SetText ("0") - labelPlayerTeam_DPS:SetPoint ("left", barFrame.splitBar.widget, "left", 4, 0) - labelYellowTeam_DPS:SetPoint ("right", barFrame.splitBar.widget, "right", -4, 0) + labelPlayerTeam_DPS:SetText("0") + labelYellowTeam_DPS:SetText("0") + labelPlayerTeam_DPS:SetPoint("left", barFrame.splitBar.widget, "left", 4, 0) + labelYellowTeam_DPS:SetPoint("right", barFrame.splitBar.widget, "right", -4, 0) function f.SwapArenaTeamColors() green_team_color = Details.class_colors.ARENA_GREEN @@ -497,27 +497,27 @@ function Details:CreateCurrentDpsFrame(parent, name) end end - --> labels for mythic dungeon / group party + --labels for mythic dungeon / group party local labelGroupDamage = f:CreateFontString (nil, "overlay", "GameFontNormal") - labelGroupDamage:SetText ("Real Time Group DPS") + labelGroupDamage:SetText("Real Time Group DPS") DF:SetFontSize (labelGroupDamage, 14) DF:SetFontOutline (labelGroupDamage, "NONE") local labelGroupDamage_DPS = f:CreateFontString (nil, "overlay", "GameFontNormal") - labelGroupDamage_DPS:SetText ("0") + labelGroupDamage_DPS:SetText("0") - labelGroupDamage:SetPoint ("center", f, "center", 0, 10) - labelGroupDamage_DPS:SetPoint ("center", labelGroupDamage, "center") - labelGroupDamage_DPS:SetPoint ("top", labelGroupDamage, "bottom", 0, spacing_vertical) + labelGroupDamage:SetPoint("center", f, "center", 0, 10) + labelGroupDamage_DPS:SetPoint("center", labelGroupDamage, "center") + labelGroupDamage_DPS:SetPoint("top", labelGroupDamage, "bottom", 0, spacing_vertical) - --> frame update function + --frame update function - --> update + --update local time_fraction = 100/1000 --one tick per 100ms f.NextUpdate = time_fraction --when the next tick occur f.NextScreenUpdate = _detalhes.realtime_dps_meter.update_interval --when the labels on the frame receive update - --> arena + --arena f.PlayerTeamBuffer = {} f.YellowTeamBuffer = {} f.PlayerTeamDamage = 0 @@ -525,18 +525,18 @@ function Details:CreateCurrentDpsFrame(parent, name) f.LastPlayerTeamDamage = 0 f.LastYellowDamage = 0 - --> mythic dungeon / party group + --mythic dungeon / party group f.GroupBuffer = {} f.GroupTotalDamage = 0 f.LastTickGroupDamage = 0 - --> general + --general f.SampleSize = _detalhes.realtime_dps_meter.sample_size f.MaxBufferIndex = 1 f.ShowingArena = false function _detalhes:UpdateTheRealCurrentDPSFrame(scenario) - --> don't run if the featured hasn't loaded + --don't run if the featured hasn't loaded if (not f) then return end @@ -553,7 +553,7 @@ function Details:CreateCurrentDpsFrame(parent, name) return end - --> where the player are + --where the player are if (scenario == "arena") then f.SampleSize = _detalhes.realtime_dps_meter.sample_size @@ -561,26 +561,26 @@ function Details:CreateCurrentDpsFrame(parent, name) labelPlayerTeam_DPS:Show() labelYellowTeam_DPS:Show() - --> update arena labels - DF:SetFontColor (labelPlayerTeam_DPS, _detalhes.realtime_dps_meter.font_color) + --update arena labels + DF:SetFontColor(labelPlayerTeam_DPS, _detalhes.realtime_dps_meter.font_color) DF:SetFontFace (labelPlayerTeam_DPS, _detalhes.realtime_dps_meter.font_face) DF:SetFontSize (labelPlayerTeam_DPS, _detalhes.realtime_dps_meter.font_size) DF:SetFontOutline (labelPlayerTeam_DPS, _detalhes.realtime_dps_meter.font_shadow) - DF:SetFontColor (labelYellowTeam_DPS, _detalhes.realtime_dps_meter.font_color) + DF:SetFontColor(labelYellowTeam_DPS, _detalhes.realtime_dps_meter.font_color) DF:SetFontFace (labelYellowTeam_DPS, _detalhes.realtime_dps_meter.font_face) DF:SetFontSize (labelYellowTeam_DPS, _detalhes.realtime_dps_meter.font_size) DF:SetFontOutline (labelYellowTeam_DPS, _detalhes.realtime_dps_meter.font_shadow) - --> wipe current data for arena + --wipe current data for arena wipe (f.PlayerTeamBuffer) wipe (f.YellowTeamBuffer) - --> reset damage + --reset damage f.PlayerTeamDamage = 0 f.YellowDamage = 0 - --> reset last tick damage + --reset last tick damage f.LastPlayerTeamDamage = 0 f.LastYellowDamage = 0 @@ -606,18 +606,18 @@ function Details:CreateCurrentDpsFrame(parent, name) labelGroupDamage:Show() labelGroupDamage_DPS:Show() - DF:SetFontColor (labelGroupDamage_DPS, _detalhes.realtime_dps_meter.font_color) + DF:SetFontColor(labelGroupDamage_DPS, _detalhes.realtime_dps_meter.font_color) DF:SetFontFace (labelGroupDamage_DPS, _detalhes.realtime_dps_meter.font_face) DF:SetFontSize (labelGroupDamage_DPS, _detalhes.realtime_dps_meter.font_size) DF:SetFontOutline (labelGroupDamage_DPS, _detalhes.realtime_dps_meter.font_shadow) - --> wipe current data for mythic dungeon + --wipe current data for mythic dungeon f.GroupBuffer = {} - --> reset damage + --reset damage f.GroupTotalDamage = 0 - --> reset last tick damage + --reset last tick damage f.LastTickGroupDamage = 0 --show the frame @@ -630,25 +630,25 @@ function Details:CreateCurrentDpsFrame(parent, name) labelYellowTeam_DPS:Hide() end - --> frame position - f:SetSize (_detalhes.realtime_dps_meter.frame_settings.width, _detalhes.realtime_dps_meter.frame_settings.height) + --frame position + f:SetSize(_detalhes.realtime_dps_meter.frame_settings.width, _detalhes.realtime_dps_meter.frame_settings.height) LibWindow.RegisterConfig (f, _detalhes.realtime_dps_meter.frame_settings) LibWindow.RestorePosition (f) - --> backdrop color - f:SetBackdropColor (unpack (_detalhes.realtime_dps_meter.frame_settings.backdrop_color)) + --backdrop color + f:SetBackdropColor(unpack (_detalhes.realtime_dps_meter.frame_settings.backdrop_color)) - --> set frame size - f:SetSize (_detalhes.realtime_dps_meter.frame_settings.width, _detalhes.realtime_dps_meter.frame_settings.height) + --set frame size + f:SetSize(_detalhes.realtime_dps_meter.frame_settings.width, _detalhes.realtime_dps_meter.frame_settings.height) - --> frame is locked + --frame is locked if (_detalhes.realtime_dps_meter.frame_settings.locked) then f:EnableMouse (false) else f:EnableMouse (true) end - --> frame can show title + --frame can show title if (_detalhes.realtime_dps_meter.frame_settings.show_title) then TitleString:Show() TitleBackground:Show() @@ -657,13 +657,13 @@ function Details:CreateCurrentDpsFrame(parent, name) TitleBackground:Hide() end - --> frame strata + --frame strata f:SetFrameStrata (_detalhes.realtime_dps_meter.frame_settings.strata) - --> calcule buffer size + --calcule buffer size f.MaxBufferIndex = f.SampleSize * time_fraction * 100 --sample size in seconds * fraction * tick milliseconds - --> interval to update the frame + --interval to update the frame f.NextScreenUpdate = _detalhes.realtime_dps_meter.update_interval @@ -677,13 +677,13 @@ function Details:CreateCurrentDpsFrame(parent, name) self.NextUpdate = self.NextUpdate - deltaTime if (self.NextUpdate <= 0) then - --> update string + --update string local currentCombat = _detalhes:GetCombat() local damageContainer = currentCombat:GetContainer (DETAILS_ATTRIBUTE_DAMAGE) - --> show the current dps during an arena match + --show the current dps during an arena match if (self.ShowingArena) then - --> the team damage done at this tick + --the team damage done at this tick local thisTickPlayerTeamDamage = 0 local thisTickYellowDamage = 0 @@ -699,7 +699,7 @@ function Details:CreateCurrentDpsFrame(parent, name) end if (actor.nome == _detalhes.playername) then - --> if player isn't in green team > swap colors + --if player isn't in green team > swap colors if (f.PlayerTeam ~= actor.arena_team) then f.SwapArenaTeamColors() f.PlayerTeam = actor.arena_team @@ -708,41 +708,41 @@ function Details:CreateCurrentDpsFrame(parent, name) end end - --> calculate how much damage the team made on this tick + --calculate how much damage the team made on this tick local playerTeamDamageDone = thisTickPlayerTeamDamage - f.LastPlayerTeamDamage local yellowDamageDone = thisTickYellowDamage - f.LastYellowDamage - --> add the damage to buffer + --add the damage to buffer tinsert (f.PlayerTeamBuffer, 1, playerTeamDamageDone) tinsert (f.YellowTeamBuffer, 1, yellowDamageDone) - --> save the current damage amount + --save the current damage amount f.LastPlayerTeamDamage = thisTickPlayerTeamDamage f.LastYellowDamage = thisTickYellowDamage - --> add the damage to current total damage + --add the damage to current total damage f.PlayerTeamDamage = f.PlayerTeamDamage + playerTeamDamageDone f.YellowDamage = f.YellowDamage + yellowDamageDone - --> remove player team damage + --remove player team damage local removedDamage = tremove (f.PlayerTeamBuffer, f.MaxBufferIndex+1) if (removedDamage) then f.PlayerTeamDamage = f.PlayerTeamDamage - removedDamage - --> be save + --be save f.PlayerTeamDamage = max (0, f.PlayerTeamDamage) end - --> remove yellow damage + --remove yellow damage local removedDamage = tremove (f.YellowTeamBuffer, f.MaxBufferIndex+1) if (removedDamage) then f.YellowDamage = f.YellowDamage - removedDamage - --> be save + --be save f.YellowDamage = max (0, f.YellowDamage) end self.NextScreenUpdate = self.NextScreenUpdate - time_fraction --always 0.1 - --> update double bar + --update double bar local teamGreenDps = self.PlayerTeamDamage / self.SampleSize local teamYellowDps = self.YellowDamage / self.SampleSize local totalDamage = teamGreenDps + teamYellowDps @@ -784,11 +784,11 @@ function Details:CreateCurrentDpsFrame(parent, name) if (self.NextScreenUpdate <= 0) then if (f.PlayerTeam == 0) then - labelPlayerTeam_DPS:SetText (_detalhes:ToK2 (self.PlayerTeamDamage / self.SampleSize)) - labelYellowTeam_DPS:SetText (_detalhes:ToK2 (self.YellowDamage / self.SampleSize)) + labelPlayerTeam_DPS:SetText(_detalhes:ToK2 (self.PlayerTeamDamage / self.SampleSize)) + labelYellowTeam_DPS:SetText(_detalhes:ToK2 (self.YellowDamage / self.SampleSize)) else - labelPlayerTeam_DPS:SetText (_detalhes:ToK2 (self.YellowDamage / self.SampleSize)) - labelYellowTeam_DPS:SetText (_detalhes:ToK2 (self.PlayerTeamDamage / self.SampleSize)) + labelPlayerTeam_DPS:SetText(_detalhes:ToK2 (self.YellowDamage / self.SampleSize)) + labelYellowTeam_DPS:SetText(_detalhes:ToK2 (self.PlayerTeamDamage / self.SampleSize)) end f.NextScreenUpdate = _detalhes.realtime_dps_meter.update_interval end @@ -798,7 +798,7 @@ function Details:CreateCurrentDpsFrame(parent, name) --iniciava um novo combate e tinha o buffer do combate anterior --ent�o dava o total de dano do combate recente menos o que tinha no buffer do round anterior - --> the party damage done at this tick + --the party damage done at this tick local thisTickGroupDamage = 0 for i, actor in damageContainer:ListActors() do @@ -807,44 +807,44 @@ function Details:CreateCurrentDpsFrame(parent, name) end end - --> calculate how much damage the team made on this tick + --calculate how much damage the team made on this tick local groupDamageDoneOnThisTick = thisTickGroupDamage - f.LastTickGroupDamage - --> add the damage to buffer + --add the damage to buffer tinsert (f.GroupBuffer, 1, groupDamageDoneOnThisTick) - --> save the current damage amount + --save the current damage amount f.LastTickGroupDamage = thisTickGroupDamage - --> add the damage to current total damage + --add the damage to current total damage f.GroupTotalDamage = f.GroupTotalDamage + groupDamageDoneOnThisTick - --> cicle buffer removing the last index and subtract its damage + --cicle buffer removing the last index and subtract its damage local removedDamage = tremove (f.GroupBuffer, f.MaxBufferIndex+1) if (removedDamage) then - --> remove the value from the total damage + --remove the value from the total damage f.GroupTotalDamage = f.GroupTotalDamage - removedDamage - --> be save + --be save f.GroupTotalDamage = max (0, f.GroupTotalDamage) end self.NextScreenUpdate = self.NextScreenUpdate - time_fraction if (self.NextScreenUpdate <= 0) then - labelGroupDamage_DPS:SetText (_detalhes:ToK2 (f.GroupTotalDamage / self.SampleSize)) + labelGroupDamage_DPS:SetText(_detalhes:ToK2 (f.GroupTotalDamage / self.SampleSize)) f.NextScreenUpdate = _detalhes.realtime_dps_meter.update_interval end end - --> set next update time + --set next update time self.NextUpdate = time_fraction end end - f:SetScript ("OnHide", function() + f:SetScript("OnHide", function() f.ShowingArena = false f.ShowingMythicDungeon = false - f:SetScript ("OnUpdate", nil) + f:SetScript("OnUpdate", nil) end) function f:StartForArenaMatch() @@ -853,14 +853,14 @@ function Details:CreateCurrentDpsFrame(parent, name) Details:UpdateTheRealCurrentDPSFrame("arena") f.ShowingArena = true - f:SetScript ("OnUpdate", on_tick) + f:SetScript("OnUpdate", on_tick) end end function f:StartForMythicDungeon() if (not f.ShowingMythicDungeon) then f.ShowingMythicDungeon = true - f:SetScript ("OnUpdate", on_tick) + f:SetScript("OnUpdate", on_tick) end end @@ -915,7 +915,7 @@ end function DetailsTestSplitBar() - --> create the frame + --create the frame local f = CreateFrame("frame", "DetailsTestSplitBarFrame", UIParent) f:SetSize(400, 200) f:SetPoint("center") @@ -939,7 +939,7 @@ function DetailsTestSplitBar() barFrame.splitBar:SetLeftColor(unpack (green_team_color)) barFrame.splitBar:SetRightColor(unpack (yellow_team_color)) - --> test the splitbar + --test the splitbar local loopTime = 0.1 f:SetScript("OnUpdate", function(self, deltaTime) loopTime = loopTime - deltaTime diff --git a/frames/window_custom.lua b/frames/window_custom.lua index ec55bdd4..4cb65c13 100644 --- a/frames/window_custom.lua +++ b/frames/window_custom.lua @@ -1,4 +1,4 @@ ---> custom window +--custom window local _detalhes = _G._detalhes local gump = _detalhes.gump @@ -9,7 +9,7 @@ local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> local pointers +--local pointers local _cstr = string.format --lua local @@ -36,7 +36,7 @@ local _IsControlKeyDown = IsControlKeyDown --api local ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> constants +--constants local CONST_MENU_X_POSITION = 10 local CONST_MENU_Y_POSITION = -40 @@ -87,7 +87,7 @@ backdropbordercolor = {0, 0, 0, 1}, }) - gump:NewColor ("DETAILS_CUSTOMDISPLAY_ICON", .7, .6, .5, 1) + gump:NewColor("DETAILS_CUSTOMDISPLAY_ICON", .7, .6, .5, 1) local CONST_CODETEXTENTRY_TEMPLATE = gump:GetTemplate ("button", "DETAILS_CUSTOMDISPLAY_CODE_BOX") local CONST_CODETEXTENTRYEXPANDED_TEMPLATE = gump:GetTemplate ("button", "DETAILS_CUSTOMDISPLAY_CODE_BOX_EXPANDED") @@ -119,11 +119,11 @@ } ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> create the window +--create the window function _detalhes:CloseCustomDisplayWindow() - --> cancel editing or creation + --cancel editing or creation if (DetailsCustomPanel.CodeEditing) then DetailsCustomPanel:CancelFunc() end @@ -134,12 +134,12 @@ DetailsCustomPanel:Reset() DetailsCustomPanel:ClearFocus() - --> hide the frame + --hide the frame _G.DetailsCustomPanel:Hide() end function _detalhes:InitializeCustomDisplayWindow() - local DetailsCustomPanel = CreateFrame ("frame", "DetailsCustomPanel", UIParent,"BackdropTemplate") + local DetailsCustomPanel = CreateFrame("frame", "DetailsCustomPanel", UIParent,"BackdropTemplate") DetailsCustomPanel.Frame = DetailsCustomPanel DetailsCustomPanel.__name = Loc ["STRING_SCRIPTS_TITLE"] DetailsCustomPanel.real_name = "DETAILS_CUSTOMDISPLAY" @@ -163,15 +163,15 @@ local GameCooltip = GameCooltip DetailsCustomPanel.Initialized = true - --> main frame + --main frame local custom_window = DetailsCustomPanel or _CreateFrame ("frame", "DetailsCustomPanel", UIParent,"BackdropTemplate") local f = custom_window - custom_window:SetPoint ("center", UIParent, "center") - custom_window:SetSize (850, 500) + custom_window:SetPoint("center", UIParent, "center") + 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,63 +183,63 @@ end end end) - custom_window:SetScript ("OnMouseUp", function(self) + custom_window:SetScript("OnMouseUp", function(self) if (self.moving) then self.moving = false self:StopMovingOrSizing() end end) - custom_window:SetScript ("OnShow", function() + custom_window:SetScript("OnShow", function() GameCooltip:Hide() end) tinsert (UISpecialFrames, "DetailsCustomPanel") - --> menu title bar - local titlebar = CreateFrame ("frame", nil, f,"BackdropTemplate") - titlebar:SetPoint ("topleft", f, "topleft", 2, -3) - titlebar:SetPoint ("topright", f, "topright", -2, -3) - titlebar:SetHeight (20) - titlebar:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) - titlebar:SetBackdropColor (.5, .5, .5, 1) - titlebar:SetBackdropBorderColor (0, 0, 0, 1) + --menu title bar + local titlebar = CreateFrame("frame", nil, f,"BackdropTemplate") + titlebar:SetPoint("topleft", f, "topleft", 2, -3) + titlebar:SetPoint("topright", f, "topright", -2, -3) + titlebar:SetHeight(20) + titlebar:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) + titlebar:SetBackdropColor(.5, .5, .5, 1) + titlebar:SetBackdropBorderColor(0, 0, 0, 1) - --> menu title - local titleLabel = _detalhes.gump:NewLabel (titlebar, titlebar, nil, "titulo", "Details! Custom Displays", "GameFontNormal", 12) - titleLabel:SetPoint ("center", titlebar , "center") - titleLabel:SetPoint ("top", titlebar , "top", 0, -4) + --menu title + local titleLabel = _detalhes.gump:NewLabel(titlebar, titlebar, nil, "titulo", "Details! Custom Displays", "GameFontNormal", 12) + titleLabel:SetPoint("center", titlebar , "center") + titleLabel:SetPoint("top", titlebar , "top", 0, -4) - --> close button - f.Close = CreateFrame ("button", "$parentCloseButton", f) - f.Close:SetPoint ("right", titlebar, "right", -2, 0) - f.Close:SetSize (16, 16) + --close button + f.Close = CreateFrame("button", "$parentCloseButton", f) + f.Close:SetPoint("right", titlebar, "right", -2, 0) + f.Close:SetSize(16, 16) - f.Close:SetNormalTexture ([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) - f.Close:SetHighlightTexture ([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) - f.Close:SetPushedTexture ([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) + f.Close:SetNormalTexture([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) + f.Close:SetHighlightTexture([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) + f.Close:SetPushedTexture([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) f.Close:GetNormalTexture():SetDesaturated(true) f.Close:GetHighlightTexture():SetDesaturated(true) f.Close:GetPushedTexture():SetDesaturated(true) f.Close:SetAlpha (0.7) - f.Close:SetScript ("OnClick", function() _detalhes:CloseCustomDisplayWindow() end) - f.Close:SetScript ("OnHide", function() + f.Close:SetScript("OnClick", function() _detalhes:CloseCustomDisplayWindow() end) + f.Close:SetScript("OnHide", function() _detalhes:CloseCustomDisplayWindow() end) - --> background - f.bg1 = f:CreateTexture (nil, "background") - f.bg1:SetTexture ([[Interface\AddOns\Details\images\background]], true) + --background + f.bg1 = f:CreateTexture(nil, "background") + f.bg1:SetTexture([[Interface\AddOns\Details\images\background]], true) f.bg1:SetAlpha (0.7) f.bg1:SetVertexColor (0.27, 0.27, 0.27) f.bg1:SetVertTile (true) f.bg1:SetHorizTile (true) f.bg1:SetAllPoints() - f:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) - f:SetBackdropColor (.5, .5, .5, .5) - f:SetBackdropBorderColor (0, 0, 0, 1) + f:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) + f:SetBackdropColor(.5, .5, .5, .5) + f:SetBackdropBorderColor(0, 0, 0, 1) DetailsCustomPanel.BoxType = 1 DetailsCustomPanel.IsEditing = false @@ -296,20 +296,20 @@ end function DetailsCustomPanel:Reset() - self.name_field:SetText ("") - self.icon_image:SetTexture ([[Interface\ICONS\TEMP]]) - self.desc_field:SetText ("") + self.name_field:SetText("") + self.icon_image:SetTexture([[Interface\ICONS\TEMP]]) + self.desc_field:SetText("") - self.author_field:SetText (UnitName ("player") .. "-" .. GetRealmName()) + self.author_field:SetText(UnitName ("player") .. "-" .. GetRealmName()) self.author_field:Enable() self.source_dropdown:Select (1, true) - self.source_field:SetText ("") + self.source_field:SetText("") self.target_dropdown:Select (1, true) - self.target_field:SetText ("") + self.target_field:SetText("") - self.spellid_entry:SetText ("") + self.spellid_entry:SetText("") DetailsCustomPanel.code1 = DetailsCustomPanel.code1_default DetailsCustomPanel.code2 = DetailsCustomPanel.code2_default @@ -325,7 +325,7 @@ function DetailsCustomPanel:RemoveDisplay (custom_object, index) table.remove (_detalhes.custom, index) - for _, instance in _ipairs (_detalhes.tabela_instancias) do + for _, instance in _ipairs(_detalhes.tabela_instancias) do if (instance.atributo == 5 and instance.sub_atributo == index) then instance:ResetAttribute() elseif (instance.atributo == 5 and instance.sub_atributo > index) then @@ -348,14 +348,14 @@ DetailsCustomPanel.IsEditing = custom_object DetailsCustomPanel.IsImporting = import - self.name_field:SetText (custom_object:GetName()) - self.desc_field:SetText (custom_object:GetDesc()) - self.icon_image:SetTexture (custom_object:GetIcon()) + self.name_field:SetText(custom_object:GetName()) + self.desc_field:SetText(custom_object:GetDesc()) + self.icon_image:SetTexture(custom_object:GetIcon()) - self.author_field:SetText (custom_object:GetAuthor()) + self.author_field:SetText(custom_object:GetAuthor()) self.author_field:Disable() - custom_window.codeeditor:SetText ("") + custom_window.codeeditor:SetText("") if (custom_object:IsScripted()) then @@ -378,19 +378,19 @@ local source = custom_object:GetSource() if (source == "[all]") then self.source_dropdown:Select (1, true) - self.source_field:SetText ("") + self.source_field:SetText("") self.source_field:Disable() elseif (source == "[raid]") then self.source_dropdown:Select (2, true) - self.source_field:SetText ("") + self.source_field:SetText("") self.source_field:Disable() elseif (source == "[player]") then self.source_dropdown:Select (3, true) - self.source_field:SetText ("") + self.source_field:SetText("") self.source_field:Disable() else self.source_dropdown:Select (4, true) - self.source_field:SetText (source) + self.source_field:SetText(source) self.source_field:Enable() end @@ -398,27 +398,27 @@ if (not target) then self.target_dropdown:Select (5, true) - self.target_field:SetText ("") + self.target_field:SetText("") self.target_field:Disable() elseif (target == "[all]") then self.target_dropdown:Select (1, true) - self.target_field:SetText ("") + self.target_field:SetText("") self.target_field:Disable() elseif (target == "[raid]") then self.target_dropdown:Select (2, true) - self.target_field:SetText ("") + self.target_field:SetText("") self.target_field:Disable() elseif (target == "[player]") then self.target_dropdown:Select (3, true) - self.target_field:SetText ("") + self.target_field:SetText("") self.target_field:Disable() else self.target_dropdown:Select (4, true) - self.target_field:SetText (target) + self.target_field:SetText(target) self.target_field:Enable() end - self.spellid_entry:SetText (custom_object:GetSpellId() or "") + self.spellid_entry:SetText(custom_object:GetSpellId() or "") end @@ -607,7 +607,7 @@ _detalhes.MicroButtonAlert:Hide() if (DetailsCustomPanel.CodeEditing) then - --> close the edit box saving the text + --close the edit box saving the text if (DetailsCustomPanel.CodeEditing == 1) then DetailsCustomPanel.code1 = custom_window.codeeditor:GetText() elseif (DetailsCustomPanel.CodeEditing == 2) then @@ -650,7 +650,7 @@ _detalhes.MicroButtonAlert:Hide() if (DetailsCustomPanel.CodeEditing) then - --> close the edit box without save + --close the edit box without save custom_window.codeeditor:Hide() DetailsCustomPanel.CodeEditing = false @@ -675,7 +675,7 @@ end function DetailsCustomPanel:SetAcceptButtonText (text) - custom_window.box0.acceptbutton:SetText (text) + custom_window.box0.acceptbutton:SetText(text) end function select_attribute (self) @@ -686,8 +686,8 @@ DetailsCustomPanel:ClearFocus() - custom_window.selected_left:SetPoint ("topleft", self, "topleft") - custom_window.selected_right:SetPoint ("topright", self, "topright") + custom_window.selected_left:SetPoint("topleft", self, "topleft") + custom_window.selected_right:SetPoint("topright", self, "topright") DetailsCustomPanel.current_attribute = self.attribute_table.attribute @@ -699,7 +699,7 @@ else --no scripted - --> check if is editing the code + --check if is editing the code if (DetailsCustomPanel.CodeEditing) then DetailsCustomPanel.AcceptFunc() end @@ -712,21 +712,21 @@ end function DetailsCustomPanel.StartEditCode (_, _, code) - if (code == 1) then --> edit main code + if (code == 1) then --edit main code - custom_window.codeeditor:SetText (DetailsCustomPanel.code1) + custom_window.codeeditor:SetText(DetailsCustomPanel.code1) - elseif (code == 2) then --> edit tooltip code + elseif (code == 2) then --edit tooltip code - custom_window.codeeditor:SetText (DetailsCustomPanel.code2) + custom_window.codeeditor:SetText(DetailsCustomPanel.code2) - elseif (code == 3) then --> edit total code + elseif (code == 3) then --edit total code - custom_window.codeeditor:SetText (DetailsCustomPanel.code3) + custom_window.codeeditor:SetText(DetailsCustomPanel.code3) - elseif (code == 4) then --> edit percent code + elseif (code == 4) then --edit percent code - custom_window.codeeditor:SetText (DetailsCustomPanel.code4) + custom_window.codeeditor:SetText(DetailsCustomPanel.code4) end @@ -736,7 +736,7 @@ DetailsCustomPanel:SetAcceptButtonText ("Save Code") --Loc ["STRING_CUSTOM_DONE"] end - --> left menu + --left menu custom_window.menu = {} local menu_start = -50 local menu_up_frame = _CreateFrame ("frame", nil, custom_window) @@ -753,15 +753,15 @@ local index = #custom_window.menu+1 local button = gump:NewButton (self, nil, "$parent" .. name, nil, CONST_MENU_WIDTH, CONST_MENU_HEIGHT, clickfunc, param1, param2, nil, label) - button:SetPoint ("topleft", self, "topleft", CONST_MENU_X_POSITION, CONST_MENU_Y_POSITION + ((index-1)*-23)) + button:SetPoint("topleft", self, "topleft", CONST_MENU_X_POSITION, CONST_MENU_Y_POSITION + ((index-1)*-23)) --button:SetTemplate (CONST_BUTTON_TEMPLATE) button:SetTemplate (gump:GetTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) - button:SetWidth (160) + button:SetWidth(160) button:SetIcon (icon, CONST_MENU_HEIGHT-4, CONST_MENU_HEIGHT-4, "overlay", {.1, .9, .1, .9}, nil, 4) - button:SetHook ("OnEnter", onenter) - button:SetHook ("OnLeave", onleave) + button:SetHook("OnEnter", onenter) + button:SetHook("OnLeave", onleave) button.widget.icontexture = texture button.tooltip = tooltip @@ -771,41 +771,41 @@ local build_menu = function(self, button, func, param2) GameCooltip:Reset() - for index, custom_object in _ipairs (_detalhes.custom) do + for index, custom_object in _ipairs(_detalhes.custom) do GameCooltip:AddLine (custom_object:GetName()) GameCooltip:AddIcon (custom_object:GetIcon()) GameCooltip:AddMenu (1, func, custom_object, index, true) end - GameCooltip:SetOption ("ButtonsYMod", -2) - GameCooltip:SetOption ("YSpacingMod", 0) - GameCooltip:SetOption ("TextHeightMod", 0) - GameCooltip:SetOption ("IgnoreButtonAutoHeight", false) + GameCooltip:SetOption("ButtonsYMod", -2) + GameCooltip:SetOption("YSpacingMod", 0) + GameCooltip:SetOption("TextHeightMod", 0) + GameCooltip:SetOption("IgnoreButtonAutoHeight", false) GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], {.6, 0.1, 0, 0.64453125}, {1, 1, 1, 0.1}, true) - GameCooltip:SetBackdrop (1, _detalhes.tooltip_backdrop, nil, _detalhes.tooltip_border_color) - GameCooltip:SetBackdrop (2, _detalhes.tooltip_backdrop, nil, _detalhes.tooltip_border_color) + GameCooltip:SetBackdrop(1, _detalhes.tooltip_backdrop, nil, _detalhes.tooltip_border_color) + GameCooltip:SetBackdrop(2, _detalhes.tooltip_backdrop, nil, _detalhes.tooltip_border_color) GameCooltip:SetType ("menu") GameCooltip:SetHost (self, "left", "right", -7, 0) GameCooltip:Show() end - --> edit button + --edit button 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 + --remove button 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 + --export button local export_display = function(_, _, custom_object, index) GameCooltip:Hide() @@ -813,7 +813,7 @@ for key, value in pairs (custom_object) do if (object_keys [key]) then - if (type (value) == "table") then + if (type(value) == "table") then export_object [key] = Details.CopyTable (value) else export_object [key] = value @@ -825,24 +825,24 @@ if (not custom_window.ExportBox) then local editbox = _detalhes.gump:NewTextEntry (custom_window, nil, "$parentExportBox", "ExportBox", CONST_EDITBOX_WIDTH, 20) - editbox:SetPoint ("bottomleft", custom_window, "bottomleft", 10, 6) + editbox:SetPoint("bottomleft", custom_window, "bottomleft", 10, 6) editbox:SetAutoFocus (false) editbox:SetTemplate (CONST_TEXTENTRY_TEMPLATE) - editbox:SetHook ("OnEditFocusLost", function() + editbox:SetHook("OnEditFocusLost", function() editbox:Hide() end) - editbox:SetHook ("OnChar", function() + editbox:SetHook("OnChar", function() editbox:Hide() end) - local flashTexture = editbox:CreateTexture (nil, "overlay") + local flashTexture = editbox:CreateTexture(nil, "overlay") flashTexture:SetColorTexture (1, 1, 1) flashTexture:SetAllPoints() flashTexture:SetAlpha (0) local flashAnimHub = DetailsFramework:CreateAnimationHub (flashTexture) - DetailsFramework:CreateAnimation (flashAnimHub, "alpha", 1, 0.2, 0, 1) - DetailsFramework:CreateAnimation (flashAnimHub, "alpha", 2, 0.2, 1, 0) + DetailsFramework:CreateAnimation(flashAnimHub, "alpha", 1, 0.2, 0, 1) + DetailsFramework:CreateAnimation(flashAnimHub, "alpha", 2, 0.2, 1, 0) editbox.FlashAnimation = flashAnimHub end @@ -853,26 +853,26 @@ end custom_window.ExportBox:Show() - custom_window.ExportBox:SetText (encoded) + custom_window.ExportBox:SetText(encoded) custom_window.ExportBox:HighlightText() custom_window.ExportBox:SetFocus() custom_window.ExportBox.FlashAnimation:Play() end - 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 + 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 + --import buttonRaceChange local import_display = function(_, _, custom_object, index) GameCooltip:Hide() if (not custom_window.ImportBox) then - local export_string = gump:NewLabel (custom_window, custom_window, "$parenImportLabel", "exportLabel", "Import String:", "GameFontNormal") --Loc ["STRING_CUSTOM_PASTE"] - export_string:SetPoint ("bottomleft", DetailsCustomPanel, "bottomleft", 10, 8) + local export_string = gump:NewLabel(custom_window, custom_window, "$parenImportLabel", "exportLabel", "Import String:", "GameFontNormal") --Loc ["STRING_CUSTOM_PASTE"] + export_string:SetPoint("bottomleft", DetailsCustomPanel, "bottomleft", 10, 8) local editbox = _detalhes.gump:NewTextEntry (custom_window, nil, "$parentImportBox", "ImportBox", CONST_EDITBOX_WIDTH - export_string.width - CONST_EDITBOX_BUTTON_WIDTH - 4, 20) - editbox:SetPoint ("left", export_string, "right", 2, 0) + editbox:SetPoint("left", export_string, "right", 2, 0) editbox:SetAutoFocus (false) editbox:SetTemplate (CONST_TEXTENTRY_TEMPLATE) @@ -893,9 +893,9 @@ setmetatable (deserialized_object, _detalhes.atributo_custom) deserialized_object.__index = _detalhes.atributo_custom - _detalhes.MicroButtonAlert.Text:SetText (Loc ["STRING_CUSTOM_IMPORT_ALERT"]) - _detalhes.MicroButtonAlert:SetPoint ("bottom", custom_window.box0.acceptbutton.widget, "top", 0, 20) - _detalhes.MicroButtonAlert:SetHeight (200) + _detalhes.MicroButtonAlert.Text:SetText(Loc ["STRING_CUSTOM_IMPORT_ALERT"]) + _detalhes.MicroButtonAlert:SetPoint("bottom", custom_window.box0.acceptbutton.widget, "top", 0, 20) + _detalhes.MicroButtonAlert:SetHeight(200) _detalhes.MicroButtonAlert:Show() DetailsCustomPanel:StartEdit (deserialized_object, true) @@ -908,21 +908,21 @@ local okey_button = gump:NewButton (custom_window, nil, "$parentImportConfirm", "ImportConfirm", CONST_EDITBOX_BUTTON_WIDTH, CONST_EDITBOX_BUTTON_HEIGHT, import, nil, nil, nil, Loc ["STRING_CUSTOM_IMPORT_BUTTON"]) okey_button:SetTemplate (CONST_BUTTON_TEMPLATE) - okey_button:SetPoint ("left", editbox, "right", 2, 0) + okey_button:SetPoint("left", editbox, "right", 2, 0) end if (custom_window.ExportBox) then custom_window.ExportBox:Hide() end - custom_window.ImportBox:SetText ("") + custom_window.ImportBox:SetText("") custom_window.ImportBox:Show() custom_window.exportLabel:Show() custom_window.ImportConfirm:Show() custom_window.ImportBox:SetFocus() end - custom_window:CreateMenuButton (Loc ["STRING_CUSTOM_IMPORT"], "Interface\\ICONS\\INV_MISC_NOTE_02", import_display, nil, nil, nil, "Import", {0.00, 0.9, 0.07, 0.93}) --> localize + custom_window:CreateMenuButton (Loc ["STRING_CUSTOM_IMPORT"], "Interface\\ICONS\\INV_MISC_NOTE_02", import_display, nil, nil, nil, "Import", {0.00, 0.9, 0.07, 0.93}) --localize local box_types = { {}, --normal @@ -945,60 +945,60 @@ --{icon = [[Interface\ICONS\INV_Inscription_Scroll]], label = "Custom Script", box = 2, attribute = false, boxtype = 2}, } - --> create box + --create box local attribute_box = _CreateFrame ("frame", nil, custom_window) - attribute_box:SetPoint ("topleft", custom_window, "topleft", 200, -60) - attribute_box:SetSize (180, 260) + attribute_box:SetPoint("topleft", custom_window, "topleft", 200, -60) + attribute_box:SetSize(180, 260) attribute_box:Hide() local button_onenter = function(self) - self:SetBackdropColor (.3, .3, .3, .3) - self.icon:SetBlendMode ("ADD") + self:SetBackdropColor(.3, .3, .3, .3) + self.icon:SetBlendMode("ADD") end local button_onleave = function(self) - self:SetBackdropColor (0, 0, 0, .2) - self.icon:SetBlendMode ("BLEND") + self:SetBackdropColor(0, 0, 0, .2) + self.icon:SetBlendMode("BLEND") end - local selected_left = attribute_box:CreateTexture (nil, "overlay") - selected_left:SetTexture ([[Interface\Store\Store-Main]]) - selected_left:SetSize (50, 20) + local selected_left = attribute_box:CreateTexture(nil, "overlay") + selected_left:SetTexture([[Interface\Store\Store-Main]]) + selected_left:SetSize(50, 20) selected_left:SetVertexColor (1, .8, 0, 1) selected_left:SetTexCoord (960/1024, 1020/1024, 68/1024, 101/1024) custom_window.selected_left = selected_left - local selected_right = attribute_box:CreateTexture (nil, "overlay") - selected_right:SetTexture ([[Interface\Store\Store-Main]]) - selected_right:SetSize (31, 20) + local selected_right = attribute_box:CreateTexture(nil, "overlay") + selected_right:SetTexture([[Interface\Store\Store-Main]]) + selected_right:SetSize(31, 20) selected_right:SetVertexColor (1, .8, 0, 1) selected_right:SetTexCoord (270/1024, 311/1024, 873/1024, 906/1024) custom_window.selected_right = selected_right - local selected_center = attribute_box:CreateTexture (nil, "overlay") - selected_center:SetTexture ([[Interface\Store\Store-Main]]) - selected_center:SetSize (49, 20) + local selected_center = attribute_box:CreateTexture(nil, "overlay") + selected_center:SetTexture([[Interface\Store\Store-Main]]) + selected_center:SetSize(49, 20) selected_center:SetVertexColor (1, .8, 0, 1) selected_center:SetTexCoord (956/1024, 1004/1024, 164/1024, 197/1024) - selected_center:SetPoint ("left", selected_left, "right") - selected_center:SetPoint ("right", selected_right, "left") + selected_center:SetPoint("left", selected_left, "right") + selected_center:SetPoint("right", selected_right, "left") - local p = 0.0625 --> 32/512 + local p = 0.0625 --32/512 for i = 1, 10 do if (attributes [i]) then local button = _CreateFrame ("button", "DetailsCustomPanelAttributeMenu" .. i, attribute_box, "BackdropTemplate") - button:SetPoint ("topleft", attribute_box, "topleft", 2, ((i-1)*23*-1) + (-26)) - button:SetPoint ("topright", attribute_box, "topright", 2, ((i-1)*23*-1) + (-26)) - button:SetHeight (20) + button:SetPoint("topleft", attribute_box, "topleft", 2, ((i-1)*23*-1) + (-26)) + button:SetPoint("topright", attribute_box, "topright", 2, ((i-1)*23*-1) + (-26)) + button:SetHeight(20) - button:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16}) - button:SetBackdropColor (0, 0, 0, .2) + button:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16}) + button:SetBackdropColor(0, 0, 0, .2) - button:SetScript ("OnEnter", button_onenter) - button:SetScript ("OnLeave", button_onleave) + button:SetScript("OnEnter", button_onenter) + button:SetScript("OnLeave", button_onleave) button.attribute_table = attributes [i] @@ -1006,66 +1006,66 @@ custom_window.script_button_attribute = button end - button:SetScript ("OnClick", select_attribute) + button:SetScript("OnClick", select_attribute) - button.icon = button:CreateTexture (nil, "overlay") - button.icon:SetPoint ("left", button, "left", 6, 0) - button.icon:SetSize (22, 22) - button.icon:SetTexture ([[Interface\AddOns\Details\images\custom_icones]]) + button.icon = button:CreateTexture(nil, "overlay") + button.icon:SetPoint("left", button, "left", 6, 0) + button.icon:SetSize(22, 22) + button.icon:SetTexture([[Interface\AddOns\Details\images\custom_icones]]) button.icon:SetTexCoord (p*(i-1), p*(i), 0, 1) button.text = button:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - button.text:SetPoint ("left", button.icon, "right", 4, 0) - button.text:SetText (attributes [i] and attributes [i].label or "") + button.text:SetPoint("left", button.icon, "right", 4, 0) + button.text:SetText(attributes [i] and attributes [i].label or "") button.text:SetTextColor (.9, .9, .9, 1) end end - --> create box 0, holds the name, author, desc and icon + --create box 0, holds the name, author, desc and icon local box0 = _CreateFrame ("frame", "DetailsCustomPanelBox0", custom_window) custom_window.box0 = box0 - box0:SetSize (450, 360) + box0:SetSize(450, 360) - box0:SetPoint ("topleft", custom_window, "topleft", CONST_INFOBOX_X_POSITION, CONST_MENU_Y_POSITION-4) + box0:SetPoint("topleft", custom_window, "topleft", CONST_INFOBOX_X_POSITION, CONST_MENU_Y_POSITION-4) --name - local name_label = gump:NewLabel (box0, box0, "$parenNameLabel", "name", Loc ["STRING_CUSTOM_NAME"], "GameFontHighlightLeft") --> localize-me - name_label:SetPoint ("topleft", box0, "topleft", 10, 0) + local name_label = gump:NewLabel(box0, box0, "$parenNameLabel", "name", Loc ["STRING_CUSTOM_NAME"], "GameFontHighlightLeft") --localize-me + name_label:SetPoint("topleft", box0, "topleft", 10, 0) local name_field = gump:NewTextEntry (box0, nil, "$parentNameEntry", "nameentry", 200, 20) - name_field:SetPoint ("left", name_label, "left", 62, 0) + name_field:SetPoint("left", name_label, "left", 62, 0) name_field:SetTemplate (CONST_TEXTENTRY_TEMPLATE) name_field.tooltip = Loc ["STRING_CUSTOM_NAME_DESC"] custom_window.name_field = name_field --author - local author_label = gump:NewLabel (box0, box0, "$parenAuthorLabel", "author", Loc ["STRING_CUSTOM_AUTHOR"], "GameFontHighlightLeft") --> localize-me - author_label:SetPoint ("topleft", name_label, "bottomleft", 0, -12) + local author_label = gump:NewLabel(box0, box0, "$parenAuthorLabel", "author", Loc ["STRING_CUSTOM_AUTHOR"], "GameFontHighlightLeft") --localize-me + author_label:SetPoint("topleft", name_label, "bottomleft", 0, -12) local author_field = gump:NewTextEntry (box0, nil, "$parentAuthorEntry", "authorentry", 200, 20) - author_field:SetPoint ("left", author_label, "left", 62, 0) + author_field:SetPoint("left", author_label, "left", 62, 0) author_field:SetTemplate (CONST_TEXTENTRY_TEMPLATE) author_field.tooltip = Loc ["STRING_CUSTOM_AUTHOR_DESC"] - author_field:SetText (UnitName ("player") .. "-" .. GetRealmName()) + author_field:SetText(UnitName ("player") .. "-" .. GetRealmName()) custom_window.author_field = author_field --description - local desc_label = gump:NewLabel (box0, box0, "$parenDescLabel", "desc", Loc ["STRING_CUSTOM_DESCRIPTION"], "GameFontHighlightLeft") --> localize-me - desc_label:SetPoint ("topleft", author_label, "bottomleft", 0, -12) + local desc_label = gump:NewLabel(box0, box0, "$parenDescLabel", "desc", Loc ["STRING_CUSTOM_DESCRIPTION"], "GameFontHighlightLeft") --localize-me + desc_label:SetPoint("topleft", author_label, "bottomleft", 0, -12) local desc_field = gump:NewTextEntry (box0, nil, "$parentDescEntry", "descentry", 200, 20) - desc_field:SetPoint ("left", desc_label, "left", 62, 0) + desc_field:SetPoint("left", desc_label, "left", 62, 0) desc_field:SetTemplate (CONST_TEXTENTRY_TEMPLATE) desc_field.tooltip = Loc ["STRING_CUSTOM_DESCRIPTION_DESC"] custom_window.desc_field = desc_field --icon - 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 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) - box0.icontexture:SetTexture (texture) + box0.icontexture:SetTexture(texture) end local pickicon = function() @@ -1074,34 +1074,34 @@ local icon_image = gump:NewImage (box0, [[Interface\ICONS\TEMP]], 20, 20, nil, nil, "icontexture", "$parentIconTexture") local icon_button = gump:NewButton (box0, nil, "$parentIconButton", "IconButton", 20, 20, pickicon) icon_button:InstallCustomTexture() - icon_button:SetPoint ("left", icon_label, "left", 64, 0) - icon_image:SetPoint ("left", icon_label, "left", 64, 0) + icon_button:SetPoint("left", icon_label, "left", 64, 0) + icon_image:SetPoint("left", icon_label, "left", 64, 0) custom_window.icon_image = icon_image --cancel local cancel_button = gump:NewButton (box0, nil, "$parentCancelButton", "cancelbutton", 130, 20, DetailsCustomPanel.CancelFunc, nil, nil, nil, Loc ["STRING_CUSTOM_CANCEL"]) - --cancel_button:SetPoint ("bottomleft", attribute_box, "bottomleft", 2, 0) - cancel_button:SetPoint ("topleft", icon_label, "bottomleft", 0, -10) + --cancel_button:SetPoint("bottomleft", attribute_box, "bottomleft", 2, 0) + cancel_button:SetPoint("topleft", icon_label, "bottomleft", 0, -10) cancel_button:SetTemplate (CONST_REGULAR_BUTTON_TEMPLATE) --accept local accept_button = gump:NewButton (box0, nil, "$parentAcceptButton", "acceptbutton", 130, 20, DetailsCustomPanel.AcceptFunc, nil, nil, nil, Loc ["STRING_CUSTOM_CREATE"]) - accept_button:SetPoint ("left", cancel_button, "right", 2, 0) + accept_button:SetPoint("left", cancel_button, "right", 2, 0) accept_button:SetTemplate (CONST_REGULAR_BUTTON_TEMPLATE) cancel_button:SetFrameLevel (500) accept_button:SetFrameLevel (500) - --> create box type 1 + --create box type 1 local box1 = _CreateFrame ("frame", "DetailsCustomPanelBox1", custom_window) custom_window.box1 = box1 - box1:SetSize (450, 180) - box1:SetPoint ("topleft", icon_label.widget, "bottomleft", -10, -20) + box1:SetSize(450, 180) + box1:SetPoint("topleft", icon_label.widget, "bottomleft", -10, -20) box1:SetFrameLevel (box0:GetFrameLevel()+1) --source - local source_label = gump:NewLabel (box1, box1, "$parenSourceLabel", "source", Loc ["STRING_CUSTOM_SOURCE"], "GameFontHighlightLeft") --> localize-me - source_label:SetPoint ("topleft", box1, "topleft", 10, 0) + local source_label = gump:NewLabel(box1, box1, "$parenSourceLabel", "source", Loc ["STRING_CUSTOM_SOURCE"], "GameFontHighlightLeft") --localize-me + source_label:SetPoint("topleft", box1, "topleft", 10, 0) local disable_source_field = function() box1.sourceentry:Disable() @@ -1121,53 +1121,53 @@ } local build_source_list = function() return targeting_options end local source_dropdown = gump:NewDropDown (box1, nil, "$parentSourceDropdown", "sourcedropdown", 178, 20, build_source_list, 1) - source_dropdown:SetPoint ("left", source_label, "left", 62, 0) + source_dropdown:SetPoint("left", source_label, "left", 62, 0) source_dropdown.tooltip = Loc ["STRING_CUSTOM_SOURCE_DESC"] custom_window.source_dropdown = source_dropdown local source_field = gump:NewTextEntry (box1, nil, "$parentSourceEntry", "sourceentry", 201, 20) - source_field:SetPoint ("topleft", source_dropdown, "bottomleft", 0, -2) + source_field:SetPoint("topleft", source_dropdown, "bottomleft", 0, -2) source_field:Disable() custom_window.source_field = source_field - local adds_boss = CreateFrame ("frame", nil, box1) - adds_boss:SetPoint ("left", source_dropdown.widget, "right", 2, 0) - adds_boss:SetSize (20, 20) + local adds_boss = CreateFrame("frame", nil, box1) + adds_boss:SetPoint("left", source_dropdown.widget, "right", 2, 0) + adds_boss:SetSize(20, 20) - local adds_boss_image = adds_boss:CreateTexture (nil, "overlay") - adds_boss_image:SetPoint ("center", adds_boss) - adds_boss_image:SetTexture ("Interface\\Buttons\\UI-MicroButton-Raid-Up") + local adds_boss_image = adds_boss:CreateTexture(nil, "overlay") + adds_boss_image:SetPoint("center", adds_boss) + adds_boss_image:SetTexture("Interface\\Buttons\\UI-MicroButton-Raid-Up") adds_boss_image:SetTexCoord (0.046875, 0.90625, 0.40625, 0.953125) - adds_boss_image:SetWidth (20) - adds_boss_image:SetHeight (16) + adds_boss_image:SetWidth(20) + adds_boss_image:SetHeight(16) local actorsFrame = gump:NewPanel (custom_window, _, "DetailsCustomActorsFrame2", "actorsFrame", 1, 1) - actorsFrame:SetPoint ("topleft", custom_window, "topright", 5, -60) + actorsFrame:SetPoint("topleft", custom_window, "topright", 5, -60) actorsFrame:Hide() local modelFrame = _CreateFrame ("playermodel", "DetailsCustomActorsFrame2Model", custom_window) - modelFrame:SetSize (138, 261) - modelFrame:SetPoint ("topright", actorsFrame.widget, "topleft", -15, -8) + modelFrame:SetSize(138, 261) + modelFrame:SetPoint("topright", actorsFrame.widget, "topleft", -15, -8) modelFrame:Hide() - local modelFrameTexture = modelFrame:CreateTexture (nil, "background") + local modelFrameTexture = modelFrame:CreateTexture(nil, "background") modelFrameTexture:SetAllPoints() - local modelFrameBackground = custom_window:CreateTexture (nil, "artwork") - modelFrameBackground:SetSize (138, 261) - modelFrameBackground:SetPoint ("topright", actorsFrame.widget, "topleft", -15, -8) - modelFrameBackground:SetTexture ([[Interface\ACHIEVEMENTFRAME\UI-GuildAchievement-Parchment-Horizontal-Desaturated]]) + local modelFrameBackground = custom_window:CreateTexture(nil, "artwork") + modelFrameBackground:SetSize(138, 261) + modelFrameBackground:SetPoint("topright", actorsFrame.widget, "topleft", -15, -8) + modelFrameBackground:SetTexture([[Interface\ACHIEVEMENTFRAME\UI-GuildAchievement-Parchment-Horizontal-Desaturated]]) modelFrameBackground:SetRotation (90) modelFrameBackground:SetVertexColor (.5, .5, .5, 0.5) - local modelFrameBackgroundIcon = custom_window:CreateTexture (nil, "overlay") - modelFrameBackgroundIcon:SetPoint ("center", modelFrameBackground, "center") - modelFrameBackgroundIcon:SetTexture ([[Interface\CHARACTERFRAME\Disconnect-Icon]]) + local modelFrameBackgroundIcon = custom_window:CreateTexture(nil, "overlay") + modelFrameBackgroundIcon:SetPoint("center", modelFrameBackground, "center") + modelFrameBackgroundIcon:SetTexture([[Interface\CHARACTERFRAME\Disconnect-Icon]]) modelFrameBackgroundIcon:SetVertexColor (.5, .5, .5, 0.7) modelFrameBackground:Hide() modelFrameBackgroundIcon:Hide() local selectedEncounterActor = function(actorName, model) - source_field:SetText (actorName) + source_field:SetText(actorName) source_dropdown:Select (4, true) box1.sourceentry:Enable() actorsFrame:Hide() @@ -1177,8 +1177,8 @@ local actorsFrameButtons = {} local buttonMouseOver = function(button) - button.MyObject.image:SetBlendMode ("ADD") - button.MyObject.line:SetBlendMode ("ADD") + button.MyObject.image:SetBlendMode("ADD") + button.MyObject.line:SetBlendMode("ADD") button.MyObject.label:SetTextColor (1, 1, 1, 1) GameTooltip:SetOwner (button, "ANCHOR_TOPLEFT") GameTooltip:AddLine (button.MyObject.actor) @@ -1186,15 +1186,15 @@ local name, description, bgImage, buttonImage, loreImage, dungeonAreaMapID, link = DetailsFramework.EncounterJournal.EJ_GetInstanceInfo (button.MyObject.ej_id) - modelFrameTexture:SetTexture (bgImage) + modelFrameTexture:SetTexture(bgImage) modelFrameTexture:SetTexCoord (3/512, 370/512, 5/512, 429/512) modelFrame:Show() modelFrame:SetDisplayInfo (button.MyObject.model) end local buttonMouseOut = function(button) - button.MyObject.image:SetBlendMode ("BLEND") - button.MyObject.line:SetBlendMode ("BLEND") + button.MyObject.image:SetBlendMode("BLEND") + button.MyObject.line:SetBlendMode("BLEND") button.MyObject.label:SetTextColor (.8, .8, .8, .8) GameTooltip:Hide() modelFrame:Hide() @@ -1222,31 +1222,31 @@ if (not thisButton) then thisButton = gump:NewButton (actorsFrame.frame, actorsFrame.frame, "DetailsCustomActorsFrame2Button"..i, "button"..i, 130, 20, selectedEncounterSpell) - thisButton:SetPoint ("topleft", "DetailsCustomActorsFrame2", "topleft", x, -y) - thisButton:SetHook ("OnEnter", buttonMouseOver) - thisButton:SetHook ("OnLeave", buttonMouseOut) + thisButton:SetPoint("topleft", "DetailsCustomActorsFrame2", "topleft", x, -y) + thisButton:SetHook("OnEnter", buttonMouseOver) + thisButton:SetHook("OnLeave", buttonMouseOut) local t = gump:NewImage (thisButton, nil, 20, 20, nil, nil, "image", "DetailsCustomActors2EncounterImageButton"..i) - t:SetPoint ("left", thisButton) - t:SetTexture ([[Interface\MINIMAP\TRACKING\Target]]) + t:SetPoint("left", thisButton) + t:SetTexture([[Interface\MINIMAP\TRACKING\Target]]) t:SetDesaturated (true) - t:SetSize (20, 20) + t:SetSize(20, 20) t:SetAlpha (0.7) - local text = gump:NewLabel (thisButton, nil, "DetailsCustomActorsFrame2Button"..i.."Label", "label", "Spell", nil, 9.5, {.8, .8, .8, .8}) - text:SetPoint ("left", t.image, "right", 2, 0) - text:SetWidth (123) - text:SetHeight (10) + local text = gump:NewLabel(thisButton, nil, "DetailsCustomActorsFrame2Button"..i.."Label", "label", "Spell", nil, 9.5, {.8, .8, .8, .8}) + text:SetPoint("left", t.image, "right", 2, 0) + text:SetWidth(123) + text:SetHeight(10) local border = gump:NewImage (thisButton, "Interface\\SPELLBOOK\\Spellbook-Parts", 40, 38, nil, nil, "border", "DetailsCustomActors2EncounterBorderButton"..i) border:SetTexCoord (0.00390625, 0.27734375, 0.44140625,0.69531250) border:SetDrawLayer ("background") - border:SetPoint ("topleft", thisButton.button, "topleft", -9, 9) + border:SetPoint("topleft", thisButton.button, "topleft", -9, 9) local line = gump:NewImage (thisButton, "Interface\\SPELLBOOK\\Spellbook-Parts", 134, 25, nil, nil, "line", "DetailsCustomActors2EncounterLineButton"..i) line:SetTexCoord (0.31250000, 0.96484375, 0.37109375, 0.52343750) line:SetDrawLayer ("background") - line:SetPoint ("left", thisButton.button, "right", -110, -3) + line:SetPoint("left", thisButton.button, "right", -110, -3) table.insert (actorsFrameButtons, #actorsFrameButtons+1, thisButton) end @@ -1257,7 +1257,7 @@ x = x + 150 end - thisButton.label:SetText (actor) + thisButton.label:SetText(actor) thisButton:SetClickFunction (selectedEncounterActor, actor, actorTable.model) thisButton.actor = actor thisButton.ej_id = ej_id @@ -1271,7 +1271,7 @@ end i = i-1 - actorsFrame:SetSize (math.ceil (i/13)*160, math.min (i*20 + 20, 280)) + actorsFrame:SetSize(math.ceil (i/13)*160, math.min (i*20 + 20, 280)) end end @@ -1289,7 +1289,7 @@ GameCooltip:AddLine (instanceTable.name, _, 1, "white") GameCooltip:AddIcon (instanceTable.icon, 1, 1, 64, 32) - for index, encounterName in ipairs (instanceTable.boss_names) do + for index, encounterName in ipairs(instanceTable.boss_names) do GameCooltip:AddMenu (2, EncounterSelect, instanceId, index, instanceTable.ej_id, encounterName, nil, true) local L, R, T, B, Texture = _detalhes:GetBossIcon (instanceId, index) GameCooltip:AddIcon (Texture, 2, 1, 20, 20, L, R, T, B) @@ -1300,28 +1300,28 @@ end end - GameCooltip:SetOption ("HeightAnchorMod", -10) - GameCooltip:SetOption ("ButtonsYMod", -2) - GameCooltip:SetOption ("YSpacingMod", 0) - GameCooltip:SetOption ("TextHeightMod", 0) - GameCooltip:SetOption ("IgnoreButtonAutoHeight", false) + GameCooltip:SetOption("HeightAnchorMod", -10) + GameCooltip:SetOption("ButtonsYMod", -2) + GameCooltip:SetOption("YSpacingMod", 0) + GameCooltip:SetOption("TextHeightMod", 0) + GameCooltip:SetOption("IgnoreButtonAutoHeight", false) GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], {.6, 0.1, 0, 0.64453125}, {1, 1, 1, 0.1}, true) GameCooltip:ShowCooltip() end - adds_boss:SetScript ("OnEnter", function() - adds_boss_image:SetBlendMode ("ADD") + adds_boss:SetScript("OnEnter", function() + adds_boss_image:SetBlendMode("ADD") BuildEncounterMenu() end) - adds_boss:SetScript ("OnLeave", function() - adds_boss_image:SetBlendMode ("BLEND") + adds_boss:SetScript("OnLeave", function() + adds_boss_image:SetBlendMode("BLEND") end) --target - local target_label = gump:NewLabel (box1, box1, "$parenTargetLabel", "target", Loc ["STRING_CUSTOM_TARGET"], "GameFontHighlightLeft") - target_label:SetPoint ("topleft", source_label, "bottomleft", 0, -40) + local target_label = gump:NewLabel(box1, box1, "$parenTargetLabel", "target", Loc ["STRING_CUSTOM_TARGET"], "GameFontHighlightLeft") + target_label:SetPoint("topleft", source_label, "bottomleft", 0, -40) local disable_target_field = function() box1.targetentry:Disable() @@ -1343,39 +1343,39 @@ } local build_target_list = function() return targeting_options end local target_dropdown = gump:NewDropDown (box1, nil, "$parentTargetDropdown", "targetdropdown", 178, 20, build_target_list, 1) - target_dropdown:SetPoint ("left", target_label, "left", 62, 0) + target_dropdown:SetPoint("left", target_label, "left", 62, 0) target_dropdown.tooltip = Loc ["STRING_CUSTOM_TARGET_DESC"] custom_window.target_dropdown = target_dropdown local target_field = gump:NewTextEntry (box1, nil, "$parentTargetEntry", "targetentry", 201, 20) - target_field:SetPoint ("topleft", target_dropdown, "bottomleft", 0, -2) + target_field:SetPoint("topleft", target_dropdown, "bottomleft", 0, -2) target_field:Disable() custom_window.target_field = target_field -- - local adds_boss = CreateFrame ("frame", nil, box1) - adds_boss:SetPoint ("left", target_dropdown.widget, "right", 2, 0) - adds_boss:SetSize (20, 20) - local adds_boss_image = adds_boss:CreateTexture (nil, "overlay") - adds_boss_image:SetPoint ("center", adds_boss) - adds_boss_image:SetTexture ("Interface\\Buttons\\UI-MicroButton-Raid-Up") + local adds_boss = CreateFrame("frame", nil, box1) + adds_boss:SetPoint("left", target_dropdown.widget, "right", 2, 0) + adds_boss:SetSize(20, 20) + local adds_boss_image = adds_boss:CreateTexture(nil, "overlay") + adds_boss_image:SetPoint("center", adds_boss) + adds_boss_image:SetTexture("Interface\\Buttons\\UI-MicroButton-Raid-Up") adds_boss_image:SetTexCoord (0.046875, 0.90625, 0.40625, 0.953125) - adds_boss_image:SetWidth (20) - adds_boss_image:SetHeight (16) + adds_boss_image:SetWidth(20) + adds_boss_image:SetHeight(16) local actorsFrame = gump:NewPanel (custom_window, _, "DetailsCustomActorsFrame", "actorsFrame", 1, 1) - actorsFrame:SetPoint ("topleft", custom_window, "topright", 5, -60) + actorsFrame:SetPoint("topleft", custom_window, "topright", 5, -60) actorsFrame:Hide() local modelFrame = _CreateFrame ("playermodel", "DetailsCustomActorsFrameModel", custom_window) - modelFrame:SetSize (138, 261) - modelFrame:SetPoint ("topright", actorsFrame.widget, "topleft", -15, -8) + modelFrame:SetSize(138, 261) + modelFrame:SetPoint("topright", actorsFrame.widget, "topleft", -15, -8) modelFrame:Hide() - local modelFrameTexture = modelFrame:CreateTexture (nil, "background") + local modelFrameTexture = modelFrame:CreateTexture(nil, "background") modelFrameTexture:SetAllPoints() local selectedEncounterActor = function(actorName) - target_field:SetText (actorName) + target_field:SetText(actorName) target_dropdown:Select (4, true) box1.targetentry:Enable() actorsFrame:Hide() @@ -1385,8 +1385,8 @@ local actorsFrameButtons = {} local buttonMouseOver = function(button) - button.MyObject.image:SetBlendMode ("ADD") - button.MyObject.line:SetBlendMode ("ADD") + button.MyObject.image:SetBlendMode("ADD") + button.MyObject.line:SetBlendMode("ADD") button.MyObject.label:SetTextColor (1, 1, 1, 1) GameTooltip:SetOwner (button, "ANCHOR_TOPLEFT") GameTooltip:AddLine (button.MyObject.actor) @@ -1394,15 +1394,15 @@ local name, description, bgImage, buttonImage, loreImage, dungeonAreaMapID, link = DetailsFramework.EncounterJournal.EJ_GetInstanceInfo (button.MyObject.ej_id) - modelFrameTexture:SetTexture (bgImage) + modelFrameTexture:SetTexture(bgImage) modelFrameTexture:SetTexCoord (3/512, 370/512, 5/512, 429/512) modelFrame:Show() modelFrame:SetDisplayInfo (button.MyObject.model) end local buttonMouseOut = function(button) - button.MyObject.image:SetBlendMode ("BLEND") - button.MyObject.line:SetBlendMode ("BLEND") + button.MyObject.image:SetBlendMode("BLEND") + button.MyObject.line:SetBlendMode("BLEND") button.MyObject.label:SetTextColor (.8, .8, .8, .8) GameTooltip:Hide() @@ -1430,31 +1430,31 @@ if (not thisButton) then thisButton = gump:NewButton (actorsFrame.frame, actorsFrame.frame, "DetailsCustomActorsFrameButton"..i, "button"..i, 130, 20, selectedEncounterSpell) - thisButton:SetPoint ("topleft", "DetailsCustomActorsFrame", "topleft", x, -y) - thisButton:SetHook ("OnEnter", buttonMouseOver) - thisButton:SetHook ("OnLeave", buttonMouseOut) + thisButton:SetPoint("topleft", "DetailsCustomActorsFrame", "topleft", x, -y) + thisButton:SetHook("OnEnter", buttonMouseOver) + thisButton:SetHook("OnLeave", buttonMouseOut) local t = gump:NewImage (thisButton, nil, 20, 20, nil, nil, "image", "DetailsCustomActorsEncounterImageButton"..i) - t:SetPoint ("left", thisButton) - t:SetTexture ([[Interface\MINIMAP\TRACKING\Target]]) + t:SetPoint("left", thisButton) + t:SetTexture([[Interface\MINIMAP\TRACKING\Target]]) t:SetDesaturated (true) - t:SetSize (20, 20) + t:SetSize(20, 20) t:SetAlpha (0.7) - local text = gump:NewLabel (thisButton, nil, "DetailsCustomActorsFrameButton"..i.."Label", "label", "Spell", nil, 9.5, {.8, .8, .8, .8}) - text:SetPoint ("left", t.image, "right", 2, 0) - text:SetWidth (123) - text:SetHeight (10) + local text = gump:NewLabel(thisButton, nil, "DetailsCustomActorsFrameButton"..i.."Label", "label", "Spell", nil, 9.5, {.8, .8, .8, .8}) + text:SetPoint("left", t.image, "right", 2, 0) + text:SetWidth(123) + text:SetHeight(10) local border = gump:NewImage (thisButton, "Interface\\SPELLBOOK\\Spellbook-Parts", 40, 38, nil, nil, "border", "DetailsCustomActorsEncounterBorderButton"..i) border:SetTexCoord (0.00390625, 0.27734375, 0.44140625,0.69531250) border:SetDrawLayer ("background") - border:SetPoint ("topleft", thisButton.button, "topleft", -9, 9) + border:SetPoint("topleft", thisButton.button, "topleft", -9, 9) local line = gump:NewImage (thisButton, "Interface\\SPELLBOOK\\Spellbook-Parts", 84, 25, nil, nil, "line", "DetailsCustomActorsEncounterLineButton"..i) line:SetTexCoord (0.31250000, 0.96484375, 0.37109375, 0.52343750) line:SetDrawLayer ("background") - line:SetPoint ("left", thisButton.button, "right", -110, -3) + line:SetPoint("left", thisButton.button, "right", -110, -3) table.insert (actorsFrameButtons, #actorsFrameButtons+1, thisButton) end @@ -1465,7 +1465,7 @@ x = x + 150 end - thisButton.label:SetText (actor) + thisButton.label:SetText(actor) thisButton:SetClickFunction (selectedEncounterActor, actor) thisButton.actor = actor thisButton.ej_id = ej_id @@ -1479,7 +1479,7 @@ end i = i-1 - actorsFrame:SetSize (math.ceil (i/13)*160, math.min (i*20 + 20, 280)) + actorsFrame:SetSize(math.ceil (i/13)*160, math.min (i*20 + 20, 280)) end end @@ -1497,7 +1497,7 @@ GameCooltip:AddLine (instanceTable.name, _, 1, "white") GameCooltip:AddIcon (instanceTable.icon, 1, 1, 64, 32) - for index, encounterName in ipairs (instanceTable.boss_names) do + for index, encounterName in ipairs(instanceTable.boss_names) do GameCooltip:AddMenu (2, EncounterSelect, instanceId, index, instanceTable.ej_id, encounterName, nil, true) local L, R, T, B, Texture = _detalhes:GetBossIcon (instanceId, index) GameCooltip:AddIcon (Texture, 2, 1, 20, 20, L, R, T, B) @@ -1508,51 +1508,51 @@ end end - GameCooltip:SetOption ("HeightAnchorMod", -10) - GameCooltip:SetOption ("ButtonsYMod", -2) - GameCooltip:SetOption ("YSpacingMod", 0) - GameCooltip:SetOption ("TextHeightMod", 0) - GameCooltip:SetOption ("IgnoreButtonAutoHeight", false) + GameCooltip:SetOption("HeightAnchorMod", -10) + GameCooltip:SetOption("ButtonsYMod", -2) + GameCooltip:SetOption("YSpacingMod", 0) + GameCooltip:SetOption("TextHeightMod", 0) + GameCooltip:SetOption("IgnoreButtonAutoHeight", false) GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], {.6, 0.1, 0, 0.64453125}, {1, 1, 1, 0.1}, true) GameCooltip:ShowCooltip() end - adds_boss:SetScript ("OnEnter", function() - adds_boss_image:SetBlendMode ("ADD") + adds_boss:SetScript("OnEnter", function() + adds_boss_image:SetBlendMode("ADD") BuildEncounterMenu() end) - adds_boss:SetScript ("OnLeave", function() - adds_boss_image:SetBlendMode ("BLEND") + adds_boss:SetScript("OnLeave", function() + adds_boss_image:SetBlendMode("BLEND") end) --spellid - local spellid_label = gump:NewLabel (box1, box1, "$parenSpellidLabel", "spellid", Loc ["STRING_CUSTOM_SPELLID"], "GameFontHighlightLeft") --> localize-me - spellid_label:SetPoint ("topleft", target_label, "bottomleft", 0, -40) + local spellid_label = gump:NewLabel(box1, box1, "$parenSpellidLabel", "spellid", Loc ["STRING_CUSTOM_SPELLID"], "GameFontHighlightLeft") --localize-me + spellid_label:SetPoint("topleft", target_label, "bottomleft", 0, -40) local spellid_entry = gump:NewSpellEntry (box1, function()end, 178, 20, nil, nil, "spellidentry", "$parentSpellIdEntry") - spellid_entry:SetPoint ("left", spellid_label, "left", 62, 0) + spellid_entry:SetPoint("left", spellid_label, "left", 62, 0) spellid_entry.tooltip = Loc ["STRING_CUSTOM_SPELLID_DESC"] custom_window.spellid_entry = spellid_entry - local spell_id_boss = CreateFrame ("frame", nil, box1) - spell_id_boss:SetPoint ("left", spellid_entry.widget, "right", 2, 0) - spell_id_boss:SetSize (20, 20) - local spell_id_boss_image = spell_id_boss:CreateTexture (nil, "overlay") - spell_id_boss_image:SetPoint ("center", spell_id_boss) - spell_id_boss_image:SetTexture ("Interface\\Buttons\\UI-MicroButton-Raid-Up") + local spell_id_boss = CreateFrame("frame", nil, box1) + spell_id_boss:SetPoint("left", spellid_entry.widget, "right", 2, 0) + spell_id_boss:SetSize(20, 20) + local spell_id_boss_image = spell_id_boss:CreateTexture(nil, "overlay") + spell_id_boss_image:SetPoint("center", spell_id_boss) + spell_id_boss_image:SetTexture("Interface\\Buttons\\UI-MicroButton-Raid-Up") spell_id_boss_image:SetTexCoord (0.046875, 0.90625, 0.40625, 0.953125) - spell_id_boss_image:SetWidth (20) - spell_id_boss_image:SetHeight (16) + spell_id_boss_image:SetWidth(20) + spell_id_boss_image:SetHeight(16) local spellsFrame = gump:NewPanel (custom_window, _, "DetailsCustomSpellsFrame", "spellsFrame", 1, 1) - spellsFrame:SetPoint ("topleft", custom_window, "topright", 5, 0) + spellsFrame:SetPoint("topleft", custom_window, "topright", 5, 0) spellsFrame:Hide() local selectedEncounterSpell = function(spellId) local _, _, icon = _GetSpellInfo(spellId) - spellid_entry:SetText (spellId) - box0.icontexture:SetTexture (icon) + spellid_entry:SetText(spellId) + box0.icontexture:SetTexture(icon) spellsFrame:Hide() GameCooltip:Hide() end @@ -1560,8 +1560,8 @@ local spellsFrameButtons = {} local buttonMouseOver = function(button) - button.MyObject.image:SetBlendMode ("ADD") - button.MyObject.line:SetBlendMode ("ADD") + button.MyObject.image:SetBlendMode("ADD") + button.MyObject.line:SetBlendMode("ADD") button.MyObject.label:SetTextColor (1, 1, 1, 1) GameTooltip:SetOwner (button, "ANCHOR_TOPLEFT") @@ -1569,8 +1569,8 @@ GameTooltip:Show() end local buttonMouseOut = function(button) - button.MyObject.image:SetBlendMode ("BLEND") - button.MyObject.line:SetBlendMode ("BLEND") + button.MyObject.image:SetBlendMode("BLEND") + button.MyObject.line:SetBlendMode("BLEND") button.MyObject.label:SetTextColor (.8, .8, .8, .8) GameTooltip:Hide() end @@ -1595,27 +1595,27 @@ if (not thisButton) then thisButton = gump:NewButton (spellsFrame.frame, spellsFrame.frame, "DetailsCustomSpellsFrameButton"..i, "button"..i, 80, 20, selectedEncounterSpell) - thisButton:SetPoint ("topleft", "DetailsCustomSpellsFrame", "topleft", x, -y) - thisButton:SetHook ("OnEnter", buttonMouseOver) - thisButton:SetHook ("OnLeave", buttonMouseOut) + thisButton:SetPoint("topleft", "DetailsCustomSpellsFrame", "topleft", x, -y) + thisButton:SetHook("OnEnter", buttonMouseOver) + thisButton:SetHook("OnLeave", buttonMouseOut) local t = gump:NewImage (thisButton, nil, 20, 20, nil, nil, "image", "DetailsCustomEncounterImageButton"..i) - t:SetPoint ("left", thisButton) + t:SetPoint("left", thisButton) - local text = gump:NewLabel (thisButton, nil, "DetailsCustomSpellsFrameButton"..i.."Label", "label", "Spell", nil, 9.5, {.8, .8, .8, .8}) - text:SetPoint ("left", t.image, "right", 2, 0) - text:SetWidth (73) - text:SetHeight (10) + local text = gump:NewLabel(thisButton, nil, "DetailsCustomSpellsFrameButton"..i.."Label", "label", "Spell", nil, 9.5, {.8, .8, .8, .8}) + text:SetPoint("left", t.image, "right", 2, 0) + text:SetWidth(73) + text:SetHeight(10) local border = gump:NewImage (thisButton, "Interface\\SPELLBOOK\\Spellbook-Parts", 40, 38, nil, nil, "border", "DetailsCustomEncounterBorderButton"..i) border:SetTexCoord (0.00390625, 0.27734375, 0.44140625,0.69531250) border:SetDrawLayer ("background") - border:SetPoint ("topleft", thisButton.button, "topleft", -9, 9) + border:SetPoint("topleft", thisButton.button, "topleft", -9, 9) local line = gump:NewImage (thisButton, "Interface\\SPELLBOOK\\Spellbook-Parts", 84, 25, nil, nil, "line", "DetailsCustomEncounterLineButton"..i) line:SetTexCoord (0.31250000, 0.96484375, 0.37109375, 0.52343750) line:SetDrawLayer ("background") - line:SetPoint ("left", thisButton.button, "right", -60, -3) + line:SetPoint("left", thisButton.button, "right", -60, -3) table.insert (spellsFrameButtons, #spellsFrameButtons+1, thisButton) end @@ -1627,8 +1627,8 @@ end local nome_magia, _, icone_magia = _GetSpellInfo(spell) - thisButton.image:SetTexture (icone_magia) - thisButton.label:SetText (nome_magia) + thisButton.image:SetTexture(icone_magia) + thisButton.label:SetText(nome_magia) thisButton:SetClickFunction (selectedEncounterSpell, spell) thisButton.spellid = spell thisButton:Show() @@ -1640,7 +1640,7 @@ end i = i-1 - spellsFrame:SetSize (math.ceil (i/20)*110, math.min (i*20 + 20, 420)) + spellsFrame:SetSize(math.ceil (i/20)*110, math.min (i*20 + 20, 420)) end @@ -1657,7 +1657,7 @@ GameCooltip:AddLine (instanceTable.name, _, 1, "white") GameCooltip:AddIcon (instanceTable.icon, 1, 1, 64, 32) - for index, encounterName in ipairs (instanceTable.boss_names) do + for index, encounterName in ipairs(instanceTable.boss_names) do GameCooltip:AddMenu (2, EncounterSelect, instanceId, index, nil, encounterName, nil, true) local L, R, T, B, Texture = _detalhes:GetBossIcon (instanceId, index) GameCooltip:AddIcon (Texture, 2, 1, 20, 20, L, R, T, B) @@ -1668,67 +1668,67 @@ end end - GameCooltip:SetOption ("ButtonsYMod", -2) - GameCooltip:SetOption ("YSpacingMod", 0) - GameCooltip:SetOption ("TextHeightMod", 0) - GameCooltip:SetOption ("IgnoreButtonAutoHeight", false) + GameCooltip:SetOption("ButtonsYMod", -2) + GameCooltip:SetOption("YSpacingMod", 0) + GameCooltip:SetOption("TextHeightMod", 0) + GameCooltip:SetOption("IgnoreButtonAutoHeight", false) GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], {.6, 0.1, 0, 0.64453125}, {1, 1, 1, 0.1}, true) - GameCooltip:SetOption ("HeightAnchorMod", -10) + GameCooltip:SetOption("HeightAnchorMod", -10) GameCooltip:ShowCooltip() end - spell_id_boss:SetScript ("OnEnter", function() - spell_id_boss_image:SetBlendMode ("ADD") + spell_id_boss:SetScript("OnEnter", function() + spell_id_boss_image:SetBlendMode("ADD") BuildEncounterMenu() end) - spell_id_boss:SetScript ("OnLeave", function() - spell_id_boss_image:SetBlendMode ("BLEND") + spell_id_boss:SetScript("OnLeave", function() + spell_id_boss_image:SetBlendMode("BLEND") end) --select target --select spell - --> create box type 2 + --create box type 2 local box2 = _CreateFrame ("frame", "DetailsCustomPanelBox2", custom_window) custom_window.box2 = box2 - box2:SetSize (450, 180) - box2:SetPoint ("topleft", icon_label.widget, "bottomleft", -10, -20) + box2:SetSize(450, 180) + box2:SetPoint("topleft", icon_label.widget, "bottomleft", -10, -20) box2:SetFrameLevel (box0:GetFrameLevel()+1) --edit main code local maincode_button = gump:NewButton (box2, nil, "$parentMainCodeButton", "maiccodebutton", 160, 20, DetailsCustomPanel.StartEditCode, 1, nil, nil, Loc ["STRING_CUSTOM_EDIT_SEARCH_CODE"]) - maincode_button:SetPoint ("topleft", custom_window, "topleft", CONST_EDITBUTTONS_X_POSITION, CONST_MENU_Y_POSITION) + maincode_button:SetPoint("topleft", custom_window, "topleft", CONST_EDITBUTTONS_X_POSITION, CONST_MENU_Y_POSITION) maincode_button.tooltip = Loc ["STRING_CUSTOM_EDITCODE_DESC"] maincode_button:SetTemplate (CONST_CODETEXTENTRY_OPENCODEBUTTONS_TEMPLATE) --edit tooltip code local tooltipcode_button = gump:NewButton (box2, nil, "$parentTooltipCodeButton", "tooltipcodebutton", 160, 20, DetailsCustomPanel.StartEditCode, 2, nil, nil, Loc ["STRING_CUSTOM_EDIT_TOOLTIP_CODE"]) - tooltipcode_button:SetPoint ("topleft", maincode_button, "bottomleft", 0, -8) + tooltipcode_button:SetPoint("topleft", maincode_button, "bottomleft", 0, -8) tooltipcode_button.tooltip = Loc ["STRING_CUSTOM_EDITTOOLTIP_DESC"] tooltipcode_button:SetTemplate (CONST_CODETEXTENTRY_OPENCODEBUTTONS_TEMPLATE) --edit total code local totalcode_button = gump:NewButton (box2, nil, "$parentTotalCodeButton", "totalcodebutton", 160, 20, DetailsCustomPanel.StartEditCode, 3, nil, nil, "Edit Total Code") - totalcode_button:SetPoint ("topleft", tooltipcode_button, "bottomleft", 0, -8) + totalcode_button:SetPoint("topleft", tooltipcode_button, "bottomleft", 0, -8) totalcode_button.tooltip = "This code is responsible for edit the total number shown in the player bar.\n\nThis is not necessary if you want show exactly the value gotten in the search code." totalcode_button:SetTemplate (CONST_CODETEXTENTRY_OPENCODEBUTTONS_TEMPLATE) --edit percent code local percentcode_button = gump:NewButton (box2, nil, "$parentPercentCodeButton", "percentcodebutton", 160, 20, DetailsCustomPanel.StartEditCode, 4, nil, nil, "Edit Percent Code") - percentcode_button:SetPoint ("topleft", totalcode_button, "bottomleft", 0, -8) + percentcode_button:SetPoint("topleft", totalcode_button, "bottomleft", 0, -8) percentcode_button.tooltip = "Edit the code responsible for the percent number in the player bar.\n\nThis is not required if you want to use simple percentage (comparing with total)." percentcode_button:SetTemplate (CONST_CODETEXTENTRY_OPENCODEBUTTONS_TEMPLATE) box2:Hide() - --> create the code editbox + --create the code editbox local code_editor = gump:NewSpecialLuaEditorEntry (custom_window, CONST_EDITBOX_WIDTH, CONST_EDITBOX_HEIGHT, "codeeditor", "$parentCodeEditor") - code_editor:SetPoint ("topleft", custom_window, "topleft", CONST_MENU_X_POSITION, CONST_EDITBOX_Y_POSITION) + code_editor:SetPoint("topleft", custom_window, "topleft", CONST_MENU_X_POSITION, CONST_EDITBOX_Y_POSITION) code_editor:SetFrameLevel (custom_window:GetFrameLevel()+4) - code_editor:SetBackdrop (nil) + code_editor:SetBackdrop(nil) code_editor:HookScript ("OnUpdate", function() local script = code_editor:GetText() local func, errortext = loadstring (script) @@ -1745,9 +1745,9 @@ -- end) - --> create a background area where the code editor is + --create a background area where the code editor is local codeEditorBackground = gump:NewButton (custom_window, nil, nil, nil, 1, 1, function()end) - codeEditorBackground:SetAllPoints (code_editor) + codeEditorBackground:SetAllPoints(code_editor) codeEditorBackground:SetTemplate (CONST_CODETEXTENTRY_TEMPLATE) code_editor:Hide() @@ -1758,18 +1758,18 @@ local expand_func = function() if (code_editor.expanded) then - code_editor:SetSize (CONST_EDITBOX_WIDTH, CONST_EDITBOX_HEIGHT) + code_editor:SetSize(CONST_EDITBOX_WIDTH, CONST_EDITBOX_HEIGHT) code_editor.expanded = nil codeEditorBackground:SetTemplate (CONST_CODETEXTENTRY_TEMPLATE) - --custom_window.box0.cancelbutton:SetPoint ("bottomleft", attribute_box, "bottomright", 37, -10) - --custom_window.box0.acceptbutton:SetPoint ("left", cancel_button, "right", 2, 0) + --custom_window.box0.cancelbutton:SetPoint("bottomleft", attribute_box, "bottomright", 37, -10) + --custom_window.box0.acceptbutton:SetPoint("left", cancel_button, "right", 2, 0) else - code_editor:SetSize (CONST_EDITBOX_WIDTH, CONST_EDITBOX_HEIGHT*1.9) + code_editor:SetSize(CONST_EDITBOX_WIDTH, CONST_EDITBOX_HEIGHT*1.9) code_editor.expanded = true codeEditorBackground:SetTemplate (CONST_CODETEXTENTRYEXPANDED_TEMPLATE) - --custom_window.box0.cancelbutton:SetPoint ("bottomleft", attribute_box, "bottomright", -237, -10) + --custom_window.box0.cancelbutton:SetPoint("bottomleft", attribute_box, "bottomright", -237, -10) --custom_window.box0.acceptbutton:SetPoint end end @@ -1807,7 +1807,7 @@ local object = DetailsCustomPanel.IsEditing - if (type (object) ~= "table") then + if (type(object) ~= "table") then return _detalhes:Msg ("This object need to be saved before.") end @@ -1829,42 +1829,42 @@ return true end - local supportFrame = CreateFrame ("frame", "$parentSupportFrame", custom_window) + local supportFrame = CreateFrame("frame", "$parentSupportFrame", custom_window) supportFrame:SetFrameLevel (500) local expand = gump:NewButton (supportFrame, nil, "$parentExpand", "expandbutton", CONST_EDITBOX_BUTTON_WIDTH, CONST_EDITBOX_BUTTON_HEIGHT, expand_func, 4, nil, nil, "Expand") - expand:SetPoint ("bottomleft", code_editor, "topleft", 0, 1) + expand:SetPoint("bottomleft", code_editor, "topleft", 0, 1) expand:SetTemplate (CONST_CODETEXTENTRYBUTTON_TEMPLATE) local font_size1 = gump:NewButton (supportFrame, nil, "$parentFont1", "font1button", CONST_EDITBOX_BUTTON_WIDTH, CONST_EDITBOX_BUTTON_HEIGHT, font_change, nil, nil, nil, "Aa") - font_size1:SetPoint ("left", expand, "right", 2, 0) + font_size1:SetPoint("left", expand, "right", 2, 0) font_size1:SetTemplate (CONST_CODETEXTENTRYBUTTON_TEMPLATE) local font_size2 = gump:NewButton (supportFrame, nil, "$parentFont2", "font2button", CONST_EDITBOX_BUTTON_WIDTH, CONST_EDITBOX_BUTTON_HEIGHT, font_change, true, nil, nil, "aA") - font_size2:SetPoint ("left", font_size1, "right", 2, 0) + font_size2:SetPoint("left", font_size1, "right", 2, 0) font_size2:SetTemplate (CONST_CODETEXTENTRYBUTTON_TEMPLATE) local apply1 = gump:NewButton (supportFrame, nil, "$parentApply", "applybutton", CONST_EDITBOX_BUTTON_WIDTH, CONST_EDITBOX_BUTTON_HEIGHT, apply_code, nil, nil, nil, "Apply") - apply1:SetPoint ("left", font_size2, "right", 2, 0) + apply1:SetPoint("left", font_size2, "right", 2, 0) apply1:SetTemplate (CONST_CODETEXTENTRYBUTTON_TEMPLATE) local open_API = gump:NewButton (supportFrame, nil, "$parentOpenAPI", "openAPIbutton", CONST_EDITBOX_BUTTON_WIDTH, CONST_EDITBOX_BUTTON_HEIGHT, function()end, nil, nil, nil, "API") --_detalhes.OpenAPI - opening the api was cancelling the editing process - open_API:SetPoint ("left", apply1, "right", 2, 0) + open_API:SetPoint("left", apply1, "right", 2, 0) open_API:SetTemplate (CONST_CODETEXTENTRYBUTTON_TEMPLATE) - local errorString = gump:CreateLabel (supportFrame) - errorString:SetPoint ("left", open_API, "right", 10, 0) + local errorString = gump:CreateLabel(supportFrame) + errorString:SetPoint("left", open_API, "right", 10, 0) errorString.color = "red" DetailsCustomPanel.ErrorString = errorString - code_editor:SetScript ("OnShow", function() + code_editor:SetScript("OnShow", function() expand:Show() font_size1:Show() font_size2:Show() apply1:Show() open_API:Show() end) - code_editor:SetScript ("OnHide", function() + code_editor:SetScript("OnHide", function() expand:Hide() font_size1:Hide() font_size2:Hide() @@ -1878,7 +1878,7 @@ apply1:Hide() open_API:Hide() - --> select damage + --select damage DetailsCustomPanelAttributeMenu1:Click() else DetailsPluginContainerWindow.OpenPlugin (DetailsCustomPanel) diff --git a/frames/window_custom_scripts.lua b/frames/window_custom_scripts.lua index 1a6001b8..fe0394c6 100644 --- a/frames/window_custom_scripts.lua +++ b/frames/window_custom_scripts.lua @@ -57,7 +57,7 @@ DF:InstallTemplate ("button", "DETAILS_CUSTOMDISPLAY_CODE_BOX_BUTTON", { backdropbordercolor = {0, 0, 0, 1}, }) -DF:NewColor ("DETAILS_CUSTOMDISPLAY_ICON", .7, .6, .5, 1) +DF:NewColor("DETAILS_CUSTOMDISPLAY_ICON", .7, .6, .5, 1) local CONST_CODETEXTENTRY_TEMPLATE = DF:GetTemplate ("button", "DETAILS_CUSTOMDISPLAY_CODE_BOX") local CONST_CODETEXTENTRYEXPANDED_TEMPLATE = DF:GetTemplate ("button", "DETAILS_CUSTOMDISPLAY_CODE_BOX_EXPANDED") diff --git a/frames/window_dump.lua b/frames/window_dump.lua index c1e54743..cb6f95da 100644 --- a/frames/window_dump.lua +++ b/frames/window_dump.lua @@ -5,7 +5,7 @@ local DetailsFramework = _G.DetailsFramework local C_Timer = _G.C_Timer -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> dump table frame +--dump table frame function Details:DumpTable (t) return Details:Dump (t) @@ -20,24 +20,24 @@ end function Details:Dump (...) if (not DetailsDumpFrame) then DetailsDumpFrame = DetailsFramework:CreateSimplePanel (_G.UIParent) - DetailsDumpFrame:SetSize (700, 600) + DetailsDumpFrame:SetSize(700, 600) DetailsDumpFrame:SetTitle ("Details! Dump Table [|cFFFF3333Ready Only|r]") local text_editor = DetailsFramework:NewSpecialLuaEditorEntry (DetailsDumpFrame, 680, 560, "Editbox", "$parentEntry", true) - text_editor:SetPoint ("topleft", DetailsDumpFrame, "topleft", 10, -30) + text_editor:SetPoint("topleft", DetailsDumpFrame, "topleft", 10, -30) - text_editor.scroll:SetBackdrop (nil) - text_editor.editbox:SetBackdrop (nil) - text_editor:SetBackdrop (nil) + text_editor.scroll:SetBackdrop(nil) + text_editor.editbox:SetBackdrop(nil) + text_editor:SetBackdrop(nil) DetailsFramework:ReskinSlider(text_editor.scroll) if (not text_editor.__background) then - text_editor.__background = text_editor:CreateTexture (nil, "background") + text_editor.__background = text_editor:CreateTexture(nil, "background") end - text_editor:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1}) - text_editor:SetBackdropBorderColor (0, 0, 0, 1) + text_editor:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1}) + text_editor:SetBackdropBorderColor(0, 0, 0, 1) text_editor.__background:SetColorTexture (0.2317647, 0.2317647, 0.2317647) text_editor.__background:SetVertexColor (0.27, 0.27, 0.27) @@ -69,7 +69,7 @@ end --------------------------------------------------------------------------------------------------------------------------------------- ---> import export window +--import export window --show a window with a big text editor and 2 buttons: okay and cancel. --cancel button always closes the window and okay calls the comfirm function passed in the argument --default text is the text shown show the window is show() @@ -82,27 +82,27 @@ function _detalhes:ShowImportWindow (defaultText, confirmFunc, titleText) if (not _G.DetailsExportWindow) then local importWindow = DetailsFramework:CreateSimplePanel (_G.UIParent, 800, 610, "Details! Dump String", "DetailsExportWindow") importWindow:SetFrameStrata ("FULLSCREEN") - importWindow:SetPoint ("center") + importWindow:SetPoint("center") DetailsFramework:ApplyStandardBackdrop (importWindow, false, 1.2) local importTextEditor = DetailsFramework:NewSpecialLuaEditorEntry (importWindow, 780, 540, "ImportEditor", "$parentEditor", true) - importTextEditor:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - importTextEditor:SetBackdropColor (.2, .2, .2, .5) - importTextEditor:SetBackdropBorderColor (0, 0, 0, 1) - importTextEditor:SetPoint ("topleft", importWindow, "topleft", 10, -30) + importTextEditor:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + importTextEditor:SetBackdropColor(.2, .2, .2, .5) + importTextEditor:SetBackdropBorderColor(0, 0, 0, 1) + importTextEditor:SetPoint("topleft", importWindow, "topleft", 10, -30) - importTextEditor.scroll:SetBackdrop (nil) - importTextEditor.editbox:SetBackdrop (nil) - importTextEditor:SetBackdrop (nil) + importTextEditor.scroll:SetBackdrop(nil) + importTextEditor.editbox:SetBackdrop(nil) + importTextEditor:SetBackdrop(nil) DetailsFramework:ReskinSlider(importTextEditor.scroll) if (not importTextEditor.__background) then - importTextEditor.__background = importTextEditor:CreateTexture (nil, "background") + importTextEditor.__background = importTextEditor:CreateTexture(nil, "background") end - importTextEditor:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1}) - importTextEditor:SetBackdropBorderColor (0, 0, 0, 1) + importTextEditor:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1}) + importTextEditor:SetBackdropBorderColor(0, 0, 0, 1) importTextEditor.__background:SetColorTexture (0.2317647, 0.2317647, 0.2317647) importTextEditor.__background:SetVertexColor (0.27, 0.27, 0.27) @@ -118,25 +118,25 @@ function _detalhes:ShowImportWindow (defaultText, confirmFunc, titleText) end importWindow:Hide() end - local okayButton = DetailsFramework:CreateButton (importTextEditor, onClickImportButton, 120, 20, "Okay", -1, nil, nil, nil, nil, nil, _detalhes.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE"), _detalhes.gump:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")) --> localize-me + local okayButton = DetailsFramework:CreateButton (importTextEditor, onClickImportButton, 120, 20, "Okay", -1, nil, nil, nil, nil, nil, _detalhes.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE"), _detalhes.gump:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")) --localize-me okayButton:SetIcon ([[Interface\BUTTONS\UI-Panel-BiggerButton-Up]], 20, 20, "overlay", {0.1, .9, 0.1, .9}) importTextEditor.OkayButton = okayButton --cancel button - local cancelButton = DetailsFramework:CreateButton (importTextEditor, function() importWindow:Hide() end, 120, 20, "Cancel", -1, nil, nil, nil, nil, nil, _detalhes.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE"), _detalhes.gump:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")) --> localize-me + local cancelButton = DetailsFramework:CreateButton (importTextEditor, function() importWindow:Hide() end, 120, 20, "Cancel", -1, nil, nil, nil, nil, nil, _detalhes.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE"), _detalhes.gump:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")) --localize-me cancelButton:SetIcon ([[Interface\BUTTONS\UI-Panel-MinimizeButton-Up]], 20, 20, "overlay", {0.1, .9, 0.1, .9}) - okayButton:SetPoint ("topright", importTextEditor, "bottomright", 0, -10) - cancelButton:SetPoint ("right", okayButton, "left", -20, 0) + okayButton:SetPoint("topright", importTextEditor, "bottomright", 0, -10) + cancelButton:SetPoint("right", okayButton, "left", -20, 0) end _G.DetailsExportWindow.ConfirmFunction = confirmFunc - _G.DetailsExportWindow.ImportEditor:SetText (defaultText or "") + _G.DetailsExportWindow.ImportEditor:SetText(defaultText or "") _G.DetailsExportWindow:Show() titleText = titleText or "Details! Dump String" - _G.DetailsExportWindow.Title:SetText (titleText) + _G.DetailsExportWindow.Title:SetText(titleText) C_Timer.After (.2, function() _G.DetailsExportWindow.ImportEditor:SetFocus (true) diff --git a/frames/window_eventtracker.lua b/frames/window_eventtracker.lua index 97f23341..6c453e0a 100644 --- a/frames/window_eventtracker.lua +++ b/frames/window_eventtracker.lua @@ -11,9 +11,9 @@ function Details:OpenEventTrackerOptions (from_options_panel) local DF = _detalhes.gump local f = DF:CreateSimplePanel (_G.UIParent, 700, 400, "Details! Event Tracker Options", "DetailsEventTrackerOptions") - f:SetPoint ("center", _G.UIParent, "center") - f:SetScript ("OnMouseDown", nil) - f:SetScript ("OnMouseUp", nil) + f:SetPoint("center", _G.UIParent, "center") + f:SetScript("OnMouseDown", nil) + f:SetScript("OnMouseUp", nil) local LibWindow = _G.LibStub("LibWindow-1.1") LibWindow.RegisterConfig (f, _detalhes.event_tracker.options_frame) LibWindow.MakeDraggable (f) @@ -25,7 +25,7 @@ function Details:OpenEventTrackerOptions (from_options_panel) local options_slider_template = DF:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE") local options_button_template = DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE") - --> frame strata options + --frame strata options local set_frame_strata = function(_, _, strata) Details.event_tracker.frame.strata = strata Details:UpdateEventTrackerFrame() @@ -37,7 +37,7 @@ function Details:OpenEventTrackerOptions (from_options_panel) strataTable [4] = {value = "HIGH", label = "HIGH", onclick = set_frame_strata} strataTable [5] = {value = "DIALOG", label = "DIALOG", onclick = set_frame_strata} - --> font options + --font options local set_font_shadow= function(_, _, shadow) Details.event_tracker.font_shadow = shadow Details:UpdateEventTrackerFrame() @@ -52,7 +52,7 @@ function Details:OpenEventTrackerOptions (from_options_panel) Details:UpdateEventTrackerFrame() end - --> texture options + --texture options local set_bar_texture = function(_, _, value) Details.event_tracker.line_texture = value Details:UpdateEventTrackerFrame() @@ -66,7 +66,7 @@ function Details:OpenEventTrackerOptions (from_options_panel) end table.sort (texTable, function(t1, t2) return t1.label < t2.label end) - --> options table + --options table local options = { {type = "label", get = function() return "Frame Settings:" end, text_template = DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")}, @@ -214,8 +214,8 @@ function Details:OpenEventTrackerOptions (from_options_panel) DF:BuildMenu (f, options, 7, -30, 500, true, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template) - f:SetScript ("OnHide", function() - --> reopen the options panel + f:SetScript("OnHide", function() + --reopen the options panel if (f.FromOptionsPanel) then C_Timer.After (0.2, function() Details:OpenOptionsWindow(Details:GetInstance(1)) @@ -235,9 +235,9 @@ function Details:CreateEventTrackerFrame(parent, name) local DF = _detalhes.gump local SharedMedia = LibStub:GetLibrary ("LibSharedMedia-3.0") - --> main farame - local f = CreateFrame ("frame", name, parent or UIParent,"BackdropTemplate") - f:SetPoint ("center", UIParent, "center") + --main farame + local f = CreateFrame("frame", name, parent or UIParent,"BackdropTemplate") + f:SetPoint("center", UIParent, "center") if (not DetailsFramework.IsDragonflight()) then f:SetMinResize (150, 40) @@ -246,13 +246,13 @@ function Details:CreateEventTrackerFrame(parent, name) --f:SetResizeBounds(150, 40, 800, 1024) end - f:SetSize (_detalhes.event_tracker.frame.width, _detalhes.event_tracker.frame.height) + f:SetSize(_detalhes.event_tracker.frame.width, _detalhes.event_tracker.frame.height) - f:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}) - f:SetBackdropColor (unpack (_detalhes.event_tracker.frame.backdrop_color)) + f:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}) + f:SetBackdropColor(unpack (_detalhes.event_tracker.frame.backdrop_color)) f:EnableMouse (true) f:SetMovable (true) - f:SetResizable (true) + f:SetResizable(true) f:SetClampedToScreen (true) local LibWindow = LibStub ("LibWindow-1.1") @@ -260,17 +260,17 @@ function Details:CreateEventTrackerFrame(parent, name) LibWindow.MakeDraggable (f) LibWindow.RestorePosition (f) - --> two resizers + --two resizers local left_resize, right_resize = DF:CreateResizeGrips (f) - left_resize:SetScript ("OnMouseDown", function(self) + left_resize:SetScript("OnMouseDown", function(self) if (not f.resizing and not _detalhes.event_tracker.frame.locked) then f.resizing = true f:StartSizing ("bottomleft") end end) - left_resize:SetScript ("OnMouseUp", function(self) + left_resize:SetScript("OnMouseUp", function(self) if (f.resizing) then f.resizing = false f:StopMovingOrSizing() @@ -278,13 +278,13 @@ function Details:CreateEventTrackerFrame(parent, name) _detalhes.event_tracker.frame.height = f:GetHeight() end end) - right_resize:SetScript ("OnMouseDown", function(self) + right_resize:SetScript("OnMouseDown", function(self) if (not f.resizing and not _detalhes.event_tracker.frame.locked) then f.resizing = true f:StartSizing ("bottomright") end end) - right_resize:SetScript ("OnMouseUp", function(self) + right_resize:SetScript("OnMouseUp", function(self) if (f.resizing) then f.resizing = false f:StopMovingOrSizing() @@ -293,33 +293,33 @@ function Details:CreateEventTrackerFrame(parent, name) end end) - f:SetScript ("OnSizeChanged", function(self) + f:SetScript("OnSizeChanged", function(self) end) - --> scroll frame + --scroll frame - --> frame config + --frame config local scroll_line_amount = 1 local scroll_width = 195 local header_size = 20 - --> on tick script + --on tick script local lineOnTick = function(self, deltaTime) - --> when this event occured on combat log + --when this event occured on combat log local gameTime = self.GameTime - --> calculate how much time elapsed since the event got triggered + --calculate how much time elapsed since the event got triggered local elapsedTime = GetTime() - gameTime - --> set the bar animation: + --set the bar animation: local animationPercent = min (elapsedTime, 1) - self.Statusbar:SetValue (animationPercent) + self.Statusbar:SetValue(animationPercent) - --> set the spark location + --set the spark location if (animationPercent < 1) then - self.Spark:SetPoint ("left", self, "left", (self:GetWidth() * animationPercent) - 10, 0) + self.Spark:SetPoint("left", self, "left", (self:GetWidth() * animationPercent) - 10, 0) if (not self.Spark:IsShown()) then self.Spark:Show() end @@ -330,53 +330,53 @@ function Details:CreateEventTrackerFrame(parent, name) end end - --> create a line on the scroll frame + --create a line on the scroll frame local scroll_createline = function(self, index) - local line = CreateFrame ("frame", "$parentLine" .. index, self,"BackdropTemplate") + local line = CreateFrame("frame", "$parentLine" .. index, self,"BackdropTemplate") line:EnableMouse (false) - line.Index = index --> hack to not trigger error on UpdateWorldTrackerLines since Index is set after this function is ran + line.Index = index --hack to not trigger error on UpdateWorldTrackerLines since Index is set after this function is ran - --> set its backdrop - line:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}) - --line:SetBackdropColor (1, 1, 1, 0.75) + --set its backdrop + line:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}) + --line:SetBackdropColor(1, 1, 1, 0.75) - --> statusbar - local statusbar = CreateFrame ("statusbar", "$parentStatusBar", line,"BackdropTemplate") + --statusbar + local statusbar = CreateFrame("statusbar", "$parentStatusBar", line,"BackdropTemplate") statusbar:SetAllPoints() - local statusbartexture = statusbar:CreateTexture (nil, "border") + local statusbartexture = statusbar:CreateTexture(nil, "border") statusbar:SetStatusBarTexture (statusbartexture) statusbar:SetMinMaxValues (0, 1) - statusbar:SetValue (0) + statusbar:SetValue(0) - local statusbarspark = statusbar:CreateTexture (nil, "artwork") - statusbarspark:SetTexture ([[Interface\CastingBar\UI-CastingBar-Spark]]) - statusbarspark:SetSize (16, 30) - statusbarspark:SetBlendMode ("ADD") + local statusbarspark = statusbar:CreateTexture(nil, "artwork") + statusbarspark:SetTexture([[Interface\CastingBar\UI-CastingBar-Spark]]) + statusbarspark:SetSize(16, 30) + statusbarspark:SetBlendMode("ADD") statusbarspark:Hide() - --> create the icon textures and texts - they are all statusbar childs - local lefticon = statusbar:CreateTexture ("$parentLeftIcon", "overlay") - lefticon:SetPoint ("left", line, "left", 0, 0) + --create the icon textures and texts - they are all statusbar childs + local lefticon = statusbar:CreateTexture("$parentLeftIcon", "overlay") + lefticon:SetPoint("left", line, "left", 0, 0) - local righticon = statusbar:CreateTexture ("$parentRightIcon", "overlay") - righticon:SetPoint ("right", line, "right", 0, 0) + local righticon = statusbar:CreateTexture("$parentRightIcon", "overlay") + righticon:SetPoint("right", line, "right", 0, 0) local lefttext = statusbar:CreateFontString ("$parentLeftText", "overlay", "GameFontNormal") DF:SetFontSize (lefttext, 9) - lefttext:SetPoint ("left", lefticon, "right", 2, 0) + lefttext:SetPoint("left", lefticon, "right", 2, 0) local righttext = statusbar:CreateFontString ("$parentRightText", "overlay", "GameFontNormal") DF:SetFontSize (righttext, 9) - righttext:SetPoint ("right", righticon, "left", -2, 0) + righttext:SetPoint("right", righticon, "left", -2, 0) - lefttext:SetJustifyH ("left") - righttext:SetJustifyH ("right") + lefttext:SetJustifyH("left") + righttext:SetJustifyH("right") - local actionicon = statusbar:CreateTexture ("$parentRightIcon", "overlay") - actionicon:SetPoint ("center", line, "center") + local actionicon = statusbar:CreateTexture("$parentRightIcon", "overlay") + actionicon:SetPoint("center", line, "center") - --> set members + --set members line.LeftIcon = lefticon line.RightIcon = righticon line.LeftText = lefttext @@ -386,16 +386,16 @@ function Details:CreateEventTrackerFrame(parent, name) line.Spark = statusbarspark line.ActionIcon = actionicon - --> set some parameters + --set some parameters _detalhes:UpdateWorldTrackerLines (line) - --> set scripts - line:SetScript ("OnUpdate", lineOnTick) + --set scripts + line:SetScript("OnUpdate", lineOnTick) return line end - --> some consts to help work with indexes + --some consts to help work with indexes local SPELLTYPE_COOLDOWN = "cooldown" local SPELLTYPE_INTERRUPT = "interrupt" local SPELLTYPE_OFFENSIVE = "offensive" @@ -442,11 +442,11 @@ function Details:CreateEventTrackerFrame(parent, name) local add_role_and_class_color = function(player_name, player_serial) - --> get the actor object + --get the actor object local actor = _detalhes.tabela_vigente[1]:GetActor (player_name) if (actor) then - --> remove realm name + --remove realm name player_name = _detalhes:GetOnlyName (player_name) local class, spec, role = actor.classe, actor.spec, actor.role @@ -454,15 +454,15 @@ function Details:CreateEventTrackerFrame(parent, name) spec, class = get_spec_or_class (player_serial, player_name) end - --> add the class color + --add the class color if (_detalhes.player_class [class]) then - --> is a player, add the class color + --is a player, add the class color player_name = _detalhes:AddColorString (player_name, class) end --add the role icon if (role ~= "NONE") then - --> have a role + --have a role player_name = _detalhes:AddRoleIcon (player_name, role, _detalhes.event_tracker.line_height) end @@ -471,9 +471,9 @@ function Details:CreateEventTrackerFrame(parent, name) player_name = _detalhes:GetOnlyName (player_name) if (class) then - --> add the class color + --add the class color if (_detalhes.player_class [class]) then - --> is a player, add the class color + --is a player, add the class color player_name = _detalhes:AddColorString (player_name, class) end end @@ -497,7 +497,7 @@ function Details:CreateEventTrackerFrame(parent, name) local loops = 20 while (fontstring:GetStringWidth() > size and loops > 0) do text = strsub (text, 1, #text-1) - fontstring:SetText (text) + fontstring:SetText(text) loops = loops - 1 end @@ -518,19 +518,19 @@ function Details:CreateEventTrackerFrame(parent, name) local spec, class = get_spec_or_class (ability [ABILITYTABLE_CASTERSERIAL], ability [ABILITYTABLE_CASTERNAME]) local texture, L, R, T, B = get_player_icon (spec, class) - line.LeftIcon:SetTexture (texture) + line.LeftIcon:SetTexture(texture) line.LeftIcon:SetTexCoord (L, R, T, B) - line.LeftText:SetText (_detalhes:GetOnlyName (ability [ABILITYTABLE_CASTERNAME])) + line.LeftText:SetText(_detalhes:GetOnlyName (ability [ABILITYTABLE_CASTERNAME])) if (ability [ABILITYTABLE_ISENEMY]) then - line:SetBackdropColor (1, .3, .3, 0.5) + line:SetBackdropColor(1, .3, .3, 0.5) else - line:SetBackdropColor (1, 1, 1, 0.5) + line:SetBackdropColor(1, 1, 1, 0.5) end if (ability [ABILITYTABLE_SPELLTYPE] == SPELLTYPE_COOLDOWN) then local spellName, _, spellIcon = GetSpellInfo(ability [ABILITYTABLE_SPELLID]) - line.RightIcon:SetTexture (spellIcon) + line.RightIcon:SetTexture(spellIcon) line.RightIcon:SetTexCoord (.06, .94, .06, .94) local targetName = ability [ABILITYTABLE_TARGETNAME] @@ -539,32 +539,32 @@ function Details:CreateEventTrackerFrame(parent, name) targetName = add_role_and_class_color (targetName, targetSerial) end - line.RightText:SetText (targetName or spellName) + line.RightText:SetText(targetName or spellName) - line.ActionIcon:SetTexture ([[Interface\AddOns\Details\images\event_tracker_icons]]) + line.ActionIcon:SetTexture([[Interface\AddOns\Details\images\event_tracker_icons]]) line.ActionIcon:SetTexCoord (0, 0.125, 0, 1) elseif (ability [ABILITYTABLE_SPELLTYPE] == SPELLTYPE_OFFENSIVE) then local spellName, _, spellIcon = GetSpellInfo(ability [ABILITYTABLE_SPELLID]) - line.RightIcon:SetTexture (spellIcon) + line.RightIcon:SetTexture(spellIcon) line.RightIcon:SetTexCoord (.06, .94, .06, .94) - line.RightText:SetText (spellName) + line.RightText:SetText(spellName) - line.ActionIcon:SetTexture ([[Interface\AddOns\Details\images\event_tracker_icons]]) + line.ActionIcon:SetTexture([[Interface\AddOns\Details\images\event_tracker_icons]]) line.ActionIcon:SetTexCoord (0.127, 0.25, 0, 1) elseif (ability [ABILITYTABLE_SPELLTYPE] == SPELLTYPE_INTERRUPT) then local spellNameInterrupted, _, spellIconInterrupted = GetSpellInfo(ability [ABILITYTABLE_EXTRASPELLID]) - line.RightIcon:SetTexture (spellIconInterrupted) + line.RightIcon:SetTexture(spellIconInterrupted) line.RightIcon:SetTexCoord (.06, .94, .06, .94) - line.RightText:SetText (spellNameInterrupted) + line.RightText:SetText(spellNameInterrupted) - line.ActionIcon:SetTexture ([[Interface\AddOns\Details\images\event_tracker_icons]]) + line.ActionIcon:SetTexture([[Interface\AddOns\Details\images\event_tracker_icons]]) line.ActionIcon:SetTexCoord (0.251, 0.375, 0, 1) elseif (ability [ABILITYTABLE_SPELLTYPE] == SPELLTYPE_CROWDCONTROL) then local spellName, _, spellIcon = GetSpellInfo(ability [ABILITYTABLE_SPELLID]) - line.RightIcon:SetTexture (spellIcon) + line.RightIcon:SetTexture(spellIcon) line.RightIcon:SetTexCoord (.06, .94, .06, .94) local targetName = ability [ABILITYTABLE_TARGETNAME] @@ -573,9 +573,9 @@ function Details:CreateEventTrackerFrame(parent, name) targetName = add_role_and_class_color (targetName, targetSerial) end - line.RightText:SetText (targetName or "unknown target") + line.RightText:SetText(targetName or "unknown target") - line.ActionIcon:SetTexture ([[Interface\AddOns\Details\images\event_tracker_icons]]) + line.ActionIcon:SetTexture([[Interface\AddOns\Details\images\event_tracker_icons]]) line.ActionIcon:SetTexCoord (0.376, 0.5, 0, 1) end @@ -583,7 +583,7 @@ function Details:CreateEventTrackerFrame(parent, name) shrink_string (line.LeftText, textSize) shrink_string (line.RightText, textSize) - --> set when the ability was registered on combat log + --set when the ability was registered on combat log line.GameTime = ability [ABILITYTABLE_GAMETIME] line:Show() end @@ -592,59 +592,59 @@ function Details:CreateEventTrackerFrame(parent, name) --title text local TitleString = f:CreateFontString (nil, "overlay", "GameFontNormal") - TitleString:SetPoint ("top", f, "top", 0, -3) - TitleString:SetText ("Details!: Event Tracker") - local TitleBackground = f:CreateTexture (nil, "artwork") - TitleBackground:SetTexture ([[Interface\Tooltips\UI-Tooltip-Background]]) + TitleString:SetPoint("top", f, "top", 0, -3) + TitleString:SetText("Details!: Event Tracker") + local TitleBackground = f:CreateTexture(nil, "artwork") + TitleBackground:SetTexture([[Interface\Tooltips\UI-Tooltip-Background]]) TitleBackground:SetVertexColor (.1, .1, .1, .9) - TitleBackground:SetPoint ("topleft", f, "topleft") - TitleBackground:SetPoint ("topright", f, "topright") - TitleBackground:SetHeight (header_size) + TitleBackground:SetPoint("topleft", f, "topleft") + TitleBackground:SetPoint("topright", f, "topright") + TitleBackground:SetHeight(header_size) - --> table with spells showing on the scroll frame + --table with spells showing on the scroll frame local CurrentShowing = {} - --> scrollframe + --scrollframe local scrollframe = DF:CreateScrollBox (f, "$parentScrollFrame", scroll_refresh, CurrentShowing, scroll_width, 400, scroll_line_amount, _detalhes.event_tracker.line_height, scroll_createline, true, true) - scrollframe:SetPoint ("topleft", f, "topleft", 0, -header_size) - scrollframe:SetPoint ("topright", f, "topright", 0, -header_size) - scrollframe:SetPoint ("bottomleft", f, "bottomleft", 0, 0) - scrollframe:SetPoint ("bottomright", f, "bottomright", 0, 0) + scrollframe:SetPoint("topleft", f, "topleft", 0, -header_size) + scrollframe:SetPoint("topright", f, "topright", 0, -header_size) + scrollframe:SetPoint("bottomleft", f, "bottomleft", 0, 0) + scrollframe:SetPoint("bottomright", f, "bottomright", 0, 0) - --> update line - used by 'UpdateWorldTrackerLines' function + --update line - used by 'UpdateWorldTrackerLines' function local update_line = function(line) - --> get the line index + --get the line index local index = line.Index - --> update left text - DF:SetFontColor (line.LeftText, _detalhes.event_tracker.font_color) + --update left text + DF:SetFontColor(line.LeftText, _detalhes.event_tracker.font_color) DF:SetFontFace (line.LeftText, _detalhes.event_tracker.font_face) DF:SetFontSize (line.LeftText, _detalhes.event_tracker.font_size) DF:SetFontOutline (line.LeftText, _detalhes.event_tracker.font_shadow) - --> update right text - DF:SetFontColor (line.RightText, _detalhes.event_tracker.font_color) + --update right text + DF:SetFontColor(line.RightText, _detalhes.event_tracker.font_color) DF:SetFontFace (line.RightText, _detalhes.event_tracker.font_face) DF:SetFontSize (line.RightText, _detalhes.event_tracker.font_size) DF:SetFontOutline (line.RightText, _detalhes.event_tracker.font_shadow) - --> adjust where the line is anchored - line:SetPoint ("topleft", line:GetParent(), "topleft", 0, -((index-1)*(_detalhes.event_tracker.line_height+1))) - line:SetPoint ("topright", line:GetParent(), "topright", 0, -((index-1)*(_detalhes.event_tracker.line_height+1))) + --adjust where the line is anchored + line:SetPoint("topleft", line:GetParent(), "topleft", 0, -((index-1)*(_detalhes.event_tracker.line_height+1))) + line:SetPoint("topright", line:GetParent(), "topright", 0, -((index-1)*(_detalhes.event_tracker.line_height+1))) - --> set its height - line:SetHeight (_detalhes.event_tracker.line_height) + --set its height + line:SetHeight(_detalhes.event_tracker.line_height) - --> set texture + --set texture local texture = SharedMedia:Fetch ("statusbar", _detalhes.event_tracker.line_texture) - line.StatusbarTexture:SetTexture (texture) + line.StatusbarTexture:SetTexture(texture) line.StatusbarTexture:SetVertexColor (unpack (_detalhes.event_tracker.line_color)) - --> set icon size - line.LeftIcon:SetSize (_detalhes.event_tracker.line_height, _detalhes.event_tracker.line_height) - line.RightIcon:SetSize (_detalhes.event_tracker.line_height, _detalhes.event_tracker.line_height) - line.ActionIcon:SetSize (_detalhes.event_tracker.line_height-4, _detalhes.event_tracker.line_height-4) + --set icon size + line.LeftIcon:SetSize(_detalhes.event_tracker.line_height, _detalhes.event_tracker.line_height) + line.RightIcon:SetSize(_detalhes.event_tracker.line_height, _detalhes.event_tracker.line_height) + line.ActionIcon:SetSize(_detalhes.event_tracker.line_height-4, _detalhes.event_tracker.line_height-4) line.ActionIcon:SetAlpha (0.65) end @@ -652,7 +652,7 @@ function Details:CreateEventTrackerFrame(parent, name) -- /run _detalhes:UpdateWorldTrackerLines() function _detalhes:UpdateWorldTrackerLines (line) - --> don't run if the featured hasn't loaded + --don't run if the featured hasn't loaded if (not f) then return end @@ -660,8 +660,8 @@ function Details:CreateEventTrackerFrame(parent, name) if (line) then update_line (line) else - --> update all lines - for index, line in ipairs (scrollframe:GetFrames()) do + --update all lines + for index, line in ipairs(scrollframe:GetFrames()) do update_line (line) end scrollframe:SetFramesHeight (_detalhes.event_tracker.line_height) @@ -670,12 +670,12 @@ function Details:CreateEventTrackerFrame(parent, name) end function _detalhes:UpdateEventTrackerFrame() - --> don't run if the featured hasn't loaded + --don't run if the featured hasn't loaded if (not f) then return end - f:SetSize (_detalhes.event_tracker.frame.width, _detalhes.event_tracker.frame.height) + f:SetSize(_detalhes.event_tracker.frame.width, _detalhes.event_tracker.frame.height) LibWindow.RegisterConfig (f, _detalhes.event_tracker.frame) LibWindow.RestorePosition (f) scrollframe:OnSizeChanged() @@ -693,16 +693,16 @@ function Details:CreateEventTrackerFrame(parent, name) if (_detalhes.event_tracker.frame.show_title) then TitleString:Show() TitleBackground:Show() - scrollframe:SetPoint ("topleft", f, "topleft", 0, -header_size) - scrollframe:SetPoint ("topright", f, "topright", 0, -header_size) + scrollframe:SetPoint("topleft", f, "topleft", 0, -header_size) + scrollframe:SetPoint("topright", f, "topright", 0, -header_size) else TitleString:Hide() TitleBackground:Hide() - scrollframe:SetPoint ("topleft", f, "topleft", 0, 0) - scrollframe:SetPoint ("topright", f, "topright", 0, 0) + scrollframe:SetPoint("topleft", f, "topleft", 0, 0) + scrollframe:SetPoint("topright", f, "topright", 0, 0) end - f:SetBackdropColor (unpack (_detalhes.event_tracker.frame.backdrop_color)) + f:SetBackdropColor(unpack (_detalhes.event_tracker.frame.backdrop_color)) scrollframe.__background:SetVertexColor (unpack (_detalhes.event_tracker.frame.backdrop_color)) f:SetFrameStrata (_detalhes.event_tracker.frame.strata) @@ -716,20 +716,20 @@ function Details:CreateEventTrackerFrame(parent, name) scrollframe:CreateLine (scroll_createline) end f.scrollframe = scrollframe - scrollframe:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16}) - scrollframe:SetBackdropColor (0, 0, 0, 0) + scrollframe:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16}) + scrollframe:SetBackdropColor(0, 0, 0, 0) - --> get tables used inside the combat parser + --get tables used inside the combat parser local cooldownListFromFramework = DetailsFramework.CooldownsAllDeffensive local attackCooldownsFromFramework = DetailsFramework.CooldownsAttack local crowdControlFromFramework = DetailsFramework.CrowdControlSpells - local combatLog = CreateFrame ("frame") + local combatLog = CreateFrame("frame") combatLog:RegisterEvent ("COMBAT_LOG_EVENT_UNFILTERED") local OBJECT_TYPE_PLAYER = 0x00000400 local OBJECT_TYPE_ENEMY = 0x00000040 - --> combat parser + --combat parser local is_player = function(flag) if (not flag) then return false @@ -743,22 +743,22 @@ function Details:CreateEventTrackerFrame(parent, name) return bit.band (flag, OBJECT_TYPE_ENEMY) ~= 0 end - combatLog:SetScript ("OnEvent", function(self, event) + combatLog:SetScript("OnEvent", function(self, event) local time, token, hidding, caster_serial, caster_name, caster_flags, caster_flags2, target_serial, target_name, target_flags, target_flags2, spellid, spellname, spelltype, extraSpellID, extraSpellName, extraSchool = CombatLogGetCurrentEventInfo() local added = false - --> defensive cooldown + --defensive cooldown if (token == "SPELL_CAST_SUCCESS" and (cooldownListFromFramework [spellid]) and is_player (caster_flags)) then tinsert (CurrentShowing, 1, {SPELLTYPE_COOLDOWN, spellid, caster_name, target_name, time, false, GetTime(), caster_serial, is_enemy (caster_flags), target_serial}) added = true - --> offensive cooldown + --offensive cooldown elseif (token == "SPELL_CAST_SUCCESS" and (attackCooldownsFromFramework [spellid]) and is_player (caster_flags)) then tinsert (CurrentShowing, 1, {SPELLTYPE_OFFENSIVE, spellid, caster_name, target_name, time, false, GetTime(), caster_serial, is_enemy (caster_flags), target_serial}) added = true - --> crowd control + --crowd control elseif (token == "SPELL_AURA_APPLIED" and (crowdControlFromFramework [spellid])) then --check if isnt a pet if (target_flags and is_player (target_flags)) then @@ -766,7 +766,7 @@ function Details:CreateEventTrackerFrame(parent, name) added = true end - --> spell interrupt + --spell interrupt elseif (token == "SPELL_INTERRUPT") then tinsert (CurrentShowing, 1, {SPELLTYPE_INTERRUPT, spellid, caster_name, target_name, time, extraSpellID, GetTime(), caster_serial, is_enemy (caster_flags), target_serial}) added = true diff --git a/frames/window_forge.lua b/frames/window_forge.lua index 649c3061..4ee2c8a3 100644 --- a/frames/window_forge.lua +++ b/frames/window_forge.lua @@ -2,7 +2,7 @@ local Details = _G.Details local L = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) ---> default weaktable +--default weaktable Details.weaktable = {__mode = "v"} Details:GetFramework():InstallTemplate("button", "DETAILS_FORGE_TEXTENTRY_TEMPLATE", { @@ -45,7 +45,7 @@ function Details:OpenForge() --main frame local f = DetailsForgePanel or Details.gump:CreateSimplePanel (UIParent, 960, 600, "Details! " .. L["STRING_SPELLLIST"], "DetailsForgePanel") - f:SetPoint ("center", UIParent, "center") + f:SetPoint("center", UIParent, "center") f:SetFrameStrata ("HIGH") f:SetToplevel (true) f:SetMovable (true) @@ -62,39 +62,39 @@ function Details:OpenForge() if (not have_plugins_enabled and false) then local nopluginLabel = f:CreateFontString (nil, "overlay", "GameFontNormal") - local nopluginIcon = f:CreateTexture (nil, "overlay") - nopluginIcon:SetPoint ("bottomleft", f, "bottomleft", 10, 10) - nopluginIcon:SetSize (16, 16) - nopluginIcon:SetTexture ([[Interface\DialogFrame\UI-Dialog-Icon-AlertNew]]) - nopluginLabel:SetPoint ("left", nopluginIcon, "right", 5, 0) - nopluginLabel:SetText (L["STRING_FORGE_ENABLEPLUGINS"]) + local nopluginIcon = f:CreateTexture(nil, "overlay") + nopluginIcon:SetPoint("bottomleft", f, "bottomleft", 10, 10) + nopluginIcon:SetSize(16, 16) + nopluginIcon:SetTexture([[Interface\DialogFrame\UI-Dialog-Icon-AlertNew]]) + nopluginLabel:SetPoint("left", nopluginIcon, "right", 5, 0) + nopluginLabel:SetText(L["STRING_FORGE_ENABLEPLUGINS"]) end if (not Details:GetTutorialCVar ("FORGE_TUTORIAL") and false) then - local tutorialFrame = CreateFrame ("frame", "$parentTutorialFrame", f,"BackdropTemplate") - tutorialFrame:SetPoint ("center", f, "center") + local tutorialFrame = CreateFrame("frame", "$parentTutorialFrame", f,"BackdropTemplate") + tutorialFrame:SetPoint("center", f, "center") tutorialFrame:SetFrameStrata ("DIALOG") - tutorialFrame:SetSize (400, 300) - tutorialFrame:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16, + tutorialFrame:SetSize(400, 300) + tutorialFrame:SetBackdrop({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}, edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize=1}) - tutorialFrame:SetBackdropColor (0, 0, 0, 1) + tutorialFrame:SetBackdropColor(0, 0, 0, 1) - tutorialFrame.Title = Details.gump:CreateLabel (tutorialFrame, L["STRING_FORGE_TUTORIAL_TITLE"], 12, "orange") - tutorialFrame.Desc = Details.gump:CreateLabel (tutorialFrame, L["STRING_FORGE_TUTORIAL_DESC"], 12) + tutorialFrame.Title = Details.gump:CreateLabel(tutorialFrame, L["STRING_FORGE_TUTORIAL_TITLE"], 12, "orange") + tutorialFrame.Desc = Details.gump:CreateLabel(tutorialFrame, L["STRING_FORGE_TUTORIAL_DESC"], 12) tutorialFrame.Desc.width = 370 - tutorialFrame.Example = Details.gump:CreateLabel (tutorialFrame, L["STRING_FORGE_TUTORIAL_VIDEO"], 12) + tutorialFrame.Example = Details.gump:CreateLabel(tutorialFrame, L["STRING_FORGE_TUTORIAL_VIDEO"], 12) - tutorialFrame.Title:SetPoint ("top", tutorialFrame, "top", 0, -5) - tutorialFrame.Desc:SetPoint ("topleft", tutorialFrame, "topleft", 10, -45) - tutorialFrame.Example:SetPoint ("topleft", tutorialFrame, "topleft", 10, -110) + tutorialFrame.Title:SetPoint("top", tutorialFrame, "top", 0, -5) + tutorialFrame.Desc:SetPoint("topleft", tutorialFrame, "topleft", 10, -45) + tutorialFrame.Example:SetPoint("topleft", tutorialFrame, "topleft", 10, -110) local editBox = Details.gump:CreateTextEntry (tutorialFrame, function()end, 375, 20, nil, nil, nil, entry_template, label_template) - editBox:SetPoint ("topleft", tutorialFrame.Example, "bottomleft", 0, -10) - editBox:SetText ([[https://www.youtube.com/watch?v=om0k1Yj2pEw]]) + editBox:SetPoint("topleft", tutorialFrame.Example, "bottomleft", 0, -10) + editBox:SetText([[https://www.youtube.com/watch?v=om0k1Yj2pEw]]) editBox:SetTemplate (Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) local closeButton = Details.gump:CreateButton (tutorialFrame, function() Details:SetTutorialCVar ("FORGE_TUTORIAL", true); tutorialFrame:Hide() end, 80, 20, L["STRING_OPTIONS_CHART_CLOSE"]) - closeButton:SetPoint ("bottom", tutorialFrame, "bottom", 0, 10) + closeButton:SetPoint("bottom", tutorialFrame, "bottom", 0, 10) closeButton:SetTemplate (Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) end @@ -102,8 +102,8 @@ function Details:OpenForge() local all_modules = {} local spell_already_added = {} - f:SetScript ("OnHide", function() - for _, module in ipairs (all_modules) do + f:SetScript("OnHide", function() + for _, module in ipairs(all_modules) do if (module.data) then wipe (module.data) end @@ -111,37 +111,37 @@ function Details:OpenForge() wipe (spell_already_added) end) - f.bg1 = f:CreateTexture (nil, "background") - f.bg1:SetTexture ([[Interface\AddOns\Details\images\background]], true) + f.bg1 = f:CreateTexture(nil, "background") + f.bg1:SetTexture([[Interface\AddOns\Details\images\background]], true) f.bg1:SetAlpha (0.7) f.bg1:SetVertexColor (0.27, 0.27, 0.27) f.bg1:SetVertTile (true) f.bg1:SetHorizTile (true) - f.bg1:SetSize (790, 454) + f.bg1:SetSize(790, 454) f.bg1:SetAllPoints() - f:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) - f:SetBackdropColor (.5, .5, .5, .5) - f:SetBackdropBorderColor (0, 0, 0, 1) + f:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) + f:SetBackdropColor(.5, .5, .5, .5) + f:SetBackdropBorderColor(0, 0, 0, 1) --[=[ --scroll gradient - local blackdiv = f:CreateTexture (nil, "artwork") - blackdiv:SetTexture ([[Interface\ACHIEVEMENTFRAME\UI-Achievement-HorizontalShadow]]) + local blackdiv = f:CreateTexture(nil, "artwork") + blackdiv:SetTexture([[Interface\ACHIEVEMENTFRAME\UI-Achievement-HorizontalShadow]]) blackdiv:SetVertexColor (0, 0, 0) blackdiv:SetAlpha (1) - blackdiv:SetPoint ("topleft", f, "topleft", 170, -100) - blackdiv:SetHeight (461) - blackdiv:SetWidth (200) + blackdiv:SetPoint("topleft", f, "topleft", 170, -100) + blackdiv:SetHeight(461) + blackdiv:SetWidth(200) --big gradient - local blackdiv = f:CreateTexture (nil, "artwork") - blackdiv:SetTexture ([[Interface\ACHIEVEMENTFRAME\UI-Achievement-HorizontalShadow]]) + local blackdiv = f:CreateTexture(nil, "artwork") + blackdiv:SetTexture([[Interface\ACHIEVEMENTFRAME\UI-Achievement-HorizontalShadow]]) blackdiv:SetVertexColor (0, 0, 0) blackdiv:SetAlpha (0.7) - blackdiv:SetPoint ("topleft", f, "topleft", 0, 0) - blackdiv:SetPoint ("bottomleft", f, "bottomleft", 0, 0) - blackdiv:SetWidth (200) + blackdiv:SetPoint("topleft", f, "topleft", 0, 0) + blackdiv:SetPoint("bottomleft", f, "bottomleft", 0, 0) + blackdiv:SetWidth(200) --]=] local no_func = function()end @@ -160,16 +160,16 @@ function Details:OpenForge() desc = L["STRING_FORGE_BUTTON_PLAYERS_DESC"], filters_widgets = function() if (not DetailsForgeAllPlayersFilterPanel) then - local w = CreateFrame ("frame", "DetailsForgeAllPlayersFilterPanel", f, "BackdropTemplate") - w:SetSize (600, 20) - w:SetPoint ("topleft", f, "topleft", 164, -40) + local w = CreateFrame("frame", "DetailsForgeAllPlayersFilterPanel", f, "BackdropTemplate") + w:SetSize(600, 20) + w:SetPoint("topleft", f, "topleft", 164, -40) -- local label = w:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - label:SetText (L["STRING_FORGE_FILTER_PLAYERNAME"] .. ": ") - label:SetPoint ("left", w, "left", 5, 0) + label:SetText(L["STRING_FORGE_FILTER_PLAYERNAME"] .. ": ") + label:SetPoint("left", w, "left", 5, 0) local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeAllPlayersNameFilter") - entry:SetHook ("OnTextChanged", function() f:refresh() end) - entry:SetPoint ("left", label, "right", 2, 0) + entry:SetHook("OnTextChanged", function() f:refresh() end) + entry:SetPoint("left", label, "right", 2, 0) entry:SetTemplate (Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) end return DetailsForgeAllPlayersFilterPanel @@ -177,7 +177,7 @@ function Details:OpenForge() search = function() local t = {} local filter = DetailsForgeAllPlayersNameFilter:GetText() - for _, actor in ipairs (Details:GetCombat("current"):GetActorList (DETAILS_ATTRIBUTE_DAMAGE)) do + for _, actor in ipairs(Details:GetCombat("current"):GetActorList (DETAILS_ATTRIBUTE_DAMAGE)) do if (actor:IsGroupPlayer()) then if (filter ~= "") then filter = lower (filter) @@ -224,24 +224,24 @@ function Details:OpenForge() desc = L["STRING_FORGE_BUTTON_PETS_DESC"], filters_widgets = function() if (not DetailsForgeAllPetsFilterPanel) then - local w = CreateFrame ("frame", "DetailsForgeAllPetsFilterPanel", f, "BackdropTemplate") - w:SetSize (600, 20) - w:SetPoint ("topleft", f, "topleft", 164, -40) + local w = CreateFrame("frame", "DetailsForgeAllPetsFilterPanel", f, "BackdropTemplate") + w:SetSize(600, 20) + w:SetPoint("topleft", f, "topleft", 164, -40) -- local label = w:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - label:SetText (L["STRING_FORGE_FILTER_PETNAME"] .. ": ") - label:SetPoint ("left", w, "left", 5, 0) + label:SetText(L["STRING_FORGE_FILTER_PETNAME"] .. ": ") + label:SetPoint("left", w, "left", 5, 0) local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeAllPetsNameFilter") - entry:SetHook ("OnTextChanged", function() f:refresh() end) - entry:SetPoint ("left", label, "right", 2, 0) + entry:SetHook("OnTextChanged", function() f:refresh() end) + entry:SetPoint("left", label, "right", 2, 0) entry:SetTemplate (Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) -- local label = w:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - label:SetText (L["STRING_FORGE_FILTER_OWNERNAME"] .. ": ") - label:SetPoint ("left", entry.widget, "right", 20, 0) + label:SetText(L["STRING_FORGE_FILTER_OWNERNAME"] .. ": ") + label:SetPoint("left", entry.widget, "right", 20, 0) local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeAllPetsOwnerFilter") - entry:SetHook ("OnTextChanged", function() f:refresh() end) - entry:SetPoint ("left", label, "right", 2, 0) + entry:SetHook("OnTextChanged", function() f:refresh() end) + entry:SetPoint("left", label, "right", 2, 0) entry:SetTemplate (Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) end return DetailsForgeAllPetsFilterPanel @@ -250,7 +250,7 @@ function Details:OpenForge() local t = {} local filter_petname = DetailsForgeAllPetsNameFilter:GetText() local filter_ownername = DetailsForgeAllPetsOwnerFilter:GetText() - for _, actor in ipairs (Details:GetCombat("current"):GetActorList (DETAILS_ATTRIBUTE_DAMAGE)) do + for _, actor in ipairs(Details:GetCombat("current"):GetActorList (DETAILS_ATTRIBUTE_DAMAGE)) do if (actor.owner) then local can_add = true if (filter_petname ~= "") then @@ -311,16 +311,16 @@ function Details:OpenForge() desc = L["STRING_FORGE_BUTTON_ENEMIES_DESC"], filters_widgets = function() if (not DetailsForgeAllEnemiesFilterPanel) then - local w = CreateFrame ("frame", "DetailsForgeAllEnemiesFilterPanel", f, "BackdropTemplate") - w:SetSize (600, 20) - w:SetPoint ("topleft", f, "topleft", 164, -40) + local w = CreateFrame("frame", "DetailsForgeAllEnemiesFilterPanel", f, "BackdropTemplate") + w:SetSize(600, 20) + w:SetPoint("topleft", f, "topleft", 164, -40) -- local label = w:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - label:SetText (L["STRING_FORGE_FILTER_ENEMYNAME"] .. ": ") - label:SetPoint ("left", w, "left", 5, 0) + label:SetText(L["STRING_FORGE_FILTER_ENEMYNAME"] .. ": ") + label:SetPoint("left", w, "left", 5, 0) local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeAllEnemiesNameFilter") - entry:SetHook ("OnTextChanged", function() f:refresh() end) - entry:SetPoint ("left", label, "right", 2, 0) + entry:SetHook("OnTextChanged", function() f:refresh() end) + entry:SetPoint("left", label, "right", 2, 0) entry:SetTemplate (Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) end return DetailsForgeAllEnemiesFilterPanel @@ -328,7 +328,7 @@ function Details:OpenForge() search = function() local t = {} local filter = DetailsForgeAllEnemiesNameFilter:GetText() - for _, actor in ipairs (Details:GetCombat("current"):GetActorList (DETAILS_ATTRIBUTE_DAMAGE)) do + for _, actor in ipairs(Details:GetCombat("current"):GetActorList (DETAILS_ATTRIBUTE_DAMAGE)) do if (actor:IsNeutralOrEnemy()) then if (filter ~= "") then filter = lower (filter) @@ -408,24 +408,24 @@ function Details:OpenForge() desc = L["STRING_FORGE_BUTTON_ALLSPELLS_DESC"], filters_widgets = function() if (not DetailsForgeAllSpellsFilterPanel) then - local w = CreateFrame ("frame", "DetailsForgeAllSpellsFilterPanel", f, "BackdropTemplate") - w:SetSize (600, 20) - w:SetPoint ("topleft", f, "topleft", 164, -40) + local w = CreateFrame("frame", "DetailsForgeAllSpellsFilterPanel", f, "BackdropTemplate") + w:SetSize(600, 20) + w:SetPoint("topleft", f, "topleft", 164, -40) -- local label = w:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - label:SetText (L["STRING_FORGE_FILTER_SPELLNAME"] .. ": ") - label:SetPoint ("left", w, "left", 5, 0) + label:SetText(L["STRING_FORGE_FILTER_SPELLNAME"] .. ": ") + label:SetPoint("left", w, "left", 5, 0) local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeAllSpellsNameFilter") - entry:SetHook ("OnTextChanged", function() f:refresh() end) - entry:SetPoint ("left", label, "right", 2, 0) + entry:SetHook("OnTextChanged", function() f:refresh() end) + entry:SetPoint("left", label, "right", 2, 0) entry:SetTemplate (Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) -- local label = w:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - label:SetText (L["STRING_FORGE_FILTER_CASTERNAME"] .. ": ") - label:SetPoint ("left", entry.widget, "right", 20, 0) + label:SetText(L["STRING_FORGE_FILTER_CASTERNAME"] .. ": ") + label:SetPoint("left", entry.widget, "right", 20, 0) local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeAllSpellsCasterFilter") - entry:SetHook ("OnTextChanged", function() f:refresh() end) - entry:SetPoint ("left", label, "right", 2, 0) + entry:SetHook("OnTextChanged", function() f:refresh() end) + entry:SetPoint("left", label, "right", 2, 0) entry:SetTemplate (Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) end return DetailsForgeAllSpellsFilterPanel @@ -441,14 +441,14 @@ function Details:OpenForge() local SpellPoll = Details.spell_pool for spellID, className in pairs (SpellPoll) do - if (type (spellID) == "number" and spellID > 12) then + if (type(spellID) == "number" and spellID > 12) then local can_add = true if (lower_FilterCaster ~= "") then --class name are stored as numbers for players and string for non-player characters local classNameOriginal = className - if (type (className) == "number") then + if (type(className) == "number") then className = Details.classid_to_classstring [className] className = lower (className) else @@ -538,32 +538,32 @@ function Details:OpenForge() filters_widgets = function() if (not DetailsForgeEncounterBossSpellsFilterPanel) then - local w = CreateFrame ("frame", "DetailsForgeEncounterBossSpellsFilterPanel", f, "BackdropTemplate") - w:SetSize (600, 20) - w:SetPoint ("topleft", f, "topleft", 164, -40) + local w = CreateFrame("frame", "DetailsForgeEncounterBossSpellsFilterPanel", f, "BackdropTemplate") + w:SetSize(600, 20) + w:SetPoint("topleft", f, "topleft", 164, -40) -- local label = w:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - label:SetText (L["STRING_FORGE_FILTER_SPELLNAME"] .. ": ") - label:SetPoint ("left", w, "left", 5, 0) + label:SetText(L["STRING_FORGE_FILTER_SPELLNAME"] .. ": ") + label:SetPoint("left", w, "left", 5, 0) local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeEncounterSpellsNameFilter") - entry:SetHook ("OnTextChanged", function() f:refresh() end) - entry:SetPoint ("left", label, "right", 2, 0) + entry:SetHook("OnTextChanged", function() f:refresh() end) + entry:SetPoint("left", label, "right", 2, 0) entry:SetTemplate (Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) -- local label = w:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - label:SetText (L["STRING_FORGE_FILTER_CASTERNAME"] .. ": ") - label:SetPoint ("left", entry.widget, "right", 20, 0) + label:SetText(L["STRING_FORGE_FILTER_CASTERNAME"] .. ": ") + label:SetPoint("left", entry.widget, "right", 20, 0) local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeEncounterSpellsCasterFilter") - entry:SetHook ("OnTextChanged", function() f:refresh() end) - entry:SetPoint ("left", label, "right", 2, 0) + entry:SetHook("OnTextChanged", function() f:refresh() end) + entry:SetPoint("left", label, "right", 2, 0) entry:SetTemplate (Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) -- local label = w:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - label:SetText (L["STRING_FORGE_FILTER_ENCOUNTERNAME"] .. ": ") - label:SetPoint ("left", entry.widget, "right", 20, 0) + label:SetText(L["STRING_FORGE_FILTER_ENCOUNTERNAME"] .. ": ") + label:SetPoint("left", entry.widget, "right", 20, 0) local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeEncounterSpellsEncounterFilter") - entry:SetHook ("OnTextChanged", function() f:refresh() end) - entry:SetPoint ("left", label, "right", 2, 0) + entry:SetHook("OnTextChanged", function() f:refresh() end) + entry:SetPoint("left", label, "right", 2, 0) entry:SetTemplate (Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) end return DetailsForgeEncounterBossSpellsFilterPanel @@ -698,13 +698,13 @@ function Details:OpenForge() filters_widgets = function() if (not DetailsForgeEncounterNpcIDsFilterPanel) then - local npcIdFrame = CreateFrame ("frame", "DetailsForgeEncounterNpcIDsFilterPanel", f, "BackdropTemplate") - npcIdFrame:SetSize (600, 20) - npcIdFrame:SetPoint ("topleft", f, "topleft", 164, -40) + local npcIdFrame = CreateFrame("frame", "DetailsForgeEncounterNpcIDsFilterPanel", f, "BackdropTemplate") + npcIdFrame:SetSize(600, 20) + npcIdFrame:SetPoint("topleft", f, "topleft", 164, -40) local filterSpellNameLabel = npcIdFrame:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - filterSpellNameLabel:SetText (L["STRING_FORGE_FILTER_SPELLNAME"] .. ": ") - filterSpellNameLabel:SetPoint ("left", npcIdFrame, "left", 5, 0) + filterSpellNameLabel:SetText(L["STRING_FORGE_FILTER_SPELLNAME"] .. ": ") + filterSpellNameLabel:SetPoint("left", npcIdFrame, "left", 5, 0) local searchEntry = fw:CreateTextEntry(npcIdFrame, nil, 120, 20, "entry", "DetailsForgeEncounterNpcIDsFilter") searchEntry:SetHook("OnTextChanged", function() f:refresh() end) @@ -772,7 +772,7 @@ function Details:OpenForge() local data = all_modules [4].data [row] local spellname, spellicon, _ - if (type (data [7]) == "number") then + if (type(data [7]) == "number") then spellname, _, spellicon = GetSpellInfo(data [7]) else if (data [7]) then @@ -793,24 +793,24 @@ function Details:OpenForge() desc = L["STRING_FORGE_BUTTON_DBMTIMERS_DESC"], filters_widgets = function() if (not DetailsForgeDBMBarsFilterPanel) then - local w = CreateFrame ("frame", "DetailsForgeDBMBarsFilterPanel", f, "BackdropTemplate") - w:SetSize (600, 20) - w:SetPoint ("topleft", f, "topleft", 164, -40) + local w = CreateFrame("frame", "DetailsForgeDBMBarsFilterPanel", f, "BackdropTemplate") + w:SetSize(600, 20) + w:SetPoint("topleft", f, "topleft", 164, -40) -- local label = w:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - label:SetText (L["STRING_FORGE_FILTER_BARTEXT"] .. ": ") - label:SetPoint ("left", w, "left", 5, 0) + label:SetText(L["STRING_FORGE_FILTER_BARTEXT"] .. ": ") + label:SetPoint("left", w, "left", 5, 0) local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeDBMBarsTextFilter") - entry:SetHook ("OnTextChanged", function() f:refresh() end) - entry:SetPoint ("left", label, "right", 2, 0) + entry:SetHook("OnTextChanged", function() f:refresh() end) + entry:SetPoint("left", label, "right", 2, 0) entry:SetTemplate (Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) -- local label = w:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - label:SetText (L["STRING_FORGE_FILTER_ENCOUNTERNAME"] .. ": ") - label:SetPoint ("left", entry.widget, "right", 20, 0) + label:SetText(L["STRING_FORGE_FILTER_ENCOUNTERNAME"] .. ": ") + label:SetPoint("left", entry.widget, "right", 20, 0) local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeDBMBarsEncounterFilter") - entry:SetHook ("OnTextChanged", function() f:refresh() end) - entry:SetPoint ("left", label, "right", 2, 0) + entry:SetHook("OnTextChanged", function() f:refresh() end) + entry:SetPoint("left", label, "right", 2, 0) entry:SetTemplate (Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) end return DetailsForgeDBMBarsFilterPanel @@ -904,7 +904,7 @@ function Details:OpenForge() local spellname, spellicon, _ local spellid = tonumber (data [2]) - if (type (spellid) == "number") then + if (type(spellid) == "number") then if (spellid < 0) then 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 @@ -913,8 +913,8 @@ function Details:OpenForge() 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}) - elseif (type (data [2]) == "string") then - --> "Xhul'horac" Imps + elseif (type(data [2]) == "string") then + --"Xhul'horac" Imps Details:OpenAuraPanel (data [2], data[3], data[5], data.id, DETAILS_WA_TRIGGER_BW_TIMER, DETAILS_WA_AURATYPE_TEXT, {bw_timer_id = data [2], text = "Next " .. (data[3] or "") .. " In", text_size = 72, icon = data[5]}) end end @@ -924,24 +924,24 @@ function Details:OpenForge() desc = L["STRING_FORGE_BUTTON_BWTIMERS_DESC"], filters_widgets = function() if (not DetailsForgeBigWigsBarsFilterPanel) then - local w = CreateFrame ("frame", "DetailsForgeBigWigsBarsFilterPanel", f, "BackdropTemplate") - w:SetSize (600, 20) - w:SetPoint ("topleft", f, "topleft", 164, -40) + local w = CreateFrame("frame", "DetailsForgeBigWigsBarsFilterPanel", f, "BackdropTemplate") + w:SetSize(600, 20) + w:SetPoint("topleft", f, "topleft", 164, -40) -- local label = w:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - label:SetText (L["STRING_FORGE_FILTER_BARTEXT"] .. ": ") - label:SetPoint ("left", w, "left", 5, 0) + label:SetText(L["STRING_FORGE_FILTER_BARTEXT"] .. ": ") + label:SetPoint("left", w, "left", 5, 0) local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeBigWigsBarsTextFilter") - entry:SetHook ("OnTextChanged", function() f:refresh() end) - entry:SetPoint ("left", label, "right", 2, 0) + entry:SetHook("OnTextChanged", function() f:refresh() end) + entry:SetPoint("left", label, "right", 2, 0) entry:SetTemplate (Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) -- local label = w:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - label:SetText (L["STRING_FORGE_FILTER_ENCOUNTERNAME"] .. ": ") - label:SetPoint ("left", entry.widget, "right", 20, 0) + label:SetText(L["STRING_FORGE_FILTER_ENCOUNTERNAME"] .. ": ") + label:SetPoint("left", entry.widget, "right", 20, 0) local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeBWBarsEncounterFilter") - entry:SetHook ("OnTextChanged", function() f:refresh() end) - entry:SetPoint ("left", label, "right", 2, 0) + entry:SetHook("OnTextChanged", function() f:refresh() end) + entry:SetPoint("left", label, "right", 2, 0) entry:SetTemplate (Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) -- end @@ -1041,7 +1041,7 @@ function Details:OpenForge() end end - for index, button in ipairs (buttons) do + for index, button in ipairs(buttons) do button:SetTemplate (CONST_BUTTON_TEMPLATE) end buttons[module_number]:SetTemplate (CONST_BUTTONSELECTED_TEMPLATE) @@ -1053,10 +1053,10 @@ function Details:OpenForge() local fillpanel = module.fill_panel if (not fillpanel) then fillpanel = fw:NewFillPanel (f, module.header, module.fill_name, nil, 740, 481, module.fill_gettotal, module.fill_fillrows, false) - fillpanel:SetPoint (170, -80) + fillpanel:SetPoint(170, -80) fillpanel.module = module - local background = fillpanel:CreateTexture (nil, "background") + local background = fillpanel:CreateTexture(nil, "background") background:SetAllPoints() background:SetColorTexture (0, 0, 0, 0.2) @@ -1074,7 +1074,7 @@ function Details:OpenForge() for o = 1, #fillpanel.scrollframe.lines do for i = 1, #fillpanel.scrollframe.lines [o].entry_inuse do - --> text entry + --text entry fillpanel.scrollframe.lines [o].entry_inuse [i]:SetTemplate (fw:GetTemplate ("button", "DETAILS_FORGE_TEXTENTRY_TEMPLATE")) end end @@ -1114,16 +1114,16 @@ function Details:OpenForge() b:SetTemplate (CONST_BUTTON_TEMPLATE) b:SetIcon ([[Interface\BUTTONS\UI-GuildButton-PublicNote-Up]], nil, nil, nil, nil, {1, 1, 1, 0.7}) - b:SetWidth (140) + b:SetWidth(140) if (lastButton) then if (brackets[i]) then - b:SetPoint ("topleft", lastButton, "bottomleft", 0, -23) + b:SetPoint("topleft", lastButton, "bottomleft", 0, -23) else - b:SetPoint ("topleft", lastButton, "bottomleft", 0, -8) + b:SetPoint("topleft", lastButton, "bottomleft", 0, -8) end else - b:SetPoint ("topleft", f, "topleft", 10, (i*16*-1) - 67) + b:SetPoint("topleft", f, "topleft", 10, (i*16*-1) - 67) end lastButton = b diff --git a/frames/window_macros.lua b/frames/window_macros.lua index e91f1346..a1bedfa1 100644 --- a/frames/window_macros.lua +++ b/frames/window_macros.lua @@ -35,32 +35,32 @@ function Details.OpenMacrosWindow() local scrollbox_line_height = 79.5 local scrollbox_size = {890, 563} - f.bg1 = f:CreateTexture (nil, "background") - f.bg1:SetTexture ([[Interface\AddOns\Details\images\background]], true) + f.bg1 = f:CreateTexture(nil, "background") + f.bg1:SetTexture([[Interface\AddOns\Details\images\background]], true) f.bg1:SetAlpha (0.8) f.bg1:SetVertexColor (0.27, 0.27, 0.27) f.bg1:SetVertTile (true) f.bg1:SetHorizTile (true) - f.bg1:SetSize (790, 454) + f.bg1:SetSize(790, 454) f.bg1:SetAllPoints() - f:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) - f:SetBackdropColor (.5, .5, .5, .7) - f:SetBackdropBorderColor (0, 0, 0, 1) + f:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) + f:SetBackdropColor(.5, .5, .5, .7) + f:SetBackdropBorderColor(0, 0, 0, 1) local macrosAvailable = Details.MacroList local OnEnterMacroButton = function(self) - self:SetBackdropColor (unpack (scrollbox_line_backdrop_color_onenter)) + self:SetBackdropColor(unpack (scrollbox_line_backdrop_color_onenter)) end local onLeaveMacroButton = function(self) - self:SetBackdropColor (unpack (scrollbox_line_backdrop_color)) + self:SetBackdropColor(unpack (scrollbox_line_backdrop_color)) end local updateMacroLine = function(self, index, title, desc, macroText) - self.Title:SetText (title) - self.Desc:SetText (desc) - self.MacroTextEntry:SetText (macroText) + self.Title:SetText(title) + self.Desc:SetText(desc) + self.MacroTextEntry:SetText(macroText) end local textEntryOnFocusGained = function(self) @@ -84,21 +84,21 @@ function Details.OpenMacrosWindow() local macroListCreateLine = function(self, index) --create a new line - local line = CreateFrame ("button", "$parentLine" .. index, self,"BackdropTemplate") + local line = CreateFrame("button", "$parentLine" .. index, self,"BackdropTemplate") --set its parameters - line:SetPoint ("topleft", self, "topleft", 0, -((index-1) * (scrollbox_line_height+1))) - line:SetSize (scrollbox_size[1], scrollbox_line_height) - line:SetScript ("OnEnter", OnEnterMacroButton) - line:SetScript ("OnLeave", onLeaveMacroButton) - line:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true, edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1}) - line:SetBackdropColor (unpack (scrollbox_line_backdrop_color)) - line:SetBackdropBorderColor (0, 0, 0, 0.3) + line:SetPoint("topleft", self, "topleft", 0, -((index-1) * (scrollbox_line_height+1))) + line:SetSize(scrollbox_size[1], scrollbox_line_height) + line:SetScript("OnEnter", OnEnterMacroButton) + line:SetScript("OnLeave", onLeaveMacroButton) + line:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true, edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1}) + line:SetBackdropColor(unpack (scrollbox_line_backdrop_color)) + line:SetBackdropBorderColor(0, 0, 0, 0.3) - local titleLabel = DF:CreateLabel (line, "", DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")) + local titleLabel = DF:CreateLabel(line, "", DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")) titleLabel.textsize = 14 titleLabel.textcolor = "yellow" - local descLabel = DF:CreateLabel (line, "", DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")) + local descLabel = DF:CreateLabel(line, "", DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")) descLabel.textsize = 12 local options_dropdown_template = DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") @@ -107,14 +107,14 @@ function Details.OpenMacrosWindow() options_dropdown_template.onenterbordercolor = {.51, .51, .51, .2} local textEntry = DF:CreateTextEntry (line, function()end, scrollbox_size[1] - 10, 40, "MacroTextEntry", _, _, options_dropdown_template) - textEntry:SetHook ("OnEditFocusGained", textEntryOnFocusGained) - textEntry:SetHook ("OnEditFocusLost", textEntryOnFocusLost) - textEntry:SetJustifyH ("left") + textEntry:SetHook("OnEditFocusGained", textEntryOnFocusGained) + textEntry:SetHook("OnEditFocusLost", textEntryOnFocusLost) + textEntry:SetJustifyH("left") textEntry:SetTextInsets (8, 8, 0, 0) - titleLabel:SetPoint ("topleft", line, "topleft", 5, -5) - descLabel:SetPoint ("topleft", titleLabel, "bottomleft", 0, -2) - textEntry:SetPoint ("topleft", descLabel, "bottomleft", 0, -4) + titleLabel:SetPoint("topleft", line, "topleft", 5, -5) + descLabel:SetPoint("topleft", titleLabel, "bottomleft", 0, -2) + textEntry:SetPoint("topleft", descLabel, "bottomleft", 0, -4) line.Title = titleLabel line.Desc = descLabel @@ -127,10 +127,10 @@ function Details.OpenMacrosWindow() end local macroScrollbox = DF:CreateScrollBox (f, "$parentMacroScrollbox", refreshMacroScrollbox, macrosAvailable, scrollbox_size[1], scrollbox_size[2], scrollbox_lines, scrollbox_line_height) - macroScrollbox:SetPoint ("topleft", f, "topleft", 5, -30) - macroScrollbox:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - macroScrollbox:SetBackdropColor (0, 0, 0, 0) - macroScrollbox:SetBackdropBorderColor (0, 0, 0, 1) + macroScrollbox:SetPoint("topleft", f, "topleft", 5, -30) + macroScrollbox:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + macroScrollbox:SetBackdropColor(0, 0, 0, 0) + macroScrollbox:SetBackdropBorderColor(0, 0, 0, 1) f.MacroScrollbox = macroScrollbox DF:ReskinSlider(macroScrollbox) diff --git a/frames/window_main.lua b/frames/window_main.lua index 172c72a1..7689962f 100644 --- a/frames/window_main.lua +++ b/frames/window_main.lua @@ -51,7 +51,7 @@ function Details:ScheduleUpdate(instancia) end end ---> skins TCoords +--skins TCoords local DEFAULT_SKIN = [[Interface\AddOns\Details\images\skins\classic_skin]] local COORDS_LEFT_BALL = {0.15625, 0.2802734375, 0.08203125, 0.2060546875} -- 160 287 84 211 local COORDS_LEFT_CONNECTOR = {0.294921875, 0.3017578125, 0.08203125, 0.2060546875} --302 84 309 211 (updated) @@ -149,27 +149,27 @@ function Details:RefreshScrollBar(x) --x = amount of bars being refreshed end end ---> self é a janela das barras +--self é a janela das barras local function move_barras (self, elapsed) self._move_func.time = self._move_func.time+elapsed if (self._move_func.time > 0.01) then - if (self._move_func.instancia.bgdisplay_loc == self._move_func._end) then --> se o tamanho atual � igual ao final declarado - self:SetScript ("OnUpdate", nil) + if (self._move_func.instancia.bgdisplay_loc == self._move_func._end) then --se o tamanho atual � igual ao final declarado + self:SetScript("OnUpdate", nil) self._move_func = nil else self._move_func.time = 0 - 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 - + 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) end 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 + + --verifica o tamanho do text for i = 1, #self._move_func.instancia.barras do local esta_barra = self._move_func.instancia.barras [i] Details:name_space (esta_barra) @@ -178,7 +178,7 @@ local function move_barras (self, elapsed) end end ---> self � a inst�ncia +--self � a inst�ncia function Details:MoveBarrasTo (destino) local janela = self.baseframe @@ -187,14 +187,14 @@ function Details:MoveBarrasTo (destino) instancia = self, time = 0 } - + if (destino > self.bgdisplay_loc) then janela._move_func.inc = 1 else janela._move_func.inc = -1 end janela._move_func._end = destino - janela:SetScript ("OnUpdate", move_barras) + janela:SetScript("OnUpdate", move_barras) end --almost deprecated @@ -203,50 +203,50 @@ function Details:MostrarScrollBar (sem_animacao) if (self.rolagem) then return end - + if (not Details.use_scroll) then self.baseframe:EnableMouseWheel (true) self.scroll:Enable() - self.scroll:SetValue (0) + self.scroll:SetValue(0) self.rolagem = true return end local main = self.baseframe local mover_para = self.largura_scroll*-1 - + if (not sem_animacao and Details.animate_scroll) then self:MoveBarrasTo (mover_para) else - --> set size of rows + --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) + --move the semi-background to the left (which moves the scroll) self.bgdisplay:SetPoint("bottomright", self.baseframe, "bottomright", mover_para, 0) - + self.bar_mod = mover_para + (-3) self.bgdisplay_loc = mover_para - - --> cancel movement if any + + --cancel movement if any if (self.baseframe:GetScript ("OnUpdate") and self.baseframe:GetScript ("OnUpdate") == move_barras) then - self.baseframe:SetScript ("OnUpdate", nil) + self.baseframe:SetScript("OnUpdate", nil) end end - + local nao_mostradas = self.rows_showing - self.rows_fit_in_window local slider_height = nao_mostradas*self.row_height self.scroll.scrollMax = slider_height self.scroll:SetMinMaxValues (0, slider_height) - + self.rolagem = true self.scroll:Enable() main:EnableMouseWheel (true) - self.scroll:SetValue (0) --> set value pode chamar o atualizador + 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) - + if (main.isLocked) then main.lock_button:SetPoint("bottomright", main, "bottomright", self.largura_scroll*-1, 0) end @@ -259,70 +259,70 @@ function Details:EsconderScrollBar (sem_animacao, force) if (not self.rolagem) then return end - + if (not Details.use_scroll and not force) then self.scroll:Disable() self.baseframe:EnableMouseWheel (false) self.rolagem = false return end - + local main = self.baseframe if (not sem_animacao and Details.animate_scroll) then - self:MoveBarrasTo (self.row_info.space.right + 3) --> + 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.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 - self.baseframe:SetScript ("OnUpdate", nil) + self.baseframe:SetScript("OnUpdate", nil) end end self.rolagem = false self.scroll:Disable() main:EnableMouseWheel (false) - + main.resize_direita:SetPoint("bottomright", main, "bottomright", 0, 0) if (main.isLocked) then main.lock_button:SetPoint("bottomright", main, "bottomright", 0, 0) end end -local function OnLeaveMainWindow (instancia, self) +local function OnLeaveMainWindow(instancia, self) instancia.is_interacting = false instancia:SetMenuAlpha (nil, nil, nil, nil, true) instancia:SetAutoHideMenu (nil, nil, true) instancia:RefreshAttributeTextSize() - + if (instancia.modo ~= Details._detalhes_props["MODO_ALONE"] and not instancia.baseframe.isLocked) then - --> resizes, lock and ungroup buttons + --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) end - - --> stretch button - Details.FadeHandler.Fader (instancia.baseframe.button_stretch, "ALPHA", 0) - + + --stretch button + Details.FadeHandler.Fader(instancia.baseframe.button_stretch, "ALPHA", 0) + elseif (instancia.modo ~= Details._detalhes_props["MODO_ALONE"] and instancia.baseframe.isLocked) then - - --> resizes, lock and ungroup buttons + + --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) end - - Details.FadeHandler.Fader (instancia.baseframe.button_stretch, "ALPHA", 0) - + + Details.FadeHandler.Fader(instancia.baseframe.button_stretch, "ALPHA", 0) + end end Details.OnLeaveMainWindow = OnLeaveMainWindow @@ -343,13 +343,13 @@ local function OnEnterMainWindow(instancia, self) if (instancia.modo ~= Details._detalhes_props["MODO_ALONE"] and not instancia.baseframe.isLocked) then - --> resize, lock and ungroup buttons + --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) - - --> ungroup + + --ungroup for _, instancia_id in pairs (instancia.snap) do if (instancia_id) then instancia.break_snap_button:SetAlpha(1) @@ -357,18 +357,18 @@ local function OnEnterMainWindow(instancia, self) end end end - - --> stretch button + + --stretch button if (not Details.disable_stretch_button) then - Details.FadeHandler.Fader (instancia.baseframe.button_stretch, "ALPHA", 0.4) + Details.FadeHandler.Fader(instancia.baseframe.button_stretch, "ALPHA", 0.4) end - + 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) - --> ungroup + --ungroup for _, instancia_id in pairs (instancia.snap) do if (instancia_id) then instancia.break_snap_button:Show() @@ -377,19 +377,19 @@ local function OnEnterMainWindow(instancia, self) end end end - + if (not Details.disable_stretch_button) then - Details.FadeHandler.Fader (instancia.baseframe.button_stretch, "ALPHA", 0.4) + Details.FadeHandler.Fader(instancia.baseframe.button_stretch, "ALPHA", 0.4) end end end Details.OnEnterMainWindow = OnEnterMainWindow local function VPL (instancia, esta_instancia) - --> conferir esquerda - if (instancia.ponto4.x-0.5 < esta_instancia.ponto1.x) then --> a janela esta a esquerda - if (instancia.ponto4.x+20 > esta_instancia.ponto1.x) then --> a janela esta a menos de 20 pixels de dist�ncia - if (instancia.ponto4.y < esta_instancia.ponto1.y + 100 and instancia.ponto4.y > esta_instancia.ponto1.y - 100) then --> a janela esta a +20 ou -20 pixels de dist�ncia na vertical + --conferir esquerda + if (instancia.ponto4.x-0.5 < esta_instancia.ponto1.x) then --a janela esta a esquerda + if (instancia.ponto4.x+20 > esta_instancia.ponto1.x) then --a janela esta a menos de 20 pixels de dist�ncia + if (instancia.ponto4.y < esta_instancia.ponto1.y + 100 and instancia.ponto4.y > esta_instancia.ponto1.y - 100) then --a janela esta a +20 ou -20 pixels de dist�ncia na vertical return 1 end end @@ -398,10 +398,10 @@ local function VPL (instancia, esta_instancia) end local function VPB (instancia, esta_instancia) - --> conferir baixo - if (instancia.ponto1.y+(20 * instancia.window_scale) < esta_instancia.ponto2.y - (16 * esta_instancia.window_scale)) then --> a janela esta em baixo - if (instancia.ponto1.x > esta_instancia.ponto2.x-100 and instancia.ponto1.x < esta_instancia.ponto2.x+100) then --> a janela esta a 20 pixels de dist�ncia para a esquerda ou para a direita - if (instancia.ponto1.y+(20 * instancia.window_scale) > esta_instancia.ponto2.y - (36 * esta_instancia.window_scale)) then --> esta a 20 pixels de dist�ncia + --conferir baixo + if (instancia.ponto1.y+(20 * instancia.window_scale) < esta_instancia.ponto2.y - (16 * esta_instancia.window_scale)) then --a janela esta em baixo + if (instancia.ponto1.x > esta_instancia.ponto2.x-100 and instancia.ponto1.x < esta_instancia.ponto2.x+100) then --a janela esta a 20 pixels de dist�ncia para a esquerda ou para a direita + if (instancia.ponto1.y+(20 * instancia.window_scale) > esta_instancia.ponto2.y - (36 * esta_instancia.window_scale)) then --esta a 20 pixels de dist�ncia return 2 end end @@ -410,10 +410,10 @@ local function VPB (instancia, esta_instancia) end local function VPR (instancia, esta_instancia) - --> conferir lateral direita - if (instancia.ponto2.x+0.5 > esta_instancia.ponto3.x) then --> a janela esta a direita - if (instancia.ponto2.x-20 < esta_instancia.ponto3.x) then --> a janela esta a menos de 20 pixels de dist�ncia - if (instancia.ponto2.y < esta_instancia.ponto3.y + 100 and instancia.ponto2.y > esta_instancia.ponto3.y - 100) then --> a janela esta a +20 ou -20 pixels de dist�ncia na vertical + --conferir lateral direita + if (instancia.ponto2.x+0.5 > esta_instancia.ponto3.x) then --a janela esta a direita + if (instancia.ponto2.x-20 < esta_instancia.ponto3.x) then --a janela esta a menos de 20 pixels de dist�ncia + if (instancia.ponto2.y < esta_instancia.ponto3.y + 100 and instancia.ponto2.y > esta_instancia.ponto3.y - 100) then --a janela esta a +20 ou -20 pixels de dist�ncia na vertical return 3 end end @@ -422,9 +422,9 @@ local function VPR (instancia, esta_instancia) end local function VPT (instancia, esta_instancia) - --> conferir cima - if (instancia.ponto3.y - (16 * instancia.window_scale) > esta_instancia.ponto4.y + (20 * esta_instancia.window_scale)) then --> a janela esta em cima - if (instancia.ponto3.x > esta_instancia.ponto4.x-100 and instancia.ponto3.x < esta_instancia.ponto4.x+100) then --> a janela esta a 20 pixels de dist�ncia para a esquerda ou para a direita + --conferir cima + if (instancia.ponto3.y - (16 * instancia.window_scale) > esta_instancia.ponto4.y + (20 * esta_instancia.window_scale)) then --a janela esta em cima + if (instancia.ponto3.x > esta_instancia.ponto4.x-100 and instancia.ponto3.x < esta_instancia.ponto4.x+100) then --a janela esta a 20 pixels de dist�ncia para a esquerda ou para a direita if (esta_instancia.ponto4.y+(40 * esta_instancia.window_scale) > instancia.ponto3.y - (16 * instancia.window_scale)) then return 4 end @@ -446,47 +446,47 @@ local show_instance_ids = function() local id_texture1 = instance.baseframe.id_texture1 if (not id_texture1) then --instancia. - instance.baseframe.id_texture1 = instance.floatingframe:CreateTexture (nil, "overlay") - instance.baseframe.id_texture2 = instance.floatingframe:CreateTexture (nil, "overlay") + 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]]) end - + local h = instance.baseframe:GetHeight() * 0.80 - instance.baseframe.id_texture1:SetSize (h, h) - instance.baseframe.id_texture2:SetSize (h, h) - + instance.baseframe.id_texture1:SetSize(h, h) + instance.baseframe.id_texture2:SetSize(h, h) + local id = instance:GetId() - + 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) - + 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) - + 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_texture1:Show() instance.baseframe.id_texture2:Show() else 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:Show() instance.baseframe.id_texture2:Hide() end @@ -497,30 +497,30 @@ end 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() - + target_instance_PosX = target_instance_PosX or 0 target_instance_PosY = target_instance_PosY or 0 moving_instance_PosX = moving_instance_PosX or 0 moving_instance_PosY = moving_instance_PosY or 0 - + local dX = target_instance_PosX - moving_instance_PosX local dY = target_instance_PosY - moving_instance_PosY local distance = (dX^2 + dY^2) ^ 0.5 local angle = atan2(dY, dX) - + local guide_balls = Details.guide_balls if (not guide_balls) then Details.guide_balls = {} guide_balls = Details.guide_balls end - - for index, ball in ipairs (guide_balls) do + + for index, ball in ipairs(guide_balls) do ball:Hide() end - + self.instance:AtualizaPontos() target_frame.instance:AtualizaPontos() - + local color = color_red local _R, _T, _L, _B = VPL (self.instance, target_frame.instance), VPB (self.instance, target_frame.instance), VPR (self.instance, target_frame.instance), VPT (self.instance, target_frame.instance) if (_R or _T or _L or _B) then @@ -535,14 +535,14 @@ local update_line = function(self, target_frame) local ball = guide_balls [i] if (not ball) then - ball = Details.overlay_frame:CreateTexture (nil, "Overlay") + ball = Details.overlay_frame:CreateTexture(nil, "Overlay") ball:SetTexture([[Interface\AddOns\Details\images\icons]]) - ball:SetSize (16, 16) + ball:SetSize(16, 16) 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() @@ -553,7 +553,7 @@ 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) @@ -564,44 +564,44 @@ local movement_onupdate = function(self, elapsed) if (instance_ids_shown and instance_ids_shown > 0.95) then show_instance_ids() instance_ids_shown = nil - + if (need_show_group_guide and not DetailsFramework.IsTimewalkWoW()) then - Details.MicroButtonAlert.Text:SetText (Loc["STRING_WINDOW1ATACH_DESC"]) + 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:Show() - + need_show_group_guide = nil end elseif (instance_ids_shown) then instance_ids_shown = instance_ids_shown + elapsed end - + if (tempo_movendo and tempo_movendo < 0) then - if (precisa_ativar) then --> se a inst�ncia estiver fechada - Details.FadeHandler.Fader (instancia_alvo.baseframe, "ALPHA", 0.15) - Details.FadeHandler.Fader (instancia_alvo.baseframe.cabecalho.ball, "ALPHA", 0.15) - Details.FadeHandler.Fader (instancia_alvo.baseframe.cabecalho.atributo_icon, "ALPHA", 0.15) + if (precisa_ativar) then --se a inst�ncia estiver fechada + Details.FadeHandler.Fader(instancia_alvo.baseframe, "ALPHA", 0.15) + Details.FadeHandler.Fader(instancia_alvo.baseframe.cabecalho.ball, "ALPHA", 0.15) + Details.FadeHandler.Fader(instancia_alvo.baseframe.cabecalho.atributo_icon, "ALPHA", 0.15) instancia_alvo:SaveMainWindowPosition() instancia_alvo:RestoreMainWindowPosition() precisa_ativar = false - + elseif (tempo_fades) then - + if (flash_bounce == 0) then - + flash_bounce = 1 local tem_livre = false - - for lado, livre in ipairs (nao_anexados) do + + for lado, livre in ipairs(nao_anexados) do if (livre) then if (lado == 1) then - + local texture = instancia_alvo.h_esquerda.texture texture:ClearAllPoints() - + if (instancia_alvo.toolbar_side == 1) then if (instancia_alvo.show_statusbar) then texture:SetPoint("topright", instancia_alvo.baseframe, "topleft", 0, 20) @@ -619,16 +619,16 @@ local movement_onupdate = function(self, elapsed) texture:SetPoint("bottomright", instancia_alvo.baseframe, "bottomleft", 0, -20) end end - + instancia_alvo.h_esquerda:Flash (1, 1, 2.0, false, 0, 0) tem_livre = true - + elseif (lado == 2) then - - + + local texture = instancia_alvo.h_baixo.texture texture:ClearAllPoints() - + if (instancia_alvo.toolbar_side == 1) then if (instancia_alvo.show_statusbar) then texture:SetPoint("topleft", instancia_alvo.baseframe, "bottomleft", 0, -14) @@ -646,15 +646,15 @@ local movement_onupdate = function(self, elapsed) texture:SetPoint("topright", instancia_alvo.baseframe, "bottomright", 0, -20) end end - + instancia_alvo.h_baixo:Flash (1, 1, 2.0, false, 0, 0) tem_livre = true - + elseif (lado == 3) then - + local texture = instancia_alvo.h_direita.texture texture:ClearAllPoints() - + if (instancia_alvo.toolbar_side == 1) then if (instancia_alvo.show_statusbar) then texture:SetPoint("topleft", instancia_alvo.baseframe, "topright", 0, 20) @@ -672,15 +672,15 @@ local movement_onupdate = function(self, elapsed) texture:SetPoint("bottomleft", instancia_alvo.baseframe, "bottomright", 0, -20) end end - + instancia_alvo.h_direita:Flash (1, 1, 2.0, false, 0, 0) tem_livre = true - + elseif (lado == 4) then - + local texture = instancia_alvo.h_cima.texture 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) @@ -688,21 +688,21 @@ local movement_onupdate = function(self, elapsed) 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) tem_livre = true - + end end end - + if (tem_livre) then if (not Details.snap_alert.playing) then instancia_alvo:SnapAlert() Details.snap_alert.playing = true - + 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.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:Show() @@ -710,49 +710,49 @@ local movement_onupdate = function(self, elapsed) end end end - + tempo_movendo = 1 else - self:SetScript ("OnUpdate", nil) + self:SetScript("OnUpdate", nil) tempo_movendo = 1 end - + elseif (tempo_movendo) then tempo_movendo = tempo_movendo - elapsed end end -local function move_janela (baseframe, iniciando, instancia, just_updating) +local function move_janela(baseframe, iniciando, instancia, just_updating) instancia_alvo = Details.tabela_instancias [instancia.meu_id-1] if (Details.disable_window_groups) then instancia_alvo = nil end - + if (iniciando) then if (baseframe.isMoving) then - --> ja esta em movimento + --ja esta em movimento return end - + baseframe.isMoving = true instancia:BaseFrameSnap() baseframe:StartMoving() - + local group = instancia:GetInstanceGroup() - for _, this_instance in ipairs (group) do + for _, this_instance in ipairs(group) do this_instance.baseframe:SetClampRectInsets (0, 0, 0, 0) this_instance.isMoving = true end - + local _, ClampLeft, ClampRight = instancia:InstanciasHorizontais() local _, ClampBottom, ClampTop = instancia:InstanciasVerticais() - + baseframe:SetClampRectInsets (-ClampLeft, ClampRight, ClampTop, -ClampBottom) if (instancia_alvo and (instancia_alvo.ativa or not just_updating)) then - + tempo_fades = 1.0 nao_anexados = {true, true, true, true} tempo_movendo = 1 @@ -760,13 +760,13 @@ local function move_janela (baseframe, iniciando, instancia, just_updating) instance_ids_shown = 0 start_draw_lines = 0 need_show_group_guide = nil - + for lado, snap_to in pairs (instancia_alvo.snap) do if (snap_to == instancia.meu_id) then start_draw_lines = false end end - + for lado, snap_to in pairs (instancia_alvo.snap) do if (snap_to) then if (snap_to == instancia.meu_id) then @@ -776,7 +776,7 @@ local function move_janela (baseframe, iniciando, instancia, just_updating) nao_anexados [lado] = false end end - + for lado = 1, 4 do if (instancia_alvo.horizontalSnap and instancia.verticalSnap) then nao_anexados [lado] = false @@ -793,61 +793,61 @@ local function move_janela (baseframe, iniciando, instancia, just_updating) local need_start = not instancia_alvo.iniciada precisa_ativar = not instancia_alvo.ativa - - if (need_start) then --> se a inst�ncia n�o tiver sido aberta ainda + + if (need_start) then --se a inst�ncia n�o tiver sido aberta ainda local lower_instance = Details:GetLowerInstanceNumber() - + instancia_alvo:RestauraJanela(instancia_alvo.meu_id, true) if (instancia_alvo:IsSoloMode()) then Details.SoloTables:switch() end - + instancia_alvo.ativa = false - + instancia_alvo:SaveMainWindowPosition() instancia_alvo:RestoreMainWindowPosition() - + Details.FadeHandler.Fader(instancia_alvo.baseframe, 1) Details.FadeHandler.Fader(instancia_alvo.rowframe, parseRowFrameAlpha(1)) Details.FadeHandler.Fader(instancia_alvo.baseframe.cabecalho.ball, 1) - + need_start = false end - - baseframe:SetScript ("OnUpdate", movement_onupdate) + + baseframe:SetScript("OnUpdate", movement_onupdate) else - --> eh a instancia 1 + --eh a instancia 1 local got_snap for side, instance_id in pairs (instancia.snap) do if (instance_id) then got_snap = true end end - + need_show_group_guide = nil - + if (not got_snap) then need_show_group_guide = instancia end - + tempo_movendo = nil start_draw_lines = nil instance_ids_shown = 0 - baseframe:SetScript ("OnUpdate", movement_onupdate) + baseframe:SetScript("OnUpdate", movement_onupdate) end - + else baseframe:StopMovingOrSizing() baseframe.isMoving = false - baseframe:SetScript ("OnUpdate", nil) + baseframe:SetScript("OnUpdate", nil) if (Details.guide_balls) then - for index, ball in ipairs (Details.guide_balls) do + for index, ball in ipairs(Details.guide_balls) do ball:Hide() end end - + for _, ins in Details:ListInstances() do if (ins.baseframe) then ins.baseframe:SetUserPlaced (false) @@ -863,18 +863,18 @@ local function move_janela (baseframe, iniciando, instancia, just_updating) if (instancia_alvo and not instancia.do_not_snap and not instancia_alvo.do_not_snap) then instancia:AtualizaPontos() instancia_alvo:AtualizaPontos() - + local esquerda, baixo, direita, cima - local meu_id = instancia.meu_id --> id da inst�ncia que esta sendo movida - + local meu_id = instancia.meu_id --id da inst�ncia que esta sendo movida + local isVertical = instancia_alvo.verticalSnap local isHorizontal = instancia_alvo.horizontalSnap - + local isSelfVertical = instancia.verticalSnap local isSelfHorizontal = instancia.horizontalSnap - + local _R, _T, _L, _B - + if (isVertical and not isSelfHorizontal) then _T, _B = VPB (instancia, instancia_alvo), VPT (instancia, instancia_alvo) elseif (isHorizontal and not isSelfVertical) then @@ -882,7 +882,7 @@ local function move_janela (baseframe, iniciando, instancia, just_updating) elseif (not isVertical and not isHorizontal) then _R, _T, _L, _B = VPL (instancia, instancia_alvo), VPB (instancia, instancia_alvo), VPR (instancia, instancia_alvo), VPT (instancia, instancia_alvo) end - + if (_L) then if (not instancia:EstaAgrupada (instancia_alvo, _L)) then esquerda = instancia_alvo.meu_id @@ -890,7 +890,7 @@ local function move_janela (baseframe, iniciando, instancia, just_updating) instancia_alvo.horizontalSnap = true end end - + if (_B) then if (not instancia:EstaAgrupada (instancia_alvo, _B)) then baixo = instancia_alvo.meu_id @@ -898,7 +898,7 @@ local function move_janela (baseframe, iniciando, instancia, just_updating) instancia_alvo.verticalSnap = true end end - + if (_R) then if (not instancia:EstaAgrupada (instancia_alvo, _R)) then direita = instancia_alvo.meu_id @@ -906,7 +906,7 @@ local function move_janela (baseframe, iniciando, instancia, just_updating) instancia_alvo.horizontalSnap = true end end - + if (_T) then if (not instancia:EstaAgrupada (instancia_alvo, _T)) then cima = instancia_alvo.meu_id @@ -914,33 +914,33 @@ local function move_janela (baseframe, iniciando, instancia, just_updating) instancia_alvo.verticalSnap = true end end - + if (esquerda or baixo or direita or cima) then instancia:agrupar_janelas ({esquerda, baixo, direita, cima}) - - --> tutorial + + --tutorial if (not Details:GetTutorialCVar ("WINDOW_GROUP_MAKING1")) then Details:SetTutorialCVar ("WINDOW_GROUP_MAKING1", true) - - local group_tutorial = CreateFrame ("frame", "DetailsWindowGroupPopUp1", instancia.baseframe, "DetailsHelpBoxTemplate") + + local group_tutorial = CreateFrame("frame", "DetailsWindowGroupPopUp1", instancia.baseframe, "DetailsHelpBoxTemplate") group_tutorial.ArrowUP:Show() group_tutorial.ArrowGlowUP:Show() - group_tutorial.Text:SetText (Loc["STRING_MINITUTORIAL_WINDOWS1"]) + group_tutorial.Text:SetText(Loc["STRING_MINITUTORIAL_WINDOWS1"]) group_tutorial:SetPoint("bottom", instancia_alvo.break_snap_button, "top", 0, 24) group_tutorial:Show() - Details.OnEnterMainWindow (instancia_alvo) - + Details.OnEnterMainWindow(instancia_alvo) + end end - for _, esta_instancia in ipairs (Details.tabela_instancias) do + for _, esta_instancia in ipairs(Details.tabela_instancias) do if (not esta_instancia:IsAtiva() and esta_instancia.iniciada) then esta_instancia:ResetaGump() - - Details.FadeHandler.Fader (esta_instancia.baseframe, "in", 0.15) - Details.FadeHandler.Fader (esta_instancia.baseframe.cabecalho.ball, "in", 0.15) - Details.FadeHandler.Fader (esta_instancia.baseframe.cabecalho.atributo_icon, "in", 0.15) - + + Details.FadeHandler.Fader(esta_instancia.baseframe, "in", 0.15) + Details.FadeHandler.Fader(esta_instancia.baseframe.cabecalho.ball, "in", 0.15) + Details.FadeHandler.Fader(esta_instancia.baseframe.cabecalho.atributo_icon, "in", 0.15) + if (esta_instancia.modo == modo_raid) then Details.raid = nil elseif (esta_instancia.modo == modo_alone) then @@ -956,23 +956,23 @@ local function move_janela (baseframe, iniciando, instancia, just_updating) end - --> salva pos de todas as janelas - for _, ins in ipairs (Details.tabela_instancias) do + --salva pos de todas as janelas + for _, ins in ipairs(Details.tabela_instancias) do if (ins:IsEnabled()) then ins:SaveMainWindowPosition() ins:RestoreMainWindowPosition() end end - + local group = instancia:GetInstanceGroup() - for _, this_instance in ipairs (group) do + for _, this_instance in ipairs(group) do this_instance.isMoving = false end Details.snap_alert.playing = false Details.snap_alert.animIn:Stop() Details.snap_alert.animOut:Play() - + if (not DetailsFramework.IsTimewalkWoW()) then Details.MicroButtonAlert:Hide() end @@ -983,17 +983,17 @@ local function move_janela (baseframe, iniciando, instancia, just_updating) instancia_alvo.h_direita:Stop() instancia_alvo.h_cima:Stop() end - + end end Details.move_janela_func = move_janela local BGFrame_scripts_onenter = function(self) - OnEnterMainWindow (self._instance, self) + OnEnterMainWindow(self._instance, self) end local BGFrame_scripts_onleave = function(self) - OnLeaveMainWindow (self._instance, self) + OnLeaveMainWindow(self._instance, self) end local BGFrame_scripts_onmousedown = function(self, button) @@ -1004,13 +1004,13 @@ local BGFrame_scripts_onmousedown = function(self, button) end if (self._instance.baseframe.isMoving) then - move_janela (self._instance.baseframe, false, self._instance) + move_janela(self._instance.baseframe, false, self._instance) self._instance:SaveMainWindowPosition() return end - + if (not self._instance.baseframe.isLocked and button == "LeftButton") then - move_janela (self._instance.baseframe, true, self._instance) + 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) @@ -1037,9 +1037,9 @@ local BGFrame_scripts_onmouseup = function(self, button) end return self._instance.baseframe.button_stretch:GetScript ("OnMouseUp") (self._instance.baseframe.button_stretch, "LeftButton") end - + if (self._instance.baseframe.isMoving) then - move_janela (self._instance.baseframe, false, self._instance) --> novo movedor da janela + move_janela(self._instance.baseframe, false, self._instance) --novo movedor da janela 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 @@ -1049,56 +1049,56 @@ local BGFrame_scripts_onmouseup = function(self, button) end end -local function BGFrame_scripts (BG, baseframe, instancia) +local function BGFrame_scripts(BG, baseframe, instancia) BG._instance = instancia - BG:SetScript ("OnEnter", BGFrame_scripts_onenter) - BG:SetScript ("OnLeave", BGFrame_scripts_onleave) - BG:SetScript ("OnMouseDown", BGFrame_scripts_onmousedown) - BG:SetScript ("OnMouseUp", BGFrame_scripts_onmouseup) + BG:SetScript("OnEnter", BGFrame_scripts_onenter) + BG:SetScript("OnLeave", BGFrame_scripts_onleave) + BG:SetScript("OnMouseDown", BGFrame_scripts_onmousedown) + BG:SetScript("OnMouseUp", BGFrame_scripts_onmouseup) 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 + 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 + move_janela(instancia.baseframe, false, instancia) --novo movedor da janela instancia:SaveMainWindowPosition() end - end) + end) end ---> scripts do base frame +--scripts do base frame local BFrame_scripts_onsizechange = function(self) self._instance:SaveMainWindowSize() self._instance:ReajustaGump() self._instance.oldwith = self:GetWidth() - Details:SendEvent ("DETAILS_INSTANCE_SIZECHANGED", nil, self._instance) + Details:SendEvent("DETAILS_INSTANCE_SIZECHANGED", nil, self._instance) self._instance:RefreshAttributeTextSize() end local BFrame_scripts_onenter = function(self) - OnEnterMainWindow (self._instance, self) + OnEnterMainWindow(self._instance, self) end local BFrame_scripts_onleave = function(self) - OnLeaveMainWindow (self._instance, self) + OnLeaveMainWindow(self._instance, self) end local BFrame_scripts_onmousedown = function(self, button) if (not self.isLocked and button == "LeftButton") then - move_janela (self, true, self._instance) + move_janela(self, true, self._instance) end end local BFrame_scripts_onmouseup = function(self, button) if (self.isMoving) then - move_janela (self, false, self._instance) --> novo movedor da janela + move_janela(self, false, self._instance) --novo movedor da janela self._instance:SaveMainWindowPosition() end end @@ -1108,45 +1108,45 @@ local function BFrame_scripts (baseframe, instancia) baseframe:SetScript("OnSizeChanged", BFrame_scripts_onsizechange) baseframe:SetScript("OnEnter", BFrame_scripts_onenter) baseframe:SetScript("OnLeave", BFrame_scripts_onleave) - baseframe:SetScript ("OnMouseDown", BFrame_scripts_onmousedown) - baseframe:SetScript ("OnMouseUp", BFrame_scripts_onmouseup) + baseframe:SetScript("OnMouseDown", BFrame_scripts_onmousedown) + baseframe:SetScript("OnMouseUp", BFrame_scripts_onmouseup) end local function backgrounddisplay_scripts (backgrounddisplay, baseframe, instancia) - backgrounddisplay:SetScript ("OnEnter", function(self) - OnEnterMainWindow (instancia, self) + backgrounddisplay:SetScript("OnEnter", function(self) + OnEnterMainWindow(instancia, self) end) - - backgrounddisplay:SetScript ("OnLeave", function(self) - OnLeaveMainWindow (instancia, self) + + backgrounddisplay:SetScript("OnLeave", function(self) + OnLeaveMainWindow(instancia, self) end) end local function instancias_horizontais (instancia, largura, esquerda, direita) if (esquerda) then - for lado, esta_instancia in pairs (instancia.snap) do - if (lado == 1) then --> movendo para esquerda + 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.auto_resize = true instancia:ReajustaGump() instancia.auto_resize = false instancias_horizontais (instancia, largura, true, false) - Details:SendEvent ("DETAILS_INSTANCE_SIZECHANGED", nil, instancia) + Details:SendEvent("DETAILS_INSTANCE_SIZECHANGED", nil, instancia) end end end - + if (direita) then - for lado, esta_instancia in pairs (instancia.snap) do - if (lado == 3) then --> movendo para esquerda + 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.auto_resize = true instancia:ReajustaGump() instancia.auto_resize = false instancias_horizontais (instancia, largura, false, true) - Details:SendEvent ("DETAILS_INSTANCE_SIZECHANGED", nil, instancia) + Details:SendEvent("DETAILS_INSTANCE_SIZECHANGED", nil, instancia) end end end @@ -1154,8 +1154,8 @@ end local function instancias_verticais (instancia, altura, esquerda, direita) if (esquerda) then - for lado, esta_instancia in pairs (instancia.snap) do - if (lado == 1) then --> movendo para esquerda + for lado, esta_instancia in pairs (instancia.snap) do + if (lado == 1) then --movendo para esquerda local instancia = Details.tabela_instancias [esta_instancia] if (instancia:IsEnabled()) then instancia.baseframe:SetHeight(altura) @@ -1163,15 +1163,15 @@ local function instancias_verticais (instancia, altura, esquerda, direita) instancia:ReajustaGump() instancia.auto_resize = false instancias_verticais (instancia, altura, true, false) - Details:SendEvent ("DETAILS_INSTANCE_SIZECHANGED", nil, instancia) + Details:SendEvent("DETAILS_INSTANCE_SIZECHANGED", nil, instancia) end end end end - + if (direita) then - for lado, esta_instancia in pairs (instancia.snap) do - if (lado == 3) then --> movendo para esquerda + for lado, esta_instancia in pairs (instancia.snap) do + if (lado == 3) then --movendo para esquerda local instancia = Details.tabela_instancias [esta_instancia] if (instancia:IsEnabled()) then instancia.baseframe:SetHeight(altura) @@ -1179,7 +1179,7 @@ local function instancias_verticais (instancia, altura, esquerda, direita) instancia:ReajustaGump() instancia.auto_resize = false instancias_verticais (instancia, altura, false, true) - Details:SendEvent ("DETAILS_INSTANCE_SIZECHANGED", nil, instancia) + Details:SendEvent("DETAILS_INSTANCE_SIZECHANGED", nil, instancia) end end end @@ -1197,15 +1197,15 @@ end function Details:InstanciasVerticais (instance) instance = self or instance - + local on_top = {} local on_bottom = {} local id = instance:GetId() - + --lower instances local this_instance = Details:GetInstance (id-1) if (this_instance) then - --> top side + --top side if (this_instance.snap [2] and this_instance.snap [2] == id) then local cid = id local snapid = 2 @@ -1216,7 +1216,7 @@ function Details:InstanciasVerticais (instance) break end end - --> bottom side + --bottom side elseif (this_instance.snap [4] and this_instance.snap [4] == id) then local cid = id local snapid = 4 @@ -1233,7 +1233,7 @@ function Details:InstanciasVerticais (instance) --upper instances local this_instance = Details:GetInstance (id+1) if (this_instance) then - --> top side + --top side if (this_instance.snap [2] and this_instance.snap [2] == id) then local cid = id local snapid = 2 @@ -1244,7 +1244,7 @@ function Details:InstanciasVerticais (instance) break end end - --> bottom side + --bottom side elseif (this_instance.snap [4] and this_instance.snap [4] == id) then local cid = id local snapid = 4 @@ -1257,11 +1257,11 @@ function Details:InstanciasVerticais (instance) end end end - - --> calc top clamp + + --calc top clamp local top_clamp = 0 local bottom_clamp = 0 - + if (instance.toolbar_side == 1) then top_clamp = top_clamp + 20 elseif (instance.toolbar_side == 2) then @@ -1270,16 +1270,16 @@ function Details:InstanciasVerticais (instance) if (instance.show_statusbar) then bottom_clamp = bottom_clamp + 14 end - - for cid, this_instance in ipairs (on_top) do + + for cid, this_instance in ipairs(on_top) do if (this_instance.show_statusbar) then top_clamp = top_clamp + 14 end top_clamp = top_clamp + 20 top_clamp = top_clamp + this_instance.baseframe:GetHeight() end - - for cid, this_instance in ipairs (on_bottom) do + + for cid, this_instance in ipairs(on_bottom) do if (this_instance.show_statusbar) then bottom_clamp = bottom_clamp + 14 end @@ -1307,15 +1307,15 @@ function Details:InstanciasHorizontais (instancia) instancia = self or instancia local linha_horizontal, esquerda, direita = {}, 0, 0 - + local top, bottom = 0, 0 local checking = instancia - + local check_index_anterior = Details.tabela_instancias [instancia.meu_id-1] - if (check_index_anterior and check_index_anterior:IsEnabled()) then --> possiu uma inst�ncia antes de mim - if (check_index_anterior.snap[3] and check_index_anterior.snap[3] == instancia.meu_id) then --> o index negativo vai para a esquerda - for i = instancia.meu_id-1, 1, -1 do + if (check_index_anterior and check_index_anterior:IsEnabled()) then --possiu uma inst�ncia antes de mim + if (check_index_anterior.snap[3] and check_index_anterior.snap[3] == instancia.meu_id) then --o index negativo vai para a esquerda + for i = instancia.meu_id-1, 1, -1 do local esta_instancia = Details.tabela_instancias [i] if (esta_instancia.snap[3]) then if (esta_instancia.snap[3] == checking.meu_id) then @@ -1327,8 +1327,8 @@ function Details:InstanciasHorizontais (instancia) break end end - elseif (check_index_anterior.snap[1] and check_index_anterior.snap[1] == instancia.meu_id) then --> o index negativo vai para a direita - for i = instancia.meu_id-1, 1, -1 do + elseif (check_index_anterior.snap[1] and check_index_anterior.snap[1] == instancia.meu_id) then --o index negativo vai para a direita + for i = instancia.meu_id-1, 1, -1 do local esta_instancia = Details.tabela_instancias [i] if (esta_instancia.snap[1]) then if (esta_instancia.snap[1] == checking.meu_id) then @@ -1342,13 +1342,13 @@ function Details:InstanciasHorizontais (instancia) end end end - + checking = instancia - + local check_index_posterior = Details.tabela_instancias [instancia.meu_id+1] if (check_index_posterior and check_index_posterior:IsEnabled()) then - if (check_index_posterior.snap[3] and check_index_posterior.snap[3] == instancia.meu_id) then --> o index posterior vai para a esquerda - for i = instancia.meu_id+1, #Details.tabela_instancias do + if (check_index_posterior.snap[3] and check_index_posterior.snap[3] == instancia.meu_id) then --o index posterior vai para a esquerda + for i = instancia.meu_id+1, #Details.tabela_instancias do local esta_instancia = Details.tabela_instancias [i] if (esta_instancia.snap[3]) then if (esta_instancia.snap[3] == checking.meu_id) then @@ -1360,8 +1360,8 @@ function Details:InstanciasHorizontais (instancia) break end end - elseif (check_index_posterior.snap[1] and check_index_posterior.snap[1] == instancia.meu_id) then --> o index posterior vai para a direita - for i = instancia.meu_id+1, #Details.tabela_instancias do + elseif (check_index_posterior.snap[1] and check_index_posterior.snap[1] == instancia.meu_id) then --o index posterior vai para a direita + for i = instancia.meu_id+1, #Details.tabela_instancias do local esta_instancia = Details.tabela_instancias [i] if (esta_instancia.snap[1]) then if (esta_instancia.snap[1] == checking.meu_id) then @@ -1377,38 +1377,38 @@ function Details:InstanciasHorizontais (instancia) end return linha_horizontal, esquerda, direita, bottom, top - + end local resizeTooltip = { {text = "|cff33CC00Click|cffEEEEEE: ".. Loc["STRING_RESIZE_COMMON"]}, - + {text = "+|cff33CC00 Click|cffEEEEEE: " .. Loc["STRING_RESIZE_HORIZONTAL"]}, {icon = [[Interface\AddOns\Details\images\key_shift]], width = 24, height = 14, l = 0, r = 1, t = 0, b =0.640625}, - + {text = "+|cff33CC00 Click|cffEEEEEE: " .. Loc["STRING_RESIZE_VERTICAL"]}, {icon = [[Interface\AddOns\Details\images\key_alt]], width = 24, height = 14, l = 0, r = 1, t = 0, b =0.640625}, - + {text = "+|cff33CC00 Click|cffEEEEEE: " .. Loc["STRING_RESIZE_ALL"]}, {icon = [[Interface\AddOns\Details\images\key_ctrl]], width = 24, height = 14, l = 0, r = 1, t = 0, b =0.640625} } ---> search key: ~resizescript +--search key: ~resizescript local resize_scripts_onmousedown = function(self, button) - _G.GameCooltip:ShowMe (false) --> Hide Cooltip - + _G.GameCooltip:ShowMe (false) --Hide Cooltip + if (Details.disable_lock_ungroup_buttons) then return end - - if (not self:GetParent().isLocked and button == "LeftButton" and self._instance.modo ~= Details._detalhes_props["MODO_ALONE"]) then + + if (not self:GetParent().isLocked and button == "LeftButton" and self._instance.modo ~= Details._detalhes_props["MODO_ALONE"]) then self:GetParent().isResizing = true self._instance:BaseFrameSnap() local isVertical = self._instance.verticalSnap local isHorizontal = self._instance.horizontalSnap - + local agrupadas if (self._instance.verticalSnap) then agrupadas = self._instance:InstanciasVerticais() @@ -1418,14 +1418,14 @@ local resize_scripts_onmousedown = function(self, button) self._instance.stretchToo = agrupadas if (self._instance.stretchToo and #self._instance.stretchToo > 0) then - for _, esta_instancia in ipairs (self._instance.stretchToo) do + for _, esta_instancia in ipairs(self._instance.stretchToo) do esta_instancia.baseframe._place = esta_instancia:SaveMainWindowPosition() esta_instancia.baseframe.isResizing = true end end - + ---------------- - + if (self._myside == "<") then if (_IsShiftKeyDown()) then self._instance.baseframe:StartSizing("left") @@ -1439,10 +1439,10 @@ local resize_scripts_onmousedown = function(self, button) else self._instance.baseframe:StartSizing("bottomleft") end - + self:SetPoint("bottomleft", self._instance.baseframe, "bottomleft", -1, -1) self.afundado = true - + elseif (self._myside == ">") then if (_IsShiftKeyDown()) then self._instance.baseframe:StartSizing ("right") @@ -1456,7 +1456,7 @@ local resize_scripts_onmousedown = function(self, button) else self._instance.baseframe:StartSizing ("bottomright") end - + if (self._instance.rolagem and Details.use_scroll) then self:SetPoint("bottomright", self._instance.baseframe, "bottomright", (self._instance.largura_scroll*-1) + 1, -1) else @@ -1464,15 +1464,15 @@ local resize_scripts_onmousedown = function(self, button) end self.afundado = true end - - Details:SendEvent ("DETAILS_INSTANCE_STARTRESIZE", nil, self._instance) + + Details:SendEvent("DETAILS_INSTANCE_STARTRESIZE", nil, self._instance) if (Details.update_speed > 0.3) then Details:SetWindowUpdateSpeed (0.3, true) Details.resize_changed_update_speed = true end - - end + + end end local resize_scripts_onmouseup = function(self, button) @@ -1494,52 +1494,52 @@ local resize_scripts_onmouseup = function(self, button) end end - if (self:GetParent().isResizing) then - + if (self:GetParent().isResizing) then + self:GetParent():StopMovingOrSizing() self:GetParent().isResizing = false - + self._instance:RefreshBars() self._instance:InstanceReset() self._instance:ReajustaGump() - + if (self._instance.stretchToo and #self._instance.stretchToo > 0) then - for _, esta_instancia in ipairs (self._instance.stretchToo) do + for _, esta_instancia in ipairs(self._instance.stretchToo) do esta_instancia.baseframe:StopMovingOrSizing() esta_instancia.baseframe.isResizing = false esta_instancia:RefreshBars() esta_instancia:InstanceReset() esta_instancia:ReajustaGump() - Details:SendEvent ("DETAILS_INSTANCE_SIZECHANGED", nil, esta_instancia) + Details:SendEvent("DETAILS_INSTANCE_SIZECHANGED", nil, esta_instancia) end self._instance.stretchToo = nil - end - + end + local largura = self._instance.baseframe:GetWidth() local altura = self._instance.baseframe:GetHeight() - + if (self._instance.eh_horizontal) then instancias_horizontais (self._instance, largura, true, true) self._instance.eh_horizontal = nil end - + --if (instancia.eh_vertical) then instancias_verticais (self._instance, altura, true, true) self._instance.eh_vertical = nil --end - - Details:SendEvent ("DETAILS_INSTANCE_ENDRESIZE", nil, self._instance) - + + Details:SendEvent("DETAILS_INSTANCE_ENDRESIZE", nil, self._instance) + if (self._instance.eh_tudo) then - for _, esta_instancia in ipairs (Details.tabela_instancias) do + for _, esta_instancia in ipairs(Details.tabela_instancias) do if (esta_instancia:IsAtiva() and esta_instancia.modo ~= Details._detalhes_props["MODO_ALONE"]) then esta_instancia.baseframe:ClearAllPoints() esta_instancia:SaveMainWindowPosition() esta_instancia:RestoreMainWindowPosition() end end - - for _, esta_instancia in ipairs (Details.tabela_instancias) do + + 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) @@ -1548,28 +1548,28 @@ local resize_scripts_onmouseup = function(self, button) esta_instancia:InstanceReset() esta_instancia:ReajustaGump() esta_instancia.auto_resize = false - Details:SendEvent ("DETAILS_INSTANCE_SIZECHANGED", nil, esta_instancia) + Details:SendEvent("DETAILS_INSTANCE_SIZECHANGED", nil, esta_instancia) end end self._instance.eh_tudo = nil end - + self._instance:BaseFrameSnap() - - for _, esta_instancia in ipairs (Details.tabela_instancias) do + + for _, esta_instancia in ipairs(Details.tabela_instancias) do if (esta_instancia:IsAtiva()) then esta_instancia:SaveMainWindowPosition() esta_instancia:RestoreMainWindowPosition() end end - + if (Details.resize_changed_update_speed) then Details:SetWindowUpdateSpeed (false, true) Details.resize_changed_update_speed = nil end - - end + + end end local resize_scripts_onhide = function(self) @@ -1587,11 +1587,11 @@ local resize_scripts_onenter = function(self) if (self._instance.modo ~= Details._detalhes_props["MODO_ALONE"] and not self._instance.baseframe.isLocked and not self.mostrando) then - OnEnterMainWindow (self._instance, self) - - self.texture:SetBlendMode ("ADD") + OnEnterMainWindow(self._instance, self) + + self.texture:SetBlendMode("ADD") self.mostrando = true - + Details:CooltipPreset (2.1) GameCooltip:AddFromTable (resizeTooltip) @@ -1604,12 +1604,12 @@ local resize_scripts_onleave = function(self) if (self.mostrando) then self.going_hide = true if (not self.movendo) then - OnLeaveMainWindow (self._instance, self) + OnLeaveMainWindow(self._instance, self) end - self.texture:SetBlendMode ("BLEND") + self.texture:SetBlendMode("BLEND") self.mostrando = false - + GameCooltip:ShowMe (false) end end @@ -1618,11 +1618,11 @@ local function resize_scripts (resizer, instancia, scrollbar, side, baseframe) resizer._instance = instancia resizer._myside = side - resizer:SetScript ("OnMouseDown", resize_scripts_onmousedown) - resizer:SetScript ("OnMouseUp", resize_scripts_onmouseup) - resizer:SetScript ("OnHide", resize_scripts_onhide) - resizer:SetScript ("OnEnter", resize_scripts_onenter) - resizer:SetScript ("OnLeave", resize_scripts_onleave) + resizer:SetScript("OnMouseDown", resize_scripts_onmousedown) + resizer:SetScript("OnMouseUp", resize_scripts_onmouseup) + resizer:SetScript("OnHide", resize_scripts_onhide) + resizer:SetScript("OnEnter", resize_scripts_onenter) + resizer:SetScript("OnLeave", resize_scripts_onleave) end local lockButtonTooltip = { @@ -1637,10 +1637,10 @@ local lockFunctionOnEnter = function(self) end if (self.instancia.modo ~= Details._detalhes_props["MODO_ALONE"] and not self.mostrando) then - OnEnterMainWindow (self.instancia, self) - + OnEnterMainWindow(self.instancia, self) + self.mostrando = true - + self.label:SetTextColor(1, 1, 1, .6) Details:CooltipPreset (2.1) @@ -1651,11 +1651,11 @@ local lockFunctionOnEnter = function(self) GameCooltip:ShowCooltip() end end - + local lockFunctionOnLeave = function(self) if (self.mostrando) then self.going_hide = true - OnLeaveMainWindow (self.instancia, self) + OnLeaveMainWindow(self.instancia, self) self.label:SetTextColor(.6, .6, .6, .7) self.mostrando = false GameCooltip:ShowMe (false) @@ -1682,15 +1682,15 @@ function Details:RefreshLockedState() elseif (not self.baseframe) then return end - + if (self.baseframe.isLocked) then 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_esquerda:EnableMouse(true) end - + return true end @@ -1709,42 +1709,42 @@ local lockFunctionOnClick = function(button, button_type, button2, isFromOptions if (baseframe.isLocked) then baseframe.isLocked = false baseframe.instance.isLocked = false - button.label:SetText (Loc["STRING_LOCK_WINDOW"]) + button.label:SetText(Loc["STRING_LOCK_WINDOW"]) button:SetWidth(button.label:GetStringWidth()+2) - + if (not Details.disable_lock_ungroup_buttons) then 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 + --tutorial if (not Details:GetTutorialCVar ("WINDOW_LOCK_UNLOCK1") and not Details.initializing) then Details:SetTutorialCVar ("WINDOW_LOCK_UNLOCK1", true) - - local lock_tutorial = CreateFrame ("frame", "DetailsWindowLockPopUp1", baseframe, "DetailsHelpBoxTemplate") + + local lock_tutorial = CreateFrame("frame", "DetailsWindowLockPopUp1", baseframe, "DetailsHelpBoxTemplate") lock_tutorial.ArrowUP:Show() lock_tutorial.ArrowGlowUP:Show() - lock_tutorial.Text:SetText (Loc["STRING_MINITUTORIAL_WINDOWS2"]) + lock_tutorial.Text:SetText(Loc["STRING_MINITUTORIAL_WINDOWS2"]) lock_tutorial:SetPoint("bottom", baseframe.UPFrame, "top", 0, 20) lock_tutorial:Show() - - end - + + end + baseframe.isLocked = true baseframe.instance.isLocked = true - button.label:SetText (Loc["STRING_UNLOCK_WINDOW"]) + button.label:SetText(Loc["STRING_UNLOCK_WINDOW"]) 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) end - + baseframe.instance:RefreshLockedState() - + Details:DelayOptionsRefresh() end @@ -1768,37 +1768,37 @@ local unSnapButtonOnEnter = function(self) break end end - + if (not have_snap) then - OnEnterMainWindow (self.instancia, self) + OnEnterMainWindow(self.instancia, self) self.mostrando = true return end - OnEnterMainWindow (self.instancia, self) + OnEnterMainWindow(self.instancia, self) self.mostrando = true - + Details:CooltipPreset (2.1) GameCooltip:SetOption("FixedWidth", 180) GameCooltip:AddFromTable (unSnapButtonTooltip) - + GameCooltip:ShowCooltip (self, "tooltip") - + end local unSnapButtonOnLeave = function(self) if (self.mostrando) then - OnLeaveMainWindow (self.instancia, self) + OnLeaveMainWindow(self.instancia, self) self.mostrando = false GameCooltip:Hide() end end ---> this should run only when the mouse is over a instance bar +--this should run only when the mouse is over a instance bar local shift_monitor = function(self) if (not self:IsMouseOver()) then - self:SetScript ("OnUpdate", shift_monitor) + self:SetScript("OnUpdate", shift_monitor) return end @@ -1806,149 +1806,140 @@ local shift_monitor = function(self) if (not self.showing_allspells) then self.showing_allspells = true local instancia = Details:GetInstance (self.instance_id) - instancia:MontaTooltip (self, self.row_id, "shift") + instancia:MontaTooltip(self, self.row_id, "shift") end - + elseif (self.showing_allspells) then self.showing_allspells = false local instancia = Details:GetInstance (self.instance_id) - instancia:MontaTooltip (self, self.row_id) + instancia:MontaTooltip(self, self.row_id) end - + if (_IsControlKeyDown()) then if (not self.showing_alltargets) then self.showing_alltargets = true local instancia = Details:GetInstance (self.instance_id) - instancia:MontaTooltip (self, self.row_id, "ctrl") + instancia:MontaTooltip(self, self.row_id, "ctrl") end - + elseif (self.showing_alltargets) then self.showing_alltargets = false local instancia = Details:GetInstance (self.instance_id) - instancia:MontaTooltip (self, self.row_id) + instancia:MontaTooltip(self, self.row_id) end - + if (_IsAltKeyDown()) then if (not self.showing_allpets) then self.showing_allpets = true local instancia = Details:GetInstance (self.instance_id) - instancia:MontaTooltip (self, self.row_id, "alt") + instancia:MontaTooltip(self, self.row_id, "alt") end - + elseif (self.showing_allpets) then self.showing_allpets = false local instancia = Details:GetInstance (self.instance_id) - instancia:MontaTooltip (self, self.row_id) + instancia:MontaTooltip(self, self.row_id) end end local barra_backdrop_onenter = { - bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], + bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16, insets = {left = 1, right = 1, top = 0, bottom = 1} } local barra_backdrop_onleave = { - bgFile = "", + bgFile = "", edgeFile = "", tile = true, tileSize = 16, edgeSize = 32, insets = {left = 1, right = 1, top = 0, bottom = 1} } ---> pre creating the truncate frame - Details.left_anti_truncate = CreateFrame ("frame", "DetailsLeftTextAntiTruncate", UIParent,"BackdropTemplate") - Details.left_anti_truncate:SetBackdrop (defaultBackdropSt) - Details.left_anti_truncate:SetBackdropColor (0, 0, 0, 0.8) +--pre creating the truncate frame + Details.left_anti_truncate = CreateFrame("frame", "DetailsLeftTextAntiTruncate", UIParent,"BackdropTemplate") + 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:SetPoint("left", Details.left_anti_truncate, "left", 3, 0) local lineScript_Onenter = function(self) self.mouse_over = true - OnEnterMainWindow (self._instance, self) + OnEnterMainWindow(self._instance, self) - self._instance:MontaTooltip (self, self.row_id) - - self:SetBackdrop (barra_backdrop_onenter) - self:SetBackdropColor (0.588, 0.588, 0.588, 0.7) + self._instance:MontaTooltip(self, self.row_id) + + self:SetBackdrop(barra_backdrop_onenter) + self:SetBackdropColor(0.588, 0.588, 0.588, 0.7) if (not Details.instances_disable_bar_highlight) then - --[[ Deprecation of right_to_left_texture in favor of StatusBar:SetReverseFill 5/2/2022 - Flamanis - if (self._instance.bars_inverted) then - self.right_to_left_texture:SetBlendMode ("ADD") - else - self.textura:SetBlendMode ("ADD") - end]] - self.textura:SetBlendMode ("ADD") + self.textura:SetBlendMode("ADD") end local lefttext = self.lineText1 if (lefttext:IsTruncated()) then if (not Details.left_anti_truncate) then - + 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:SetFontColor (Details.left_anti_truncate.text, lefttext:GetTextColor()) - + Details:SetFontColor(Details.left_anti_truncate.text, lefttext:GetTextColor()) + 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) + 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) Details.left_anti_truncate:Show() lefttext.untruncated = true end - - self:SetScript ("OnUpdate", shift_monitor) + + self:SetScript("OnUpdate", shift_monitor) + + self.iconHighlight:Show() end local lineScript_Onleave = function(self) self.mouse_over = false - OnLeaveMainWindow (self._instance, self) - + OnLeaveMainWindow(self._instance, self) + --_GameTooltip:Hide() GameCooltip:ShowMe (false) - - self:SetBackdrop (barra_backdrop_onleave) - self:SetBackdropBorderColor (0, 0, 0, 0) - self:SetBackdropColor (0, 0, 0, 0) - --[[ Deprecation of right_to_left_texture in favor of StatusBar:SetReverseFill 5/2/2022 - Flamanis - if (self._instance.bars_inverted) then - self.right_to_left_texture:SetBlendMode ("BLEND") - else - self.textura:SetBlendMode ("BLEND") - end]] - self.textura:SetBlendMode ("BLEND") - + + self:SetBackdrop(barra_backdrop_onleave) + self:SetBackdropBorderColor(0, 0, 0, 0) + self:SetBackdropColor(0, 0, 0, 0) + + self.textura:SetBlendMode("BLEND") + self.showing_allspells = false - self:SetScript ("OnUpdate", nil) - + self:SetScript("OnUpdate", nil) + local lefttext = self.lineText1 if (lefttext.untruncated) then lefttext.untruncated = nil Details.left_anti_truncate:Hide() end + + self.iconHighlight:Hide() end local lineScript_Onmousedown = function(self, button) if (self.fading_in) then return end - + local lefttext = self.lineText1 if (lefttext.untruncated) then lefttext.untruncated = nil Details.left_anti_truncate:Hide() end - + if (button == "RightButton") then return Details.switch:ShowMe (self._instance) - - --elseif (button == "MiddleButton") then elseif (button == "LeftButton") then end - + self._instance:HandleTextsOnMouseClick (self, "down") self.mouse_down = _GetTime() @@ -1959,34 +1950,33 @@ local lineScript_Onmousedown = function(self, button) if (not self._instance.baseframe.isLocked) then GameCooltip:Hide() - move_janela (self._instance.baseframe, true, self._instance) + move_janela(self._instance.baseframe, true, self._instance) end end local lineScript_Onmouseup = function(self, button) - local is_shift_down = _IsShiftKeyDown() local is_control_down = _IsControlKeyDown() if (self._instance.baseframe.isMoving) then - move_janela (self._instance.baseframe, false, self._instance) + move_janela(self._instance.baseframe, false, self._instance) self._instance:SaveMainWindowPosition() - if (self._instance:MontaTooltip (self, self.row_id)) then + if (self._instance:MontaTooltip(self, self.row_id)) then GameCooltip:Show (self, 1) end end self._instance:HandleTextsOnMouseClick (self, "up") - + local x, y = _GetCursorPosition() x = floor(x) y = floor(y) if (self.mouse_down and (self.mouse_down+0.4 > _GetTime() and (x == self.x and y == self.y)) or (x == self.x and y == self.y)) then if (self.button == "LeftButton" or self.button == "MiddleButton") then - if (self._instance.atributo == 5 or is_shift_down) then - --> report + if (self._instance.atributo == 5 or is_shift_down) then + --report if (self._instance.atributo == 5 and is_shift_down) then local custom = self._instance:GetCustomObject() if (custom and custom.on_shift_click) then @@ -1994,24 +1984,24 @@ local lineScript_Onmouseup = function(self, button) if (func) then local successful, errortext = pcall (func, self, self.minha_tabela, self._instance) if (not successful) then - Details:Msg ("error occurred custom script shift+click:", errortext) + Details:Msg("error occurred custom script shift+click:", errortext) end return end end end - + if (Details.row_singleclick_overwrite [self._instance.atributo] and type (Details.row_singleclick_overwrite [self._instance.atributo][self._instance.sub_atributo]) == "function") then return Details.row_singleclick_overwrite [self._instance.atributo][self._instance.sub_atributo] (_, self.minha_tabela, self._instance, is_shift_down, is_control_down) end - + return Details:ReportSingleLine (self._instance, self) end if (not self.minha_tabela) then - return Details:Msg ("this bar is waiting update.") + return Details:Msg("this bar is waiting update.") end - + self._instance:AbreJanelaInfo (self.minha_tabela, nil, nil, is_shift_down, is_control_down) end end @@ -2022,11 +2012,12 @@ local lineScript_Onclick = function(self, button) end local lineScript_Onshow = function(self) - -- search key: ~model + --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) 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) @@ -2153,7 +2144,7 @@ local iconFrame_OnEnter = function(self) local gotInfo local localizedItemLevelString = _G.STAT_AVERAGE_ITEM_LEVEL if (ilvl) then - GameCooltip:AddLine(localizedItemLevelString .. ":" , ilvl and "|T:" .. 24 .. ":" .. 24 ..":0:0:64:64:4:60:4:60|t" .. floor(ilvl.ilvl) or "|T:" .. 24 .. ":" .. 24 ..":0:0:64:64:4:60:4:60|t ??") --> Loc from GlobalStrings.lua + GameCooltip:AddLine(localizedItemLevelString .. ":" , ilvl and "|T:" .. 24 .. ":" .. 24 ..":0:0:64:64:4:60:4:60|t" .. floor(ilvl.ilvl) or "|T:" .. 24 .. ":" .. 24 ..":0:0:64:64:4:60:4:60|t ??") --Loc from GlobalStrings.lua GameCooltip:AddIcon([[]], 1, 1, 1, 20) Details:AddTooltipBackgroundStatusbar() gotInfo = true @@ -2286,17 +2277,20 @@ local iconFrame_OnEnter = function(self) end end -local icon_frame_on_leave = function(self) + +local iconFrame_OnLeave = function(self) GameCooltip:Hide() - + if (GameTooltip and GameTooltip:IsShown()) then GameTooltip:Hide() end - + if (self.row.icone_classe:GetTexture() ~= "") then - --self.row.icone_classe:SetSize (self.row.icone_classe:GetWidth()-1, self.row.icone_classe:GetWidth()-1) - --self.row.icone_classe:SetBlendMode ("BLEND") + --self.row.icone_classe:SetSize(self.row.icone_classe:GetWidth()-1, self.row.icone_classe:GetWidth()-1) + --self.row.icone_classe:SetBlendMode("BLEND") end + + self.row.iconHighlight:Hide() end local icon_frame_events = Details:CreateEventListener() @@ -2305,7 +2299,7 @@ function icon_frame_events:EnterCombat() anim.anim:Stop() anim:Hide() tinsert (Details.icon_animations.load.available, anim) - + anim.icon_frame.icon_animation = nil anim.icon_frame = nil end @@ -2368,15 +2362,15 @@ local icon_frame_inspect_callback = function(guid, unitid, iconFrame) end local icon_frame_create_animation = function() - local f = CreateFrame ("frame", nil, UIParent) + local f = CreateFrame("frame", nil, UIParent) f:SetFrameStrata ("FULLSCREEN") f.anim = f:CreateAnimationGroup() - f.rotate = f.anim:CreateAnimation ("Rotation") - f.rotate:SetDegrees (360) - f.rotate:SetDuration (2) + f.rotate = f.anim:CreateAnimation("Rotation") + f.rotate:SetDegrees(360) + f.rotate:SetDuration(2) f.anim:SetLooping ("repeat") - local t = f:CreateTexture (nil, "overlay") + local t = f:CreateTexture(nil, "overlay") t:SetTexture([[Interface\COMMON\StreamCircle]]) t:SetAlpha(0.7) t:SetAllPoints() @@ -2397,14 +2391,14 @@ local icon_frame_on_click_up = function(self, button) 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 + --open the rank panel local instance = Details:GetInstance (self.row.instance_id) if (instance) then local attribute, subattribute = instance:GetDisplay() local combat = instance:GetShowingCombat() local diff = combat:GetDifficulty() local bossInfo = combat:GetBossInfo() - + if ((attribute == 1 or attribute == 2) and bossInfo) then --if bossInfo is nil, means the combat isn't a boss local db = Details.OpenStorage() if (db and bossInfo.id) then @@ -2417,77 +2411,77 @@ local icon_frame_on_click_up = function(self, button) end return end - + if (Details.in_combat) then - Details:Msg (Loc["STRING_QUERY_INSPECT_FAIL1"]) + Details:Msg(Loc["STRING_QUERY_INSPECT_FAIL1"]) return end - + if (self.showing == "actor") then - + if (Details.ilevel.core:HasQueuedInspec (self.unitname)) then - - --> icon animation + + --icon animation local anim = tremove (Details.icon_animations.load.available) if (not anim) then icon_frame_create_animation() anim = tremove (Details.icon_animations.load.available) end - + local f = anim if (not f.question_icon) then - f.question_icon = self:GetParent():GetParent().border:CreateTexture (nil, "overlay") + f.question_icon = self:GetParent():GetParent().border:CreateTexture(nil, "overlay") f.question_icon:SetTexture([[Interface\GossipFrame\ActiveLegendaryQuestIcon]]) - f.question_icon:SetSize (16, 16) + f.question_icon:SetSize(16, 16) end f.question_icon:ClearAllPoints() f.question_icon:SetPoint("center", self, "center") f.question_icon:Show() - + if (not Details.HideBarQuestionIcon) then function Details:HideBarQuestionIcon (frame) frame.question_icon:Hide() end end Details:ScheduleTimer ("HideBarQuestionIcon", 1, f) - + self.icon_animation = anim anim.icon_frame = self - + local pid pid = icon_frame_events:ScheduleTimer ("CancelAnim", 1, {anim}) Details.icon_animations.load.in_use [anim] = pid anim.parent = self - + return end local does_query = Details.ilevel.core:QueryInspect (self.unitname, icon_frame_inspect_callback, self) - + if (self.icon_animation) then return end - - --> icon animation + + --icon animation local anim = tremove (Details.icon_animations.load.available) if (not anim) then icon_frame_create_animation() anim = tremove (Details.icon_animations.load.available) end - + anim:Show() - anim:SetParent (self) + anim:SetParent(self) anim:ClearAllPoints() anim:SetFrameStrata ("TOOLTIP") anim:SetPoint("center", self, "center") - anim:SetSize (self:GetWidth()*1.7, self:GetHeight()*1.7) - + anim:SetSize(self:GetWidth()*1.7, self:GetHeight()*1.7) + anim.anim:Play() - + self.icon_animation = anim anim.icon_frame = self - + local pid if (does_query) then pid = icon_frame_events:ScheduleTimer ("CancelAnim", 4, {anim, true}) @@ -2496,7 +2490,7 @@ local icon_frame_on_click_up = function(self, button) end Details.icon_animations.load.in_use [anim] = pid anim.parent = self - + if (anim.question_icon) then anim.question_icon:Hide() end @@ -2505,7 +2499,7 @@ end local setFrameIconScripts = function(row) row.icon_frame:SetScript("OnEnter", iconFrame_OnEnter) - row.icon_frame:SetScript("OnLeave", icon_frame_on_leave) + row.icon_frame:SetScript("OnLeave", iconFrame_OnLeave) row.icon_frame:SetScript("OnMouseDown", icon_frame_on_click_down) row.icon_frame:SetScript("OnMouseUp", icon_frame_on_click_up) end @@ -2528,20 +2522,20 @@ end function Details:ReportSingleLine (instancia, barra) local reportar - if (instancia.atributo == 5) then --> custom - - --> dump cooltip + if (instancia.atributo == 5) then --custom + + --dump cooltip local GameCooltip = GameCooltip if (GameCooltipFrame1:IsShown()) then local actor_name = barra.lineText1:GetText() or "" actor_name = actor_name:gsub ((".*%."), "") - + if (instancia.segmento == -1) then --overall reportar = {"Details!: " .. Loc["STRING_OVERALL"] .. " " .. instancia.customName .. ": " .. actor_name .. " " .. Loc["STRING_CUSTOM_REPORT"]} else reportar = {"Details!: " .. instancia.customName .. ": " .. actor_name .. " " .. Loc["STRING_CUSTOM_REPORT"]} end - + local amt = GameCooltip.Indexes for i = 2, amt do local left_text, right_text = GameCooltip:GetText (i) @@ -2550,10 +2544,10 @@ function Details:ReportSingleLine (instancia, barra) else reportar = {"Details!: " .. instancia.customName .. ": " .. Loc["STRING_CUSTOM_REPORT"]} reportar [#reportar+1] = barra.lineText1:GetText() .. " " .. barra.lineText4:GetText() - + --reportar [#reportar+1] = (i-1) .. ". " .. left_text .. " ... " .. right_text end - + else reportar = {"Details!: " .. Loc["STRING_REPORT"] .. " " .. Details.sub_atributos [instancia.atributo].lista [instancia.sub_atributo]} reportar [#reportar+1] = barra.lineText1:GetText() .. " " .. barra.lineText4:GetText() @@ -2567,22 +2561,22 @@ 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) + 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) + Details.FadeHandler.Fader(self, "ALPHA", 0) + end) - button:SetScript ("OnMouseDown", function(self, button) + button:SetScript("OnMouseDown", function(self, button) if (button ~= "LeftButton") then return end - + if (instancia:IsSoloMode()) then return end @@ -2602,7 +2596,7 @@ local function button_stretch_scripts (baseframe, backgrounddisplay, instancia) _a = baseframe.wallpaper:GetAlpha() gump:GradientEffect (baseframe.wallpaper, "texture", _r, _g, _b, _a, _r, _g, _b, 0.05, 0.5) end - + if (instancia.stretch_button_side == 1) then baseframe:StartSizing ("top") baseframe.stretch_direction = "top" @@ -2610,11 +2604,11 @@ local function button_stretch_scripts (baseframe, backgrounddisplay, instancia) baseframe:StartSizing ("bottom") baseframe.stretch_direction = "bottom" end - + local linha_horizontal = {} - + local checking = instancia - for i = instancia.meu_id-1, 1, -1 do + for i = instancia.meu_id-1, 1, -1 do local esta_instancia = Details.tabela_instancias [i] if ((esta_instancia.snap[1] and esta_instancia.snap[1] == checking.meu_id) or (esta_instancia.snap[3] and esta_instancia.snap[3] == checking.meu_id)) then linha_horizontal [#linha_horizontal+1] = esta_instancia @@ -2623,9 +2617,9 @@ local function button_stretch_scripts (baseframe, backgrounddisplay, instancia) break end end - + checking = instancia - for i = instancia.meu_id+1, #Details.tabela_instancias do + for i = instancia.meu_id+1, #Details.tabela_instancias do local esta_instancia = Details.tabela_instancias [i] if ((esta_instancia.snap[1] and esta_instancia.snap[1] == checking.meu_id) or (esta_instancia.snap[3] and esta_instancia.snap[3] == checking.meu_id)) then linha_horizontal [#linha_horizontal+1] = esta_instancia @@ -2634,7 +2628,7 @@ local function button_stretch_scripts (baseframe, backgrounddisplay, instancia) break end end - + instancia.stretchToo = linha_horizontal if (#instancia.stretchToo > 0) then for _, thisInstance in ipairs(instancia.stretchToo) do @@ -2656,30 +2650,30 @@ local function button_stretch_scripts (baseframe, backgrounddisplay, instancia) end end end - + Details:SnapTextures (true) - - Details:SendEvent ("DETAILS_INSTANCE_STARTSTRETCH", nil, instancia) - - --> change the update speed + + Details:SendEvent("DETAILS_INSTANCE_STARTSTRETCH", nil, instancia) + + --change the update speed if (Details.update_speed > 0.3) then Details:SetWindowUpdateSpeed (0.3, true) Details.stretch_changed_update_speed = true end - + end) - - button:SetScript ("OnMouseUp", function(self, button) - + + button:SetScript("OnMouseUp", function(self, button) + if (button ~= "LeftButton") then return end - + if (instancia:IsSoloMode()) then return end - - if (baseframe.isResizing) then + + if (baseframe.isResizing) then baseframe:StopMovingOrSizing() baseframe.isResizing = false instancia:RestoreMainWindowPosition (baseframe._place) @@ -2688,14 +2682,14 @@ local function button_stretch_scripts (baseframe, backgrounddisplay, instancia) if (instancia.need_rolagem) then instancia:MostrarScrollBar (true) end - Details:SendEvent ("DETAILS_INSTANCE_SIZECHANGED", nil, instancia) - + Details:SendEvent("DETAILS_INSTANCE_SIZECHANGED", nil, instancia) + instancia:RefreshBars() instancia:InstanceReset() instancia:ReajustaGump() - + baseframe.stretch_direction = nil - + if (instancia.stretchToo and #instancia.stretchToo > 0) then for _, esta_instancia in ipairs(instancia.stretchToo) do esta_instancia.baseframe:StopMovingOrSizing() @@ -2707,31 +2701,31 @@ local function button_stretch_scripts (baseframe, backgrounddisplay, instancia) esta_instancia:MostrarScrollBar(true) end Details:SendEvent("DETAILS_INSTANCE_SIZECHANGED", nil, esta_instancia) - + local _r, _g, _b, _a = esta_instancia.baseframe:GetBackdropColor() gump:GradientEffect(esta_instancia.baseframe, "frame", _r, _g, _b, _a, instancia.bg_r, instancia.bg_g, instancia.bg_b, instancia.bg_alpha, 0.5) - + if (esta_instancia.wallpaper.enabled) then _r, _g, _b = esta_instancia.baseframe.wallpaper:GetVertexColor() _a = esta_instancia.baseframe.wallpaper:GetAlpha() gump:GradientEffect(esta_instancia.baseframe.wallpaper, "texture", _r, _g, _b, _a, _r, _g, _b, esta_instancia.wallpaper.alpha, 1.0) end - + esta_instancia.baseframe:SetFrameStrata(esta_instancia.strata) esta_instancia.rowframe:SetFrameStrata(esta_instancia.strata) esta_instancia:StretchButtonAlwaysOnTop() - - Details:SendEvent ("DETAILS_INSTANCE_ENDSTRETCH", nil, esta_instancia.baseframe) - + + Details:SendEvent("DETAILS_INSTANCE_ENDSTRETCH", nil, esta_instancia.baseframe) + esta_instancia:RefreshBars() esta_instancia:InstanceReset() esta_instancia:ReajustaGump() end instancia.stretchToo = nil end - - end - + + end + local _r, _g, _b, _a = baseframe:GetBackdropColor() gump:GradientEffect(baseframe, "frame", _r, _g, _b, _a, instancia.bg_r, instancia.bg_g, instancia.bg_b, instancia.bg_alpha, 0.5) if (instancia.wallpaper.enabled) then @@ -2739,88 +2733,88 @@ local function button_stretch_scripts (baseframe, backgrounddisplay, instancia) _a = baseframe.wallpaper:GetAlpha() gump:GradientEffect(baseframe.wallpaper, "texture", _r, _g, _b, _a, _r, _g, _b, instancia.wallpaper.alpha, 1.0) end - + baseframe:SetFrameStrata(instancia.strata) instancia.rowframe:SetFrameStrata(instancia.strata) instancia:StretchButtonAlwaysOnTop() Details:SnapTextures (false) - Details:SendEvent ("DETAILS_INSTANCE_ENDSTRETCH", nil, instancia) + Details:SendEvent("DETAILS_INSTANCE_ENDSTRETCH", nil, instancia) if (Details.stretch_changed_update_speed) then Details:SetWindowUpdateSpeed(false, true) Details.stretch_changed_update_speed = nil end - end) + end) end local function button_down_scripts (main_frame, backgrounddisplay, instancia, scrollbar) - main_frame.button_down:SetScript ("OnMouseDown", function(self) + main_frame.button_down:SetScript("OnMouseDown", function(self) if (not scrollbar:IsEnabled()) then return end - + local B = instancia.barraS[2] if (B < instancia.rows_showing) then - scrollbar:SetValue (scrollbar:GetValue() + instancia.row_height) + scrollbar:SetValue(scrollbar:GetValue() + instancia.row_height) end - + 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 B = instancia.barraS[2] if (B < instancia.rows_showing) then - scrollbar:SetValue (scrollbar:GetValue() + instancia.row_height) + scrollbar:SetValue(scrollbar:GetValue() + instancia.row_height) else self:Disable() end end 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) + self:SetScript("OnUpdate", nil) end) end local function button_up_scripts (main_frame, backgrounddisplay, instancia, scrollbar) - main_frame.button_up:SetScript ("OnMouseDown", function(self) + main_frame.button_up:SetScript("OnMouseDown", function(self) if (not scrollbar:IsEnabled()) then return end - + local A = instancia.barraS[1] if (A > 1) then - scrollbar:SetValue (scrollbar:GetValue() - instancia.row_height*2) + scrollbar:SetValue(scrollbar:GetValue() - instancia.row_height*2) end - + 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 A = instancia.barraS[1] if (A > 1) then - scrollbar:SetValue (scrollbar:GetValue() + instancia.row_height*2) + scrollbar:SetValue(scrollbar:GetValue() + instancia.row_height*2) else self:Disable() end end end) end) - - 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("OnMouseUp", function(self) + self.precionado = false + self:SetScript("OnUpdate", nil) + end) + + main_frame.button_up:SetScript("OnEnable", function(self) local current = scrollbar:GetValue() if (current == 0) then main_frame.button_up:Disable() @@ -2831,81 +2825,81 @@ end function DetailsKeyBindScrollUp() local last_key_pressed = Details.KeyBindScrollUpLastPressed or GetTime()-0.3 - + local to_top = false if (last_key_pressed+0.2 > GetTime()) then to_top = true end - + Details.KeyBindScrollUpLastPressed = GetTime() - - for index, instance in ipairs (Details.tabela_instancias) do + + for index, instance in ipairs(Details.tabela_instancias) do if (instance:IsEnabled()) then - + local scrollbar = instance.scroll - + local A = instance.barraS[1] if (A and A > 1) then if (to_top) then - scrollbar:SetValue (0) + scrollbar:SetValue(0) scrollbar.ultimo = 0 instance.baseframe.button_up:Disable() else - scrollbar:SetValue (scrollbar:GetValue() - instance.row_height*2) + scrollbar:SetValue(scrollbar:GetValue() - instance.row_height*2) end elseif (A) then - scrollbar:SetValue (0) + scrollbar:SetValue(0) scrollbar.ultimo = 0 instance.baseframe.button_up:Disable() end - + end end end function DetailsKeyBindScrollDown() - for index, instance in ipairs (Details.tabela_instancias) do + for index, instance in ipairs(Details.tabela_instancias) do if (instance:IsEnabled()) then - + local scrollbar = instance.scroll - + local B = instance.barraS[2] if (B and B < instance.rows_showing) then - scrollbar:SetValue (scrollbar:GetValue() + instance.row_height*2) + scrollbar:SetValue(scrollbar:GetValue() + instance.row_height*2) elseif (B) then local _, maxValue = scrollbar:GetMinMaxValues() - scrollbar:SetValue (maxValue) + scrollbar:SetValue(maxValue) scrollbar.ultimo = maxValue instance.baseframe.button_down:Disable() end - + end end end local function iterate_scroll_scripts (backgrounddisplay, backgroundframe, baseframe, scrollbar, instancia) - baseframe:SetScript ("OnMouseWheel", + baseframe:SetScript("OnMouseWheel", function(self, delta) - if (delta > 0) then --> rolou pra cima + if (delta > 0) then --rolou pra cima local A = instancia.barraS[1] if (A) then if (A > 1) then - scrollbar:SetValue (scrollbar:GetValue() - instancia.row_height * Details.scroll_speed) + scrollbar:SetValue(scrollbar:GetValue() - instancia.row_height * Details.scroll_speed) else - scrollbar:SetValue (0) + scrollbar:SetValue(0) scrollbar.ultimo = 0 baseframe.button_up:Disable() end end - elseif (delta < 0) then --> rolou pra baixo + elseif (delta < 0) then --rolou pra baixo local B = instancia.barraS[2] if (B) then if (B < (instancia.rows_showing or 0)) then - scrollbar:SetValue (scrollbar:GetValue() + instancia.row_height * Details.scroll_speed) + scrollbar:SetValue(scrollbar:GetValue() + instancia.row_height * Details.scroll_speed) else local _, maxValue = scrollbar:GetMinMaxValues() - scrollbar:SetValue (maxValue) + scrollbar:SetValue(maxValue) scrollbar.ultimo = maxValue baseframe.button_down:Disable() end @@ -2914,19 +2908,19 @@ 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 + if (ultimo == meu_valor) then --n�o mudou return end - - --> shortcut + + --shortcut local minValue, maxValue = scrollbar:GetMinMaxValues() if (minValue == meu_valor) then instancia.barraS[1] = 1 instancia.barraS[2] = instancia.rows_fit_in_window - instancia:RefreshMainWindow (instancia, true) + instancia:RefreshMainWindow(instancia, true) self.ultimo = meu_valor baseframe.button_up:Disable() return @@ -2938,29 +2932,29 @@ local function iterate_scroll_scripts (backgrounddisplay, backgroundframe, basef end instancia.barraS[1] = min instancia.barraS[2] = (instancia.rows_showing or 0) - instancia:RefreshMainWindow (instancia, true) + instancia:RefreshMainWindow(instancia, true) self.ultimo = meu_valor baseframe.button_down:Disable() return end - + if (not baseframe.button_up:IsEnabled()) then baseframe.button_up:Enable() end if (not baseframe.button_down:IsEnabled()) then baseframe.button_down:Enable() end - - if (meu_valor > ultimo) then --> scroll down - + + if (meu_valor > ultimo) then --scroll down + local B = instancia.barraS[2] - if (B < (instancia.rows_showing or 0)) then --> se o valor maximo n�o for o m�ximo de barras a serem mostradas + if (B < (instancia.rows_showing or 0)) then --se o valor maximo n�o for o m�ximo de barras a serem mostradas local precisa_passar = ((B+1) * instancia.row_height) - (instancia.row_height*instancia.rows_fit_in_window) - --if (meu_valor > precisa_passar) then --> o valor atual passou o valor que precisa passar pra locomover - if (true) then --> testing by pass row check - local diff = meu_valor - ultimo --> pega a diferen�a de H - diff = diff / instancia.row_height --> calcula quantas barras ele pulou - diff = ceil(diff) --> arredonda para cima + --if (meu_valor > precisa_passar) then --o valor atual passou o valor que precisa passar pra locomover + if (true) then --testing by pass row check + local diff = meu_valor - ultimo --pega a diferen�a de H + diff = diff / instancia.row_height --calcula quantas barras ele pulou + diff = ceil(diff) --arredonda para cima if (instancia.barraS[2]+diff > (instancia.rows_showing or 0) and ultimo > 0) then instancia.barraS[1] = (instancia.rows_showing or 0) - (instancia.rows_fit_in_window-1) instancia.barraS[2] = (instancia.rows_showing or 0) @@ -2968,16 +2962,16 @@ local function iterate_scroll_scripts (backgrounddisplay, backgroundframe, basef instancia.barraS[2] = instancia.barraS[2]+diff instancia.barraS[1] = instancia.barraS[1]+diff end - instancia:RefreshMainWindow (instancia, true) + instancia:RefreshMainWindow(instancia, true) end end - else --> scroll up + else --scroll up local A = instancia.barraS[1] if (A > 1) then local precisa_passar = (A-1) * instancia.row_height --if (meu_valor < precisa_passar) then - if (true) then --> testing by pass row check - --> calcula quantas barras passou + if (true) then --testing by pass row check + --calcula quantas barras passou local diff = ultimo - meu_valor diff = diff / instancia.row_height diff = ceil(diff) @@ -2989,12 +2983,12 @@ local function iterate_scroll_scripts (backgrounddisplay, backgroundframe, basef instancia.barraS[1] = instancia.barraS[1]-diff end - instancia:RefreshMainWindow (instancia, true) + instancia:RefreshMainWindow(instancia, true) end end end self.ultimo = meu_valor - end) + end) end function Details:HaveInstanceAlert() @@ -3012,11 +3006,11 @@ local hide_click_func = function() end function Details:InstanceAlert (msg, icon, time, clickfunc, doflash, forceAlert) - + if (not forceAlert and Details.streamer_config.no_alerts) then --return end - + if (not self.meu_id) then local lower = Details:GetLowerInstanceNumber() if (lower) then @@ -3025,24 +3019,24 @@ function Details:InstanceAlert (msg, icon, time, clickfunc, doflash, forceAlert) return end end - - if (type (msg) == "boolean" and not msg) then + + if (type(msg) == "boolean" and not msg) then self.alert:Hide() self.alert.rotate:Stop() self.alert_time = nil return end - + if (msg) then - self.alert.text:SetText (msg) + self.alert.text:SetText(msg) else - self.alert.text:SetText ("") + self.alert.text:SetText("") end - + if (icon) then - if (type (icon) == "table") then + 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) @@ -3065,10 +3059,10 @@ function Details:InstanceAlert (msg, icon, time, clickfunc, doflash, forceAlert) else self.alert.icon:SetTexture("") end - + self.alert.button.func = nil wipe (self.alert.button.func_param) - + if (clickfunc) then self.alert.button.func = clickfunc[1] self.alert.button.func_param = {unpack(clickfunc, 2)} @@ -3077,20 +3071,20 @@ function Details:InstanceAlert (msg, icon, time, clickfunc, doflash, forceAlert) time = time or 15 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:SetFrameStrata ("TOOLTIP") self.alert.button:SetFrameStrata ("TOOLTIP") - + self.alert:Show() - + if (doflash) then self.alert:DoFlash() end - + self.alert:Play() end @@ -3099,7 +3093,7 @@ 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 - Details:Msg ("error on alert function:", errortext) + Details:Msg("error on alert function:", errortext) end end self:GetParent():Hide() @@ -3107,32 +3101,32 @@ end local function CreateAlertFrame (baseframe, instancia) - local frame_upper = CreateFrame ("scrollframe", "DetailsAlertFrameScroll" .. instancia.meu_id, baseframe) + 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:SetFrameStrata ("TOOLTIP") - - local frame_lower = CreateFrame ("frame", "DetailsAlertFrameScrollChild" .. instancia.meu_id, frame_upper) + + 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_upper:SetScrollChild (frame_lower) - local alert_bg = CreateFrame ("frame", "DetailsAlertFrame" .. instancia.meu_id, frame_lower,"BackdropTemplate") + 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:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16, + 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:SetBackdropColor(.1, .1, .1, 1) alert_bg:SetFrameStrata ("FULLSCREEN") alert_bg:SetFrameLevel(baseframe:GetFrameLevel() + 6) alert_bg:Hide() - local toptexture = alert_bg:CreateTexture (nil, "background") + 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) @@ -3140,106 +3134,106 @@ local function CreateAlertFrame (baseframe, instancia) 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 rotate_frame = CreateFrame ("frame", "DetailsAlertFrameRotate" .. instancia.meu_id, alert_bg) + + 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:SetFrameStrata ("FULLSCREEN") - - local icon = rotate_frame:CreateTexture (nil, "overlay") + + local icon = rotate_frame:CreateTexture(nil, "overlay") icon:SetPoint("center", rotate_frame, "center") icon:SetWidth(14) icon:SetHeight(14) - - local button = CreateFrame ("button", "DetailsInstance"..instancia.meu_id.."AlertButton", alert_bg) + + local button = CreateFrame("button", "DetailsInstance"..instancia.meu_id.."AlertButton", alert_bg) button:SetAllPoints() button:SetFrameStrata ("FULLSCREEN") - button:SetScript ("OnClick", alert_on_click) + button:SetScript("OnClick", alert_on_click) button._instance = instancia button.func_param = {} - + local RotateAnimGroup = rotate_frame:CreateAnimationGroup() - local rotate = RotateAnimGroup:CreateAnimation ("Rotation") - rotate:SetDegrees (360) - rotate:SetDuration (6) + local rotate = RotateAnimGroup:CreateAnimation("Rotation") + rotate:SetDegrees(360) + rotate:SetDuration(6) RotateAnimGroup:SetLooping ("repeat") - + alert_bg:Hide() - + local anime = alert_bg:CreateAnimationGroup() - anime.group = anime:CreateAnimation ("Translation") - anime.group:SetDuration (0.15) + anime.group = anime:CreateAnimation("Translation") + anime.group:SetDuration(0.15) anime.group:SetOffset (0, 10) - anime:SetScript ("OnFinished", function(self) + 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) end) - + local on_enter_alert = function(self) text:SetTextColor(1, 0.8, 0.3, 1) - icon:SetBlendMode ("ADD") + icon:SetBlendMode("ADD") end local on_leave_alert = function(self) text:SetTextColor(1, 1, 1, 0.8) - icon:SetBlendMode ("BLEND") + icon:SetBlendMode("BLEND") end - - button:SetScript ("OnEnter", on_enter_alert) - button:SetScript ("OnLeave", on_leave_alert) + + button:SetScript("OnEnter", on_enter_alert) + button:SetScript("OnLeave", on_leave_alert) function alert_bg:Play() anime:Play() end - - local flash_texture = button:CreateTexture (nil, "overlay") + + 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:SetAllPoints() - flash_texture:SetBlendMode ("ADD") + flash_texture:SetBlendMode("ADD") local animation = flash_texture:CreateAnimationGroup() - local anim1 = animation:CreateAnimation ("ALPHA") - local anim2 = animation:CreateAnimation ("ALPHA") + local anim1 = animation:CreateAnimation("ALPHA") + local anim2 = animation:CreateAnimation("ALPHA") anim1:SetOrder (1) - + anim1:SetFromAlpha (0) anim1:SetToAlpha (1) - - anim1:SetDuration (0.1) + + anim1:SetDuration(0.1) anim2:SetOrder (2) - + anim1:SetFromAlpha (1) anim1:SetToAlpha (0) - - anim2:SetDuration (0.2) - animation:SetScript ("OnFinished", function(self) + + anim2:SetDuration(0.2) + animation:SetScript("OnFinished", function(self) flash_texture:Hide() end) flash_texture:Hide() - + local do_flash = function() flash_texture:Show() animation:Play() end - + function alert_bg:DoFlash() C_Timer.After (0.23, do_flash) end - + alert_bg.text = text alert_bg.icon = icon alert_bg.button = button alert_bg.rotate = RotateAnimGroup - + instancia.alert = alert_bg - + return alert_bg end @@ -3248,28 +3242,28 @@ function Details:InstanceMsg (text, icon, textcolor, iconcoords, iconcolor) self.freeze_icon:Hide() return self.freeze_texto:Hide() end - - self.freeze_texto:SetText (text) + + self.freeze_texto:SetText(text) 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) + local r, g, b, a = gump:ParseColors(textcolor) self.freeze_texto:SetTextColor(r, g, b, a) else self.freeze_texto:SetTextColor(1, 1, 1, 1) end - + if (iconcoords and type (iconcoords) == "table") then self.freeze_icon:SetTexCoord(unpack(iconcoords)) else self.freeze_icon:SetTexCoord(0, 1, 0, 1) end - + if (iconcolor) then - local r, g, b, a = gump:ParseColors (iconcolor) + local r, g, b, a = gump:ParseColors(iconcolor) self.freeze_icon:SetVertexColor(r, g, b, a) else self.freeze_icon:SetVertexColor(1, 1, 1, 1) @@ -3307,7 +3301,7 @@ local function show_anti_overlap (instance, host, side) anti_menu_overlap:Show() end -Details.snap_alert = CreateFrame ("frame", "DetailsSnapAlertFrame", UIParent, "ActionBarButtonSpellActivationAlert") +Details.snap_alert = CreateFrame("frame", "DetailsSnapAlertFrame", UIParent, "ActionBarButtonSpellActivationAlert") Details.snap_alert:Hide() Details.snap_alert:SetFrameStrata ("FULLSCREEN") @@ -3322,16 +3316,16 @@ end do --search key: ~tooltip - local tooltip_anchor = CreateFrame ("frame", "DetailsTooltipAnchor", UIParent,"BackdropTemplate") - tooltip_anchor:SetSize (140, 20) + local tooltip_anchor = CreateFrame("frame", "DetailsTooltipAnchor", UIParent,"BackdropTemplate") + tooltip_anchor:SetSize(140, 20) 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: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") @@ -3339,35 +3333,35 @@ do GameTooltip:AddLine(Loc["STRING_OPTIONS_TOOLTIPS_ANCHOR_TEXT_DESC"]) 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 - local xofs, yofs = self:GetCenter() + local xofs, yofs = self:GetCenter() local scale = self:GetEffectiveScale() local UIscale = UIParent:GetScale() xofs = xofs * scale - GetScreenWidth() * UIscale / 2 yofs = yofs * scale - GetScreenHeight() * UIscale / 2 Details.tooltip.anchor_screen_pos[1] = xofs / UIscale Details.tooltip.anchor_screen_pos[2] = yofs / UIscale - + elseif (button == "RightButton" and not self.moving) then tooltip_anchor:MoveAnchor() end end) - + function tooltip_anchor:MoveAnchor() if (self.locked) then self:SetAlpha(1) @@ -3387,38 +3381,38 @@ do tooltip_anchor.alert.animOut:Play() end end - + function tooltip_anchor:Restore() local x, y = Details.tooltip.anchor_screen_pos[1], Details.tooltip.anchor_screen_pos[2] - local scale = self:GetEffectiveScale() + local scale = self:GetEffectiveScale() local UIscale = UIParent:GetScale() x = x * UIscale / scale y = y * UIscale / scale self:ClearAllPoints() - self:SetParent (UIParent) + self:SetParent(UIParent) self:SetPoint("center", UIParent, "center", x, y) end - - tooltip_anchor.alert = CreateFrame ("frame", "DetailsTooltipAnchorAlert", UIParent, "ActionBarButtonSpellActivationAlert") + + 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) - local icon = tooltip_anchor:CreateTexture (nil, "overlay") + local icon = tooltip_anchor:CreateTexture(nil, "overlay") icon:SetTexture([[Interface\AddOns\Details\images\minimap]]) icon:SetPoint("left", tooltip_anchor, "left", 4, 0) - icon:SetSize (18, 18) - + icon:SetSize(18, 18) + local text = tooltip_anchor:CreateFontString(nil, "overlay", "GameFontHighlightSmall") text:SetPoint("left", icon, "right", 6, 0) - text:SetText (Loc["STRING_OPTIONS_TOOLTIPS_ANCHOR_TEXT"]) - + text:SetText(Loc["STRING_OPTIONS_TOOLTIPS_ANCHOR_TEXT"]) + tooltip_anchor:EnableMouse(false) end ---> ~inicio ~janela ~window ~nova ~start +--~inicio ~janela ~window ~nova ~start function gump:CriaJanelaPrincipal (ID, instancia, criando) -- main frames ----------------------------------------------------------------------------------------------------------------------------------------------- @@ -3469,16 +3463,16 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) --background holds the wallpaper, alert strings ans textures, have setallpoints on baseframe --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 + 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.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 + + --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:SetFrameStrata (baseframe_strata) rowframe:SetFrameLevel(3) @@ -3489,73 +3483,73 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) local value = parseRowFrameAlpha(value) self:SetAlpha(value) end - - --> right click bookmark + + --right click bookmark local switchbutton = CreateFrame("button", "Details_SwitchButtonFrame" .. ID, UIParent) switchbutton:SetAllPoints(baseframe) switchbutton:SetFrameStrata (baseframe_strata) 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) + + --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:Hide() - --anti_menu_overlap:SetBackdrop (gump_fundo_backdrop) --debug + --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) + + --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) instancia.floatingframe = floatingframe -- scroll bar ----------------------------------------------------------------------------------------------------------------------------------------------- ---> create the scrollbar, almost not used. +--create the scrollbar, almost not used. - local scrollbar = CreateFrame ("slider", "Details_ScrollBar"..ID, backgrounddisplay) --> scroll - - --> scroll image-node up - baseframe.scroll_up = backgrounddisplay:CreateTexture (nil, "background") + local scrollbar = CreateFrame("slider", "Details_ScrollBar"..ID, backgrounddisplay) --scroll + + --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) - - --> scroll image-node down - baseframe.scroll_down = backgrounddisplay:CreateTexture (nil, "background") + + --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) - - --> scroll image-node middle - baseframe.scroll_middle = backgrounddisplay:CreateTexture (nil, "background") + + --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) - - --> scroll widgets - baseframe.button_up = CreateFrame ("button", "DetailsScrollUp" .. instancia.meu_id, backgrounddisplay) - baseframe.button_down = CreateFrame ("button", "DetailsScrollDown" .. instancia.meu_id, backgrounddisplay) - + + --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:SetNormalTexture ([[Interface\BUTTONS\UI-ScrollBar-ScrollUpButton-Up]]) - baseframe.button_up:SetPushedTexture ([[Interface\BUTTONS\UI-ScrollBar-ScrollUpButton-Down]]) + 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:SetNormalTexture ([[Interface\BUTTONS\UI-ScrollBar-ScrollDownButton-Up]]) - baseframe.button_down:SetPushedTexture ([[Interface\BUTTONS\UI-ScrollBar-ScrollDownButton-Down]]) + 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() @@ -3567,51 +3561,51 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) scrollbar:SetPoint("left", backgrounddisplay, "right", 3, 0) scrollbar:Show() - --> config set + --config set scrollbar:SetOrientation ("VERTICAL") scrollbar.scrollMax = 0 scrollbar:SetMinMaxValues (0, 0) - scrollbar:SetValue (0) + scrollbar:SetValue(0) scrollbar.ultimo = 0 - - --> thumb - scrollbar.thumb = scrollbar:CreateTexture (nil, "overlay") + + --thumb + scrollbar.thumb = scrollbar:CreateTexture(nil, "overlay") scrollbar.thumb:SetTexture([[Interface\Buttons\UI-ScrollBar-Knob]]) - scrollbar.thumb:SetSize (29, 30) + scrollbar.thumb:SetSize(29, 30) scrollbar:SetThumbTexture (scrollbar.thumb) - - --> scripts + + --scripts button_down_scripts (baseframe, backgrounddisplay, instancia, scrollbar) button_up_scripts (baseframe, backgrounddisplay, instancia, scrollbar) - + -- stretch button ----------------------------------------------------------------------------------------------------------------------------------------------- - baseframe.button_stretch = CreateFrame ("button", "DetailsButtonStretch" .. instancia.meu_id, baseframe) + 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) - - local stretch_texture = baseframe.button_stretch:CreateTexture (nil, "overlay") + + 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) baseframe.button_stretch.texture = stretch_texture - + baseframe.button_stretch:SetWidth(32) baseframe.button_stretch:SetHeight(16) - + baseframe.button_stretch:Show() - Details.FadeHandler.Fader (baseframe.button_stretch, "ALPHA", 0) + Details.FadeHandler.Fader(baseframe.button_stretch, "ALPHA", 0) button_stretch_scripts (baseframe, backgrounddisplay, instancia) -- main window config ------------------------------------------------------------------------------------------------------------------------------------------------- baseframe:SetClampedToScreen (true) - baseframe:SetSize (Details.new_window_size.width, Details.new_window_size.height) - + baseframe:SetSize(Details.new_window_size.width, Details.new_window_size.height) + baseframe:SetPoint("center", _UIParent) baseframe:EnableMouseWheel (false) baseframe:EnableMouse(true) @@ -3623,68 +3617,68 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) --baseframe:SetResizeBounds(150, 7, _detalhes.max_window_size.width, _detalhes.max_window_size.height) end - baseframe:SetBackdrop (defaultBackdropSt) - baseframe:SetBackdropColor (instancia.bg_r, instancia.bg_g, instancia.bg_b, instancia.bg_alpha) - + baseframe:SetBackdrop(defaultBackdropSt) + baseframe:SetBackdropColor(instancia.bg_r, instancia.bg_g, instancia.bg_b, instancia.bg_alpha) + -- background window config ------------------------------------------------------------------------------------------------------------------------------------------------- backgroundframe:SetAllPoints(baseframe) backgroundframe:SetScrollChild (backgrounddisplay) - - backgrounddisplay:SetResizable (true) + + backgrounddisplay:SetResizable(true) 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) - + backgrounddisplay:SetBackdrop(defaultBackdropSt) + backgrounddisplay:SetBackdropColor(instancia.bg_r, instancia.bg_g, instancia.bg_b, instancia.bg_alpha) + -- instance mini widgets ------------------------------------------------------------------------------------------------------------------------------------------------- - --> overall data warning + --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:Hide() - instancia.overall_data_warning:SetText (Loc["STRING_TUTORIAL_OVERALL1"]) + instancia.overall_data_warning:SetText(Loc["STRING_TUTORIAL_OVERALL1"]) - --> freeze icon - instancia.freeze_icon = backgrounddisplay:CreateTexture (nil, "overlay") + --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: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:Hide() - - --> details version + + --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:SetText ("this is a alpha version of Details\nyou can help us sending bug reports\nuse the blue button.") + 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 - + end instancia._version:Hide() - - --> wallpaper - baseframe.wallpaper = baseframe:CreateTexture (nil, "overlay") + + --wallpaper + baseframe.wallpaper = baseframe:CreateTexture(nil, "overlay") baseframe.wallpaper:Hide() - - --> alert frame + + --alert frame baseframe.alert = CreateAlertFrame (baseframe, instancia) - + -- resizers & lock button ~lock ------------------------------------------------------------------------------------------------------------------------------------------------------------ - --> right resizer - baseframe.resize_direita = CreateFrame ("button", "Details_Resize_Direita"..ID, baseframe) - - local resize_direita_texture = baseframe.resize_direita:CreateTexture (nil, "overlay") + --right resizer + 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) @@ -3700,8 +3694,8 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) 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) + --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) @@ -3709,21 +3703,21 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) 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.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:SetScript ("OnClick", lockFunctionOnClick) - baseframe.lock_button:SetScript ("OnEnter", lockFunctionOnEnter) - baseframe.lock_button:SetScript ("OnLeave", lockFunctionOnLeave) - baseframe.lock_button:SetScript ("OnHide", lockFunctionOnHide) + 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.instancia = instancia - - --> left resizer - baseframe.resize_esquerda = CreateFrame ("button", "Details_Resize_Esquerda"..ID, baseframe) - - local resize_esquerda_texture = baseframe.resize_esquerda:CreateTexture (nil, "overlay") + + --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) @@ -3737,55 +3731,55 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) baseframe.resize_esquerda:EnableMouse(true) baseframe.resize_esquerda:SetFrameStrata ("HIGH") baseframe.resize_esquerda:SetFrameLevel(baseframe:GetFrameLevel() + 6) - + baseframe.resize_esquerda:SetAlpha(0) baseframe.resize_direita:SetAlpha(0) - + if (instancia.isLocked) then instancia.isLocked = not instancia.isLocked lockFunctionOnClick (baseframe.lock_button, nil, nil, true) end - - Details.FadeHandler.Fader (baseframe.lock_button, -1, 3.0) + + Details.FadeHandler.Fader(baseframe.lock_button, -1, 3.0) -- scripts ------------------------------------------------------------------------------------------------------------------------------------------------------------ BFrame_scripts (baseframe, instancia) --baseframe - BGFrame_scripts (switchbutton, baseframe, instancia) --backgroundframe - BGFrame_scripts (backgrounddisplay, baseframe, instancia) - + BGFrame_scripts(switchbutton, baseframe, instancia) --backgroundframe + BGFrame_scripts(backgrounddisplay, baseframe, instancia) + iterate_scroll_scripts (backgrounddisplay, backgroundframe, baseframe, scrollbar, instancia) - + -- create toolbar ---------------------------------------------------------------------------------------------------------------------------------------------------------- gump:CriaCabecalho (baseframe, instancia) - --- create statusbar ---------------------------------------------------------------------------------------------------------------------------------------------------------- + +-- create statusbar ---------------------------------------------------------------------------------------------------------------------------------------------------------- gump:CriaRodape (baseframe, instancia) -- left and right side bars ------------------------------------------------------------------------------------------------------------------------------------------------------------ -- ~barra ~bordas ~border - --> left - baseframe.barra_esquerda = floatingframe:CreateTexture (nil, "artwork") + --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:SetHeight (512) 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") + --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) - --> bottom - baseframe.barra_fundo = floatingframe:CreateTexture (nil, "artwork") + --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) @@ -3795,51 +3789,51 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) -- break snap button ---------------------------------------------------------------------------------------------------------------------------------------------------------- - instancia.break_snap_button = CreateFrame ("button", "DetailsBreakSnapButton" .. ID, floatingframe) + 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:SetSize (13, 13) + instancia.break_snap_button:SetSize(13, 13) instancia.break_snap_button:SetAlpha(0) - + instancia.break_snap_button.instancia = instancia - - instancia.break_snap_button:SetScript ("OnClick", function() + + instancia.break_snap_button:SetScript("OnClick", function() if (Details.disable_lock_ungroup_buttons) then return end instancia:Desagrupar (-1) - --> hide tutorial + --hide tutorial if (DetailsWindowGroupPopUp1 and DetailsWindowGroupPopUp1:IsShown()) then DetailsWindowGroupPopUp1:Hide() end end) - - instancia.break_snap_button:SetScript ("OnEnter", unSnapButtonOnEnter) - instancia.break_snap_button:SetScript ("OnLeave", unSnapButtonOnLeave) - instancia.break_snap_button:SetNormalTexture (DEFAULT_SKIN) + instancia.break_snap_button:SetScript("OnEnter", unSnapButtonOnEnter) + instancia.break_snap_button:SetScript("OnLeave", unSnapButtonOnLeave) + + instancia.break_snap_button:SetNormalTexture(DEFAULT_SKIN) instancia.break_snap_button:SetDisabledTexture (DEFAULT_SKIN) - instancia.break_snap_button:SetHighlightTexture (DEFAULT_SKIN, "ADD") - instancia.break_snap_button:SetPushedTexture (DEFAULT_SKIN) - + 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)) - --- scripts ------------------------------------------------------------------------------------------------------------------------------------------------------------ - + +-- scripts ------------------------------------------------------------------------------------------------------------------------------------------------------------ + resize_scripts (baseframe.resize_direita, instancia, scrollbar, ">", baseframe) resize_scripts (baseframe.resize_esquerda, instancia, scrollbar, "<", baseframe) - + -- side bars highlights ------------------------------------------------------------------------------------------------------------------------------------------------------------ - --> top - local fcima = CreateFrame ("frame", "DetailsTopSideBarHighlight" .. instancia.meu_id, floatingframe) + --top + local fcima = CreateFrame("frame", "DetailsTopSideBarHighlight" .. instancia.meu_id, floatingframe) gump:CreateFlashAnimation (fcima) fcima:Hide() - - instancia.h_cima = fcima:CreateTexture (nil, "overlay") + + 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) @@ -3847,13 +3841,13 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) instancia.h_cima:SetDesaturated(true) fcima.texture = instancia.h_cima instancia.h_cima = fcima - - --> bottom - local fbaixo = CreateFrame ("frame", "DetailsBottomSideBarHighlight" .. instancia.meu_id, floatingframe) + + --bottom + local fbaixo = CreateFrame("frame", "DetailsBottomSideBarHighlight" .. instancia.meu_id, floatingframe) gump:CreateFlashAnimation (fbaixo) fbaixo:Hide() - - instancia.h_baixo = fbaixo:CreateTexture (nil, "overlay") + + 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) @@ -3861,13 +3855,13 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) instancia.h_baixo:SetDesaturated(true) fbaixo.texture = instancia.h_baixo instancia.h_baixo = fbaixo - - --> left - local fesquerda = CreateFrame ("frame", "DetailsLeftSideBarHighlight" .. instancia.meu_id, floatingframe) + + --left + local fesquerda = CreateFrame("frame", "DetailsLeftSideBarHighlight" .. instancia.meu_id, floatingframe) gump:CreateFlashAnimation (fesquerda) fesquerda:Hide() - - instancia.h_esquerda = fesquerda:CreateTexture (nil, "overlay") + + 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) @@ -3875,13 +3869,13 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) instancia.h_esquerda:SetDesaturated(true) fesquerda.texture = instancia.h_esquerda instancia.h_esquerda = fesquerda - - --> right - local fdireita = CreateFrame ("frame", "DetailsRightSideBarHighlight" .. instancia.meu_id, floatingframe) - gump:CreateFlashAnimation (fdireita) + + --right + local fdireita = CreateFrame("frame", "DetailsRightSideBarHighlight" .. instancia.meu_id, floatingframe) + gump:CreateFlashAnimation (fdireita) fdireita:Hide() - - instancia.h_direita = fdireita:CreateTexture (nil, "overlay") + + 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) @@ -3890,7 +3884,7 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) fdireita.texture = instancia.h_direita instancia.h_direita = fdireita ---> done +--done if (criando) then local CProps = { @@ -3907,7 +3901,7 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) end return baseframe, backgroundframe, backgrounddisplay, scrollbar - + end function Details:IsShowingOverallDataWarning() @@ -3925,13 +3919,13 @@ end function Details:SetBarFollowPlayer (follow) - + if (follow == nil) then follow = self.following.enabled end - + self.following.enabled = follow - + self:RefreshBars() self:InstanceReset() self:ReajustaGump() @@ -3943,7 +3937,7 @@ function Details:SetBarOrientationDirection (orientation) end self.bars_inverted = orientation - + self:InstanceRefreshRows() self:RefreshBars() self:InstanceReset() @@ -3954,44 +3948,44 @@ function Details:SetBarGrowDirection (direction) if (not direction) then direction = self.bars_grow_direction end - + self.bars_grow_direction = direction local x = self.row_info.space.left - - local bars = self.barras or self.Bars --> .Bars for third-party plugins - local baseframe = self.baseframe or self.Frame --> .Frame for plugins + + local bars = self.barras or self.Bars --.Bars for third-party plugins + local baseframe = self.baseframe or self.Frame --.Frame for plugins local height = self.row_height - - if (direction == 1) then --> top to bottom - for index, row in ipairs (bars) do + + if (direction == 1) then --top to bottom + for index, row in ipairs(bars) do local y = height * (index - 1) y = y * -1 row:ClearAllPoints() - - if (self.toolbar_side == 1) then - --> if titlebar is attached to the top side, don't add any midifiers + + 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) else - --> if the titlebar is on the bottom side, remove the gap between the baseframe and the titlebar + --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) end end - - elseif (direction == 2) then --> bottom to top - for index, row in ipairs (bars) do + + elseif (direction == 2) then --bottom to top + for index, row in ipairs(bars) do local y = height * (index - 1) 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 + 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) else - --> the titlebar is on the bottom side, align bars on the bottom + --the titlebar is on the bottom side, align bars on the bottom row:SetPoint("bottomleft", baseframe, "bottomleft", x, y + 0) end end end - - --> update all row width + + --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) @@ -4003,15 +3997,33 @@ function Details:SetBarGrowDirection (direction) end end ---> Alias -function gump:NewRow (instancia, index) - return gump:CreateNewLine (instancia, index) -end +local windowLineMixin = { + SetLineTexture = function(self, texture, coords, vertexColor) + self.texture:SetTexture(texture) + self.texture:SetTexCoord(unpack(coords)) + self.texture:SetVertexColor(DetailsFramework:ParseColors(vertexColor)) + end, + + SetLineIconTexture = function(self, texture, coords, vertexColor) + self.icon_frame:SetTexture(texture) + self.icon_frame:SetTexCoord(unpack(coords)) + self.icon_frame:SetVertexColor(DetailsFramework:ParseColors(vertexColor)) + + self.iconHighlight:SetTexture(texture) + self.iconHighlight:SetTexCoord(unpack(coords)) + self.iconHighlight:SetVertexColor(DetailsFramework:ParseColors(vertexColor)) + end, + + GetActor = function(self) + return self.minha_tabela + end, +} Details.barras_criadas = 0 -local getActor = function(self) - return self.minha_tabela +--alias +function gump:NewRow(instancia, index) + return gump:CreateNewLine(instancia, index) end --search key: ~row ~barra ~newbar ~createbar ~createrow @@ -4019,27 +4031,26 @@ function gump:CreateNewLine(instance, index) --instance = window object, index = row number local baseframe = instance.baseframe 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") + DetailsFramework:Mixin(newLine, windowLineMixin) + newLine.row_id = index newLine.instance_id = instance.meu_id newLine.animacao_fim = 0 newLine.animacao_fim2 = 0 - newLine.GetActor = getActor - --set point, almost irrelevant here, it recalc this on SetBarGrowDirection() local yOffset = instance.row_height * (index-1) if (instance.bars_grow_direction == 1) then 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, yOffset + 2) end - + --row height newLine:SetHeight(instance.row_info.height) newLine:SetWidth(baseframe:GetWidth()+instance.row_info.space.right) @@ -4092,13 +4103,18 @@ function gump:CreateNewLine(instance, index) newLine.overlayTexture:SetAllPoints() --class icon - local classIcon = newLine.border:CreateTexture(nil, "overlay") + local classIcon = newLine.border:CreateTexture(nil, "overlay", nil, 5) 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 - + + --class icon highlight + local iconHightlight = newLine.border:CreateTexture(nil, "overlay", nil, 6) + iconHightlight:SetAllPoints(classIcon) + newLine.iconHighlight = iconHightlight + local iconFrame = CreateFrame("frame", "DetailsBarra_IconFrame_" .. instance.meu_id .. "_" .. index, newLine.statusbar) iconFrame:SetPoint("topleft", classIcon, "topleft") iconFrame:SetPoint("bottomright", classIcon, "bottomright") @@ -4106,15 +4122,15 @@ function gump:CreateNewLine(instance, index) iconFrame.instance_id = instance.meu_id iconFrame.row = newLine newLine.icon_frame = iconFrame - + 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") newLine.lineText1:SetPoint("left", newLine.icone_classe, "right", 3, 0) - newLine.lineText1:SetJustifyH ("left") + newLine.lineText1:SetJustifyH("left") newLine.lineText1:SetNonSpaceWrap (true) --create text columns @@ -4126,117 +4142,117 @@ function gump:CreateNewLine(instance, index) setLineScripts (newLine, instance, index) --hide - Details.FadeHandler.Fader (newLine, 1) + Details.FadeHandler.Fader(newLine, 1) --adds the window container instance.barras [index] = newLine - + --set the left text - newLine.lineText1:SetText (Loc["STRING_NEWROW"]) - + newLine.lineText1:SetText(Loc["STRING_NEWROW"]) + --refresh rows instance:InstanceRefreshRows() - - Details:SendEvent ("DETAILS_INSTANCE_NEWROW", nil, instance, newLine) - + + Details:SendEvent("DETAILS_INSTANCE_NEWROW", nil, instance, newLine) + return newLine end function Details:SetBarTextSettings (size, font, fixedcolor, leftcolorbyclass, rightcolorbyclass, leftoutline, rightoutline, customrighttextenabled, customrighttext, percentage_type, showposition, customlefttextenabled, customlefttext, smalloutline_left, smalloutlinecolor_left, smalloutline_right, smalloutlinecolor_right, translittext) - - --> size + + --size if (size) then self.row_info.font_size = size end - --> font + --font if (font) then self.row_info.font_face = font self.row_info.font_face_file = SharedMedia:Fetch("font", font) end - --> fixed color + --fixed color if (fixedcolor) then - local red, green, blue, alpha = gump:ParseColors (fixedcolor) + local red, green, blue, alpha = gump:ParseColors(fixedcolor) local c = self.row_info.fixed_text_color c[1], c[2], c[3], c[4] = red, green, blue, alpha end - - --> left color by class - if (type (leftcolorbyclass) == "boolean") then + + --left color by class + if (type(leftcolorbyclass) == "boolean") then self.row_info.textL_class_colors = leftcolorbyclass end - - --> right color by class - if (type (rightcolorbyclass) == "boolean") then + + --right color by class + if (type(rightcolorbyclass) == "boolean") then self.row_info.textR_class_colors = rightcolorbyclass end - - --> left text outline - if (type (leftoutline) == "boolean") then + + --left text outline + if (type(leftoutline) == "boolean") then self.row_info.textL_outline = leftoutline end - - --> right text outline - if (type (rightoutline) == "boolean") then + + --right text outline + if (type(rightoutline) == "boolean") then self.row_info.textR_outline = rightoutline end - + -- left text small outline and small outline color - if (type (smalloutline_left) == "boolean") then + if (type(smalloutline_left) == "boolean") then self.row_info.textL_outline_small = smalloutline_left end if (smalloutlinecolor_left) then - local red, green, blue, alpha = gump:ParseColors (smalloutlinecolor_left) - local c = self.row_info.textL_outline_small_color - c[1], c[2], c[3], c[4] = red, green, blue, alpha + local red, green, blue, alpha = gump:ParseColors(smalloutlinecolor_left) + local color = self.row_info.textL_outline_small_color + color[1], color[2], color[3], color[4] = red, green, blue, alpha end -- right text small outline and small outline color - if (type (smalloutline_right) == "boolean") then + if (type(smalloutline_right) == "boolean") then self.row_info.textR_outline_small = smalloutline_right end if (smalloutlinecolor_right) then - local red, green, blue, alpha = gump:ParseColors (smalloutlinecolor_right) - local c = self.row_info.textR_outline_small_color - c[1], c[2], c[3], c[4] = red, green, blue, alpha + local red, green, blue, alpha = gump:ParseColors(smalloutlinecolor_right) + local color = self.row_info.textR_outline_small_color + color[1], color[2], color[3], color[4] = red, green, blue, alpha end - - --> custom left text - if (type (customlefttextenabled) == "boolean") then + + --custom left text + if (type(customlefttextenabled) == "boolean") then self.row_info.textL_enable_custom_text = customlefttextenabled end if (customlefttext) then self.row_info.textL_custom_text = customlefttext end - --> custom right text - if (type (customrighttextenabled) == "boolean") then + --custom right text + if (type(customrighttextenabled) == "boolean") then self.row_info.textR_enable_custom_text = customrighttextenabled end if (customrighttext) then self.row_info.textR_custom_text = customrighttext end - - --> percent type + + --percent type if (percentage_type) then self.row_info.percent_type = percentage_type end - - --> show position number - if (type (showposition) == "boolean") then + + --show position number + if (type(showposition) == "boolean") then self.row_info.textL_show_number = showposition end - --> translit text by Vardex (https://github.com/Vardex May 22, 2019) - if (type (translittext) == "boolean") then + --translit text by Vardex (https://github.com/Vardex May 22, 2019) + if (type(translittext) == "boolean") then self.row_info.textL_translit_text = translittext end - + self:InstanceReset() self:InstanceRefreshRows() end -function Details:SetBarBackdropSettings (enabled, size, color, use_class_colors) +function Details:SetBarBackdropSettings(enabled, size, color, use_class_colors) if (type(enabled) ~= "boolean") then enabled = self.row_info.backdrop.enabled end @@ -4252,7 +4268,7 @@ function Details:SetBarBackdropSettings (enabled, size, color, use_class_colors) if (type(use_class_colors) ~= "boolean") then use_class_colors = self.row_info.backdrop.use_class_colors end - + self.row_info.backdrop.enabled = enabled self.row_info.backdrop.size = size self.row_info.backdrop.color = color @@ -4313,51 +4329,49 @@ function Details:RefreshTitleBar() end end -function Details:SetBarModel (upper_enabled, upper_model, upper_alpha, lower_enabled, lower_model, lower_alpha) - - --> is enabled - if (type (upper_enabled) == "boolean") then +function Details:SetBarModel(upper_enabled, upper_model, upper_alpha, lower_enabled, lower_model, lower_alpha) + --is enabled + if (type(upper_enabled) == "boolean") then self.row_info.models.upper_enabled = upper_enabled end - if (type (lower_enabled) == "boolean") then + if (type(lower_enabled) == "boolean") then self.row_info.models.lower_enabled = lower_enabled end - - --> models: + + --models if (upper_model) then self.row_info.models.upper_model = upper_model end if (lower_model) then self.row_info.models.lower_model = lower_model end - - --> alpha values: + + --alpha values if (upper_alpha) then self.row_info.models.upper_alpha = upper_alpha - end + end if (lower_alpha) then self.row_info.models.lower_alpha = lower_alpha end - + self:InstanceReset() self:InstanceRefreshRows() self:ReajustaGump() - Details:RefreshMainWindow (-1, true) + Details:RefreshMainWindow(-1, true) end -- ~spec ~icons -function Details:SetBarSpecIconSettings (enabled, iconfile, fulltrack) - - if (type (enabled) ~= "boolean") then +function Details:SetBarSpecIconSettings(enabled, iconfile, fulltrack) + if (type(enabled) ~= "boolean") then enabled = self.row_info.use_spec_icons end if (not iconfile) then iconfile = self.row_info.spec_file end - + self.row_info.use_spec_icons = enabled self.row_info.spec_file = iconfile - + if (enabled) then if (not Details.track_specs) then Details.track_specs = true @@ -4365,7 +4379,7 @@ function Details:SetBarSpecIconSettings (enabled, iconfile, fulltrack) end else local have_enabled - for _, instance in ipairs (Details.tabela_instancias) do + for _, instance in ipairs(Details.tabela_instancias) do if (instance:IsEnabled() and instance.row_info.use_spec_icons) then have_enabled = true break @@ -4376,7 +4390,7 @@ function Details:SetBarSpecIconSettings (enabled, iconfile, fulltrack) Details:ResetSpecCache(true) --force end end - + self:InstanceReset() self:InstanceRefreshRows() self:ReajustaGump() @@ -4416,14 +4430,13 @@ function Details:SetBarFactionIconSettings(show_faction_icon, faction_icon_size_ self:ReajustaGump() end -function Details:SetBarSettings (height, texture, colorclass, fixedcolor, backgroundtexture, backgroundcolorclass, backgroundfixedcolor, alpha, iconfile, barstart, spacement, texture_custom, icon_size_offset) - - --> bar start - if (type (barstart) == "boolean") then +function Details:SetBarSettings(height, texture, colorclass, fixedcolor, backgroundtexture, backgroundcolorclass, backgroundfixedcolor, alpha, iconfile, barstart, spacement, texture_custom, icon_size_offset) + --bar start + if (type(barstart) == "boolean") then self.row_info.start_after_icon = barstart end - - --> icon file + + --icon file if (iconfile) then self.row_info.icon_file = iconfile if (iconfile == "") then @@ -4432,63 +4445,63 @@ function Details:SetBarSettings (height, texture, colorclass, fixedcolor, backgr self.row_info.no_icon = false end end - - --> alpha + + --alpha if (alpha) then self.row_info.alpha = alpha end - - --> height + + --height if (height) then self.row_info.height = height self.row_height = height + self.row_info.space.between end - - --> spacement + + --spacement if (spacement) then self.row_info.space.between = spacement self.row_height = self.row_info.height + spacement end - - --> texture + + --texture if (texture) then self.row_info.texture = texture self.row_info.texture_file = SharedMedia:Fetch("statusbar", texture) end - + if (texture_custom) then self.row_info.texture_custom = texture_custom self.row_info.texture_custom_file = "Interface\\" .. self.row_info.texture_custom end - - --> color by class - if (type (colorclass) == "boolean") then + + --color by class + if (type(colorclass) == "boolean") then self.row_info.texture_class_colors = colorclass end - - --> fixed color + + --fixed color if (fixedcolor) then - local red, green, blue = gump:ParseColors (fixedcolor) - local c = self.row_info.fixed_texture_color - c[1], c[2], c[3], c[4] = red, green, blue, self.row_info.alpha + local red, green, blue = gump:ParseColors(fixedcolor) + local color = self.row_info.fixed_texture_color + color[1], color[2], color[3], color[4] = red, green, blue, self.row_info.alpha end - - --> background texture + + --background texture if (backgroundtexture) then self.row_info.texture_background = backgroundtexture self.row_info.texture_background_file = SharedMedia:Fetch("statusbar", backgroundtexture) end - - --> background color by class - if (type (backgroundcolorclass) == "boolean") then + + --background color by class + if (type(backgroundcolorclass) == "boolean") then self.row_info.texture_background_class_color = backgroundcolorclass end - - --> background fixed color + + --background fixed color if (backgroundfixedcolor) then - local red, green, blue, alpha = gump:ParseColors (backgroundfixedcolor) - local c = self.row_info.fixed_texture_background_color - c [1], c [2], c [3], c [4] = red, green, blue, alpha + local red, green, blue, alpha = gump:ParseColors(backgroundfixedcolor) + local color = self.row_info.fixed_texture_background_color + color[1], color[2], color[3], color[4] = red, green, blue, alpha end if (icon_size_offset and type(icon_size_offset) == "number") then @@ -4522,25 +4535,24 @@ local separators = { } function Details:GetBarBracket() - return brackets [self.row_info.textR_bracket] + return brackets[self.row_info.textR_bracket] end function Details:GetBarSeparator() - return separators [self.row_info.textR_separator] + return separators[self.row_info.textR_separator] end -function Details:SetBarRightTextSettings (total, persecond, percent, bracket, separator) +function Details:SetBarRightTextSettings(total, persecond, percent, bracket, separator) + if (type(total) == "boolean") then + self.row_info.textR_show_data[1] = total + end + if (type(persecond) == "boolean") then + self.row_info.textR_show_data[2] = persecond + end + if (type(percent) == "boolean") then + self.row_info.textR_show_data[3] = percent + end - if (type (total) == "boolean") then - self.row_info.textR_show_data [1] = total - end - if (type (persecond) == "boolean") then - self.row_info.textR_show_data [2] = persecond - end - if (type (percent) == "boolean") then - self.row_info.textR_show_data [3] = percent - end - if (bracket) then self.row_info.textR_bracket = bracket end @@ -4549,19 +4561,18 @@ function Details:SetBarRightTextSettings (total, persecond, percent, bracket, se end self:InstanceReset() - end --/script _detalhes:InstanceRefreshRows (_detalhes.tabela_instancias[1]) --onupdate function for 'Fast Updates' feature -local fast_ps_func = function(self) +local fastUpdatePerSecondFunc = function(self) local instance = self.instance - + if (not instance.showing) then return end - + local combatTime = instance.showing:GetCombatTime() local abbreviationType = Details.ps_abbreviation local abbreviationFunc = tokFunctions[abbreviationType] @@ -4602,52 +4613,51 @@ local fast_ps_func = function(self) end -- ~dps ~hps ---> check if can start or need to stop +--check if can start or need to stop function Details:CheckPsUpdate() + local isEnabled = self.row_info.fast_ps_update - local is_enabled = self.row_info.fast_ps_update - - if (is_enabled) then - --> check if the frame is created + if (isEnabled) then + --check if the frame is created if (not self.ps_update_frame) then - self.ps_update_frame = CreateFrame ("frame", "DetailsInstance" .. self.meu_id .. "PsUpdate", self.baseframe) + self.ps_update_frame = CreateFrame("frame", "DetailsInstance" .. self.meu_id .. "PsUpdate", self.baseframe) self.ps_update_frame.instance = self end - - --> if isn't in combat, just stop + + --if isn't in combat, just stop if (not Details.in_combat) then if (self.ps_update_frame.is_running) then self.ps_update_frame.is_running = nil self.ps_update_frame:Hide() - self.ps_update_frame:SetScript ("OnUpdate", nil) + self.ps_update_frame:SetScript("OnUpdate", nil) end return end - - --> check if needs to start + + --check if needs to start local attribute, sub_attribute = self:GetDisplay() - - --> check if the instance is showing damage done/dps or healing done/hps + + --check if the instance is showing damage done/dps or healing done/hps if ( (attribute == 1 and (sub_attribute == 1 or sub_attribute == 2)) or (attribute == 2 and (sub_attribute == 1 or sub_attribute == 2))) then if (not self.ps_update_frame.is_running) then self.ps_update_frame.is_running = true self.ps_update_frame:Show() - self.ps_update_frame:SetScript ("OnUpdate", fast_ps_func) + self.ps_update_frame:SetScript("OnUpdate", fastUpdatePerSecondFunc) end else - --> check if needs to stop + --check if needs to stop if (self.ps_update_frame.is_running) then self.ps_update_frame.is_running = nil self.ps_update_frame:Hide() - self.ps_update_frame:SetScript ("OnUpdate", nil) + self.ps_update_frame:SetScript("OnUpdate", nil) end end - + else if (self.ps_update_frame and self.ps_update_frame.is_running) then self.ps_update_frame.is_running = nil self.ps_update_frame:Hide() - self.ps_update_frame:SetScript ("OnUpdate", nil) + self.ps_update_frame:SetScript("OnUpdate", nil) end end end @@ -4655,19 +4665,19 @@ end -- /run _detalhes:GetInstance(1):FastPSUpdate (true) -- /dump (_detalhes:GetInstance(1).fast_ps_update) -function Details:FastPSUpdate (enabled) - if (type (enabled) ~= "boolean") then +function Details:FastPSUpdate(enabled) + if (type(enabled) ~= "boolean") then enabled = self.row_info.fast_ps_update end - + self.row_info.fast_ps_update = enabled - + self:CheckPsUpdate() end function Details:AdjustInLineTextPadding() - for _, row in ipairs(self.barras) do + for _, row in ipairs(self.barras) do 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) @@ -4679,14 +4689,14 @@ function Details:InstanceRefreshRows(instance) if (instance) then self = instance end - + if (not self.barras or not self.barras[1]) then return end - + --mirror local isInvertedBars = self.bars_inverted - + --texture local textureFile = SharedMedia:Fetch("statusbar", self.row_info.texture) local textureFile2 = SharedMedia:Fetch("statusbar", self.row_info.texture_background) @@ -4694,7 +4704,7 @@ function Details:InstanceRefreshRows(instance) --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 @@ -4732,7 +4742,7 @@ function Details:InstanceRefreshRows(instance) --icons 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 isDesaturated = self.row_info.icon_grayscale local icon_offset_x, icon_offset_y = unpack(self.row_info.icon_offset) --line border @@ -4754,16 +4764,17 @@ function Details:InstanceRefreshRows(instance) 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) + row.icone_classe:SetSize(height, height) - if (icon_force_grayscale) then + if (isDesaturated) then row.icone_classe:SetDesaturated(true) + row.iconHighlight:SetDesaturated(true) else row.icone_classe:SetDesaturated(false) + row.iconHighlight:SetDesaturated(false) end --icon and texture anchors @@ -4795,17 +4806,18 @@ function Details:InstanceRefreshRows(instance) row.statusbar:SetPoint("bottomright", row, "bottomright") row.lineText1:SetPoint("left", row.statusbar, "left", 2, 0) row.icone_classe:Hide() + row.iconHighlight:Hide() else row.icone_classe:ClearAllPoints() 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") else row.statusbar:SetPoint("topleft", row, "topleft") end - + row.statusbar:SetPoint("bottomright", row, "bottomright") row.lineText1:SetPoint("left", row.icone_classe, "right", 3, 0) end @@ -4819,16 +4831,17 @@ function Details:InstanceRefreshRows(instance) row.lineText3:SetJustifyH("left") 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) - + 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.icone_classe:Hide() + row.iconHighlight: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")]] @@ -4837,13 +4850,13 @@ function Details:InstanceRefreshRows(instance) row.icone_classe:ClearAllPoints() 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") else row.statusbar:SetPoint("bottomright", row, "bottomright") end - + row.statusbar:SetPoint("topleft", row, "topleft") row.lineText1:SetPoint("right", row.icone_classe, "left", -2, 0) @@ -4851,12 +4864,12 @@ function Details:InstanceRefreshRows(instance) 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]) + local color = self.row_info.fixed_texture_background_color + row.background:SetVertexColor(color[1], color[2], color[3], color[4]) else - local c = self.row_info.fixed_texture_background_color + local color = 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, color[4]) end --outline @@ -4895,36 +4908,28 @@ function Details:InstanceRefreshRows(instance) row.lineText2:SetShadowColor(0, 0, 0, 0) end - --texture: + --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.background:SetTexture(textureFile2) row.overlayTexture:SetTexture(overlayTexture) row.overlayTexture:SetVertexColor(unpack(overlayColor)) - + 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) else row.statusbar:SetReverseFill(false) - --row.right_to_left_texture:Hide() end - + --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) - --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) 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 end - + --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) @@ -4934,13 +4939,13 @@ function Details:InstanceRefreshRows(instance) 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 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") @@ -4955,8 +4960,8 @@ function Details:InstanceRefreshRows(instance) row.lineBorder:UpdateSizes() else row.lineBorder:Hide() - end - + end + --models if (upper_model_enabled) then row.using_upper_3dmodels = true @@ -4967,7 +4972,7 @@ function Details:InstanceRefreshRows(instance) row.using_upper_3dmodels = false row.modelbox_high:Hide() end - + if (lower_model_enabled) then row.using_lower_3dmodels = true row.modelbox_low:Show() @@ -4979,7 +4984,7 @@ function Details:InstanceRefreshRows(instance) end end - + self:SetBarGrowDirection() self:UpdateClickThrough() end @@ -5019,135 +5024,135 @@ function Details:SetInstanceWallpaperLevel(wallpaperLevel) elseif (wallpaperLevel == 3) then wallpaperTexture:SetParent(self.windowSwitchButton) --framelevel +4 end - - --debug - --/run Details:GetWindow(1):SetInstanceWallpaperLevel(0) end -- search key: ~wallpaper -function Details:InstanceWallpaper (texture, anchor, alpha, texcoord, width, height, overlay) - +function Details:InstanceWallpaper(texture, anchor, alpha, texCoord, width, height, overlay) local wallpaper = self.wallpaper - - if (type (texture) == "boolean" and texture) then - texture, anchor, alpha, texcoord, width, height, overlay = wallpaper.texture, wallpaper.anchor, wallpaper.alpha, wallpaper.texcoord, wallpaper.width, wallpaper.height, wallpaper.overlay - - elseif (type (texture) == "boolean" and not texture) then + + if (type(texture) == "boolean" and texture) then + texture, anchor, alpha, texCoord, width, height, overlay = wallpaper.texture, wallpaper.anchor, wallpaper.alpha, wallpaper.texcoord, wallpaper.width, wallpaper.height, wallpaper.overlay + + elseif (type(texture) == "boolean" and not texture) then self.wallpaper.enabled = false - return Details.FadeHandler.Fader (self.baseframe.wallpaper, "in") - - elseif (type (texture) == "table") then + return Details.FadeHandler.Fader(self.baseframe.wallpaper, "in") + + elseif (type(texture) == "table") then anchor = texture.anchor or wallpaper.anchor alpha = texture.alpha or wallpaper.alpha + if (texture.texcoord) then - texcoord = {unpack(texture.texcoord)} + texCoord = {unpack(texture.texcoord)} else - texcoord = wallpaper.texcoord + texCoord = wallpaper.texcoord end + width = texture.width or wallpaper.width height = texture.height or wallpaper.height + if (texture.overlay) then overlay = {unpack(texture.overlay)} else overlay = wallpaper.overlay end - - if (type (texture.enabled) == "boolean") then + + if (type(texture.enabled) == "boolean") then if (not texture.enabled) then wallpaper.enabled = false wallpaper.texture = texture.texture or wallpaper.texture wallpaper.anchor = anchor wallpaper.alpha = alpha - wallpaper.texcoord = texcoord + wallpaper.texcoord = texCoord wallpaper.width = width wallpaper.height = height wallpaper.overlay = overlay return self:InstanceWallpaper (false) end end - + texture = texture.texture or wallpaper.texture else texture = texture or wallpaper.texture anchor = anchor or wallpaper.anchor alpha = alpha or wallpaper.alpha - texcoord = texcoord or wallpaper.texcoord + texCoord = texCoord or wallpaper.texcoord width = width or wallpaper.width height = height or wallpaper.height overlay = overlay or wallpaper.overlay end - + if (not wallpaper.texture and not texture) then texture = "Interface\\AddOns\\Details\\images\\background" - - texcoord = {0, 1, 0, 0.7} + texCoord = {0, 1, 0, 0.7} alpha = 0.5 width, height = self:GetSize() anchor = "all" end - - local t = self.baseframe.wallpaper - t:ClearAllPoints() - + local wallpaperTable = self.baseframe.wallpaper + + wallpaperTable:ClearAllPoints() + if (anchor == "all") then - t:SetPoint("topleft", self.baseframe, "topleft") - t:SetPoint("bottomright", self.baseframe, "bottomright") + wallpaperTable:SetPoint("topleft", self.baseframe, "topleft") + wallpaperTable: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) + wallpaperTable:SetPoint("topleft", self.baseframe.titleBar, "topleft", 0, 0) + wallpaperTable:SetPoint("bottomright", self.baseframe, "bottomright", 1, -1) + elseif (anchor == "center") then - t:SetPoint("center", self.baseframe, "center", 0, 4) + wallpaperTable: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") + wallpaperTable:SetPoint("center", self.baseframe, "center") + wallpaperTable:SetPoint("left", self.baseframe, "left") + wallpaperTable: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") + wallpaperTable:SetPoint("center", self.baseframe, "center") + wallpaperTable:SetPoint("top", self.baseframe, "top") + wallpaperTable:SetPoint("bottom", self.baseframe, "bottom") + else - t:SetPoint(anchor, self.baseframe, anchor) + wallpaperTable:SetPoint(anchor, self.baseframe, anchor) end - - t:SetTexture(texture) - t:SetTexCoord(unpack(texcoord)) - t:SetWidth(width) - t:SetHeight(height) - t:SetVertexColor(unpack(overlay)) - + + wallpaperTable:SetTexture(texture) + wallpaperTable:SetTexCoord(unpack(texCoord)) + wallpaperTable:SetWidth(width) + wallpaperTable:SetHeight(height) + wallpaperTable:SetVertexColor(unpack(overlay)) + wallpaper.enabled = true wallpaper.texture = texture wallpaper.anchor = anchor wallpaper.alpha = alpha - wallpaper.texcoord = texcoord + wallpaper.texcoord = texCoord wallpaper.width = width wallpaper.height = height wallpaper.overlay = overlay - t:Show() - --t:SetAlpha(alpha) - Details.FadeHandler.Fader (t, "ALPHAANIM", alpha) - + wallpaperTable:Show() + Details.FadeHandler.Fader(wallpaperTable, "ALPHAANIM", alpha) end function Details:GetTextures() - local t = {} - t [1] = self.baseframe.rodape.esquerdo - t [2] = self.baseframe.rodape.direita - t [3] = self.baseframe.rodape.top_bg - - t [4] = self.baseframe.cabecalho.ball_r - t [5] = self.baseframe.cabecalho.ball - t [6] = self.baseframe.cabecalho.emenda - t [7] = self.baseframe.cabecalho.top_bg - - t [8] = self.baseframe.barra_esquerda - t [9] = self.baseframe.barra_direita - t [10] = self.baseframe.UPFrame - return t - --atributo_icon � uma exce��o + local textureTable = {} + textureTable[1] = self.baseframe.rodape.esquerdo + textureTable[2] = self.baseframe.rodape.direita + textureTable[3] = self.baseframe.rodape.top_bg + + textureTable[4] = self.baseframe.cabecalho.ball_r + textureTable[5] = self.baseframe.cabecalho.ball + textureTable[6] = self.baseframe.cabecalho.emenda + textureTable[7] = self.baseframe.cabecalho.top_bg + + textureTable[8] = self.baseframe.barra_esquerda + textureTable[9] = self.baseframe.barra_direita + textureTable[10] = self.baseframe.UPFrame + return textureTable end function Details:SetWindowAlphaForInteract(alpha) @@ -5166,7 +5171,7 @@ function Details:SetWindowAlphaForInteract(alpha) end else --mouse left the window - if (self.combat_changes_alpha and self.combat_changes_alpha ~= 1) then --> combat alpha + if (self.combat_changes_alpha and self.combat_changes_alpha ~= 1) then --combat alpha self:InstanceAlpha(self.combat_changes_alpha) self:SetIconAlpha(self.combat_changes_alpha, nil, true) self.rowframe:SetFrameAlpha(self.combat_changes_alpha) --alpha do combate � absoluta @@ -5185,19 +5190,18 @@ function Details:SetWindowAlphaForInteract(alpha) self.baseframe:SetAlpha(alpha) end end - + if (Details.debug) then - Details:Msg ("(debug) setting window alpha for SetWindowAlphaForInteract() -> ", alpha) - end - + Details:Msg("(debug) setting window alpha for SetWindowAlphaForInteract() -> ", alpha) + end end -- ~autohide �utohide -function Details:SetWindowAlphaForCombat (entering_in_combat, true_hide, alphaAmount) +function Details:SetWindowAlphaForCombat(enteringInCombat, trueHide, alphaAmount) local amount, rowsamount, menuamount --get the values - if (entering_in_combat) then + if (enteringInCombat) then amount = alphaAmount / 100 self.combat_changes_alpha = amount rowsamount = amount @@ -5233,14 +5237,14 @@ function Details:SetWindowAlphaForCombat (entering_in_combat, true_hide, alphaAm end self.combat_changes_alpha = nil end - + --apply - if (true_hide and amount == 0) then + if (trueHide and amount == 0) then self.baseframe:Hide() self.rowframe:Hide() self.windowSwitchButton:Hide() if (Details.debug) then - Details:Msg ("(debug) hiding window SetWindowAlphaForCombat()", amount, rowsamount, menuamount) + Details:Msg("(debug) hiding window SetWindowAlphaForCombat()", amount, rowsamount, menuamount) end else self.baseframe:Show() @@ -5249,79 +5253,69 @@ function Details:SetWindowAlphaForCombat (entering_in_combat, true_hide, alphaAm self:InstanceAlpha(min(amount, self.color[4])) Details.FadeHandler.Fader(self.rowframe, "ALPHAANIM", parseRowFrameAlpha(rowsamount)) Details.FadeHandler.Fader(self.baseframe, "ALPHAANIM", rowsamount) - --]] end - + if (self.show_statusbar) then self.baseframe.barra_fundo:Hide() end if (self.hide_icon) then self.baseframe.cabecalho.atributo_icon:Hide() end - end --this function is called only from SetAutoHideMenu() -function Details:InstanceButtonsColors (red, green, blue, alpha, no_save, only_left, only_right) - +function Details:InstanceButtonsColors(red, green, blue, alpha, noSave, onlyLeft, onlyRight) if (not red) then red, green, blue, alpha = unpack(self.color_buttons) end - - if (type (red) ~= "number") then - red, green, blue, alpha = gump:ParseColors (red) + + if (type(red) ~= "number") then + red, green, blue, alpha = gump:ParseColors(red) end - - if (not no_save) then - self.color_buttons [1] = red - self.color_buttons [2] = green - self.color_buttons [3] = blue - self.color_buttons [4] = alpha + + if (not noSave) then + self.color_buttons[1] = red + self.color_buttons[2] = green + self.color_buttons[3] = blue + self.color_buttons[4] = alpha end - + local baseToolbar = self.baseframe.cabecalho - - if (only_left) then - + if (onlyLeft) then local icons = {baseToolbar.modo_selecao, baseToolbar.segmento, baseToolbar.atributo, baseToolbar.report, baseToolbar.fechar, baseToolbar.reset, baseToolbar.fechar} - - for _, button in ipairs (icons) do + for _, button in ipairs(icons) do button:SetAlpha(alpha) end if (self:IsLowerInstance()) then - for _, ThisButton in ipairs (Details.ToolBar.Shown) do + for _, ThisButton in ipairs(Details.ToolBar.Shown) do ThisButton:SetAlpha(alpha) end end - else - local icons = {baseToolbar.modo_selecao, baseToolbar.segmento, baseToolbar.atributo, baseToolbar.report, baseToolbar.fechar, baseToolbar.reset, baseToolbar.fechar} - - for _, button in ipairs (icons) do + for _, button in ipairs(icons) do button:SetAlpha(alpha) end if (self:IsLowerInstance()) then - for _, ThisButton in ipairs (Details.ToolBar.Shown) do + for _, ThisButton in ipairs(Details.ToolBar.Shown) do ThisButton:SetAlpha(alpha) end end - end end -function Details:InstanceAlpha (alpha) +function Details:InstanceAlpha(alpha) self.baseframe.cabecalho.ball_r:SetAlpha(alpha) self.baseframe.cabecalho.ball:SetAlpha(alpha) - - local skin = Details.skins [self.skin] + + local skin = Details.skins[self.skin] if (not skin.icon_ignore_alpha) then self.baseframe.cabecalho.atributo_icon:SetAlpha(alpha) - end - + end + self.baseframe.cabecalho.emenda:SetAlpha(alpha) self.baseframe.cabecalho.top_bg:SetAlpha(alpha) self.baseframe.barra_esquerda:SetAlpha(alpha) @@ -5360,13 +5354,13 @@ function Details:InstanceColor(red, green, blue, alpha, noSave, changeStatusbar) local tempSkin = self:WaitForSkin() skin = tempSkin end - + self.baseframe.cabecalho.ball_r:SetVertexColor(red, green, blue) self.baseframe.cabecalho.ball_r:SetAlpha(alpha) - + self.baseframe.cabecalho.ball:SetVertexColor(red, green, blue) self.baseframe.cabecalho.ball:SetAlpha(alpha) - + if (not skin.icon_ignore_alpha) then self.baseframe.cabecalho.atributo_icon:SetAlpha(alpha) end @@ -5382,44 +5376,43 @@ function Details:InstanceColor(red, green, blue, alpha, noSave, changeStatusbar) self.baseframe.barra_direita:SetAlpha(alpha) self.baseframe.barra_fundo:SetVertexColor(red, green, blue) self.baseframe.barra_fundo:SetAlpha(alpha) - + self.baseframe.UPFrame:SetAlpha(alpha) end -function Details:StatusBarAlertTime (instance) +function Details:StatusBarAlertTime(instance) instance.baseframe.statusbar:Hide() end -function Details:StatusBarAlert (text, icon, color, time) - +function Details:StatusBarAlert(text, icon, color, time) local statusbar = self.baseframe.statusbar - + if (text) then - if (type (text) == "table") 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) end - - statusbar.text:SetText (text.text or "") - + + statusbar.text:SetText(text.text or "") + if (text.size) then Details:SetFontSize(statusbar.text, text.size) else Details:SetFontSize(statusbar.text, 9) end else - statusbar.text:SetText (text) + statusbar.text:SetText(text) statusbar.text:SetTextColor(1, 1, 1, 1) Details:SetFontSize(statusbar.text, 9) end else - statusbar.text:SetText ("") + statusbar.text:SetText("") end - + if (icon) then - if (type (icon) == "table") 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) @@ -5436,13 +5429,13 @@ function Details:StatusBarAlert (text, icon, color, time) else statusbar.icon:SetTexture("") end - + if (color) then - statusbar:SetBackdropColor (gump:ParseColors (color)) + statusbar:SetBackdropColor(gump:ParseColors(color)) else - statusbar:SetBackdropColor (0, 0, 0, 1) + statusbar:SetBackdropColor(0, 0, 0, 1) end - + if (icon or text) then statusbar:Show() if (time) then @@ -5453,124 +5446,125 @@ function Details:StatusBarAlert (text, icon, color, time) end end - -function gump:CriaRodape (baseframe, instancia) - +function gump:CriaRodape(baseframe, instancia) baseframe.rodape = {} - - --> esquerdo com statusbar - baseframe.rodape.esquerdo = instancia.floatingframe:CreateTexture (nil, "overlay") + + --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) - - --> esquerdo sem statusbar - baseframe.rodape.esquerdo_nostatusbar = instancia.floatingframe:CreateTexture (nil, "overlay") + + --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) - - --> direito com statusbar - baseframe.rodape.direita = instancia.floatingframe:CreateTexture (nil, "overlay") + + --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) - - --> direito sem statusbar - baseframe.rodape.direita_nostatusbar = instancia.floatingframe:CreateTexture (nil, "overlay") + + --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) - - --> barra centro - baseframe.rodape.top_bg = baseframe:CreateTexture (nil, "background") + + --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) - - local StatusBarLeftAnchor = CreateFrame ("frame", "DetailsStatusBarAnchorLeft" .. instancia.meu_id, baseframe) + + 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) baseframe.rodape.StatusBarLeftAnchor = StatusBarLeftAnchor - - local StatusBarCenterAnchor = CreateFrame ("frame", "DetailsStatusBarAnchorCenter" .. instancia.meu_id, baseframe) + + 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) 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) - - local statusbar_icon = baseframe.statusbar:CreateTexture (nil, "overlay") - 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) - - baseframe.statusbar:SetBackdrop ({ - bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16, - insets = {left = 0, right = 0, top = 0, bottom = 0}}) - baseframe.statusbar:SetBackdropColor (0, 0, 0, 1) - - baseframe.statusbar.icon = statusbar_icon - baseframe.statusbar.text = statusbar_text - baseframe.statusbar.instancia = instancia - - baseframe.statusbar:Hide() - - --> frame invis�vel - baseframe.DOWNFrame = CreateFrame ("frame", "DetailsDownFrame" .. instancia.meu_id, baseframe) + + --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) + + local statusbar_icon = baseframe.statusbar:CreateTexture(nil, "overlay") + 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) + + baseframe.statusbar:SetBackdrop({ + bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16, + insets = {left = 0, right = 0, top = 0, bottom = 0}}) + baseframe.statusbar:SetBackdropColor(0, 0, 0, 1) + + baseframe.statusbar.icon = statusbar_icon + baseframe.statusbar.text = statusbar_text + baseframe.statusbar.instancia = instancia + + baseframe.statusbar:Hide() + + --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:Show() baseframe.DOWNFrame:EnableMouse(true) baseframe.DOWNFrame:SetMovable (true) - baseframe.DOWNFrame:SetResizable (true) - - BGFrame_scripts (baseframe.DOWNFrame, baseframe, instancia) + baseframe.DOWNFrame:SetResizable(true) + + BGFrame_scripts(baseframe.DOWNFrame, baseframe, instancia) end function Details:GetMenuAnchorPoint() local toolbar_side = self.toolbar_side local menu_side = self.menu_anchor.side - + if (menu_side == 1) then --left if (toolbar_side == 1) then --top return self.menu_points [1], "bottomleft", "bottomright" + elseif (toolbar_side == 2) then --bottom return self.menu_points [1], "topleft", "topright" end + elseif (menu_side == 2) then --right if (toolbar_side == 1) then --top return self.menu_points [2], "topleft", "bottomleft" + elseif (toolbar_side == 2) then --bottom return self.menu_points [2], "topleft", "topleft" end end end ---> search key: ~icon +--search key: ~icon function Details:ToolbarMenuButtonsSize(size) size = size or self.menu_icons_size self.menu_icons_size = size @@ -5579,13 +5573,12 @@ end local SetIconAlphaCacheButtonsTable = {} function Details:SetIconAlpha(alpha, hide, noAnimations) - if (self.attribute_text.enabled) then if (not self.menu_attribute_string) then --created on demand self:AttributeMenu() end - + if (hide) then Details.FadeHandler.Fader(self.menu_attribute_string.widget, unpack(Details.windows_fade_in)) else @@ -5596,7 +5589,7 @@ function Details:SetIconAlpha(alpha, hide, noAnimations) end end end - + table.wipe(SetIconAlphaCacheButtonsTable) SetIconAlphaCacheButtonsTable[1] = self.baseframe.cabecalho.modo_selecao SetIconAlphaCacheButtonsTable[2] = self.baseframe.cabecalho.segmento @@ -5624,12 +5617,12 @@ function Details:SetIconAlpha(alpha, hide, noAnimations) end end end - + if (self:IsLowerInstance()) then if (#Details.ToolBar.Shown > 0) then - for index, button in ipairs (Details.ToolBar.Shown) do + for index, button in ipairs(Details.ToolBar.Shown) do if (hide) then - Details.FadeHandler.Fader (button, unpack(Details.windows_fade_in)) + Details.FadeHandler.Fader(button, unpack(Details.windows_fade_in)) else if (noAnimations) then button:SetAlpha(alpha) @@ -5642,82 +5635,85 @@ function Details:SetIconAlpha(alpha, hide, noAnimations) end end -function Details:ToolbarMenuSetButtonsOptions (spacement, shadow) - if (type (spacement) ~= "number") then +function Details:ToolbarMenuSetButtonsOptions(spacement, shadow) + if (type(spacement) ~= "number") then spacement = self.menu_icons.space end - - if (type (shadow) ~= "boolean") then + + if (type(shadow) ~= "boolean") then shadow = self.menu_icons.shadow end - + self.menu_icons.space = spacement self.menu_icons.shadow = shadow - + return self:ToolbarMenuSetButtons() end -- search key: ~buttons ~icons - local tbuttons = {} -function Details:ToolbarMenuSetButtons (_mode, _segment, _attributes, _report, _reset, _close) - +function Details:ToolbarMenuSetButtons(_mode, _segment, _attributes, _report, _reset, _close) if (_mode == nil) then _mode = self.menu_icons[1] end + if (_segment == nil) then _segment = self.menu_icons[2] end + if (_attributes == nil) then _attributes = self.menu_icons[3] end + if (_report == nil) then _report = self.menu_icons[4] end + if (_reset == nil) then _reset = self.menu_icons[5] end + if (_close == nil) then _close = self.menu_icons[6] end - + self.menu_icons[1] = _mode self.menu_icons[2] = _segment self.menu_icons[3] = _attributes self.menu_icons[4] = _report self.menu_icons[5] = _reset self.menu_icons[6] = _close - + table.wipe (tbuttons) - - tbuttons [1] = self.baseframe.cabecalho.modo_selecao - tbuttons [2] = self.baseframe.cabecalho.segmento - tbuttons [3] = self.baseframe.cabecalho.atributo - tbuttons [4] = self.baseframe.cabecalho.report - tbuttons [5] = self.baseframe.cabecalho.reset - tbuttons [6] = self.baseframe.cabecalho.fechar + + tbuttons[1] = self.baseframe.cabecalho.modo_selecao + tbuttons[2] = self.baseframe.cabecalho.segmento + tbuttons[3] = self.baseframe.cabecalho.atributo + tbuttons[4] = self.baseframe.cabecalho.report + tbuttons[5] = self.baseframe.cabecalho.reset + tbuttons[6] = self.baseframe.cabecalho.fechar local anchor_frame, point1, point2 = self:GetMenuAnchorPoint() local got_anchor = false self.lastIcon = nil self.firstIcon = nil - + local size = self.menu_icons_size local space = self.menu_icons.space local shadow = self.menu_icons.shadow - + local toolbar_icon_file = self.toolbar_icon_file if (shadow) then toolbar_icon_file = toolbar_icon_file .. "_shadow" end local total_buttons_shown = 0 - - --> normal buttons + + --normal buttons if (self.menu_anchor.side == 1) then - for index, button in ipairs (tbuttons) do - if (self.menu_icons [index]) then + for index, button in ipairs(tbuttons) do + if (self.menu_icons[index]) then button:ClearAllPoints() if (got_anchor) then button:SetPoint("left", self.lastIcon.widget or self.lastIcon, "right", space, 0) @@ -5726,23 +5722,24 @@ function Details:ToolbarMenuSetButtons (_mode, _segment, _attributes, _report, _ got_anchor = button self.firstIcon = button end + self.lastIcon = button - button:SetParent (self.baseframe) + button:SetParent(self.baseframe) button:SetFrameLevel(self.baseframe.UPFrame:GetFrameLevel()+1) button:Show() - button:SetSize (16*size, 16*size) - - button:SetNormalTexture (toolbar_icon_file) - button:SetHighlightTexture (toolbar_icon_file) - button:SetPushedTexture (toolbar_icon_file) - + button:SetSize(16 * size, 16 * size) + + button:SetNormalTexture(toolbar_icon_file) + button:SetHighlightTexture(toolbar_icon_file) + button:SetPushedTexture(toolbar_icon_file) + total_buttons_shown = total_buttons_shown + 1 else button:Hide() end end - + elseif (self.menu_anchor.side == 2) then for index = #tbuttons, 1, -1 do local button = tbuttons [index] @@ -5757,76 +5754,75 @@ function Details:ToolbarMenuSetButtons (_mode, _segment, _attributes, _report, _ self.firstIcon = button end self.lastIcon = button - button:SetParent (self.baseframe) + button:SetParent(self.baseframe) button:SetFrameLevel(self.baseframe.UPFrame:GetFrameLevel()+1) button:Show() - - button:SetSize (16*size, 16*size) - - button:SetNormalTexture (toolbar_icon_file) - button:SetHighlightTexture (toolbar_icon_file) - button:SetPushedTexture (toolbar_icon_file) - + + button:SetSize(16 * size, 16 * size) + + button:SetNormalTexture(toolbar_icon_file) + button:SetHighlightTexture(toolbar_icon_file) + button:SetPushedTexture(toolbar_icon_file) + total_buttons_shown = total_buttons_shown + 1 else button:Hide() end end end - - --> plugins buttons - + + --plugins buttons local pluginFirstIcon = true if (not self.baseframe.cabecalho.PluginIconsSeparator) then - self.baseframe.cabecalho.PluginIconsSeparator = self.baseframe:CreateTexture (nil, "overlay") + self.baseframe.cabecalho.PluginIconsSeparator = self.baseframe:CreateTexture(nil, "overlay") 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) - + local scale = 0.4 - self.baseframe.cabecalho.PluginIconsSeparator:SetSize (16 * scale, 16 * scale) + self.baseframe.cabecalho.PluginIconsSeparator:SetSize(16 * scale, 16 * scale) end - + self.baseframe.cabecalho.PluginIconsSeparator:Hide() - + if (self:IsLowerInstance()) then if (#Details.ToolBar.Shown > 0) then - + local last_plugin_icon - + if (#Details.ToolBar.Shown > 0) then self.baseframe.cabecalho.PluginIconsSeparator:Show() self.baseframe.cabecalho.PluginIconsSeparator:ClearAllPoints() self.baseframe.cabecalho.PluginIconsSeparator.widget = self.baseframe.cabecalho.PluginIconsSeparator end - - for index, button in ipairs (Details.ToolBar.Shown) do + + for index, button in ipairs(Details.ToolBar.Shown) do button:ClearAllPoints() - + if (got_anchor) then if (pluginFirstIcon) then -- space = space + 6 --was adding an extra padding between plugin icons end - + if (self.plugins_grow_direction == 2) then --right if (self.menu_anchor.side == 1) then --left - + local temp_space = space - + 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.lastIcon = self.baseframe.cabecalho.PluginIconsSeparator end - + button:SetPoint("left", self.lastIcon.widget or self.lastIcon, "right", temp_space, 0) - + elseif (self.menu_anchor.side == 2) then --right - + local temp_space = space - + 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) @@ -5836,78 +5832,78 @@ function Details:ToolbarMenuSetButtons (_mode, _segment, _attributes, _report, _ button:SetPoint("left", last_plugin_icon or self.lastIcon.widget or self.firstIcon, "right", temp_space, 0) end - + elseif (self.plugins_grow_direction == 1) then --left if (self.menu_anchor.side == 1) then --left - + local temp_space = space - + 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.lastIcon = self.baseframe.cabecalho.PluginIconsSeparator end - + 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 - + local temp_space = space - + 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.lastIcon = self.baseframe.cabecalho.PluginIconsSeparator - + end - + 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) self.firstIcon = button got_anchor = button end - + self.lastIcon = button - last_plugin_icon = button - - button:SetParent (self.baseframe) + last_plugin_icon = button + + button:SetParent(self.baseframe) button:SetFrameLevel(self.baseframe.UPFrame:GetFrameLevel()+1) button:Show() - - button:SetSize (16*size, 16*size) - + + button:SetSize(16*size, 16*size) + if (shadow and button.shadow) then - button:SetNormalTexture (button.__icon .. "_shadow") - button:SetPushedTexture (button.__icon .. "_shadow") - button:SetHighlightTexture (button.__icon .. "_shadow", "ADD") + button:SetNormalTexture(button.__icon .. "_shadow") + button:SetPushedTexture(button.__icon .. "_shadow") + button:SetHighlightTexture(button.__icon .. "_shadow", "ADD") else - button:SetNormalTexture (button.__icon) - button:SetPushedTexture (button.__icon) - button:SetHighlightTexture (button.__icon, "ADD") + button:SetNormalTexture(button.__icon) + button:SetPushedTexture(button.__icon) + button:SetHighlightTexture(button.__icon, "ADD") end - + total_buttons_shown = total_buttons_shown + 1 end end - + if (self.baseframe.cabecalho.PluginIconsSeparator:IsShown()) then if (self.baseframe.cabecalho.modo_selecao:GetAlpha() == 0) then self.baseframe.cabecalho.PluginIconsSeparator:Hide() end end - + end - + self.total_buttons_shown = total_buttons_shown self:RefreshAttributeTextSize() - + return true - + end function Details:ToolbarMenuButtons (_mode, _segment, _attributes, _report) @@ -5922,7 +5918,7 @@ local on_leave_menu = function(self, elapsed) if (not _G.GameCooltip.mouseOver and not _G.GameCooltip.buttonOver and (not _G.GameCooltip:GetOwner() or _G.GameCooltip:GetOwner() == self)) then _G.GameCooltip:ShowMe (false) end - self:SetScript ("OnUpdate", nil) + self:SetScript("OnUpdate", nil) end end @@ -5930,13 +5926,13 @@ local OnClickNovoMenu = function(_, _, id, instance) local is_new if (not Details.tabela_instancias [id]) then - --> esta criando uma nova + --esta criando uma nova is_new = true end local ninstance = Details.CriarInstancia (_, _, id) instance.baseframe.cabecalho.modo_selecao:GetScript ("OnEnter")(instance.baseframe.cabecalho.modo_selecao, _, true) - + if (ninstance and is_new) then ninstance.baseframe.cabecalho.modo_selecao:GetScript ("OnEnter")(ninstance.baseframe.cabecalho.modo_selecao, _, true) end @@ -5948,8 +5944,8 @@ end function Details:FormatCooltipBackdrop() --local CoolTip = GameCooltip - --CoolTip:SetBackdrop (1, menus_backdrop, menus_backdropcolor, menus_bordercolor) - --CoolTip:SetBackdrop (2, menus_backdrop, menus_backdropcolor_sec, menus_bordercolor) + --CoolTip:SetBackdrop(1, menus_backdrop, menus_backdropcolor, menus_bordercolor) + --CoolTip:SetBackdrop(2, menus_backdrop, menus_backdropcolor_sec, menus_bordercolor) return true end @@ -5957,17 +5953,17 @@ local build_mode_list = function(self, deltaTime) local gameCooltip = GameCooltip local instance = parameters_table [1] parameters_table[2] = parameters_table[2] + deltaTime - + if (parameters_table[2] > 0.15) then self:SetScript("OnUpdate", nil) - + gameCooltip:Reset() gameCooltip:SetType("menu") gameCooltip:SetLastSelected("main", parameters_table [3]) gameCooltip:SetFixedParameter(instance) - + gameCooltip:SetOption("TextSize", Details.font_sizes.menus) - gameCooltip:SetOption("TextFont", Details.font_faces.menus) + gameCooltip:SetOption("TextFont", Details.font_faces.menus) gameCooltip:SetOption("ButtonHeightModSub", -2) gameCooltip:SetOption("ButtonHeightMod", -5) gameCooltip:SetOption("ButtonsYModSub", -3) @@ -5976,17 +5972,17 @@ local build_mode_list = function(self, deltaTime) gameCooltip:SetOption("YSpacingMod", 1) gameCooltip:SetOption("HeighMod", 3) gameCooltip:SetOption("SubFollowButton", true) - + Details:SetTooltipMinWidth() - + gameCooltip:AddLine(Loc["STRING_MODE_GROUP"]) gameCooltip:AddMenu(1, instance.AlteraModo, 2, true) gameCooltip:AddIcon([[Interface\AddOns\Details\images\modo_icones]], 1, 1, 20, 20, 32/256, 32/256*2, 0, 1) - + gameCooltip:AddLine(Loc["STRING_MODE_ALL"]) gameCooltip:AddMenu(1, instance.AlteraModo, 3, true) gameCooltip:AddIcon([[Interface\AddOns\Details\images\modo_icones]], 1, 1, 20, 20, 32/256*2, 32/256*3, 0, 1) - + gameCooltip:AddLine(Loc["STRING_OPTIONS_PLUGINS"]) gameCooltip:AddMenu(1, instance.AlteraModo, 4, true) gameCooltip:AddIcon([[Interface\AddOns\Details\images\modo_icones]], 1, 1, 20, 20, 32/256*3, 32/256*4, 0, 1) @@ -5994,7 +5990,7 @@ local build_mode_list = function(self, deltaTime) --build raid plugins list local raidPlugins = Details.RaidTables:GetAvailablePlugins() if (#raidPlugins >= 0) then - for index, ptable in ipairs (raidPlugins) do + for index, ptable in ipairs(raidPlugins) do --if a plugin has the member 'NoMenu', it won't be shown on menus to select plugins if (ptable[3].__enabled and not ptable[3].NoMenu) then --PluginName, PluginIcon, PluginObject, PluginAbsoluteName @@ -6004,27 +6000,27 @@ local build_mode_list = function(self, deltaTime) end --build self plugins list if (#Details.SoloTables.Menu > 0) then - for index, ptable in ipairs (Details.SoloTables.Menu) do + for index, ptable in ipairs(Details.SoloTables.Menu) do if (ptable[3].__enabled and not ptable[3].NoMenu) then gameCooltip:AddMenu(2, Details.SoloTables.EnableSoloMode, instance, ptable[4], true, ptable[1], ptable[2], true) end end end - + --window control GameCooltip:AddLine("$div") gameCooltip:AddLine(Loc["STRING_MENU_INSTANCE_CONTROL"]) gameCooltip:AddIcon([[Interface\AddOns\Details\images\modo_icones]], 1, 1, 20, 20, 0.625, 0.75, 0, 1) - + local hasClosedInstances = false - for index = 1, math.min(#Details.tabela_instancias, Details.instances_amount), 1 do + for index = 1, math.min(#Details.tabela_instancias, Details.instances_amount), 1 do local thisInstance = Details.tabela_instancias [index] if (not thisInstance.ativa) then hasClosedInstances = true break end end - + if (Details:GetNumInstancesAmount() < Details:GetMaxInstancesAmount()) then gameCooltip:AddMenu(2, OnClickNovoMenu, true, instance, nil, Loc["STRING_OPTIONS_WC_CREATE"], _, true) gameCooltip:AddIcon([[Interface\Buttons\UI-AttributeButton-Encourage-Up]], 2, 1, 16, 16) @@ -6032,18 +6028,18 @@ local build_mode_list = function(self, deltaTime) GameCooltip:AddLine("$div", nil, 2, nil, -5, -11) end end - + local ClosedInstances = 0 - for index = 1, math.min(#Details.tabela_instancias, Details.instances_amount), 1 do + for index = 1, math.min(#Details.tabela_instancias, Details.instances_amount), 1 do local thisInstance = Details.tabela_instancias [index] if (not thisInstance.ativa) then local atributo = thisInstance.atributo local sub_atributo = thisInstance.sub_atributo ClosedInstances = ClosedInstances + 1 - + if (atributo == 5) then local CustomObject = Details.custom[sub_atributo] - + if (not CustomObject) then thisInstance:ResetAttribute() atributo = thisInstance.atributo @@ -6057,7 +6053,7 @@ local build_mode_list = function(self, deltaTime) else local modo = thisInstance.modo - + if (modo == 1) then --alone atributo = Details.SoloTables.Mode or 1 local SoloInfo = Details.SoloTables.Menu [atributo] @@ -6067,36 +6063,36 @@ local build_mode_list = function(self, deltaTime) else gameCooltip:AddMenu(2, OnClickNovoMenu, index, instance, nil, "#".. index .. " Unknown Plugin", _, true) end - + elseif (modo == 4) then --raid - + local plugin_name = thisInstance.current_raid_plugin or thisInstance.last_raid_plugin if (plugin_name) then local plugin_object = Details:GetPlugin (plugin_name) if (plugin_object) then gameCooltip:AddMenu(2, OnClickNovoMenu, index, instance, nil, "#".. index .. " " .. plugin_object.__name, _, true) - gameCooltip:AddIcon(plugin_object.__icon, 2, 1, 16, 16, 0, 1, 0, 1) + gameCooltip:AddIcon(plugin_object.__icon, 2, 1, 16, 16, 0, 1, 0, 1) else gameCooltip:AddMenu(2, OnClickNovoMenu, index, instance, nil, "#".. index .. " Unknown Plugin", _, true) end else gameCooltip:AddMenu(2, OnClickNovoMenu, index, instance, nil, "#".. index .. " Unknown Plugin", _, true) end - + else - + --CoolTip:AddMenu(2, OnClickNovoMenu, index, instancia, nil, "#".. index .. " " .. _detalhes.atributos.lista [atributo] .. " - " .. _detalhes.sub_atributos [atributo].lista [sub_atributo], _, true) gameCooltip:AddMenu(2, OnClickNovoMenu, index, instance, nil, "#".. index .. " " .. Details.sub_atributos [atributo].lista [sub_atributo], _, true) gameCooltip:AddIcon(Details.sub_atributos [atributo].icones[sub_atributo] [1], 2, 1, 16, 16, unpack(Details.sub_atributos [atributo].icones[sub_atributo] [2])) - + end end gameCooltip:SetOption("TextSize", Details.font_sizes.menus) gameCooltip:SetOption("TextFont", Details.font_faces.menus) end - end - + end + if (ClosedInstances > 0 or Details:GetNumInstancesAmount() < Details:GetMaxInstancesAmount()) then GameCooltip:AddLine("$div", nil, 2, nil, -5, -11) end @@ -6104,36 +6100,36 @@ local build_mode_list = function(self, deltaTime) GameCooltip:AddLine(Loc["STRING_MENU_CLOSE_INSTANCE"], nil, 2, "white", nil, Details.font_sizes.menus, Details.font_faces.menus) GameCooltip:AddIcon([[Interface\Buttons\UI-Panel-MinimizeButton-Up]], 2, 1, 14, 14, 0.2, 0.8, 0.2, 0.8) GameCooltip:AddMenu(2, Details.close_instancia_func, instance.baseframe.cabecalho.fechar) - + --CoolTip:SetWallpaper (2, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true) - - --> space + + --space GameCooltip:AddLine("$div") - - --> forge and history buttons + + --forge and history buttons gameCooltip:AddLine(Loc["STRING_SPELLLIST"]) gameCooltip:AddMenu(1, Details.OpenForge) gameCooltip:AddIcon([[Interface\MINIMAP\Vehicle-HammerGold-3]], 1, 1, 16, 16, 0, 1, 0, 1) - - --> statistics + + --statistics gameCooltip:AddLine(Loc["STRING_STATISTICS"]) gameCooltip:AddMenu(1, Details.OpenRaidHistoryWindow) gameCooltip:AddIcon([[Interface\PvPRankBadges\PvPRank08]], 1, 1, 16, 16, 0, 1, 0, 1) - - --> space + + --space GameCooltip:AddLine("$div") - - --> options + + --options gameCooltip:AddLine(Loc["STRING_OPTIONS_WINDOW"]) gameCooltip:AddMenu(1, Details.OpenOptionsWindow) gameCooltip:AddIcon([[Interface\AddOns\Details\images\modo_icones]], 1, 1, 20, 20, 0.5, 0.625, 0, 1) - - --> finishes the menu + + --finishes the menu Details:SetMenuOwner (self, instance) - - + + show_anti_overlap (instance, self, "top") - + gameCooltip:ShowCooltip() end end @@ -6151,19 +6147,19 @@ function Details:SetMenuOwner (self, instance) else GameCooltip:SetOwner (self) end - - elseif (instance.toolbar_side == 2) then --> bottom - + + elseif (instance.toolbar_side == 2) then --bottom + local instance_height = instance.baseframe:GetHeight() - + if (y + math.max (instance_height, 250) > screen_height) then GameCooltip:SetOwner (self, "top", "bottom", 0, -10) else GameCooltip:SetOwner (self, "bottom", "top", 0, 0) end - + end - + end local empty_segment_color = {1, 1, 1, .4} @@ -6184,17 +6180,17 @@ local segment_color_red = {1, 0, 0, 1} function Details:GetSegmentInfo(index) local combat - + if (index == -1 or index == "overall") then combat = Details.tabela_overall - elseif (index == 0 or index == "current") then + elseif (index == 0 or index == "current") then combat = Details.tabela_vigente else combat = Details.tabela_historico.tabelas[index] end - + if (combat) then - + local enemy local color local raid_type @@ -6203,9 +6199,9 @@ function Details:GetSegmentInfo(index) local background local background_coords local is_trash - + if (combat.is_boss and combat.is_boss.name) then - + if (combat.instance_type == "party") then raid_type = "party" enemy = combat.is_boss.name @@ -6224,12 +6220,12 @@ function Details:GetSegmentInfo(index) killed = false end - + local p = Details:GetBossPortrait (combat.is_boss.mapid, combat.is_boss.index) if (p) then portrait = p end - + local b = Details:GetRaidIcon (combat.is_boss.mapid) if (b) then background = b @@ -6245,28 +6241,28 @@ function Details:GetSegmentInfo(index) end end end - + elseif (combat.is_arena) then enemy = combat.is_arena.name - + local file, coords = Details:GetArenaInfo (combat.is_arena.mapid) if (file) then background = "Interface\\Glues\\LOADINGSCREENS\\" .. file background_coords = coords end - + else enemy = combat.enemy - + if (combat.is_trash) then is_trash = true end end - + return enemy, color, raid_type, killed, is_trash, portrait, background, background_coords end - + end function Details:UnpackMythicDungeonInfo(t) @@ -6281,11 +6277,11 @@ local buildSegmentTooltip = function(self, deltaTime) local gameCooltip = GameCooltip local instance = parameters_table[1] parameters_table[2] = parameters_table[2] + deltaTime - + local battleground_color = {1, 0.666, 0, 1} - + if (parameters_table[2] > 0.15) then - self:SetScript ("OnUpdate", nil) + self:SetScript("OnUpdate", nil) gameCooltip:Reset() gameCooltip:SetType("menu") @@ -6294,7 +6290,7 @@ local buildSegmentTooltip = function(self, deltaTime) gameCooltip:SetOption("RightTextWidth", 105) gameCooltip:SetOption("RightTextHeight", 12) gameCooltip:SetOption("SubFollowButton", true) - + local menuIndex = 0 Details.segments_amount = floor(Details.segments_amount) local amountOfSegments = 0 @@ -6312,11 +6308,11 @@ local buildSegmentTooltip = function(self, deltaTime) local fill = abs(segmentsWithACombat - Details.segments_amount) segments_used = 0 segments_filled = fill - + local dungeon_color = party_line_color local dungeon_color_trash = party_line_color_trash local dungeon_run_id = false - + local isMythicDungeon = false for i = Details.segments_amount, 1, -1 do if (i <= fill) then @@ -6324,7 +6320,7 @@ local buildSegmentTooltip = function(self, deltaTime) if (thisCombat) then local enemy = thisCombat.is_boss and thisCombat.is_boss.name local segment_info_added = false - + segments_used = segments_used + 1 if (thisCombat.is_mythic_dungeon_segment) then @@ -6335,15 +6331,15 @@ local buildSegmentTooltip = function(self, deltaTime) isMythicDungeon = thisCombat.is_mythic_dungeon_run_id end end - + local mythicDungeonInfo = thisCombat:GetMythicDungeonInfo() - + if (mythicDungeonInfo) then --is a boss, trash overall or run overall segment local bossInfo = thisCombat.is_boss local isMythicOverallSegment, segmentID, mythicLevel, EJID, mapID, zoneName, encounterID, encounterName, startedAt, endedAt, runID = Details:UnpackMythicDungeonInfo(mythicDungeonInfo) local combat_time = thisCombat:GetCombatTime() - + if (not dungeon_run_id) then dungeon_run_id = runID else @@ -6373,49 +6369,49 @@ local buildSegmentTooltip = function(self, deltaTime) end gameCooltip:AddIcon([[Interface\AddOns\Details\images\icons]], "main", "left", 14, 10, 479/512, 510/512, 24/512, 51/512) end - + local portrait = (thisCombat.is_boss and thisCombat.is_boss.bossimage) or Details:GetBossPortrait(nil, nil, encounterName, EJID) if (portrait) then gameCooltip:AddIcon(portrait, 2, "top", 128, 64, 0, 1, 0, 0.96) end - + local backgroundImage = Details:GetRaidIcon(mapID, EJID, "party") if (backgroundImage) then gameCooltip:SetWallpaper(2, backgroundImage, {0.070, 0.695, 0.087, 0.566}, {1, 1, 1, 0.5}, true) end - + --sub menu local decorrido = thisCombat:GetCombatTime() local minutos, segundos = floor(decorrido/60), floor(decorrido%60) - + if (segmentID == "trashoverall") then gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_TIMEINCOMBAT"] .. ":", Details.gump:IntegerToTimer (decorrido), 2, "white", "white") local totalRealTime = endedAt - startedAt local wasted = totalRealTime - decorrido - + --wasted time gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_WASTED_TIME"] .. ":", "|cFFFF3300" .. Details.gump:IntegerToTimer (wasted) .. " (" .. floor (wasted / totalRealTime * 100) .. "%)|r", 2, "white", "white") gameCooltip:AddStatusBar(100, 2, 0, 0, 0, 0.35, false, false, "Skyline") gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_TOTALTIME"] .. ":", Details.gump:IntegerToTimer (endedAt - startedAt), 2, "white", "white") - + elseif (isMythicOverallSegment) then gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_TIMEINCOMBAT"] .. ":", Details.gump:IntegerToTimer (decorrido), 2, "white", "white") local totalRealTime = endedAt - startedAt local wasted = totalRealTime - decorrido - + --wasted time gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_WASTED_TIME"] .. ":", "|cFFFF3300" .. Details.gump:IntegerToTimer (wasted) .. " (" .. floor (wasted / totalRealTime * 100) .. "%)|r", 2, "white", "white") gameCooltip:AddStatusBar(100, 2, 0, 0, 0, 0.35, false, false, "Skyline") gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_TOTALTIME"] .. ":", Details.gump:IntegerToTimer (totalRealTime), 2, "white", "white") - + else gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_COMBATTIME"] .. ":", Details.gump:IntegerToTimer (decorrido), 2, "white", "white") end - + if (thisCombat.is_boss) then gameCooltip:AddLine("", "", 2, "white", "white") end - + gameCooltip:AddLine(Loc["STRING_SEGMENT_START"] .. ":", thisCombat.data_inicio, 2, "white", "white") gameCooltip:AddLine(Loc["STRING_SEGMENT_END"] .. ":", thisCombat.data_fim or "in progress", 2, "white", "white") gameCooltip:AddStatusBar (100, 1, .3, .3, .3, 0.2, false, false, "Skyline") @@ -6432,7 +6428,7 @@ local buildSegmentTooltip = function(self, deltaTime) gameCooltip:AddLine("", "", 2, "white", "white") gameCooltip:AddLine(Loc["STRING_SEGMENT_START"] .. ":", thisCombat.data_inicio, 2, "white", "white") gameCooltip:AddLine(Loc["STRING_SEGMENT_END"] .. ":", thisCombat.data_fim or "in progress", 2, "white", "white") - + if (trashInfo) then local backgroundImage = Details:GetRaidIcon(trashInfo.MapID, trashInfo.EJID, "party") if (backgroundImage) then @@ -6441,13 +6437,13 @@ local buildSegmentTooltip = function(self, deltaTime) end end segment_info_added = true - + elseif (thisCombat.is_boss and thisCombat.is_boss.name) then - + isMythicDungeon = false local try_number = thisCombat.is_boss.try_number local combat_time = thisCombat:GetCombatTime() - + if (thisCombat.instance_type == "party") then gameCooltip:AddLine(thisCombat.is_boss.name .." (#"..i..")", _, 1, dungeon_color) elseif (thisCombat.is_boss.killed) then @@ -6492,7 +6488,7 @@ local buildSegmentTooltip = function(self, deltaTime) end gameCooltip:AddIcon([[Interface\AddOns\Details\images\icons]], "main", "left", 16, 16, 0.96875, 1, 0, 0.03125) - + if (Details.tooltip.submenu_wallpaper) then local background = Details:GetRaidIcon (thisCombat.is_boss.mapid) if (background) then @@ -6513,39 +6509,39 @@ local buildSegmentTooltip = function(self, deltaTime) end end else - --> wallpaper = main window + --wallpaper = main window --CoolTip:SetWallpaper (2, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true) end - + elseif (thisCombat.is_pvp) then isMythicDungeon = false gameCooltip:AddLine(thisCombat.is_pvp.name, _, 1, battleground_color) enemy = thisCombat.is_pvp.name gameCooltip:AddIcon([[Interface\AddOns\Details\images\icons]], "main", "left", 16, 12, 0.251953125, 0.306640625, 0.205078125, 0.248046875) - + if (Details.tooltip.submenu_wallpaper) then local file, coords = Details:GetBattlegroundInfo (thisCombat.is_pvp.mapid) if (file) then gameCooltip:SetWallpaper (2, "Interface\\Glues\\LOADINGSCREENS\\" .. file, coords, empty_segment_color, true) end else - --> wallpaper = main window + --wallpaper = main window --CoolTip:SetWallpaper (2, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true) end - + elseif (thisCombat.is_arena) then isMythicDungeon = false gameCooltip:AddLine(thisCombat.is_arena.name, _, 1, "yellow") enemy = thisCombat.is_arena.name gameCooltip:AddIcon([[Interface\AddOns\Details\images\icons]], "main", "left", 16, 12, 0.251953125, 0.306640625, 0.205078125, 0.248046875) - + if (Details.tooltip.submenu_wallpaper) then local file, coords = Details:GetArenaInfo (thisCombat.is_arena.mapid) if (file) then gameCooltip:SetWallpaper (2, "Interface\\Glues\\LOADINGSCREENS\\" .. file, coords, empty_segment_color, true) end else - --> wallpaper = main window + --wallpaper = main window --CoolTip:SetWallpaper (2, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true) end else @@ -6556,34 +6552,34 @@ local buildSegmentTooltip = function(self, deltaTime) else gameCooltip:AddLine(segmentos.past..i, _, 1, "silver") end - + if (thisCombat.is_trash) then gameCooltip:AddIcon([[Interface\AddOns\Details\images\icons]], "main", "left", 16, 12, 0.02734375, 0.11328125, 0.19140625, 0.3125) else gameCooltip:AddIcon([[Interface\QUESTFRAME\UI-Quest-BulletPoint]], "main", "left", 16, 16) end - + if (Details.tooltip.submenu_wallpaper) then gameCooltip:SetWallpaper (2, [[Interface\ACHIEVEMENTFRAME\UI-Achievement-StatsBackground]], segments_common_tex, segments_common_color, true) else - --> wallpaper = main window + --wallpaper = main window --CoolTip:SetWallpaper (2, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true) end - + end - + gameCooltip:AddMenu(1, instance.TrocaTabela, i) - + if (not segment_info_added) then gameCooltip:AddLine(Loc["STRING_SEGMENT_ENEMY"] .. ":", enemy, 2, "white", "white") local decorrido = thisCombat:GetCombatTime() local minutos, segundos = floor(decorrido/60), floor(decorrido%60) gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_COMBATTIME"] .. ":", minutos.."m "..segundos.."s", 2, "white", "white") - + gameCooltip:AddLine(Loc["STRING_SEGMENT_START"] .. ":", thisCombat.data_inicio, 2, "white", "white") gameCooltip:AddLine(Loc["STRING_SEGMENT_END"] .. ":", thisCombat.data_fim or "in progress", 2, "white", "white") end - + amountOfSegments = amountOfSegments + 1 else gameCooltip:AddLine(Loc["STRING_SEGMENT_LOWER"] .. " #" .. i, _, 1, "gray") @@ -6593,7 +6589,7 @@ local buildSegmentTooltip = function(self, deltaTime) gameCooltip:AddIcon([[Interface\CHARACTERFRAME\Disconnect-Icon]], 2, 1, 12, 12, 0.3125, 0.65625, 0.265625, 0.671875) --CoolTip:SetWallpaper (2, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true) end - + if (menuIndex) then menuIndex = menuIndex + 1 if (instance.segmento == i) then @@ -6601,38 +6597,38 @@ local buildSegmentTooltip = function(self, deltaTime) menuIndex = nil end end - + end - + end - + GameCooltip:AddLine("$div", nil, nil, -5, -13) - + ----------- current local enemy = Details.tabela_vigente.is_boss and Details.tabela_vigente.is_boss.name or Details.tabela_vigente.enemy or "--x--x--" local file, coords - + local thisCombat = Details.tabela_vigente local segment_info_added - - --> add the new line + + --add the new line gameCooltip:AddLine(segmentos.current_standard, _, 1, "white") gameCooltip:AddMenu(1, instance.TrocaTabela, 0) gameCooltip:AddIcon([[Interface\QUESTFRAME\UI-Quest-BulletPoint]], "main", "left", 16, 16, nil, nil, nil, nil, "orange") -- - - --> current segment is a dungeon mythic+? + + --current segment is a dungeon mythic+? if (thisCombat.is_mythic_dungeon_segment) then local mythicDungeonInfo = thisCombat:GetMythicDungeonInfo() - + if (mythicDungeonInfo) then - --> is a boss, trash overall or run overall segment - + --is a boss, trash overall or run overall segment + local bossInfo = thisCombat.is_boss - + local isMythicOverallSegment, segmentID, mythicLevel, EJID, mapID, zoneName, encounterID, encounterName, startedAt, endedAt, runID = Details:UnpackMythicDungeonInfo (mythicDungeonInfo) local combat_time = thisCombat:GetCombatTime() - + if (not dungeon_run_id) then dungeon_run_id = runID else @@ -6643,7 +6639,7 @@ local buildSegmentTooltip = function(self, deltaTime) end end - --> is mythic overall + --is mythic overall if (isMythicOverallSegment) then --mostrar o tempo da dungeon local totalTime = combat_time @@ -6651,7 +6647,7 @@ local buildSegmentTooltip = function(self, deltaTime) --CoolTip:AddLine(zoneName .. " +" .. mythicLevel .. " (overall)", _detalhes.gump:IntegerToTimer (endedAt - startedAt), 1, dungeon_color) --CoolTip:AddIcon([[Interface\AddOns\Details\images\icons]], "main", "left", 14, 10, 479/512, 510/512, 24/512, 51/512) gameCooltip:AddLine(zoneName .. " +" .. mythicLevel .. " (" .. Loc["STRING_SEGMENTS_LIST_OVERALL"] .. ")", nil, 2, "white", "white") - + else if (segmentID == "trashoverall") then --CoolTip:AddLine(encounterName .. " (" .. Loc["STRING_SEGMENTS_LIST_TRASH"] .. ")", _detalhes.gump:IntegerToTimer (combat_time), 1, dungeon_color, "gray") @@ -6663,74 +6659,74 @@ local buildSegmentTooltip = function(self, deltaTime) end --CoolTip:AddIcon([[Interface\AddOns\Details\images\icons]], "main", "left", 14, 10, 479/512, 510/512, 24/512, 51/512) end - + local portrait = (thisCombat.is_boss and thisCombat.is_boss.bossimage) or Details:GetBossPortrait (nil, nil, encounterName, EJID) if (portrait) then gameCooltip:AddIcon(portrait, 2, "top", 128, 64, 0, 1, 0, 0.96) end - + local backgroundImage = Details:GetRaidIcon (mapID, EJID, "party") if (backgroundImage) then gameCooltip:SetWallpaper (2, backgroundImage, {0.070, 0.695, 0.087, 0.566}, {1, 1, 1, 0.5}, true) -- party_wallpaper_tex -- {0.09, 0.698125, .17, 0.833984375} end - - --> sub menu + + --sub menu local decorrido = thisCombat:GetCombatTime() local minutos, segundos = floor(decorrido/60), floor(decorrido%60) --CoolTip:AddLine(Loc["STRING_SEGMENTS_LIST_COMBATTIME"] .. ":", minutos.."m "..segundos.."s", 2, "white", "white") - + if (segmentID == "trashoverall") then local totalRealTime = endedAt - startedAt local wasted = totalRealTime - decorrido - + gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_TIMEINCOMBAT"] .. ":", Details.gump:IntegerToTimer (decorrido), 2, "white", "white") - + --wasted time gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_WASTED_TIME"] .. ":", "|cFFFF3300" .. Details.gump:IntegerToTimer (wasted) .. " (" .. floor (wasted / totalRealTime * 100) .. "%)|r", 2, "white", "white") gameCooltip:AddStatusBar (100, 2, 0, 0, 0, 0.35, false, false, "Skyline") - + gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_TOTALTIME"] .. ":", Details.gump:IntegerToTimer (endedAt - startedAt) .. " [|cFFFF3300" .. Details.gump:IntegerToTimer (totalRealTime - decorrido) .. "|r]", 2, "white", "white") - + elseif (isMythicOverallSegment) then gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_TIMEINCOMBAT"] .. ":", Details.gump:IntegerToTimer (decorrido), 2, "white", "white") local totalRealTime = endedAt - startedAt local wasted = totalRealTime - decorrido - - + + gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_TOTALTIME"] .. ":", Details.gump:IntegerToTimer (totalRealTime), 2, "white", "white") - + --wasted time gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_WASTED_TIME"] .. ":", "|cFFFF3300" .. Details.gump:IntegerToTimer (wasted) .. " (" .. floor (wasted / totalRealTime * 100) .. "%)|r", 2, "white", "white") gameCooltip:AddStatusBar (100, 2, 0, 0, 0, 0.35, false, false, "Skyline") - + else gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_COMBATTIME"] .. ":", Details.gump:IntegerToTimer (decorrido), 2, "white", "white") end - + if (thisCombat.is_boss) then gameCooltip:AddLine("", "", 2, "white", "white") end - + gameCooltip:AddLine(Loc["STRING_SEGMENT_START"] .. ":", thisCombat.data_inicio, 2, "white", "white") gameCooltip:AddLine(Loc["STRING_SEGMENT_END"] .. ":", thisCombat.data_fim or "in progress", 2, "white", "white") - + else - --> the combat has mythic dungeon tag but doesn't have a mythic dungeon table information - --> so this is a trash cleanup segment - + --the combat has mythic dungeon tag but doesn't have a mythic dungeon table information + --so this is a trash cleanup segment + local trashInfo = thisCombat:GetMythicDungeonTrashInfo() - + --CoolTip:AddLine(Loc["STRING_SEGMENT_TRASH"], _detalhes.gump:IntegerToTimer (thisCombat:GetCombatTime()), 1, dungeon_color_trash, "gray") --CoolTip:AddIcon([[Interface\AddOns\Details\images\icons]], "main", "left", 16, 12, 0.02734375, 0.11328125, 0.19140625, 0.3125, "red") --CoolTip:AddIcon([[Interface\AddOns\Details\images\icons]], "main", "left", 14, 10, 479/512, 510/512, 24/512, 51/512, nil, nil, true) - + --submenu gameCooltip:AddLine(Loc["STRING_SEGMENT_TRASH"], nil, 2, "white", "white") gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_COMBATTIME"] .. ":", Details.gump:IntegerToTimer (thisCombat:GetCombatTime()), 2, "white", "white") gameCooltip:AddLine("", "", 2, "white", "white") gameCooltip:AddLine(Loc["STRING_SEGMENT_START"] .. ":", thisCombat.data_inicio, 2, "white", "white") gameCooltip:AddLine(Loc["STRING_SEGMENT_END"] .. ":", thisCombat.data_fim or "in progress", 2, "white", "white") - + if (trashInfo) then local backgroundImage = Details:GetRaidIcon (trashInfo.MapID, trashInfo.EJID, "party") if (backgroundImage) then @@ -6738,7 +6734,7 @@ local buildSegmentTooltip = function(self, deltaTime) end end end - + segment_info_added = true elseif (Details.tabela_vigente.is_boss and Details.tabela_vigente.is_boss.name) then @@ -6760,7 +6756,7 @@ local buildSegmentTooltip = function(self, deltaTime) end end end - + if (Details.tooltip.submenu_wallpaper) then local background = Details:GetRaidIcon (Details.tabela_vigente.is_boss.mapid) if (background) then @@ -6779,10 +6775,10 @@ local buildSegmentTooltip = function(self, deltaTime) end end else - --> wallpaper = main window + --wallpaper = main window --CoolTip:SetWallpaper (2, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true) end - + elseif (Details.tabela_vigente.is_pvp) then enemy = Details.tabela_vigente.is_pvp.name file, coords = Details:GetBattlegroundInfo (Details.tabela_vigente.is_pvp.mapid) @@ -6793,42 +6789,42 @@ local buildSegmentTooltip = function(self, deltaTime) if (Details.tooltip.submenu_wallpaper) then gameCooltip:SetWallpaper (2, [[Interface\ACHIEVEMENTFRAME\UI-Achievement-StatsBackground]], segments_common_tex, {1, 1, 1, 0.5}, true) else - --> wallpaper = main window + --wallpaper = main window --CoolTip:SetWallpaper (2, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true) end - end + end if (Details.tooltip.submenu_wallpaper) then if (file) then gameCooltip:SetWallpaper (2, "Interface\\Glues\\LOADINGSCREENS\\" .. file, coords, empty_segment_color, true) end else - --> wallpaper = main window + --wallpaper = main window --CoolTip:SetWallpaper (2, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true) end - + if (not segment_info_added) then gameCooltip:AddLine(Loc["STRING_SEGMENT_ENEMY"] .. ":", enemy, 2, "white", "white") - + if (not Details.tabela_vigente:GetEndTime()) then if (Details.in_combat) then local decorrido = Details.tabela_vigente:GetCombatTime() local minutos, segundos = floor(decorrido/60), floor(decorrido%60) - gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_COMBATTIME"] .. ":", minutos.."m "..segundos.."s", 2, "white", "white") + gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_COMBATTIME"] .. ":", minutos.."m "..segundos.."s", 2, "white", "white") else gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_COMBATTIME"] .. ":", "--x--x--", 2, "white", "white") end else local decorrido = Details.tabela_vigente:GetCombatTime() local minutos, segundos = floor(decorrido/60), floor(decorrido%60) - gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_COMBATTIME"] .. ":", minutos.."m "..segundos.."s", 2, "white", "white") + gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_COMBATTIME"] .. ":", minutos.."m "..segundos.."s", 2, "white", "white") end gameCooltip:AddLine(Loc["STRING_SEGMENT_START"] .. ":", Details.tabela_vigente.data_inicio, 2, "white", "white") - gameCooltip:AddLine(Loc["STRING_SEGMENT_END"] .. ":", Details.tabela_vigente.data_fim or "in progress", 2, "white", "white") + gameCooltip:AddLine(Loc["STRING_SEGMENT_END"] .. ":", Details.tabela_vigente.data_fim or "in progress", 2, "white", "white") end - - --> fill � a quantidade de menu que esta sendo mostrada + + --fill � a quantidade de menu que esta sendo mostrada if (instance.segmento == 0) then if (fill - 2 == menuIndex) then gameCooltip:SetLastSelected ("main", fill + 0) @@ -6840,72 +6836,72 @@ local buildSegmentTooltip = function(self, deltaTime) menuIndex = nil end - + ----------- overall --CoolTip:AddLine(segmentos.overall_standard, _, 1, "white") Loc["STRING_REPORT_LAST"] .. " " .. fight_amount .. " " .. Loc["STRING_REPORT_FIGHTS"] gameCooltip:AddLine(Loc["STRING_SEGMENT_OVERALL"], _, 1, "white") gameCooltip:AddMenu(1, instance.TrocaTabela, -1) gameCooltip:AddIcon([[Interface\QUESTFRAME\UI-Quest-BulletPoint]], "main", "left", 16, 16, nil, nil, nil, nil, "orange") - + local enemy_name = Details.tabela_overall.overall_enemy_name - + gameCooltip:AddLine(Loc["STRING_SEGMENT_ENEMY"] .. ":", enemy_name, 2, "white", "white") - + local combat_time = Details.tabela_overall:GetCombatTime() local minutos, segundos = floor(combat_time / 60), floor(combat_time % 60) - - gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_COMBATTIME"] .. ":", minutos.."m "..segundos.."s", 2, "white", "white") - + + gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_COMBATTIME"] .. ":", minutos.."m "..segundos.."s", 2, "white", "white") + --CoolTip:SetWallpaper (2, [[Interface\ACHIEVEMENTFRAME\UI-Achievement-StatsComparisonBackground]], {0.085, 166/256, 0, 1}, {.42, .4, .4, 0.9}, true) - + if (Details.tooltip.submenu_wallpaper) then --CoolTip:SetWallpaper (2, [[Interface\PetPaperDollFrame\PetStatsBG-Hunter]], {321/512, 0, 0, 190/512}, {1, 1, 1, 0.9}, true) --CoolTip:SetWallpaper (2, [[Interface\ACHIEVEMENTFRAME\UI-Achievement-StatsComparisonBackground]], {166/256, 1, 0, 1}, {1, 1, 1, 0.9}, true) else - --> wallpaper = main window + --wallpaper = main window --CoolTip:SetWallpaper (2, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true) end - + gameCooltip:AddLine(Loc["STRING_SEGMENT_START"] .. ":", Details.tabela_overall.data_inicio, 2, "white", "white") gameCooltip:AddLine(Loc["STRING_SEGMENT_END"] .. ":", Details.tabela_overall.data_fim, 2, "white", "white") - + -- combats added local combats_added = Details.tabela_overall.segments_added or Details.empty_table gameCooltip:AddLine(Loc["STRING_SEGMENTS"] .. ":", #combats_added, 2, "white", "white") - + if (#combats_added > 0) then gameCooltip:AddLine("", "", 2, "white", "white") end - - for i, segment in ipairs (combats_added) do + + for i, segment in ipairs(combats_added) do local minutos, segundos = floor(segment.elapsed/60), floor(segment.elapsed%60) - + local name = segment.name if (name:len() > 20) then name = string.sub (name, 1, #name - (#name - 20)) end - + gameCooltip:AddLine("" .. name, minutos.."m "..segundos.."s", 2, "white", "white") - + local segmentType = segment.type if (segmentType == DETAILS_SEGMENTTYPE_MYTHICDUNGEON_TRASH) then gameCooltip:AddIcon([[Interface\AddOns\Details\images\icons]], 2, 1, 12, 8, 479/512, 510/512, 24/512, 51/512, nil, nil, true) - + elseif (segmentType == DETAILS_SEGMENTTYPE_MYTHICDUNGEON_BOSS) then gameCooltip:AddIcon([[Interface\AddOns\Details\images\icons]], 2, 1, 12, 12, 0.96875, 1, 0, 0.03125, party_line_color) - + elseif (segmentType == DETAILS_SEGMENTTYPE_RAID_TRASH or segmentType == DETAILS_SEGMENTTYPE_DUNGEON_TRASH) then gameCooltip:AddIcon([[Interface\AddOns\Details\images\icons]], 2, 1, 10, 8, 0.02734375, 0.11328125, 0.19140625, 0.3125) - + elseif (segmentType == DETAILS_SEGMENTTYPE_RAID_BOSS) then gameCooltip:AddIcon([[Interface\AddOns\Details\images\icons]], 2, 1, 12, 12, 0.96875, 1, 0, 0.03125) - + end - + --CoolTip:AddStatusBar (100, 2, 0, 0, 0, 0.2, false, false, "Skyline") end - - --> fill � a quantidade de menu que esta sendo mostrada + + --fill � a quantidade de menu que esta sendo mostrada if (instance.segmento == -1) then if (fill - 2 == menuIndex) then gameCooltip:SetLastSelected ("main", fill + 1) @@ -6916,48 +6912,48 @@ local buildSegmentTooltip = function(self, deltaTime) end menuIndex = nil end - + --------------------------------------------- - + Details:SetMenuOwner (self, instance) - + gameCooltip:SetOption("TextSize", Details.font_sizes.menus) gameCooltip:SetOption("TextFont", Details.font_faces.menus) - + gameCooltip:SetOption("SubMenuIsTooltip", true) - + gameCooltip:SetOption("ButtonHeightMod", -4) gameCooltip:SetOption("ButtonsYMod", -10) gameCooltip:SetOption("YSpacingMod", 1) - + gameCooltip:SetOption("ButtonHeightModSub", 4) gameCooltip:SetOption("ButtonsYModSub", 0) gameCooltip:SetOption("YSpacingModSub", -4) - + gameCooltip:SetOption("HeighMod", 12) - + Details:SetTooltipMinWidth() - + show_anti_overlap (instance, self, "top") - + gameCooltip:ShowCooltip() - - self:SetScript ("OnUpdate", nil) - end - + + self:SetScript("OnUpdate", nil) + end + end -- ~skin function Details:SetUserCustomSkinFile (file) - if (type (file) ~= "string") then + if (type(file) ~= "string") then error ("SetUserCustomSkinFile() file must be a string.") end - + if (file:find ("\\") or file:find ("/")) then error ("SetUserCustomSkinFile() file must be only the file name (with out up folders) and slashes.") end - + self.skin_custom = file self:ChangeSkin() end @@ -6996,7 +6992,7 @@ function Details:ChangeSkin(skin_name) local tempSkin = Details:WaitForSkin() this_skin = tempSkin end - + local just_updating = false if (self.skin == skin_name) then just_updating = true @@ -7004,24 +7000,24 @@ function Details:ChangeSkin(skin_name) if (not just_updating) then - --> skin updater + --skin updater if (self.bgframe.skin_script) then - self.bgframe:SetScript ("OnUpdate", nil) + self.bgframe:SetScript("OnUpdate", nil) self.bgframe.skin_script = false end - - --> reset all config + + --reset all config self:ResetInstanceConfigKeepingValues (true) - - --> overwrites + + --overwrites local overwrite_cprops = this_skin.instance_cprops if (overwrite_cprops) then - + local copy = Details.CopyTable(overwrite_cprops) - + for cprop, value in pairs (copy) do if (not Details.instance_skin_ignored_values [cprop]) then - if (type (value) == "table") then + if (type(value) == "table") then for cprop2, value2 in pairs (value) do if (not self[cprop]) then self[cprop] = {} @@ -7034,16 +7030,16 @@ function Details:ChangeSkin(skin_name) end end end - - --> reset micro frames + + --reset micro frames Details.StatusBar:Reset (self) - --> customize micro frames + --customize micro frames if (this_skin.micro_frames) then if (this_skin.micro_frames.left) then Details.StatusBar:SetPlugin (self, this_skin.micro_frames.left, "left") end - + if (this_skin.micro_frames.textxmod) then Details.StatusBar:ApplyOptions (self.StatusBar.left, "textxmod", this_skin.micro_frames.textxmod) Details.StatusBar:ApplyOptions (self.StatusBar.center, "textxmod", this_skin.micro_frames.textxmod) @@ -7075,51 +7071,51 @@ function Details:ChangeSkin(skin_name) Details.StatusBar:ApplyOptions (self.StatusBar.right, "textsize", this_skin.micro_frames.size) end end - + end - + self.skin = skin_name local skin_file = this_skin.file - --> set textures + --set textures if (self.skin_custom ~= "") then 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_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.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.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.break_snap_button:SetNormalTexture (skin_file) --> cadeado + 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.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.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.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) - self.break_snap_button:SetHighlightTexture (skin_file, "ADD") - self.break_snap_button:SetPushedTexture (skin_file) + self.break_snap_button:SetHighlightTexture(skin_file, "ADD") + self.break_snap_button:SetPushedTexture(skin_file) - --> update toolbar icons + --update toolbar icons local toolbar_buttons = {} - + do local toolbar_icon_file = self.toolbar_icon_file if (not toolbar_icon_file) then @@ -7132,17 +7128,17 @@ function Details:ChangeSkin(skin_name) toolbar_buttons [4] = self.baseframe.cabecalho.report toolbar_buttons [5] = self.baseframe.cabecalho.reset toolbar_buttons [6] = self.baseframe.cabecalho.fechar - + for i = 1, #toolbar_buttons do local button = toolbar_buttons [i] - button:SetNormalTexture (toolbar_icon_file) - button:SetHighlightTexture (toolbar_icon_file) - button:SetPushedTexture (toolbar_icon_file) + button:SetNormalTexture(toolbar_icon_file) + button:SetHighlightTexture(toolbar_icon_file) + button:SetPushedTexture(toolbar_icon_file) end end - -----------> icon anchor and size - + +----------icon anchor and size + 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]) @@ -7163,155 +7159,155 @@ function Details:ChangeSkin(skin_name) --end end else - local icon_anchor = this_skin.icon_anchor_main --> ancora do icone do canto direito superior + 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:ChangeIcon() end -----------> lock alpha head - +----------lock alpha head + if (not this_skin.can_change_alpha_head) then self.baseframe.cabecalho.ball:SetAlpha(1) else self.baseframe.cabecalho.ball:SetAlpha(self.color[4]) end - -----------> update abbreviation function on the class files - + +----------update abbreviation function on the class files + Details.atributo_damage:UpdateSelectedToKFunction() Details.atributo_heal:UpdateSelectedToKFunction() Details.atributo_energy:UpdateSelectedToKFunction() Details.atributo_misc:UpdateSelectedToKFunction() Details.atributo_custom:UpdateSelectedToKFunction() - -----------> call widgets handlers + +----------call widgets handlers self:SetBarSettings (self.row_info.height) self:SetBarBackdropSettings() self:SetBarSpecIconSettings() self:SetBarRightTextSettings() - --> update toolbar + --update toolbar self:ToolbarSide() - --> update stretch button + --update stretch button self:StretchButtonAnchor() - - --> update side bars + + --update side bars if (self.show_sidebars) then self:ShowSideBars() else self:HideSideBars() end - --> refresh the side of the micro displays and its lock state + --refresh the side of the micro displays and its lock state self:MicroDisplaysSide() self:MicroDisplaysLock() self:RefreshMicroDisplays() - - --> update statusbar + + --update statusbar if (self.show_statusbar) then self:ShowStatusBar() else self:HideStatusBar() end - --> update wallpaper + --update wallpaper if (self.wallpaper.enabled) then self:InstanceWallpaper (true) else self:InstanceWallpaper (false) end - --> update instance color + --update instance color self:InstanceColor() self:SetBackgroundColor() self:SetBackgroundAlpha() self:SetAutoHideMenu() self:SetBackdropTexture() - --> refresh all bars + --refresh all bars self:InstanceRefreshRows() - --> update menu saturation + --update menu saturation self:DesaturateMenu() - - --> update statusbar color + + --update statusbar color self:StatusBarColor() - - --> update attribute string + + --update attribute string self:AttributeMenu() - - --> update top menus + + --update top menus self:LeftMenuAnchorSide() - - --> update window strata level + + --update window strata level self:SetFrameStrata() - - --> update the combat alphas + + --update the combat alphas self:AdjustAlphaByContext() - - --> update icons + + --update icons Details.ToolBar:ReorganizeIcons (true) --call self:SetMenuAlpha() - - --> refresh options panel if opened + + --refresh options panel if opened if (_G.DetailsOptionsWindow and _G.DetailsOptionsWindow:IsShown() and not _G.DetailsOptionsWindow.IsLoading) then Details:OpenOptionsWindow (self) end - --> auto interact + --auto interact if (self.menu_alpha.enabled) then self:SetMenuAlpha (nil, nil, nil, nil, self.is_interacting) end - - --> set the scale + + --set the scale self:SetWindowScale() - - --> refresh lock buttons + + --refresh lock buttons self:RefreshLockedState() - --> update borders + --update borders self:UpdateFullBorder() self:UpdateRowAreaBorder() - --> update title bar + --update title bar self:RefreshTitleBar() - - --> update the wallpaper level + + --update the wallpaper level self:SetInstanceWallpaperLevel() - --> clear any control sscript running in this instance - self.bgframe:SetScript ("OnUpdate", nil) + --clear any control sscript running in this instance + self.bgframe:SetScript("OnUpdate", nil) self.bgframe.skin_script = nil - - --> check if the skin has control scripts to run + + --check if the skin has control scripts to run if (not just_updating or Details.initializing) then local callbackFunc = this_skin.callback if (callbackFunc) then DetailsFramework:SetEnvironment(callbackFunc) local okey, result = pcall (callbackFunc, this_skin, self, just_updating) if (not okey) then - Details:Msg ("|cFFFF9900error on skin callback function|r:", result) + Details:Msg("|cFFFF9900error on skin callback function|r:", result) end end - + if (this_skin.control_script) then local onStartScript = this_skin.control_script_on_start if (onStartScript) then DetailsFramework:SetEnvironment(onStartScript) local okey, result = pcall (onStartScript, this_skin, self) if (not okey) then - Details:Msg ("|cFFFF9900error on skin control on start function|r:", result) + Details:Msg("|cFFFF9900error on skin control on start function|r:", result) end end - + local controlFunc = this_skin.control_script DetailsFramework:SetEnvironment(controlFunc) - self.bgframe:SetScript ("OnUpdate", controlFunc) + self.bgframe:SetScript("OnUpdate", controlFunc) self.bgframe.skin_script = true self.bgframe.skin = this_skin end end - + self:UpdateClickThrough() end @@ -7340,24 +7336,24 @@ function Details:UpdateClickThroughSettings (inCombat, window, bars, toolbaricon if (inCombat ~= nil) then self.clickthrough_incombatonly = inCombat end - + if (window ~= nil) then self.clickthrough_window = window end - + if (bars ~= nil) then self.clickthrough_rows = bars end - + if (toolbaricons ~= nil) then self.clickthrough_toolbaricons = toolbaricons end - + self:UpdateClickThrough() end function Details:UpdateClickThrough() - + local barsClickThrough = self.clickthrough_rows local windowClickThrough = self.clickthrough_window local onlyInCombat = self.clickthrough_incombatonly @@ -7368,17 +7364,17 @@ function Details:UpdateClickThrough() if (InCombatLockdown()) then --player bars if (barsClickThrough) then - for barIndex, barObject in ipairs (self.barras) do + for barIndex, barObject in ipairs(self.barras) do barObject:EnableMouse(false) barObject.icon_frame:EnableMouse(false) end else - for barIndex, barObject in ipairs (self.barras) do + for barIndex, barObject in ipairs(self.barras) do barObject:EnableMouse(true) barObject.icon_frame:EnableMouse(true) end end - + --window frames if (windowClickThrough) then self.baseframe:EnableMouse(false) @@ -7390,7 +7386,7 @@ function Details:UpdateClickThrough() self.baseframe.UPFrame:EnableMouse(false) self.baseframe.DOWNFrame:EnableMouse(false) - + else self.baseframe:EnableMouse(true) self.bgframe:EnableMouse(true) @@ -7401,7 +7397,7 @@ function Details:UpdateClickThrough() self.baseframe.UPFrame:EnableMouse(true) self.baseframe.DOWNFrame:EnableMouse(true) end - + --titlebar icons local toolbar_buttons = {} toolbar_buttons [1] = self.baseframe.cabecalho.modo_selecao @@ -7410,18 +7406,18 @@ function Details:UpdateClickThrough() toolbar_buttons [4] = self.baseframe.cabecalho.report toolbar_buttons [5] = self.baseframe.cabecalho.reset toolbar_buttons [6] = self.baseframe.cabecalho.fechar - - for i, button in ipairs (toolbar_buttons) do + + for i, button in ipairs(toolbar_buttons) do button:EnableMouse(toolbar_buttons) end - + else --player bars - for barIndex, barObject in ipairs (self.barras) do + for barIndex, barObject in ipairs(self.barras) do barObject:EnableMouse(true) barObject.icon_frame:EnableMouse(true) end - + --window frames self.baseframe:EnableMouse(true) self.bgframe:EnableMouse(true) @@ -7431,7 +7427,7 @@ function Details:UpdateClickThrough() self.windowBackgroundDisplay:EnableMouse(true) self.baseframe.UPFrame:EnableMouse(true) self.baseframe.DOWNFrame:EnableMouse(true) - + --titlebar icons, forcing true because the player isn't in combat and the inCombat setting is enabled local toolbar_buttons = {} toolbar_buttons [1] = self.baseframe.cabecalho.modo_selecao @@ -7440,8 +7436,8 @@ function Details:UpdateClickThrough() toolbar_buttons [4] = self.baseframe.cabecalho.report toolbar_buttons [5] = self.baseframe.cabecalho.reset toolbar_buttons [6] = self.baseframe.cabecalho.fechar - - for i, button in ipairs (toolbar_buttons) do + + for i, button in ipairs(toolbar_buttons) do button:EnableMouse(true) end end @@ -7449,16 +7445,16 @@ function Details:UpdateClickThrough() --player bars if (barsClickThrough) then - for barIndex, barObject in ipairs (self.barras) do + for barIndex, barObject in ipairs(self.barras) do barObject:EnableMouse(false) barObject.icon_frame:EnableMouse(false) end else - for barIndex, barObject in ipairs (self.barras) do + for barIndex, barObject in ipairs(self.barras) do barObject:EnableMouse(true) end end - + --window frame if (windowClickThrough) then self.baseframe:EnableMouse(false) @@ -7479,7 +7475,7 @@ function Details:UpdateClickThrough() self.baseframe.UPFrame:EnableMouse(true) self.baseframe.DOWNFrame:EnableMouse(true) end - + --titlebar icons local toolbar_buttons = {} toolbar_buttons [1] = self.baseframe.cabecalho.modo_selecao @@ -7488,8 +7484,8 @@ function Details:UpdateClickThrough() toolbar_buttons [4] = self.baseframe.cabecalho.report toolbar_buttons [5] = self.baseframe.cabecalho.reset toolbar_buttons [6] = self.baseframe.cabecalho.fechar - - for i, button in ipairs (toolbar_buttons) do + + for i, button in ipairs(toolbar_buttons) do button:EnableMouse(toolbarIcons) end end @@ -7497,25 +7493,25 @@ end function Details:DelayedCheckCombatAlpha (instance, alpha) if (UnitAffectingCombat("player") or InCombatLockdown()) then - instance:SetWindowAlphaForCombat (true, true, alpha) --> hida a janela - instance:SetWindowAlphaForCombat (true, true, alpha) --> hida a janela + instance:SetWindowAlphaForCombat (true, true, alpha) --hida a janela + instance:SetWindowAlphaForCombat (true, true, alpha) --hida a janela end end function Details:DelayedCheckOutOfCombatAlpha (instance, alpha) if (not UnitAffectingCombat("player") and not InCombatLockdown()) then - instance:SetWindowAlphaForCombat (true, true, alpha) --> hida a janela - instance:SetWindowAlphaForCombat (true, true, alpha) --> hida a janela + instance:SetWindowAlphaForCombat (true, true, alpha) --hida a janela + instance:SetWindowAlphaForCombat (true, true, alpha) --hida a janela end end function Details:DelayedCheckOutOfCombatAndGroupAlpha (instance, alpha) if ((Details.zone_type == "raid" or Details.zone_type == "party") and IsInInstance()) then if (UnitAffectingCombat("player") or InCombatLockdown()) then - instance:SetWindowAlphaForCombat (false, false, alpha) --> deshida a janela + instance:SetWindowAlphaForCombat (false, false, alpha) --deshida a janela else - instance:SetWindowAlphaForCombat (true, true, alpha) --> hida a janela - instance:SetWindowAlphaForCombat (true, true, alpha) --> hida a janela + instance:SetWindowAlphaForCombat (true, true, alpha) --hida a janela + instance:SetWindowAlphaForCombat (true, true, alpha) --hida a janela end end end @@ -7542,15 +7538,15 @@ function Details:AdjustAlphaByContext(interacting) if (self.hide_on_context[3].inverse) then --while in group if (Details.in_group) then - self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, 3)) --> hida a janela - self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, 3)) --> hida a janela + self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, 3)) --hida a janela + self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, 3)) --hida a janela hasRuleEnabled = true end else --while not in group if (not Details.in_group) then - self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, 3)) --> hida a janela - self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, 3)) --> hida a janela + self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, 3)) --hida a janela + self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, 3)) --hida a janela hasRuleEnabled = true end end @@ -7560,8 +7556,8 @@ function Details:AdjustAlphaByContext(interacting) if (self.hide_on_context[4].enabled) then local isInInstance = IsInInstance() if (not isInInstance or (not Details.zone_type == "raid" and not Details.zone_type == "party")) then - self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, 4)) --> hida a janela - self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, 4)) --> hida a janela + self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, 4)) --hida a janela + self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, 4)) --hida a janela hasRuleEnabled = true end end @@ -7570,8 +7566,8 @@ function Details:AdjustAlphaByContext(interacting) if (self.hide_on_context[5].enabled) then local isInInstance = IsInInstance() if (isInInstance or Details.zone_type == "raid" or Details.zone_type == "party") then - self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, 5)) --> hida a janela - self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, 5)) --> hida a janela + self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, 5)) --hida a janela + self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, 5)) --hida a janela hasRuleEnabled = true end end @@ -7593,7 +7589,7 @@ function Details:AdjustAlphaByContext(interacting) self:SetWindowAlphaForCombat(true, true, getAlphaByContext(self, contextId)) self:SetWindowAlphaForCombat(true, true, getAlphaByContext(self, contextId)) else - self:SetWindowAlphaForCombat(false, false, getAlphaByContext(self, contextId)) --> deshida a janela + self:SetWindowAlphaForCombat(false, false, getAlphaByContext(self, contextId)) --deshida a janela end hasRuleEnabled = true else @@ -7612,10 +7608,10 @@ function Details:AdjustAlphaByContext(interacting) if (isInInstance and Details.zone_type == "pvp") then --player is inside a battleground if (not self.hide_on_context[7].inverse) then - self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, 7)) --> hida a janela - self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, 7)) --> hida a janela + self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, 7)) --hida a janela + self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, 7)) --hida a janela else - self:SetWindowAlphaForCombat (false, false, getAlphaByContext(self, 7)) --> deshida a janela + self:SetWindowAlphaForCombat (false, false, getAlphaByContext(self, 7)) --deshida a janela end hasRuleEnabled = true @@ -7623,10 +7619,10 @@ function Details:AdjustAlphaByContext(interacting) --player is not inside a battleground if (not self.hide_on_context[7].inverse) then --there's no inverse rule: do nothing - --self:SetWindowAlphaForCombat (false, false, getAlphaByContext(self, 7)) --> deshida a janela + --self:SetWindowAlphaForCombat (false, false, getAlphaByContext(self, 7)) --deshida a janela else - self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, 7)) --> hida a janela - self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, 7)) --> hida a janela + self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, 7)) --hida a janela + self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, 7)) --hida a janela hasRuleEnabled = true end end @@ -7637,20 +7633,20 @@ function Details:AdjustAlphaByContext(interacting) if (_G.DetailsMythicPlusFrame and _G.DetailsMythicPlusFrame.IsDoingMythicDungeon) then --player is inside a dungeon mythic+ if (not self.hide_on_context[8].inverse) then - self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, 8)) --> hida a janela - self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, 8)) --> hida a janela + self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, 8)) --hida a janela + self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, 8)) --hida a janela else - self:SetWindowAlphaForCombat (false, false, getAlphaByContext(self, 8)) --> deshida a janela + self:SetWindowAlphaForCombat (false, false, getAlphaByContext(self, 8)) --deshida a janela end hasRuleEnabled = true else if (not self.hide_on_context[8].inverse) then --there's no inverse rule: do nothing - --self:SetWindowAlphaForCombat (false, false, getAlphaByContext(self, 8)) --> deshida a janela + --self:SetWindowAlphaForCombat (false, false, getAlphaByContext(self, 8)) --deshida a janela else - self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, 8)) --> hida a janela - self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, 8)) --> hida a janela + self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, 8)) --hida a janela + self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, 8)) --hida a janela hasRuleEnabled = true end end @@ -7677,7 +7673,7 @@ function Details:LeftMenuAnchorSide (side) if (not side) then side = self.menu_anchor.side end - + self.menu_anchor.side = side return self:MenuAnchor() end @@ -7686,44 +7682,44 @@ function Details:SetFrameStrata(strata) if (not strata) then strata = self.strata end - + self.strata = strata - + self.rowframe:SetFrameStrata(strata) self.windowSwitchButton:SetFrameStrata(strata) self.baseframe:SetFrameStrata(strata) - + if (strata == "BACKGROUND") then self.break_snap_button:SetFrameStrata ("LOW") self.baseframe.resize_esquerda:SetFrameStrata ("LOW") self.baseframe.resize_direita:SetFrameStrata ("LOW") self.baseframe.lock_button:SetFrameStrata ("LOW") - + elseif (strata == "LOW") then self.break_snap_button:SetFrameStrata ("MEDIUM") self.baseframe.resize_esquerda:SetFrameStrata ("MEDIUM") self.baseframe.resize_direita:SetFrameStrata ("MEDIUM") self.baseframe.lock_button:SetFrameStrata ("MEDIUM") - + elseif (strata == "MEDIUM") then self.break_snap_button:SetFrameStrata ("HIGH") self.baseframe.resize_esquerda:SetFrameStrata ("HIGH") self.baseframe.resize_direita:SetFrameStrata ("HIGH") self.baseframe.lock_button:SetFrameStrata ("HIGH") - + elseif (strata == "HIGH") then self.break_snap_button:SetFrameStrata ("DIALOG") self.baseframe.resize_esquerda:SetFrameStrata ("DIALOG") self.baseframe.resize_direita:SetFrameStrata ("DIALOG") self.baseframe.lock_button:SetFrameStrata ("DIALOG") - + elseif (strata == "DIALOG") then self.break_snap_button:SetFrameStrata ("FULLSCREEN") self.baseframe.resize_esquerda:SetFrameStrata ("FULLSCREEN") self.baseframe.resize_direita:SetFrameStrata ("FULLSCREEN") self.baseframe.lock_button:SetFrameStrata ("FULLSCREEN") end - + self:StretchButtonAlwaysOnTop() end @@ -7786,20 +7782,20 @@ end -- ~attributemenu (text with attribute name) function Details:RefreshAttributeTextSize() if (self.attribute_text.enabled and self.total_buttons_shown and self.baseframe and self.menu_attribute_string) then - + 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) return end - + local buttons_shown = self.total_buttons_shown local buttons_width, buttons_spacement = self.menu_icons_size * 16, self.menu_icons.space - + 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) @@ -7974,7 +7970,7 @@ end --@timer_bg: battleground elapsed time --@timer_arena: arena match elapsed time function Details:AttributeMenu (enabled, pos_x, pos_y, font, size, color, side, shadow, timer_encounter, timer_bg, timer_arena) - if (type (enabled) ~= "boolean") then + if (type(enabled) ~= "boolean") then enabled = self.attribute_text.enabled end @@ -7984,27 +7980,27 @@ function Details:AttributeMenu (enabled, pos_x, pos_y, font, size, color, side, if (not pos_y) then pos_y = self.attribute_text.anchor [2] end - + if (not font) then font = self.attribute_text.text_face end - + if (not size) then size = self.attribute_text.text_size end - + if (not color) then color = self.attribute_text.text_color end - + if (not side) then side = self.attribute_text.side end - - if (type (shadow) ~= "boolean") then + + if (type(shadow) ~= "boolean") then shadow = self.attribute_text.shadow end - + if (type(self.attribute_text.show_timer) ~= "boolean") then self.attribute_text.show_timer = true end @@ -8030,31 +8026,31 @@ function Details:AttributeMenu (enabled, pos_x, pos_y, font, size, color, side, self.attribute_text.show_timer = timer_encounter self.attribute_text.show_timer_bg = timer_bg self.attribute_text.show_timer_arena = timer_arena - - --> enabled + + --enabled if (not enabled and self.menu_attribute_string) then return self.menu_attribute_string:Hide() elseif (not enabled) then return end - - --> protection against failed clean up framework table + + --protection against failed clean up framework table if (self.menu_attribute_string and not getmetatable (self.menu_attribute_string)) then self.menu_attribute_string = nil end - - if (not self.menu_attribute_string) then - --local label = gump:NewLabel (self.floatingframe, nil, "DetailsAttributeStringInstance" .. self.meu_id, nil, "", "GameFontHighlightSmall") - local label = gump:NewLabel (self.baseframe, nil, "DetailsAttributeStringInstance" .. self.meu_id, nil, "", "GameFontHighlightSmall") + + if (not self.menu_attribute_string) then + --local label = gump:NewLabel(self.floatingframe, nil, "DetailsAttributeStringInstance" .. self.meu_id, nil, "", "GameFontHighlightSmall") + local label = gump:NewLabel(self.baseframe, nil, "DetailsAttributeStringInstance" .. self.meu_id, nil, "", "GameFontHighlightSmall") self.menu_attribute_string = label self.menu_attribute_string.owner_instance = self self.menu_attribute_string.Enabled = true self.menu_attribute_string.__enabled = true - + function self.menu_attribute_string:OnEvent(instance, attribute, subAttribute) instance:RefreshTitleBarText() end - + Details:RegisterEvent(self.menu_attribute_string, "DETAILS_INSTANCE_CHANGEATTRIBUTE", self.menu_attribute_string.OnEvent) Details:RegisterEvent(self.menu_attribute_string, "DETAILS_INSTANCE_CHANGEMODE", self.menu_attribute_string.OnEvent) Details:RegisterEvent(self.menu_attribute_string, "DETAILS_INSTANCE_CHANGESEGMENT", self.menu_attribute_string.OnEvent) @@ -8063,20 +8059,20 @@ function Details:AttributeMenu (enabled, pos_x, pos_y, font, size, color, side, end self.menu_attribute_string:Show() - - --> anchor - if (side == 1) then --> a string esta no lado de cima + + --anchor + 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]) - + 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]) end - - elseif (side == 2) then --> a string esta no lado de baixo + + 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) @@ -8086,20 +8082,20 @@ function Details:AttributeMenu (enabled, pos_x, pos_y, font, size, color, side, end end - + --font face local fontPath = SharedMedia:Fetch("font", font) Details:SetFontFace(self.menu_attribute_string, fontPath) - + --font size Details:SetFontSize(self.menu_attribute_string, size) - + --color - Details:SetFontColor (self.menu_attribute_string, color) + Details:SetFontColor(self.menu_attribute_string, color) C_Timer.After(1, function() - Details:SetFontColor (self.menu_attribute_string, color) + Details:SetFontColor(self.menu_attribute_string, color) end) - + --shadow Details:SetFontOutline(self.menu_attribute_string, shadow) @@ -8109,26 +8105,26 @@ end -- ~backdrop function Details:SetBackdropTexture (texturename) - + if (not texturename) then texturename = self.backdrop_texture end - + self.backdrop_texture = texturename - + local texture_path = SharedMedia:Fetch("background", texturename) - - self.baseframe:SetBackdrop ({ + + self.baseframe:SetBackdrop({ bgFile = texture_path, tile = true, tileSize = 128, insets = {left = 0, right = 0, top = 0, bottom = 0}} ) - self.bgdisplay:SetBackdrop ({ + self.bgdisplay:SetBackdrop({ bgFile = texture_path, tile = true, tileSize = 128, insets = {left = 0, right = 0, top = 0, bottom = 0}} ) - + self:SetBackgroundAlpha (self.bg_alpha) - + end -- ~alpha (transparency of buttons on the toolbar) ~autohide �utohide ~menuauto @@ -8143,7 +8139,7 @@ function Details:SetAutoHideMenu (left, right, interacting) if (self.auto_hide_menu.left) then local r, g, b = unpack(self.color_buttons) self:InstanceButtonsColors (r, g, b, self.menu_icons_alpha, true, true) --no save, only left - + if (self.baseframe.cabecalho.PluginIconsSeparator) then self.baseframe.cabecalho.PluginIconsSeparator:Show() end @@ -8152,7 +8148,7 @@ function Details:SetAutoHideMenu (left, right, interacting) if (self.auto_hide_menu.left) then local r, g, b = unpack(self.color_buttons) self:InstanceButtonsColors (r, g, b, 0, true, true) --no save, only left - + if (self.baseframe.cabecalho.PluginIconsSeparator) then self.baseframe.cabecalho.PluginIconsSeparator:Hide() end @@ -8170,26 +8166,26 @@ function Details:SetAutoHideMenu (left, right, interacting) self.auto_hide_menu.left = left self.auto_hide_menu.right = right - + local r, g, b = unpack(self.color_buttons) if (not left) then --auto hide is off self:InstanceButtonsColors (r, g, b, self.menu_icons_alpha, true, true) --no save, only left - + if (self.baseframe.cabecalho.PluginIconsSeparator) then self.baseframe.cabecalho.PluginIconsSeparator:Show() end else if (self.is_interacting) then self:InstanceButtonsColors (r, g, b, self.menu_icons_alpha, true, true) --no save, only left - + if (self.baseframe.cabecalho.PluginIconsSeparator) then self.baseframe.cabecalho.PluginIconsSeparator:Show() end else self:InstanceButtonsColors (0, 0, 0, 0, true, true) --no save, only left - + if (self.baseframe.cabecalho.PluginIconsSeparator) then self.baseframe.cabecalho.PluginIconsSeparator:Hide() end @@ -8202,7 +8198,7 @@ end -- transparency for toolbar, borders and statusbar function Details:SetMenuAlpha (enabled, onenter, onleave, ignorebars, interacting) - if (interacting) then --> called from a onenter or onleave script + if (interacting) then --called from a onenter or onleave script if (self.menu_alpha.enabled) then if (self.is_interacting) then return self:SetWindowAlphaForInteract (self.menu_alpha.onenter) @@ -8214,7 +8210,7 @@ function Details:SetMenuAlpha (enabled, onenter, onleave, ignorebars, interactin end --ignorebars - + if (enabled == nil) then enabled = self.menu_alpha.enabled end @@ -8232,7 +8228,7 @@ function Details:SetMenuAlpha (enabled, onenter, onleave, ignorebars, interactin self.menu_alpha.onenter = onenter self.menu_alpha.onleave = onleave self.menu_alpha.ignorebars = ignorebars - + if (not enabled) then self.baseframe:SetAlpha(1) self.rowframe:SetFrameAlpha(1) @@ -8248,11 +8244,11 @@ function Details:SetMenuAlpha (enabled, onenter, onleave, ignorebars, interactin end if (self.is_interacting) then - return self:SetWindowAlphaForInteract (onenter) --> set alpha + return self:SetWindowAlphaForInteract (onenter) --set alpha else - return self:SetWindowAlphaForInteract (onleave) --> set alpha + return self:SetWindowAlphaForInteract (onleave) --set alpha end - + end function Details:GetInstanceCurrentAlpha() @@ -8284,8 +8280,8 @@ function Details:MicroDisplaysLock (lockstate) lockstate = self.micro_displays_locked end self.micro_displays_locked = lockstate - - if (lockstate) then --> is locked + + if (lockstate) then --is locked Details.StatusBar:LockDisplays (self, true) else Details.StatusBar:LockDisplays (self, false) @@ -8296,22 +8292,22 @@ function Details:MicroDisplaysSide (side, fromuser) if (not side) then side = self.micro_displays_side end - + self.micro_displays_side = side - + Details.StatusBar:ReloadAnchors (self) - - if (self.micro_displays_side == 2 and not self.show_statusbar) then --> bottom side + + if (self.micro_displays_side == 2 and not self.show_statusbar) then --bottom side Details.StatusBar:Hide (self) if (fromuser) then - Details:Msg (Loc["STRING_OPTIONS_MICRODISPLAYWARNING"]) + Details:Msg(Loc["STRING_OPTIONS_MICRODISPLAYWARNING"]) end elseif (self.micro_displays_side == 2) then Details.StatusBar:Show (self) elseif (self.micro_displays_side == 1) then Details.StatusBar:Show (self) end - + end function Details:IsGroupedWith (instance) @@ -8327,16 +8323,16 @@ end function Details:GetInstanceGroup (instance_id) local instance = self - + if (instance_id) then instance = Details:GetInstance (instance_id) if (not instance or not instance:IsEnabled()) then return end end - + local current_group = {instance} - + for side, insId in pairs (instance.snap) do if (insId < instance:GetId()) then local last_id = instance:GetId() @@ -8376,7 +8372,7 @@ function Details:GetInstanceGroup (instance_id) end end end - + return current_group end @@ -8404,27 +8400,27 @@ function Details:SetWindowScale(scale, fromOptions) end function Details:ToolbarSide (side, only_update_anchors) - + if (not side) then side = self.toolbar_side end - + self.toolbar_side = side - + local skin = Details.skins [self.skin] - - if (side == 1) then --> top - + + if (side == 1) then --top + local anchor_mod = not self.show_sidebars and skin.instance_cprops.show_sidebars_need_resize_by or 0 - - --> icon (ball) point + + --icon (ball) point self.baseframe.cabecalho.ball_point:ClearAllPoints() local x, y = unpack(skin.icon_point_anchor) x = x + (anchor_mod) self.baseframe.cabecalho.ball_point:SetPoint("bottomleft", self.baseframe, "topleft", x, y) - - --> ball + + --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)) @@ -8432,151 +8428,151 @@ function Details:ToolbarSide (side, only_update_anchors) 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) - --> ball r + --ball r 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) - --> tex coords + --tex coords self.baseframe.cabecalho.top_bg:SetTexCoord(unpack(COORDS_TOP_BACKGROUND)) - --> up frames + --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.UPFrameConnect:ClearAllPoints() 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) - - - else --> bottom - + + + else --bottom + local y = 0 if (self.show_statusbar) then y = -14 end - + local anchor_mod = not self.show_sidebars and skin.instance_cprops.show_sidebars_need_resize_by or 0 - - --> ball point + + --ball point self.baseframe.cabecalho.ball_point:ClearAllPoints() - + 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) - - --> ball + + --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) local l, r, t, b = unpack(COORDS_LEFT_BALL) self.baseframe.cabecalho.ball:SetTexCoord(l, r, b, t) - --> ball r + --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) local l, r, t, b = unpack(COORDS_RIGHT_BALL) self.baseframe.cabecalho.ball_r:SetTexCoord(l, r, b, t) - - --> tex coords + + --tex coords local l, r, t, b = unpack(COORDS_LEFT_CONNECTOR) 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) - --> up frames + --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.UPFrameConnect:ClearAllPoints() 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) end if (only_update_anchors) then - --> ShowSideBars depends on this and creates a infinite loop + --ShowSideBars depends on this and creates a infinite loop return end - - --> update top menus + + --update top menus self:LeftMenuAnchorSide() self:StretchButtonAnchor() self:HideMainIcon() --attribute menu reseting value - + if (self.show_sidebars) then self:ShowSideBars() end - + self:AttributeMenu() - - --> update the grow direction to update the gap between the titlebar and the baseframe + + --update the grow direction to update the gap between the titlebar and the baseframe self:SetBarGrowDirection() end function Details:StretchButtonAlwaysOnTop (on_top) - - if (type (on_top) ~= "boolean") then + + if (type(on_top) ~= "boolean") then on_top = self.grab_on_top end - + self.grab_on_top = on_top - + if (self.grab_on_top) then self.baseframe.button_stretch:SetFrameStrata ("FULLSCREEN") else self.baseframe.button_stretch:SetFrameStrata (self.strata) end - + end function Details:StretchButtonAnchor (side) - + if (not side) then side = self.stretch_button_side end - + if (side == 1 or string.lower (side) == "top") then - + self.baseframe.button_stretch:ClearAllPoints() - + local y = 0 if (self.toolbar_side == 2) then --bottom 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.stretch_button_side = 1 - + elseif (side == 2 or string.lower (side) == "bottom") then - + self.baseframe.button_stretch:ClearAllPoints() - + local y = 0 if (self.toolbar_side == 2) then --bottom y = y -20 @@ -8584,17 +8580,17 @@ function Details:StretchButtonAnchor (side) if (self.show_statusbar) then y = y -14 end - + 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.stretch_button_side = 2 - + end - + end function Details:MenuAnchor (x, y) @@ -8607,7 +8603,7 @@ function Details:MenuAnchor (x, y) end self.menu_anchor [1] = x self.menu_anchor [2] = y - + elseif (self.toolbar_side == 2) then --bottom if (not x) then x = self.menu_anchor_down [1] @@ -8618,76 +8614,76 @@ function Details:MenuAnchor (x, y) self.menu_anchor_down [1] = x self.menu_anchor_down [2] = y end - + local menu_points = self.menu_points -- = {MenuAnchorLeft, MenuAnchorRight} - - if (self.menu_anchor.side == 1) then --> left - + + if (self.menu_anchor.side == 1) then --left + menu_points [1]:ClearAllPoints() - - if (self.toolbar_side == 1) then --> top + + if (self.toolbar_side == 1) then --top menu_points [1]:SetPoint("bottomleft", self.baseframe.cabecalho.ball, "bottomright", x, y) -- y+2 - - else --> bottom + + else --bottom menu_points [1]:SetPoint("topleft", self.baseframe.cabecalho.ball, "topright", x, (y*-1) - 4) end - - elseif (self.menu_anchor.side == 2) then --> right - + + elseif (self.menu_anchor.side == 2) then --right + menu_points [2]:ClearAllPoints() - - if (self.toolbar_side == 1) then --> top + + if (self.toolbar_side == 1) then --top menu_points [2]:SetPoint("topleft", self.baseframe.cabecalho.ball_r, "bottomleft", x, y+16) - - else --> bottom + + else --bottom menu_points [2]:SetPoint("topleft", self.baseframe.cabecalho.ball_r, "topleft", x, (y*-1) - 4) end end - + self:ToolbarMenuButtons() end function Details:HideMainIcon (value) - if (type (value) ~= "boolean") then + if (type(value) ~= "boolean") then value = self.hide_icon end - + if (value) then - + self.hide_icon = true - Details.FadeHandler.Fader (self.baseframe.cabecalho.atributo_icon, 1) - + 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)) - + 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) local l, r, t, b = unpack(COORDS_LEFT_CONNECTOR_NO_ICON) self.baseframe.cabecalho.emenda:SetTexCoord(l, r, b, t) end - + local skin = Details.skins [self.skin] - + if (skin.icon_on_top) then - self.baseframe.cabecalho.atributo_icon:SetParent (self.floatingframe) + self.baseframe.cabecalho.atributo_icon:SetParent(self.floatingframe) else - self.baseframe.cabecalho.atributo_icon:SetParent (self.baseframe) + self.baseframe.cabecalho.atributo_icon:SetParent(self.baseframe) end - + else self.hide_icon = false - Details.FadeHandler.Fader (self.baseframe.cabecalho.atributo_icon, 0) - + Details.FadeHandler.Fader(self.baseframe.cabecalho.atributo_icon, 0) + if (self.toolbar_side == 1) then 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) @@ -8698,7 +8694,7 @@ function Details:HideMainIcon (value) end end ---> search key: ~desaturate +--search key: ~desaturate function Details:DesaturateMenu (value) if (value == nil) then @@ -8706,7 +8702,7 @@ function Details:DesaturateMenu (value) end if (value) then - + self.desaturated_menu = true self.baseframe.cabecalho.modo_selecao:GetNormalTexture():SetDesaturated(true) self.baseframe.cabecalho.segmento:GetNormalTexture():SetDesaturated(true) @@ -8716,13 +8712,13 @@ function Details:DesaturateMenu (value) self.baseframe.cabecalho.fechar:GetNormalTexture():SetDesaturated(true) if (self.meu_id == Details:GetLowerInstanceNumber()) then - for _, button in ipairs (Details.ToolBar.AllButtons) do + for _, button in ipairs(Details.ToolBar.AllButtons) do 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) @@ -8730,13 +8726,13 @@ function Details:DesaturateMenu (value) 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 + for _, button in ipairs(Details.ToolBar.AllButtons) do button:GetNormalTexture():SetDesaturated(false) end end - + end end @@ -8744,13 +8740,13 @@ function Details:ShowSideBars (instancia) if (instancia) then self = instancia end - + self.show_sidebars = true - + self.baseframe.barra_esquerda:Show() self.baseframe.barra_direita:Show() - - --> set default spacings + + --set default spacings local this_skin = Details.skins [self.skin] if (this_skin.instance_cprops and this_skin.instance_cprops.row_info and this_skin.instance_cprops.row_info.space) then self.row_info.space.left = this_skin.instance_cprops.row_info.space.left @@ -8763,7 +8759,7 @@ function Details:ShowSideBars (instancia) 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) - + if (self.toolbar_side == 2) then self.baseframe.barra_fundo:Show() local l, r, t, b = unpack(COORDS_BOTTOM_SIDE_BAR) @@ -8777,9 +8773,9 @@ function Details:ShowSideBars (instancia) 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_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) @@ -8793,20 +8789,20 @@ function Details:ShowSideBars (instancia) self.baseframe.barra_fundo:SetPoint("bottomright", self.baseframe, "bottomright", -1, -56) end end - + --self:SetBarGrowDirection() --passando true - apenas atulizar as anchors self:ToolbarSide (nil, true) - + end function Details:HideSideBars (instancia) if (instancia) then self = instancia end - + self.show_sidebars = false - + local this_skin = Details.skins [self.skin] local space_config = this_skin.instance_cprops and this_skin.instance_cprops.row_info and this_skin.instance_cprops.row_info.space if (space_config) then @@ -8815,7 +8811,7 @@ function Details:HideSideBars (instancia) else self.row_info.space.left = 0 end - + if (space_config.right_noborder) then self.row_info.space.right = space_config.right_noborder else @@ -8829,7 +8825,7 @@ function Details:HideSideBars (instancia) self.baseframe.barra_esquerda:Hide() self.baseframe.barra_direita:Hide() self.baseframe.barra_fundo:Hide() - + --self:SetBarGrowDirection() --j� � chamado no toolbarside --passando true - apenas atulizar as anchors self:ToolbarSide (nil, true) @@ -8839,33 +8835,33 @@ function Details:HideStatusBar (instancia) if (instancia) then self = instancia end - + self.show_statusbar = false - + self.baseframe.rodape.esquerdo:Hide() self.baseframe.rodape.direita:Hide() self.baseframe.rodape.top_bg:Hide() self.baseframe.rodape.StatusBarLeftAnchor:Hide() self.baseframe.rodape.StatusBarCenterAnchor:Hide() self.baseframe.DOWNFrame:Hide() - + --debug self.baseframe.rodape.direita_nostatusbar:Show() self.baseframe.rodape.esquerdo_nostatusbar:Show() -- - + if (self.toolbar_side == 2) then self:ToolbarSide() end - + if (self.show_sidebars) then self:ShowSideBars() end - + self:StretchButtonAnchor() - - if (self.micro_displays_side == 2) then --> bottom side - Details.StatusBar:Hide (self) --> mini displays widgets + + if (self.micro_displays_side == 2) then --bottom side + Details.StatusBar:Hide (self) --mini displays widgets end end @@ -8882,7 +8878,7 @@ function Details:StatusBarColor (r, g, b, a, no_save) self.statusbar_info.overlay [3] = b 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) @@ -8893,33 +8889,33 @@ function Details:StatusBarColor (r, g, b, a, no_save) self.baseframe.rodape.esquerdo_nostatusbar:SetAlpha(a) self.baseframe.rodape.top_bg:SetVertexColor(r, g, b) self.baseframe.rodape.top_bg:SetAlpha(a) - + end function Details:ShowStatusBar(instancia) if (instancia) then self = instancia end - + self.show_statusbar = true - + self.baseframe.rodape.esquerdo:Show() self.baseframe.rodape.direita:Show() self.baseframe.rodape.top_bg:Show() self.baseframe.rodape.StatusBarLeftAnchor:Show() self.baseframe.rodape.StatusBarCenterAnchor:Show() self.baseframe.DOWNFrame:Show() - + --debug --self.baseframe.rodape.direita_nostatusbar:Hide() --self.baseframe.rodape.esquerdo_nostatusbar:Hide() -- - + self:ToolbarSide() self:StretchButtonAnchor() - - if (self.micro_displays_side == 2) then --> bottom side - Details.StatusBar:Show(self) --> mini displays widgets + + if (self.micro_displays_side == 2) then --bottom side + Details.StatusBar:Show(self) --mini displays widgets end end @@ -8948,125 +8944,125 @@ function Details:SetTooltipBackdrop (border_texture, border_size, border_color) end ---> reset button functions +--reset button functions local reset_button_onenter = function(self, _, forced, from_click) - + if (Details.instances_menu_click_to_open and not forced) then return end local instancia = self._instance or self.widget._instance local baseframe = instancia.baseframe - + local gameCooltip = GameCooltip - + OnEnterMainWindow(self.instance, self) gameCooltip.buttonOver = true self.instance.baseframe.cabecalho.button_mouse_over = true - + if (self.instance.desaturated_menu) then self:GetNormalTexture():SetDesaturated(false) end - + gameCooltip:Reset() gameCooltip:SetType ("menu") - + gameCooltip:SetOption("ButtonsYMod", -6) gameCooltip:SetOption("HeighMod", 6) gameCooltip:SetOption("YSpacingMod", -3) gameCooltip:SetOption("TextHeightMod", 0) gameCooltip:SetOption("IgnoreButtonAutoHeight", false) - + Details:SetTooltipMinWidth() - + gameCooltip:AddLine(Loc["STRING_ERASE_DATA_OVERALL"], nil, 1, "white", nil, Details.font_sizes.menus, Details.font_faces.menus) gameCooltip:AddIcon([[Interface\Buttons\UI-StopButton]], 1, 1, 14, 14, 0, 1, 0, 1, "orange") gameCooltip:AddMenu(1, Details.tabela_historico.resetar_overall) - + gameCooltip:AddLine("$div", nil, 1, nil, -5, -11) - + gameCooltip:AddLine(Loc["STRING_ERASE_DATA"], nil, 1, "white", nil, Details.font_sizes.menus, Details.font_faces.menus) gameCooltip:AddIcon([[Interface\Buttons\UI-StopButton]], 1, 1, 14, 14, 0, 1, 0, 1, "red") gameCooltip:AddMenu(1, Details.tabela_historico.resetar) - + show_anti_overlap (self.instance, self, "top") - + Details:SetMenuOwner (self, self.instance) gameCooltip:ShowCooltip() end - + local reset_button_onleave = function(self) - OnLeaveMainWindow (self.instance, self) - + OnLeaveMainWindow(self.instance, self) + if (self.instance.desaturated_menu) then self:GetNormalTexture():SetDesaturated(true) end - + hide_anti_overlap (self.instance.baseframe.anti_menu_overlap) - + GameCooltip.buttonOver = false self.instance.baseframe.cabecalho.button_mouse_over = false - + if (GameCooltip.active) then parameters_table [2] = 0 - self:SetScript ("OnUpdate", on_leave_menu) + self:SetScript("OnUpdate", on_leave_menu) else - self:SetScript ("OnUpdate", nil) + self:SetScript("OnUpdate", nil) end - + end - ---> close button functions + +--close button functions local close_button_onclick = function(self, button_type, button) - + if (self and not self.instancia and button and button.instancia) then self = button end - + self = self or button - + self:Disable() - self.instancia:DesativarInstancia() - - --> n�o h� mais inst�ncias abertas, ent�o manda msg alertando + self.instancia:DesativarInstancia() + + --n�o h� mais inst�ncias abertas, ent�o manda msg alertando if (Details.opened_windows == 0) then - Details:Msg (Loc["STRING_CLOSEALL"]) + Details:Msg(Loc["STRING_CLOSEALL"]) end - - --> tutorial, how to fully delete a window + + --tutorial, how to fully delete a window --_detalhes:SetTutorialCVar ("FULL_DELETE_WINDOW", false) - + if (not Details:GetTutorialCVar ("FULL_DELETE_WINDOW")) then Details:SetTutorialCVar ("FULL_DELETE_WINDOW", true) - + 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:SetBackdropColor(0, 0, 0, 0.9) panel:SetPoint("center", UIParent, "center") - + local s = panel:CreateFontString(nil, "overlay", "GameFontNormal") s:SetPoint("center", panel, "center") - s:SetText (Loc["STRING_TUTORIAL_FULLY_DELETE_WINDOW"]) - + s:SetText(Loc["STRING_TUTORIAL_FULLY_DELETE_WINDOW"]) + panel:Show() end - + GameCooltip:Hide() end Details.close_instancia_func = close_button_onclick local close_button_onenter = function(self) - OnEnterMainWindow (self.instance, self, 3) + OnEnterMainWindow(self.instance, self, 3) if (self.instance.desaturated_menu) then self:GetNormalTexture():SetDesaturated(false) end - + local GameCooltip = GameCooltip - + GameCooltip.buttonOver = true self.instance.baseframe.cabecalho.button_mouse_over = true - + GameCooltip:Reset() GameCooltip:SetType ("menu") GameCooltip:SetOption("ButtonsYMod", -7) @@ -9080,60 +9076,60 @@ end GameCooltip:SetOption("SubMenuIsTooltip", true) GameCooltip:SetOption("FixedWidthSub", 180) --GameCooltip:SetOption("FixedHeight", 30) - + GameCooltip:SetOption("HeighMod", 9) 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) - + GameCooltip:AddLine(Loc["STRING_MENU_CLOSE_INSTANCE_DESC"], nil, 2, "white", nil, Details.font_sizes.menus, Details.font_faces.menus) GameCooltip:AddIcon([[Interface\CHATFRAME\UI-ChatIcon-Minimize-Up]], 2, 1, 18, 18) - + GameCooltip:AddLine(Loc["STRING_MENU_CLOSE_INSTANCE_DESC2"], nil, 2, "white", nil, Details.font_sizes.menus, Details.font_faces.menus) GameCooltip:AddIcon([[Interface\PaperDollInfoFrame\UI-GearManager-LeaveItem-Transparent]], 2, 1, 18, 18) - + GameCooltip:SetWallpaper (1, Details.tooltip.menus_bg_texture, Details.tooltip.menus_bg_coords, Details.tooltip.menus_bg_color, true) GameCooltip:SetWallpaper (2, Details.tooltip.menus_bg_texture, Details.tooltip.menus_bg_coords, Details.tooltip.menus_bg_color, true) - GameCooltip:SetBackdrop (1, menus_backdrop, nil, menus_bordercolor) - GameCooltip:SetBackdrop (2, menus_backdrop, nil, menus_bordercolor) - + GameCooltip:SetBackdrop(1, menus_backdrop, nil, menus_bordercolor) + GameCooltip:SetBackdrop(2, menus_backdrop, nil, menus_bordercolor) + show_anti_overlap (self.instance, self, "top") - + Details:SetMenuOwner (self, self.instance) GameCooltip:ShowCooltip() end - + local close_button_onleave = function(self) - OnLeaveMainWindow (self.instance, self, 3) + OnLeaveMainWindow(self.instance, self, 3) if (self.instance.desaturated_menu) then self:GetNormalTexture():SetDesaturated(true) end - + hide_anti_overlap (self.instance.baseframe.anti_menu_overlap) - + GameCooltip.buttonOver = false self.instance.baseframe.cabecalho.button_mouse_over = false - + if (GameCooltip.active) then parameters_table [2] = 0 - self:SetScript ("OnUpdate", on_leave_menu) + self:SetScript("OnUpdate", on_leave_menu) else - self:SetScript ("OnUpdate", nil) + self:SetScript("OnUpdate", nil) end - + end - + ------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> build upper menu bar +--build upper menu bar local menu_can_open = function() if (GameCooltip.active) then local owner = GameCooltip:GetOwner() if (owner and owner:GetScript ("OnUpdate") == on_leave_menu) then - owner:SetScript ("OnUpdate", nil) + owner:SetScript("OnUpdate", nil) end return true end @@ -9149,16 +9145,16 @@ local report_on_enter = function(self, motion, forced, from_click) local instancia = self._instance or self.widget._instance local baseframe = instancia.baseframe - OnEnterMainWindow (instancia, self, 3) + OnEnterMainWindow(instancia, self, 3) if (instancia.desaturated_menu) then self:GetNormalTexture():SetDesaturated(false) end - + GameCooltip.buttonOver = true baseframe.cabecalho.button_mouse_over = true - + GameCooltip:Reset() - + GameCooltip:SetType ("menu") GameCooltip:SetOption("ButtonsYMod", -6) GameCooltip:SetOption("HeighMod", 6) @@ -9167,39 +9163,39 @@ local report_on_enter = function(self, motion, forced, from_click) GameCooltip:SetOption("IgnoreButtonAutoHeight", false) Details:SetTooltipMinWidth() - + Details:CheckLastReportsIntegrity() - + local last_reports = Details.latest_report_table if (#last_reports > 0) then local amountReports = #last_reports amountReports = math.min (amountReports, 10) - + for index = amountReports, 1, -1 do local report = last_reports [index] local instance_number, attribute, subattribute, amt, report_where, custom_name = unpack(report) - + local name = Details:GetSubAttributeName (attribute, subattribute, custom_name) - + local artwork = Details.GetReportIconAndColor (report_where) - + GameCooltip:AddLine(name .. " (#" .. amt .. ")", nil, 1, "white", nil, Details.font_sizes.menus, Details.font_faces.menus) if (artwork) then GameCooltip:AddIcon(artwork.icon, 1, 1, 14, 14, artwork.coords[1], artwork.coords[2], artwork.coords[3], artwork.coords[4], artwork.color, nil, false) end GameCooltip:AddMenu(1, Details.ReportFromLatest, index) end - + GameCooltip:AddLine("$div", nil, nil, -4) end - + GameCooltip:AddLine(Loc["STRING_REPORT_TOOLTIP"], nil, 1, "white", nil, Details.font_sizes.menus, Details.font_faces.menus) GameCooltip:AddIcon([[Interface\Addons\Details\Images\report_button]], 1, 1, 12, 19) GameCooltip:AddMenu(1, Details.Reportar, instancia, nil, "INSTANCE" .. instancia.meu_id) - + show_anti_overlap (instancia, self, "top") Details:SetMenuOwner (self, instancia) - + GameCooltip:ShowCooltip() end @@ -9208,22 +9204,22 @@ local report_on_leave = function(self, motion, forced, from_click) local instancia = self._instance or self.widget._instance local baseframe = instancia.baseframe - OnLeaveMainWindow (instancia, self, 3) - + OnLeaveMainWindow(instancia, self, 3) + hide_anti_overlap (instancia.baseframe.anti_menu_overlap) - + GameCooltip.buttonOver = false baseframe.cabecalho.button_mouse_over = false - + if (instancia.desaturated_menu) then self:GetNormalTexture():SetDesaturated(true) end - + if (GameCooltip.active) then parameters_table [2] = from_click and 1 or 0 - self:SetScript ("OnUpdate", on_leave_menu) + self:SetScript("OnUpdate", on_leave_menu) else - self:SetScript ("OnUpdate", nil) + self:SetScript("OnUpdate", nil) end end @@ -9236,69 +9232,69 @@ local atributo_on_enter = function(self, motion, forced, from_click) local instancia = self._instance or self.widget._instance local baseframe = instancia.baseframe - - OnEnterMainWindow (instancia, self, 3) + + OnEnterMainWindow(instancia, self, 3) if (instancia.desaturated_menu) then self:GetNormalTexture():SetDesaturated(false) - end + end GameCooltip.buttonOver = true baseframe.cabecalho.button_mouse_over = true - + show_anti_overlap (instancia, self, "top") GameCooltip:Reset() GameCooltip:SetType (3) GameCooltip:SetFixedParameter (instancia) - + if (Details.solo and Details.solo == instancia.meu_id) then Details:MontaSoloOption (instancia) - + elseif (instancia:IsRaidMode()) then - + local have_plugins = Details:MontaRaidOption (instancia) if (not have_plugins) then GameCooltip:SetType ("tooltip") GameCooltip:SetOption("ButtonsYMod", 0) - + 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: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) - + end - + else Details:MontaAtributosOption (instancia) GameCooltip:SetOption("YSpacingMod", -1) GameCooltip:SetOption("YSpacingModSub", -2) end - + GameCooltip:SetOption("TextSize", Details.font_sizes.menus) - + Details:SetMenuOwner (self, instancia) - - + + GameCooltip:ShowCooltip () end local atributo_on_leave = function(self, motion, forced, from_click) local instancia = self._instance or self.widget._instance local baseframe = instancia.baseframe - - OnLeaveMainWindow (instancia, self, 3) - + + OnLeaveMainWindow(instancia, self, 3) + hide_anti_overlap (instancia.baseframe.anti_menu_overlap) - + if (instancia.desaturated_menu) then self:GetNormalTexture():SetDesaturated(true) end - + GameCooltip.buttonOver = false baseframe.cabecalho.button_mouse_over = false - + if (GameCooltip.active) then parameters_table [2] = 0 self:SetScript("OnUpdate", on_leave_menu) @@ -9307,7 +9303,7 @@ local atributo_on_leave = function(self, motion, forced, from_click) end end -local segmentButton_OnEnter = function(self, motion, forced, fromClick) +local segmentButton_OnEnter = function(self, motion, forced, fromClick) if (Details.instances_menu_click_to_open and not forced) then return end @@ -9334,7 +9330,7 @@ local segmentButton_OnEnter = function(self, motion, forced, fromClick) self:SetScript("OnUpdate", buildSegmentTooltip) end -local segmentButton_OnLeave = function(self, motion, forced, fromClick) +local segmentButton_OnLeave = function(self, motion, forced, fromClick) local instance = self._instance or self.widget._instance local baseframe = instance.baseframe @@ -9365,16 +9361,16 @@ local modo_selecao_on_enter = function(self, motion, forced, from_click) local instancia = self._instance or self.widget._instance local baseframe = instancia.baseframe - - OnEnterMainWindow (instancia, self, 3) - + + OnEnterMainWindow(instancia, self, 3) + if (instancia.desaturated_menu) then self:GetNormalTexture():SetDesaturated(false) end - + GameCooltip.buttonOver = true baseframe.cabecalho.button_mouse_over = true - + local passou = 0 if (_G.GameCooltip.active) then passou = 0.15 @@ -9394,8 +9390,8 @@ local modo_selecao_on_enter = function(self, motion, forced, from_click) parameters_table [1] = instancia parameters_table [2] = from_click and 1 or passou parameters_table [3] = checked - - self:SetScript ("OnUpdate", build_mode_list) + + self:SetScript("OnUpdate", build_mode_list) end local modo_selecao_on_leave = function(self) @@ -9403,28 +9399,28 @@ local modo_selecao_on_leave = function(self) local instancia = self._instance or self.widget._instance local baseframe = instancia.baseframe - OnLeaveMainWindow (instancia, self, 3) - + OnLeaveMainWindow(instancia, self, 3) + hide_anti_overlap (instancia.baseframe.anti_menu_overlap) - + if (instancia.desaturated_menu) then self:GetNormalTexture():SetDesaturated(true) end - + GameCooltip.buttonOver = false baseframe.cabecalho.button_mouse_over = false - + if (GameCooltip.active) then parameters_table [2] = 0 - self:SetScript ("OnUpdate", on_leave_menu) + self:SetScript("OnUpdate", on_leave_menu) else - self:SetScript ("OnUpdate", nil) + self:SetScript("OnUpdate", nil) end end --- these can +-- these can local title_bar_icons = { {texture = [[Interface\AddOns\Details\images\toolbar_icons]], texcoord = {0/256, 32/256, 0, 1}}, {texture = [[Interface\AddOns\Details\images\toolbar_icons]], texcoord = {32/256, 64/256, 0, 1}}, @@ -9445,149 +9441,149 @@ function Details:GetTitleBarIconsTexture (button, instance) end function Details:CreateFakeWindow() - local t = CreateFrame ("frame") - t:SetSize (200, 91) - 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) + local t = CreateFrame("frame") + t:SetSize(200, 91) + 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:SetBackdrop ({bgFile = "Interface\\AddOns\\Details\\images\\background", tile = true, tileSize = 16 }) - tb:SetBackdropColor (0.7, 0.7, 0.7, 0.4) + 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") - Details:SetFontColor (tt, "white") + 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) - tt:SetText ("Damage Done") - + tt:SetText("Damage Done") + t.TitleIcons = {} for i = 1, 5 do - local b = tb:CreateTexture (nil, "overlay") - b:SetSize (12, 12) + local b = tb:CreateTexture(nil, "overlay") + b:SetSize(12, 12) 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)) tinsert (t.TitleIcons, b) end - + t.TitleBar = tb t.TitleText = tt - + return t end local function click_to_change_segment (instancia, buttontype) if (buttontype == "LeftButton") then - + local segmento_goal = instancia.segmento + 1 if (segmento_goal > segments_used) then segmento_goal = -1 elseif (segmento_goal > Details.segments_amount) then segmento_goal = -1 end - + local total_shown = segments_filled+2 local goal = segmento_goal+1 - + local select_ = math.abs (goal - total_shown) GameCooltip:Select (1, select_) - + instancia:TrocaTabela (segmento_goal) - + segmentButton_OnEnter (instancia.baseframe.cabecalho.segmento.widget, _, true, true) - + elseif (buttontype == "RightButton") then - + local segmento_goal = instancia.segmento - 1 if (segmento_goal < -1) then segmento_goal = segments_used end - + local total_shown = segments_filled+2 local goal = segmento_goal+1 - + local select_ = math.abs (goal - total_shown) GameCooltip:Select (1, select_) - + instancia:TrocaTabela (segmento_goal) segmentButton_OnEnter (instancia.baseframe.cabecalho.segmento.widget, _, true, true) - + elseif (buttontype == "MiddleButton") then - + local segmento_goal = 0 - + local total_shown = segments_filled+2 local goal = segmento_goal+1 - + local select_ = math.abs (goal - total_shown) GameCooltip:Select (1, select_) - + instancia:TrocaTabela (segmento_goal) segmentButton_OnEnter (instancia.baseframe.cabecalho.segmento.widget, _, true, true) - + end end function gump:CriaCabecalho (baseframe, instancia) baseframe.cabecalho = {} - - --> FECHAR INSTANCIA ---------------------------------------------------------------------------------------------------------------------------------------------------- - baseframe.cabecalho.fechar = CreateFrame ("button", "DetailsCloseInstanceButton" .. instancia.meu_id, baseframe) --, "UIPanelCloseButton" + + --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:SetNormalTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) + 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:SetHighlightTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) + baseframe.cabecalho.fechar:SetHighlightTexture([[Interface\AddOns\Details\images\toolbar_icons]]) baseframe.cabecalho.fechar:GetHighlightTexture():SetTexCoord(160/256, 192/256, 0, 1) - baseframe.cabecalho.fechar:SetPushedTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) + baseframe.cabecalho.fechar:SetPushedTexture([[Interface\AddOns\Details\images\toolbar_icons]]) 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]]) - --baseframe.cabecalho.fechar:SetPushedTexture ([[Interface\Buttons\UI-Panel-MinimizeButton-Down]]) - + --baseframe.cabecalho.fechar:SetNormalTexture([[Interface\Buttons\UI-Panel-MinimizeButton-Up]]) + --baseframe.cabecalho.fechar:SetHighlightTexture([[Interface\Buttons\UI-Panel-MinimizeButton-Highlight]]) + --baseframe.cabecalho.fechar:SetPushedTexture([[Interface\Buttons\UI-Panel-MinimizeButton-Down]]) + baseframe.cabecalho.fechar.instancia = instancia baseframe.cabecalho.fechar.instance = instancia - - baseframe.cabecalho.fechar:SetScript ("OnEnter", close_button_onenter) - baseframe.cabecalho.fechar:SetScript ("OnLeave", close_button_onleave) - - baseframe.cabecalho.fechar:SetScript ("OnClick", close_button_onclick) - - --> 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.fechar:SetScript("OnEnter", close_button_onenter) + baseframe.cabecalho.fechar:SetScript("OnLeave", close_button_onleave) + + baseframe.cabecalho.fechar:SetScript("OnClick", close_button_onclick) + + --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) - - --> icone do atributo - --baseframe.cabecalho.atributo_icon = _detalhes.listener:CreateTexture (nil, "artwork") - baseframe.cabecalho.atributo_icon = baseframe:CreateTexture ("DetailsAttributeIcon" .. instancia.meu_id, "background") + + --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) - - --> bola overlay - --baseframe.cabecalho.ball = _detalhes.listener:CreateTexture (nil, "overlay") - baseframe.cabecalho.ball = baseframe:CreateTexture (nil, "overlay") + + --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:SetTexture(DEFAULT_SKIN) baseframe.cabecalho.ball:SetTexCoord(unpack(COORDS_LEFT_BALL)) - --> emenda - baseframe.cabecalho.emenda = baseframe:CreateTexture (nil, "background") + --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) @@ -9597,16 +9593,16 @@ function gump:CriaCabecalho (baseframe, instancia) baseframe.cabecalho.atributo_icon:Hide() baseframe.cabecalho.ball:Hide() - --> bola do canto direito superior - baseframe.cabecalho.ball_r = baseframe:CreateTexture (nil, "background") + --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)) - --> barra centro - baseframe.cabecalho.top_bg = baseframe:CreateTexture (nil, "background") + --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) @@ -9614,86 +9610,86 @@ function gump:CriaCabecalho (baseframe, instancia) baseframe.cabecalho.top_bg:SetWidth(512) baseframe.cabecalho.top_bg:SetHeight(128) - --> frame invis�vel - baseframe.UPFrame = CreateFrame ("frame", "DetailsUpFrameInstance"..instancia.meu_id, baseframe) + --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.is_toolbar = true - + baseframe.UPFrame:Show() baseframe.UPFrame:EnableMouse(true) baseframe.UPFrame:SetMovable (true) - baseframe.UPFrame:SetResizable (true) - - BGFrame_scripts (baseframe.UPFrame, baseframe, instancia) - - --> corrige o v�o entre o baseframe e o upframe - baseframe.UPFrameConnect = CreateFrame ("frame", "DetailsAntiGap"..instancia.meu_id, baseframe) + baseframe.UPFrame:SetResizable(true) + + BGFrame_scripts(baseframe.UPFrame, 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:SetMovable (true) - baseframe.UPFrameConnect:SetResizable (true) + baseframe.UPFrameConnect:SetResizable(true) baseframe.UPFrameConnect.is_toolbar = true - - BGFrame_scripts (baseframe.UPFrameConnect, baseframe, instancia) - - baseframe.UPFrameLeftPart = CreateFrame ("frame", "DetailsUpFrameLeftPart"..instancia.meu_id, baseframe) + + 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:SetSize (22, 20) + baseframe.UPFrameLeftPart:SetSize(22, 20) baseframe.UPFrameLeftPart:EnableMouse(true) baseframe.UPFrameLeftPart:SetMovable (true) - baseframe.UPFrameLeftPart:SetResizable (true) + baseframe.UPFrameLeftPart:SetResizable(true) baseframe.UPFrameLeftPart.is_toolbar = true - - BGFrame_scripts (baseframe.UPFrameLeftPart, baseframe, instancia) - --> anchors para os micro displays no lado de cima da janela - local StatusBarLeftAnchor = CreateFrame ("frame", "DetailsStatusBarLeftAnchor" .. instancia.meu_id, baseframe) + BGFrame_scripts(baseframe.UPFrameLeftPart, 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) baseframe.cabecalho.StatusBarLeftAnchor = StatusBarLeftAnchor - - local StatusBarCenterAnchor = CreateFrame ("frame", "DetailsStatusBarCenterAnchor" .. instancia.meu_id, baseframe) + + 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) - baseframe.cabecalho.StatusBarCenterAnchor = StatusBarCenterAnchor + baseframe.cabecalho.StatusBarCenterAnchor = StatusBarCenterAnchor - local StatusBarRightAnchor = CreateFrame ("frame", "DetailsStatusBarRightAnchor" .. instancia.meu_id, baseframe) + local StatusBarRightAnchor = CreateFrame("frame", "DetailsStatusBarRightAnchor" .. instancia.meu_id, baseframe) 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) - MenuAnchorLeft:SetSize (1, 1) - - local MenuAnchorRight = CreateFrame ("frame", "DetailsMenuAnchorRight"..instancia.meu_id, baseframe) - MenuAnchorRight:SetSize (1, 1) - - local Menu2AnchorRight = CreateFrame ("frame", "DetailsMenu2AnchorRight"..instancia.meu_id, baseframe) - Menu2AnchorRight:SetSize (1, 1) - + + local MenuAnchorLeft = CreateFrame("frame", "DetailsMenuAnchorLeft"..instancia.meu_id, baseframe) + MenuAnchorLeft:SetSize(1, 1) + + local MenuAnchorRight = CreateFrame("frame", "DetailsMenuAnchorRight"..instancia.meu_id, baseframe) + MenuAnchorRight:SetSize(1, 1) + + local Menu2AnchorRight = CreateFrame("frame", "DetailsMenu2AnchorRight"..instancia.meu_id, baseframe) + Menu2AnchorRight:SetSize(1, 1) + instancia.menu_points = {MenuAnchorLeft, MenuAnchorRight} instancia.menu2_points = {Menu2AnchorRight} - --- bot�es -------------------------------------------------------------------------------------------------------------------------------------------------- + +-- bot�es +------------------------------------------------------------------------------------------------------------------------------------------------- local CoolTip = _G.GameCooltip - --> SELE��O DO MODO ---------------------------------------------------------------------------------------------------------------------------------------------------- + --SELE��O DO MODO ---------------------------------------------------------------------------------------------------------------------------------------------------- local modo_selecao_button_click = function() if (Details.instances_menu_click_to_open) then if (instancia.LastMenuOpened == "mode" and GameCooltipFrame1:IsShown()) then GameCooltip:ShowMe (false) instancia.LastMenuOpened = nil - else + else modo_selecao_on_enter (instancia.baseframe.cabecalho.modo_selecao.widget, _, true, true) instancia.LastMenuOpened = "mode" end @@ -9701,25 +9697,25 @@ function gump:CriaCabecalho (baseframe, instancia) Details:OpenOptionsWindow (instancia) end 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.widget._instance = instancia - - baseframe.cabecalho.modo_selecao:SetScript ("OnEnter", modo_selecao_on_enter) - baseframe.cabecalho.modo_selecao:SetScript ("OnLeave", modo_selecao_on_leave) - + + baseframe.cabecalho.modo_selecao:SetScript("OnEnter", modo_selecao_on_enter) + baseframe.cabecalho.modo_selecao:SetScript("OnLeave", modo_selecao_on_leave) + local b = baseframe.cabecalho.modo_selecao.widget - b:SetNormalTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) + b:SetNormalTexture([[Interface\AddOns\Details\images\toolbar_icons]]) b:GetNormalTexture():SetTexCoord(0/256, 32/256, 0, 1) - b:SetHighlightTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) + b:SetHighlightTexture([[Interface\AddOns\Details\images\toolbar_icons]]) 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) - - - --> SELECIONAR O SEGMENTO ---------------------------------------------------------------------------------------------------------------------------------------------------- + b:SetPushedTexture([[Interface\AddOns\Details\images\toolbar_icons]]) + b:GetPushedTexture():SetTexCoord(0/256, 32/256, 0, 1) + + + --SELECIONAR O SEGMENTO ---------------------------------------------------------------------------------------------------------------------------------------------------- local segmento_button_click = function(self, button, param1) if (Details.instances_menu_click_to_open) then if (instancia.LastMenuOpened == "segments" and GameCooltipFrame1:IsShown()) then @@ -9733,27 +9729,27 @@ function gump:CriaCabecalho (baseframe, instancia) click_to_change_segment (instancia, button) end 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.widget._instance = instancia baseframe.cabecalho.segmento:SetPoint("left", baseframe.cabecalho.modo_selecao, "right", 0, 0) - - --> ativa bot�o do meio e direito + + --ativa bot�o do meio e direito baseframe.cabecalho.segmento:SetClickFunction (segmento_button_click, nil, nil, "rightclick") - baseframe.cabecalho.segmento:SetScript ("OnEnter", segmentButton_OnEnter) - baseframe.cabecalho.segmento:SetScript ("OnLeave", segmentButton_OnLeave) - + baseframe.cabecalho.segmento:SetScript("OnEnter", segmentButton_OnEnter) + baseframe.cabecalho.segmento:SetScript("OnLeave", segmentButton_OnLeave) + local b = baseframe.cabecalho.segmento.widget - b:SetNormalTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) + b:SetNormalTexture([[Interface\AddOns\Details\images\toolbar_icons]]) b:GetNormalTexture():SetTexCoord(32/256, 64/256, 0, 1) - b:SetHighlightTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) + b:SetHighlightTexture([[Interface\AddOns\Details\images\toolbar_icons]]) b:GetHighlightTexture():SetTexCoord(32/256, 64/256, 0, 1) - b:SetPushedTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) + b:SetPushedTexture([[Interface\AddOns\Details\images\toolbar_icons]]) b:GetPushedTexture():SetTexCoord(32/256, 64/256, 0, 1) - --> SELECIONAR O ATRIBUTO ---------------------------------------------------------------------------------------------------------------------------------------------------- + --SELECIONAR O ATRIBUTO ---------------------------------------------------------------------------------------------------------------------------------------------------- local atributo_button_click = function() if (Details.instances_menu_click_to_open) then if (instancia.LastMenuOpened == "attributes" and GameCooltipFrame1:IsShown()) then @@ -9765,24 +9761,24 @@ function gump:CriaCabecalho (baseframe, instancia) end end 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.widget._instance = instancia 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) - + 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:SetNormalTexture([[Interface\AddOns\Details\images\toolbar_icons]]) b:GetNormalTexture():SetTexCoord(66/256, 93/256, 0, 1) - b:SetHighlightTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) + b:SetHighlightTexture([[Interface\AddOns\Details\images\toolbar_icons]]) b:GetHighlightTexture():SetTexCoord(68/256, 93/256, 0, 1) - b:SetPushedTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) + b:SetPushedTexture([[Interface\AddOns\Details\images\toolbar_icons]]) b:GetPushedTexture():SetTexCoord(68/256, 93/256, 0, 1) - - --> REPORTAR ~report ---------------------------------------------------------------------------------------------------------------------------------------------------- + + --REPORTAR ~report ---------------------------------------------------------------------------------------------------------------------------------------------------- local report_func = function() instancia:Reportar ("INSTANCE" .. instancia.meu_id) GameCooltip2:Hide() @@ -9792,21 +9788,21 @@ function gump:CriaCabecalho (baseframe, instancia) baseframe.cabecalho.report.widget._instance = instancia 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) + 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:SetNormalTexture([[Interface\AddOns\Details\images\toolbar_icons]]) b:GetNormalTexture():SetTexCoord(96/256, 128/256, 0, 1) - b:SetHighlightTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) + b:SetHighlightTexture([[Interface\AddOns\Details\images\toolbar_icons]]) b:GetHighlightTexture():SetTexCoord(96/256, 128/256, 0, 1) - b:SetPushedTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) + b:SetPushedTexture([[Interface\AddOns\Details\images\toolbar_icons]]) b:GetPushedTexture():SetTexCoord(96/256, 128/256, 0, 1) - - - + + + -- ~delete ~erase ~reset ---> reset ---------------------------------------------------------------------------------------------------------------------------------------------------- +--reset ---------------------------------------------------------------------------------------------------------------------------------------------------- local reset_func = function() if (Details.instances_menu_click_to_open) then @@ -9819,30 +9815,30 @@ function gump:CriaCabecalho (baseframe, instancia) end else if (not Details.disable_reset_button) then - Details.tabela_historico:resetar() + Details.tabela_historico:resetar() else - Details:Msg (Loc["STRING_OPTIONS_DISABLED_RESET"]) + Details:Msg(Loc["STRING_OPTIONS_DISABLED_RESET"]) end end end - baseframe.cabecalho.reset = CreateFrame ("button", "DetailsClearSegmentsButton" .. instancia.meu_id, baseframe) + baseframe.cabecalho.reset = CreateFrame("button", "DetailsClearSegmentsButton" .. instancia.meu_id, baseframe) baseframe.cabecalho.reset:SetFrameLevel(baseframe.UPFrame:GetFrameLevel()+1) - baseframe.cabecalho.reset:SetSize (10, 16) + baseframe.cabecalho.reset:SetSize(10, 16) baseframe.cabecalho.reset:SetPoint("right", baseframe.cabecalho.novo, "left") baseframe.cabecalho.reset.instance = instancia baseframe.cabecalho.reset._instance = instancia - - baseframe.cabecalho.reset:SetScript ("OnClick", reset_func) - baseframe.cabecalho.reset:SetScript ("OnEnter", reset_button_onenter) - baseframe.cabecalho.reset:SetScript ("OnLeave", reset_button_onleave) - + + baseframe.cabecalho.reset:SetScript("OnClick", reset_func) + baseframe.cabecalho.reset:SetScript("OnEnter", reset_button_onenter) + baseframe.cabecalho.reset:SetScript("OnLeave", reset_button_onleave) + local b = baseframe.cabecalho.reset - b:SetNormalTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) + b:SetNormalTexture([[Interface\AddOns\Details\images\toolbar_icons]]) b:GetNormalTexture():SetTexCoord(128/256, 160/256, 0, 1) - b:SetHighlightTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) + b:SetHighlightTexture([[Interface\AddOns\Details\images\toolbar_icons]]) b:GetHighlightTexture():SetTexCoord(128/256, 160/256, 0, 1) - b:SetPushedTexture ([[Interface\AddOns\Details\images\toolbar_icons]]) + b:SetPushedTexture([[Interface\AddOns\Details\images\toolbar_icons]]) b:GetPushedTexture():SetTexCoord(128/256, 160/256, 0, 1) end diff --git a/frames/window_news.lua b/frames/window_news.lua index bd5519aa..5a15d285 100644 --- a/frames/window_news.lua +++ b/frames/window_news.lua @@ -35,7 +35,7 @@ function Details:OpenNewsWindow(textToShow, dumpValues, keeptext) newsFrame:Text((DetailsNewsWindowText:GetText() or "") .. "\n\n" .. returnString) else if (dumpValues) then - newsFrame.DumpTableFrame:SetText (returnString) + newsFrame.DumpTableFrame:SetText(returnString) else newsFrame:Text (returnString) end @@ -94,30 +94,30 @@ function Details:CreateOrOpenNewsWindow() 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) + 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},}) - frameUpper:SetBackdropColor (.1, .1, .1, .3) + frameUpper:SetBackdropColor(.1, .1, .1, .3) frameUpper:SetScrollChild (frameLower) - local slider = CreateFrame ("slider", "DetailsNewsWindowSlider", frame, "BackdropTemplate") - slider.bg = slider:CreateTexture (nil, "background") - slider.bg:SetAllPoints (true) - slider.bg:SetTexture (0, 0, 0, 0.5) + local slider = CreateFrame("slider", "DetailsNewsWindowSlider", frame, "BackdropTemplate") + slider.bg = slider:CreateTexture(nil, "background") + slider.bg:SetAllPoints(true) + slider.bg:SetTexture(0, 0, 0, 0.5) - slider.thumb = slider:CreateTexture (nil, "OVERLAY") - slider.thumb:SetTexture ("Interface\\Buttons\\UI-ScrollBar-Knob") - slider.thumb:SetSize (25, 25) + slider.thumb = slider:CreateTexture(nil, "OVERLAY") + slider.thumb:SetTexture("Interface\\Buttons\\UI-ScrollBar-Knob") + slider.thumb:SetSize(25, 25) slider:SetThumbTexture (slider.thumb) slider:SetOrientation ("vertical"); - slider:SetSize (16, 499) - slider:SetPoint ("topleft", frameUpper, "topright") + slider:SetSize(16, 499) + slider:SetPoint("topleft", frameUpper, "topright") slider:SetMinMaxValues (0, 2000) slider:SetValue(0) slider:SetScript("OnValueChanged", function(self) @@ -130,15 +130,15 @@ function Details:CreateOrOpenNewsWindow() if (IsShiftKeyDown() and (delta > 0)) then slider:SetValue(0) elseif (IsShiftKeyDown() and (delta < 0)) then - slider:SetValue (2000) + slider:SetValue(2000) elseif ((delta < 0) and (current < 2000)) then - slider:SetValue (current + 20) + slider:SetValue(current + 20) elseif ((delta > 0) and (current > 1)) then - slider:SetValue (current - 20) + slider:SetValue(current - 20) end end) - --> text box + --text box local texto = frameLower:CreateFontString("DetailsNewsWindowText", "overlay", "GameFontNormal") texto:SetPoint("topleft", frameLower, "topleft") texto:SetJustifyH("left") @@ -165,7 +165,7 @@ function Details:CreateOrOpenNewsWindow() DetailsFramework:ApplyStandardBackdrop(statusBar) statusBar:SetAlpha (0.8) DetailsFramework:BuildStatusbarAuthorInfo(statusBar, "", "") - statusBar.authorName:SetPoint ("left", statusBar, "left", 207, 0) + statusBar.authorName:SetPoint("left", statusBar, "left", 207, 0) function frame:Title (title) @@ -173,7 +173,7 @@ function Details:CreateOrOpenNewsWindow() end function frame:Text (text) - texto:SetText (text or "") + texto:SetText(text or "") end frame:Hide() diff --git a/frames/window_options2.lua b/frames/window_options2.lua index 8ac674b3..bb8c6500 100644 --- a/frames/window_options2.lua +++ b/frames/window_options2.lua @@ -174,8 +174,8 @@ function Details.options.InitializeOptionsWindow(instance) editingGroupCheckBox:SetPoint("left", editingGroupLabel, "right", 2, 0) formatFooterText(editingGroupLabel) - --> create test bars - DF:NewColor ("C_OptionsButtonOrange", 0.9999, 0.8196, 0, 1) + --create test bars + DF:NewColor("C_OptionsButtonOrange", 0.9999, 0.8196, 0, 1) local create_test_bars_func = function() _detalhes.CreateTestBars() if (not _detalhes.test_bar_update) then @@ -185,17 +185,17 @@ function Details.options.InitializeOptionsWindow(instance) end end local fillbars = DF:NewButton(footerFrame, _, "$parentCreateExampleBarsButton", nil, 140, 20, create_test_bars_func, nil, nil, nil, Loc ["STRING_OPTIONS_TESTBARS"], 1) - fillbars:SetPoint ("bottomleft", f.widget, "bottomleft", 10, 10) + fillbars:SetPoint("bottomleft", f.widget, "bottomleft", 10, 10) fillbars:SetTemplate(options_button_template) fillbars:SetIcon ("Interface\\AddOns\\Details\\images\\icons", nil, nil, nil, {323/512, 365/512, 42/512, 78/512}, {1, 1, 1, 0.6}, 4, 2) - --> change log + --change log local changelog = DF:NewButton(footerFrame, _, "$parentOpenChangeLogButton", nil, 140, 20, _detalhes.OpenNewsWindow, "change_log", nil, nil, Loc ["STRING_OPTIONS_CHANGELOG"], 1) - changelog:SetPoint ("left", fillbars, "right", 10, 0) + changelog:SetPoint("left", fillbars, "right", 10, 0) changelog:SetTemplate (options_button_template) changelog:SetIcon ("Interface\\AddOns\\Details\\images\\icons", nil, nil, nil, {367/512, 399/512, 43/512, 76/512}, {1, 1, 1, 0.8}, 4, 2) - --> search field + --search field local searchBox = DF:CreateTextEntry(footerFrame, function()end, 140, 20, _, _, _, options_dropdown_template) searchBox:SetPoint("left", changelog, "right", 10, 0) diff --git a/frames/window_options2_sections.lua b/frames/window_options2_sections.lua index 95315fc3..5cbb7208 100644 --- a/frames/window_options2_sections.lua +++ b/frames/window_options2_sections.lua @@ -146,7 +146,7 @@ end do local buildSection = function(sectionFrame) - --> abbreviation options + --abbreviation options local icon = [[Interface\COMMON\mini-hourglass]] local iconcolor = {1, 1, 1, .5} local iconsize = {14, 14} @@ -171,7 +171,7 @@ do return abbreviationOptions end - --> number system + --number system local onSelectNumeralSystem = function(_, _, systemNumber) _detalhes:SelectNumericalSystem(systemNumber) end @@ -194,7 +194,7 @@ do return numeralSystems end - --> time measure type + --time measure type local onSelectTimeType = function(_, _, timetype) _detalhes.time_type = timetype _detalhes.time_type_original = timetype @@ -210,7 +210,7 @@ do return timetypeOptions end - --> auto erase | erase data + --auto erase | erase data local onSelectEraseData = function(_, _, eraseType) _detalhes.segments_auto_erase = eraseType afterUpdate() @@ -225,7 +225,7 @@ do return eraseDataOptions end - --> deathlog limit + --deathlog limit local onSelectDeathLogLimit = function(_, _, limitAmount) _detalhes:SetDeathLogLimit(limitAmount) end @@ -742,7 +742,7 @@ do end end - --> skin selection + --skin selection local onSelectSkin = function(_, _, skinName) if (isGroupEditing()) then Details:InstanceGroupCall(currentInstance, "OptionPanelOnChangeSkin", skinName) @@ -762,7 +762,7 @@ do return skinOptions end - --> save skin + --save skin local saveAsSkin = function(skinName, dontSave) local fileName = skinName or "" @@ -777,7 +777,7 @@ do for key, value in pairs (currentInstance) do if (_detalhes.instance_defaults[key] ~= nil) then - if (type (value) == "table") then + if (type(value) == "table") then savedObject[key] = Details.CopyTable(value) else savedObject[key] = value @@ -792,7 +792,7 @@ do return savedObject end - --> load skin + --load skin local loadSkin = function(instance, skinObject) function Details:LoadSkinFromOptionsPanel(skinObject) --set skin preset @@ -804,7 +804,7 @@ do --overwrite all instance parameters with saved ones for key, value in pairs (skinObject) do if (key ~= "skin" and not _detalhes.instance_skin_ignored_values[key]) then - if (type (value) == "table") then + if (type(value) == "table") then instance[key] = Details.CopyTable (value) else instance[key] = value @@ -823,11 +823,11 @@ do end end - --> import skin string + --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) - if (type (skinString) ~= "string" or string.len(skinString) < 2) then + if (type(skinString) ~= "string" or string.len(skinString) < 2) then return end @@ -841,7 +841,7 @@ do Details.options.SetCurrentInstanceAndRefresh(currentInstance) afterUpdate() else - Details:Msg (Loc ["STRING_CUSTOM_IMPORT_ERROR"]) + Details:Msg(Loc ["STRING_CUSTOM_IMPORT_ERROR"]) end end, "Details! Import Skin (paste string)") --localize-me @@ -936,7 +936,7 @@ do end, values = function() local loadtable = {} - for index, _table in ipairs (_detalhes.savedStyles) do + for index, _table in ipairs(_detalhes.savedStyles) do tinsert (loadtable, {value = index, label = _table.name, onclick = function() loadSkin(currentInstance, _table) end, icon = "Interface\\GossipFrame\\TabardGossipIcon", iconcolor = {.7, .7, .5, 1}}) end @@ -953,7 +953,7 @@ do end, values = function() local loadtable = {} - for index, _table in ipairs (_detalhes.savedStyles) do + for index, _table in ipairs(_detalhes.savedStyles) do tinsert (loadtable, {value = index, label = _table.name, onclick = function(_, _, index) table.remove (_detalhes.savedStyles, index) Details.options.SetCurrentInstanceAndRefresh(currentInstance) @@ -975,13 +975,13 @@ do end, values = function() local loadtable = {} - for index, _table in ipairs (_detalhes.savedStyles) do + for index, _table in ipairs(_detalhes.savedStyles) do tinsert (loadtable, {value = index, label = _table.name, onclick = function(_, _, index) local compressedData = Details:CompressData(_detalhes.savedStyles[index], "print") if (compressedData) then _detalhes:ShowImportWindow(compressedData, nil, "Details! Export Skin") else - Details:Msg ("failed to export skin.") --localize-me + Details:Msg("failed to export skin.") --localize-me end Details.options.SetCurrentInstanceAndRefresh(currentInstance) afterUpdate() @@ -1803,7 +1803,7 @@ end -- ~04 bars texts do - --> text font selection + --text font selection local onSelectFont = function(_, instance, fontName) editInstanceSetting(currentInstance, "SetBarTextSettings", nil, fontName) afterUpdate() @@ -1819,7 +1819,7 @@ do return fontTable end - --> percent type + --percent type local onSelectPercent = function(_, instance, percentType) editInstanceSetting(currentInstance, "SetBarTextSettings", nil, nil, nil, nil, nil, nil, nil, nil, nil, percentType) afterUpdate() @@ -1833,7 +1833,7 @@ do return percentTable end - --> brackets + --brackets local onSelectBracket = function(_, instance, value) editInstanceSetting(currentInstance, "SetBarRightTextSettings", nil, nil, nil, value) afterUpdate() @@ -1850,7 +1850,7 @@ do return BracketTable end - --> separators + --separators local onSelectSeparator = function(_, instance, value) editInstanceSetting(currentInstance, "SetBarRightTextSettings", nil, nil, nil, nil, value) afterUpdate() @@ -2188,7 +2188,7 @@ do afterUpdate() end - --> menu text face + --menu text face local onSelectFont = function(_, _, fontName) _detalhes.font_faces.menus = fontName end @@ -2203,7 +2203,7 @@ do return fontTable end - --> attribute text font + --attribute text font local on_select_attribute_font = function(self, instance, fontName) editInstanceSetting(currentInstance, "AttributeMenu", nil, nil, nil, fontName) afterUpdate() @@ -2218,14 +2218,14 @@ do return fonts end - --> icon set menu + --icon set menu local on_select_icon_set = function(self, instance, texturePath) editInstanceSetting(currentInstance, "toolbar_icon_file", texturePath) editInstanceSetting(currentInstance, "ChangeSkin") afterUpdate() end - --> custom title bar texture + --custom title bar texture local onSelectCustomTitleBarTexture = function(_, instance, textureName) editInstanceSetting(currentInstance, "SetTitleBarSettings", nil, nil, textureName) editInstanceSetting(currentInstance, "RefreshTitleBar") @@ -2717,7 +2717,7 @@ end -- ~06 - body setings do - --> frame strata options + --frame strata options local strata = { ["BACKGROUND"] = "Background", ["LOW"] = "Low", @@ -2740,7 +2740,7 @@ do } local buildStrataMenu = function() return strataTable end - --> backdrop texture + --backdrop texture local onBackdropSelect = function(_, instance, backdropName) editInstanceSetting(currentInstance, "SetBackdropTexture", backdropName) afterUpdate() @@ -2757,7 +2757,7 @@ do return backdropTable end - --> instance selector selection + --instance selector selection local onSelectInstance = function() end local buildInstanceMenu = function() @@ -3103,7 +3103,7 @@ end do local buildSection = function(sectionFrame) - --> update micro displays + --update micro displays local updateMicroFrames = function() local instance = currentInstance @@ -3209,14 +3209,14 @@ do sectionOptions.always_boxfirst = true DF:BuildMenu(sectionFrame, sectionOptions, startX, startY-20, heightSize, false, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template) - do --> micro displays + do --micro displays --statics texts - DF:NewLabel (sectionFrame, _, "$parentMicroDisplaysAnchor", "MicroDisplaysAnchor", Loc ["STRING_OPTIONS_MICRODISPLAY_ANCHOR"], "GameFontNormal") - DF:NewLabel (sectionFrame, _, "$parentMicroDisplayLeftLabel", "MicroDisplayLeftLabel", Loc ["STRING_ANCHOR_LEFT"], "GameFontHighlightLeft") - DF:NewLabel (sectionFrame, _, "$parentMicroDisplayCenterLabel", "MicroDisplayCenterLabel", Loc ["STRING_CENTER_UPPER"], "GameFontHighlightLeft") - DF:NewLabel (sectionFrame, _, "$parentMicroDisplayRightLabel", "MicroDisplayRightLabel", Loc ["STRING_ANCHOR_RIGHT"], "GameFontHighlightLeft") - DF:NewLabel (sectionFrame, _, "$parentMicroDisplayWarningLabel", "MicroDisplayWarningLabel", Loc ["STRING_OPTIONS_MICRODISPLAYS_WARNING"], "GameFontHighlightSmall", 10, "orange") + DF:NewLabel(sectionFrame, _, "$parentMicroDisplaysAnchor", "MicroDisplaysAnchor", Loc ["STRING_OPTIONS_MICRODISPLAY_ANCHOR"], "GameFontNormal") + DF:NewLabel(sectionFrame, _, "$parentMicroDisplayLeftLabel", "MicroDisplayLeftLabel", Loc ["STRING_ANCHOR_LEFT"], "GameFontHighlightLeft") + DF:NewLabel(sectionFrame, _, "$parentMicroDisplayCenterLabel", "MicroDisplayCenterLabel", Loc ["STRING_CENTER_UPPER"], "GameFontHighlightLeft") + DF:NewLabel(sectionFrame, _, "$parentMicroDisplayRightLabel", "MicroDisplayRightLabel", Loc ["STRING_ANCHOR_RIGHT"], "GameFontHighlightLeft") + DF:NewLabel(sectionFrame, _, "$parentMicroDisplayWarningLabel", "MicroDisplayWarningLabel", Loc ["STRING_OPTIONS_MICRODISPLAYS_WARNING"], "GameFontHighlightSmall", 10, "orange") --dropdown on select option local onMicroDisplaySelect = function(_, _, micro_display) @@ -3236,21 +3236,21 @@ do --dropdown options local buildLeftMicroMenu = function() local options = {} - for index, _name_and_icon in ipairs (_detalhes.StatusBar.Menu) do + for index, _name_and_icon in ipairs(_detalhes.StatusBar.Menu) do options [#options+1] = {value = {"left", index}, label = _name_and_icon [1], onclick = onMicroDisplaySelect, icon = _name_and_icon [2]} end return options end local buildCenterMicroMenu = function() local options = {} - for index, _name_and_icon in ipairs (_detalhes.StatusBar.Menu) do + for index, _name_and_icon in ipairs(_detalhes.StatusBar.Menu) do options [#options+1] = {value = {"center", index}, label = _name_and_icon [1], onclick = onMicroDisplaySelect, icon = _name_and_icon [2]} end return options end local buildRightMicroMenu = function() local options = {} - for index, _name_and_icon in ipairs (_detalhes.StatusBar.Menu) do + for index, _name_and_icon in ipairs(_detalhes.StatusBar.Menu) do options [#options+1] = {value = {"right", index}, label = _name_and_icon [1], onclick = onMicroDisplaySelect, icon = _name_and_icon [2]} end return options @@ -3264,9 +3264,9 @@ do DF:NewDropDown (sectionFrame, _, "$parentMicroDisplayCenterDropdown", "MicroDisplayCenterDropdown", DROPDOWN_WIDTH, dropdown_height, buildCenterMicroMenu, nil, options_dropdown_template) DF:NewDropDown (sectionFrame, _, "$parentMicroDisplayRightDropdown", "MicroDisplayRightDropdown", DROPDOWN_WIDTH, dropdown_height, buildRightMicroMenu, nil, options_dropdown_template) - sectionFrame.MicroDisplayLeftDropdown:SetPoint ("left", sectionFrame.MicroDisplayLeftLabel, "right", 2) - sectionFrame.MicroDisplayCenterDropdown:SetPoint ("left", sectionFrame.MicroDisplayCenterLabel, "right", 2) - sectionFrame.MicroDisplayRightDropdown:SetPoint ("left", sectionFrame.MicroDisplayRightLabel, "right", 2) + sectionFrame.MicroDisplayLeftDropdown:SetPoint("left", sectionFrame.MicroDisplayLeftLabel, "right", 2) + sectionFrame.MicroDisplayCenterDropdown:SetPoint("left", sectionFrame.MicroDisplayCenterLabel, "right", 2) + sectionFrame.MicroDisplayRightDropdown:SetPoint("left", sectionFrame.MicroDisplayRightLabel, "right", 2) sectionFrame.MicroDisplayLeftDropdown.tooltip = Loc ["STRING_OPTIONS_MICRODISPLAYS_DROPDOWN_TOOLTIP"] sectionFrame.MicroDisplayCenterDropdown.tooltip = Loc ["STRING_OPTIONS_MICRODISPLAYS_DROPDOWN_TOOLTIP"] @@ -3286,15 +3286,15 @@ do end end) - hideLeftMicroFrameButton:SetPoint ("left", sectionFrame.MicroDisplayLeftDropdown, "right", 2, 0) - hideLeftMicroFrameButton:SetNormalTexture ([[Interface\Buttons\UI-GroupLoot-Pass-Down]]) - hideLeftMicroFrameButton:SetPushedTexture ([[Interface\Buttons\UI-GroupLoot-Pass-Up]]) + hideLeftMicroFrameButton:SetPoint("left", sectionFrame.MicroDisplayLeftDropdown, "right", 2, 0) + hideLeftMicroFrameButton:SetNormalTexture([[Interface\Buttons\UI-GroupLoot-Pass-Down]]) + 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) @@ -3311,15 +3311,15 @@ do self:GetNormalTexture():SetDesaturated (true) end end) - HideCenterMicroFrameButton:SetPoint ("left", sectionFrame.MicroDisplayCenterDropdown, "right", 2, 0) - HideCenterMicroFrameButton:SetNormalTexture ([[Interface\Buttons\UI-GroupLoot-Pass-Down]]) - HideCenterMicroFrameButton:SetPushedTexture ([[Interface\Buttons\UI-GroupLoot-Pass-Up]]) + HideCenterMicroFrameButton:SetPoint("left", sectionFrame.MicroDisplayCenterDropdown, "right", 2, 0) + HideCenterMicroFrameButton:SetNormalTexture([[Interface\Buttons\UI-GroupLoot-Pass-Down]]) + 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) @@ -3335,15 +3335,15 @@ do self:GetNormalTexture():SetDesaturated (true) end end) - HideRightMicroFrameButton:SetPoint ("left", sectionFrame.MicroDisplayRightDropdown, "right", 2, 0) - HideRightMicroFrameButton:SetNormalTexture ([[Interface\Buttons\UI-GroupLoot-Pass-Down]]) - HideRightMicroFrameButton:SetPushedTexture ([[Interface\Buttons\UI-GroupLoot-Pass-Up]]) + HideRightMicroFrameButton:SetPoint("left", sectionFrame.MicroDisplayRightDropdown, "right", 2, 0) + HideRightMicroFrameButton:SetNormalTexture([[Interface\Buttons\UI-GroupLoot-Pass-Down]]) + 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) @@ -3351,27 +3351,27 @@ do currentInstance.StatusBar ["right"]:Setup() currentInstance.StatusBar ["right"]:Setup() end) - configRightMicroFrameButton:SetPoint ("left", HideRightMicroFrameButton, "right", 1, -1) - configRightMicroFrameButton:SetNormalTexture ([[Interface\Buttons\UI-OptionsButton]]) - configRightMicroFrameButton:SetHighlightTexture ([[Interface\Buttons\UI-OptionsButton]]) + configRightMicroFrameButton:SetPoint("left", HideRightMicroFrameButton, "right", 1, -1) + configRightMicroFrameButton:SetNormalTexture([[Interface\Buttons\UI-OptionsButton]]) + 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) currentInstance.StatusBar ["center"]:Setup() currentInstance.StatusBar ["center"]:Setup() end) - configCenterMicroFrameButton:SetPoint ("left", HideCenterMicroFrameButton, "right", 1, -1) - configCenterMicroFrameButton:SetNormalTexture ([[Interface\Buttons\UI-OptionsButton]]) - configCenterMicroFrameButton:SetHighlightTexture ([[Interface\Buttons\UI-OptionsButton]]) + configCenterMicroFrameButton:SetPoint("left", HideCenterMicroFrameButton, "right", 1, -1) + configCenterMicroFrameButton:SetNormalTexture([[Interface\Buttons\UI-OptionsButton]]) + 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) currentInstance.StatusBar ["left"]:Setup() currentInstance.StatusBar ["left"]:Setup() end) - configLeftMicroFrameButton:SetPoint ("left", hideLeftMicroFrameButton, "right", 1, -1) - configLeftMicroFrameButton:SetNormalTexture ([[Interface\Buttons\UI-OptionsButton]]) - configLeftMicroFrameButton:SetHighlightTexture ([[Interface\Buttons\UI-OptionsButton]]) + configLeftMicroFrameButton:SetPoint("left", hideLeftMicroFrameButton, "right", 1, -1) + configLeftMicroFrameButton:SetNormalTexture([[Interface\Buttons\UI-OptionsButton]]) + configLeftMicroFrameButton:SetHighlightTexture([[Interface\Buttons\UI-OptionsButton]]) configLeftMicroFrameButton.tooltip = Loc ["STRING_OPTIONS_MICRODISPLAYS_OPTION_TOOLTIP"] local x = startX @@ -3411,14 +3411,14 @@ do local on_enter = function(self) - self:SetBackdropColor (.5, .5, .5, .8) + self:SetBackdropColor(.5, .5, .5, .8) if (self ["toolbarPluginsIcon" .. self.id]) then - self ["toolbarPluginsIcon" .. self.id]:SetBlendMode ("ADD") + self ["toolbarPluginsIcon" .. self.id]:SetBlendMode("ADD") elseif (self ["raidPluginsIcon" .. self.id]) then - self ["raidPluginsIcon" .. self.id]:SetBlendMode ("ADD") + self ["raidPluginsIcon" .. self.id]:SetBlendMode("ADD") elseif (self ["soloPluginsIcon" .. self.id]) then - self ["soloPluginsIcon" .. self.id]:SetBlendMode ("ADD") + self ["soloPluginsIcon" .. self.id]:SetBlendMode("ADD") end if (self.plugin) then @@ -3442,14 +3442,14 @@ do end local on_leave = function(self) - self:SetBackdropColor (.3, .3, .3, .3) + self:SetBackdropColor(.3, .3, .3, .3) if (self ["toolbarPluginsIcon" .. self.id]) then - self ["toolbarPluginsIcon" .. self.id]:SetBlendMode ("BLEND") + self ["toolbarPluginsIcon" .. self.id]:SetBlendMode("BLEND") elseif (self ["raidPluginsIcon" .. self.id]) then - self ["raidPluginsIcon" .. self.id]:SetBlendMode ("BLEND") + self ["raidPluginsIcon" .. self.id]:SetBlendMode("BLEND") elseif (self ["soloPluginsIcon" .. self.id]) then - self ["soloPluginsIcon" .. self.id]:SetBlendMode ("BLEND") + self ["soloPluginsIcon" .. self.id]:SetBlendMode("BLEND") end GameCooltip:Hide() @@ -3457,32 +3457,32 @@ do local y = -20 - --> toolbar - DF:NewLabel (anchorFrame, _, "$parentToolbarPluginsLabel", "toolbarLabel", Loc ["STRING_OPTIONS_PLUGINS_TOOLBAR_ANCHOR"], "GameFontNormal", 16) - anchorFrame.toolbarLabel:SetPoint ("topleft", anchorFrame, "topleft", 10, y) + --toolbar + DF:NewLabel(anchorFrame, _, "$parentToolbarPluginsLabel", "toolbarLabel", Loc ["STRING_OPTIONS_PLUGINS_TOOLBAR_ANCHOR"], "GameFontNormal", 16) + anchorFrame.toolbarLabel:SetPoint("topleft", anchorFrame, "topleft", 10, y) y = y - 30 do - local descbar = anchorFrame:CreateTexture (nil, "artwork") - descbar:SetTexture (.3, .3, .3, .8) - descbar:SetPoint ("topleft", anchorFrame, "topleft", 5, y+3) - descbar:SetSize (650, 20) - DF:NewLabel (anchorFrame, _, "$parentDescNameLabel", "descNameLabel", Loc ["STRING_OPTIONS_PLUGINS_NAME"], "GameFontNormal", 12) - anchorFrame.descNameLabel:SetPoint ("topleft", anchorFrame, "topleft", 15, y) - DF:NewLabel (anchorFrame, _, "$parentDescAuthorLabel", "descAuthorLabel", Loc ["STRING_OPTIONS_PLUGINS_AUTHOR"], "GameFontNormal", 12) - anchorFrame.descAuthorLabel:SetPoint ("topleft", anchorFrame, "topleft", 180, y) - DF:NewLabel (anchorFrame, _, "$parentDescVersionLabel", "descVersionLabel", Loc ["STRING_OPTIONS_PLUGINS_VERSION"], "GameFontNormal", 12) - anchorFrame.descVersionLabel:SetPoint ("topleft", anchorFrame, "topleft", 290, y) - DF:NewLabel (anchorFrame, _, "$parentDescEnabledLabel", "descEnabledLabel", Loc ["STRING_ENABLED"], "GameFontNormal", 12) - anchorFrame.descEnabledLabel:SetPoint ("topleft", anchorFrame, "topleft", 400, y) - DF:NewLabel (anchorFrame, _, "$parentDescOptionsLabel", "descOptionsLabel", Loc ["STRING_OPTIONS_PLUGINS_OPTIONS"], "GameFontNormal", 12) - anchorFrame.descOptionsLabel:SetPoint ("topleft", anchorFrame, "topleft", 510, y) + local descbar = anchorFrame:CreateTexture(nil, "artwork") + descbar:SetTexture(.3, .3, .3, .8) + descbar:SetPoint("topleft", anchorFrame, "topleft", 5, y+3) + descbar:SetSize(650, 20) + DF:NewLabel(anchorFrame, _, "$parentDescNameLabel", "descNameLabel", Loc ["STRING_OPTIONS_PLUGINS_NAME"], "GameFontNormal", 12) + anchorFrame.descNameLabel:SetPoint("topleft", anchorFrame, "topleft", 15, y) + DF:NewLabel(anchorFrame, _, "$parentDescAuthorLabel", "descAuthorLabel", Loc ["STRING_OPTIONS_PLUGINS_AUTHOR"], "GameFontNormal", 12) + anchorFrame.descAuthorLabel:SetPoint("topleft", anchorFrame, "topleft", 180, y) + DF:NewLabel(anchorFrame, _, "$parentDescVersionLabel", "descVersionLabel", Loc ["STRING_OPTIONS_PLUGINS_VERSION"], "GameFontNormal", 12) + anchorFrame.descVersionLabel:SetPoint("topleft", anchorFrame, "topleft", 290, y) + DF:NewLabel(anchorFrame, _, "$parentDescEnabledLabel", "descEnabledLabel", Loc ["STRING_ENABLED"], "GameFontNormal", 12) + anchorFrame.descEnabledLabel:SetPoint("topleft", anchorFrame, "topleft", 400, y) + DF:NewLabel(anchorFrame, _, "$parentDescOptionsLabel", "descOptionsLabel", Loc ["STRING_OPTIONS_PLUGINS_OPTIONS"], "GameFontNormal", 12) + anchorFrame.descOptionsLabel:SetPoint("topleft", anchorFrame, "topleft", 510, y) end y = y - 30 - --> toolbar plugins loop + --toolbar plugins loop local i = 1 local allplugins_toolbar = _detalhes.ToolBar.NameTable --where is store all plugins for the title bar @@ -3511,47 +3511,47 @@ do for absName, pluginObject in pairs (allplugins_toolbar) do local bframe = CreateFrame("frame", "OptionsPluginToolbarBG", anchorFrame, "BackdropTemplate") - bframe:SetSize (640, 20) - bframe:SetPoint ("topleft", anchorFrame, "topleft", 10, y) - bframe:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, insets = {left = 1, right = 1, top = 0, bottom = 1}}) - bframe:SetBackdropColor (.3, .3, .3, .3) - bframe:SetScript ("OnEnter", on_enter) - bframe:SetScript ("OnLeave", on_leave) + bframe:SetSize(640, 20) + bframe:SetPoint("topleft", anchorFrame, "topleft", 10, y) + bframe:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, insets = {left = 1, right = 1, top = 0, bottom = 1}}) + bframe:SetBackdropColor(.3, .3, .3, .3) + bframe:SetScript("OnEnter", on_enter) + bframe:SetScript("OnLeave", on_leave) bframe.plugin = pluginObject bframe.id = i DF:NewImage (bframe, pluginObject.__icon, 18, 18, nil, nil, "toolbarPluginsIcon"..i, "$parentToolbarPluginsIcon"..i) - bframe ["toolbarPluginsIcon"..i]:SetPoint ("topleft", anchorFrame, "topleft", 10, y) + bframe ["toolbarPluginsIcon"..i]:SetPoint("topleft", anchorFrame, "topleft", 10, y) - DF:NewLabel (bframe, _, "$parentToolbarPluginsLabel"..i, "toolbarPluginsLabel"..i, pluginObject.__name) - bframe ["toolbarPluginsLabel"..i]:SetPoint ("left", bframe ["toolbarPluginsIcon"..i], "right", 2, 0) + DF:NewLabel(bframe, _, "$parentToolbarPluginsLabel"..i, "toolbarPluginsLabel"..i, pluginObject.__name) + bframe ["toolbarPluginsLabel"..i]:SetPoint("left", bframe ["toolbarPluginsIcon"..i], "right", 2, 0) - DF:NewLabel (bframe, _, "$parentToolbarPluginsLabel2"..i, "toolbarPluginsLabel2"..i, pluginObject.__author) - bframe ["toolbarPluginsLabel2"..i]:SetPoint ("topleft", anchorFrame, "topleft", 180, y-4) + DF:NewLabel(bframe, _, "$parentToolbarPluginsLabel2"..i, "toolbarPluginsLabel2"..i, pluginObject.__author) + bframe ["toolbarPluginsLabel2"..i]:SetPoint("topleft", anchorFrame, "topleft", 180, y-4) - DF:NewLabel (bframe, _, "$parentToolbarPluginsLabel3"..i, "toolbarPluginsLabel3"..i, pluginObject.__version) - bframe ["toolbarPluginsLabel3"..i]:SetPoint ("topleft", anchorFrame, "topleft", 290, y-4) + DF:NewLabel(bframe, _, "$parentToolbarPluginsLabel3"..i, "toolbarPluginsLabel3"..i, pluginObject.__version) + bframe ["toolbarPluginsLabel3"..i]:SetPoint("topleft", anchorFrame, "topleft", 290, y-4) local plugin_stable = _detalhes:GetPluginSavedTable (absName) local plugin = _detalhes:GetPlugin (absName) DF:NewSwitch (bframe, _, "$parentToolbarSlider"..i, "toolbarPluginsSlider"..i, 60, 20, _, _, plugin_stable.enabled, nil, nil, nil, nil, options_switch_template) bframe ["toolbarPluginsSlider"..i].PluginName = absName tinsert (anchorFrame.plugin_widgets, bframe ["toolbarPluginsSlider"..i]) - bframe ["toolbarPluginsSlider"..i]:SetPoint ("topleft", anchorFrame, "topleft", 415, y) + bframe ["toolbarPluginsSlider"..i]:SetPoint("topleft", anchorFrame, "topleft", 415, y) bframe ["toolbarPluginsSlider"..i]:SetAsCheckBox() bframe ["toolbarPluginsSlider"..i].OnSwitch = function(self, _, value) plugin_stable.enabled = value plugin.__enabled = value if (value) then - _detalhes:SendEvent ("PLUGIN_ENABLED", plugin) + _detalhes:SendEvent("PLUGIN_ENABLED", plugin) else - _detalhes:SendEvent ("PLUGIN_DISABLED", plugin) + _detalhes:SendEvent("PLUGIN_DISABLED", plugin) end end if (pluginObject.OpenOptionsPanel) then DF:NewButton (bframe, nil, "$parentOptionsButton"..i, "OptionsButton"..i, 120, 20, pluginObject.OpenOptionsPanel, nil, nil, nil, Loc ["STRING_OPTIONS_PLUGINS_OPTIONS"], nil, options_button_template) - bframe ["OptionsButton"..i]:SetPoint ("topleft", anchorFrame, "topleft", 510, y-0) + bframe ["OptionsButton"..i]:SetPoint("topleft", anchorFrame, "topleft", 510, y-0) bframe ["OptionsButton"..i]:SetTextColor (button_color_rgb) bframe ["OptionsButton"..i]:SetIcon ([[Interface\Buttons\UI-OptionsButton]], 14, 14, nil, {0, 1, 0, 1}, nil, 3) end @@ -3579,35 +3579,35 @@ do OpenOptionsPanel = false, } - local bframe = CreateFrame ("frame", "OptionsPluginToolbarBG", anchorFrame,"BackdropTemplate") - bframe:SetSize (640, 20) - bframe:SetPoint ("topleft", anchorFrame, "topleft", 10, y) - bframe:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, insets = {left = 1, right = 1, top = 0, bottom = 1}}) - bframe:SetBackdropColor (.3, .3, .3, .3) - bframe:SetScript ("OnEnter", on_enter) - bframe:SetScript ("OnLeave", on_leave) + local bframe = CreateFrame("frame", "OptionsPluginToolbarBG", anchorFrame,"BackdropTemplate") + bframe:SetSize(640, 20) + bframe:SetPoint("topleft", anchorFrame, "topleft", 10, y) + bframe:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, insets = {left = 1, right = 1, top = 0, bottom = 1}}) + bframe:SetBackdropColor(.3, .3, .3, .3) + bframe:SetScript("OnEnter", on_enter) + bframe:SetScript("OnLeave", on_leave) bframe.id = i bframe.hasDesc = allExistentToolbarPlugins [o] [4] DF:NewImage (bframe, pluginObject.__icon, 18, 18, nil, nil, "toolbarPluginsIcon"..i, "$parentToolbarPluginsIcon"..i) - bframe ["toolbarPluginsIcon"..i]:SetPoint ("topleft", anchorFrame, "topleft", 10, y) + bframe ["toolbarPluginsIcon"..i]:SetPoint("topleft", anchorFrame, "topleft", 10, y) - DF:NewLabel (bframe, _, "$parentToolbarPluginsLabel"..i, "toolbarPluginsLabel"..i, pluginObject.__name) - bframe ["toolbarPluginsLabel"..i]:SetPoint ("left", bframe ["toolbarPluginsIcon"..i], "right", 2, 0) + DF:NewLabel(bframe, _, "$parentToolbarPluginsLabel"..i, "toolbarPluginsLabel"..i, pluginObject.__name) + bframe ["toolbarPluginsLabel"..i]:SetPoint("left", bframe ["toolbarPluginsIcon"..i], "right", 2, 0) bframe ["toolbarPluginsLabel"..i].color = notInstalledColor - DF:NewLabel (bframe, _, "$parentToolbarPluginsLabel2"..i, "toolbarPluginsLabel2"..i, pluginObject.__author) - bframe ["toolbarPluginsLabel2"..i]:SetPoint ("topleft", anchorFrame, "topleft", 180, y-4) + DF:NewLabel(bframe, _, "$parentToolbarPluginsLabel2"..i, "toolbarPluginsLabel2"..i, pluginObject.__author) + bframe ["toolbarPluginsLabel2"..i]:SetPoint("topleft", anchorFrame, "topleft", 180, y-4) bframe ["toolbarPluginsLabel2"..i].color = notInstalledColor - DF:NewLabel (bframe, _, "$parentToolbarPluginsLabel3"..i, "toolbarPluginsLabel3"..i, pluginObject.__version) - bframe ["toolbarPluginsLabel3"..i]:SetPoint ("topleft", anchorFrame, "topleft", 290, y-4) + DF:NewLabel(bframe, _, "$parentToolbarPluginsLabel3"..i, "toolbarPluginsLabel3"..i, pluginObject.__version) + bframe ["toolbarPluginsLabel3"..i]:SetPoint("topleft", anchorFrame, "topleft", 290, y-4) bframe ["toolbarPluginsLabel3"..i].color = notInstalledColor local installButton = DF:CreateButton (bframe, function() Details:CopyPaste (allExistentToolbarPlugins [o] [5]) end, 120, 20, "Install") installButton:SetTemplate (options_button_template) - installButton:SetPoint ("topleft", anchorFrame, "topleft", 510, y-0) + installButton:SetPoint("topleft", anchorFrame, "topleft", 510, y-0) i = i + 1 y = y - 20 @@ -3617,26 +3617,26 @@ do y = y - 10 --raid - DF:NewLabel (anchorFrame, _, "$parentRaidPluginsLabel", "raidLabel", Loc ["STRING_OPTIONS_PLUGINS_RAID_ANCHOR"], "GameFontNormal", 16) - anchorFrame.raidLabel:SetPoint ("topleft", anchorFrame, "topleft", 10, y) + DF:NewLabel(anchorFrame, _, "$parentRaidPluginsLabel", "raidLabel", Loc ["STRING_OPTIONS_PLUGINS_RAID_ANCHOR"], "GameFontNormal", 16) + anchorFrame.raidLabel:SetPoint("topleft", anchorFrame, "topleft", 10, y) y = y - 30 do - local descbar = anchorFrame:CreateTexture (nil, "artwork") - descbar:SetTexture (.3, .3, .3, .8) - descbar:SetPoint ("topleft", anchorFrame, "topleft", 5, y+3) - descbar:SetSize (650, 20) - DF:NewLabel (anchorFrame, _, "$parentDescNameLabel2", "descNameLabel", Loc ["STRING_OPTIONS_PLUGINS_NAME"], "GameFontNormal", 12) - anchorFrame.descNameLabel:SetPoint ("topleft", anchorFrame, "topleft", 15, y) - DF:NewLabel (anchorFrame, _, "$parentDescAuthorLabel2", "descAuthorLabel", Loc ["STRING_OPTIONS_PLUGINS_AUTHOR"], "GameFontNormal", 12) - anchorFrame.descAuthorLabel:SetPoint ("topleft", anchorFrame, "topleft", 180, y) - DF:NewLabel (anchorFrame, _, "$parentDescVersionLabel2", "descVersionLabel", Loc ["STRING_OPTIONS_PLUGINS_VERSION"], "GameFontNormal", 12) - anchorFrame.descVersionLabel:SetPoint ("topleft", anchorFrame, "topleft", 290, y) - DF:NewLabel (anchorFrame, _, "$parentDescEnabledLabel2", "descEnabledLabel", Loc ["STRING_ENABLED"], "GameFontNormal", 12) - anchorFrame.descEnabledLabel:SetPoint ("topleft", anchorFrame, "topleft", 400, y) - DF:NewLabel (anchorFrame, _, "$parentDescOptionsLabel2", "descOptionsLabel", Loc ["STRING_OPTIONS_PLUGINS_OPTIONS"], "GameFontNormal", 12) - anchorFrame.descOptionsLabel:SetPoint ("topleft", anchorFrame, "topleft", 510, y) + local descbar = anchorFrame:CreateTexture(nil, "artwork") + descbar:SetTexture(.3, .3, .3, .8) + descbar:SetPoint("topleft", anchorFrame, "topleft", 5, y+3) + descbar:SetSize(650, 20) + DF:NewLabel(anchorFrame, _, "$parentDescNameLabel2", "descNameLabel", Loc ["STRING_OPTIONS_PLUGINS_NAME"], "GameFontNormal", 12) + anchorFrame.descNameLabel:SetPoint("topleft", anchorFrame, "topleft", 15, y) + DF:NewLabel(anchorFrame, _, "$parentDescAuthorLabel2", "descAuthorLabel", Loc ["STRING_OPTIONS_PLUGINS_AUTHOR"], "GameFontNormal", 12) + anchorFrame.descAuthorLabel:SetPoint("topleft", anchorFrame, "topleft", 180, y) + DF:NewLabel(anchorFrame, _, "$parentDescVersionLabel2", "descVersionLabel", Loc ["STRING_OPTIONS_PLUGINS_VERSION"], "GameFontNormal", 12) + anchorFrame.descVersionLabel:SetPoint("topleft", anchorFrame, "topleft", 290, y) + DF:NewLabel(anchorFrame, _, "$parentDescEnabledLabel2", "descEnabledLabel", Loc ["STRING_ENABLED"], "GameFontNormal", 12) + anchorFrame.descEnabledLabel:SetPoint("topleft", anchorFrame, "topleft", 400, y) + DF:NewLabel(anchorFrame, _, "$parentDescOptionsLabel2", "descOptionsLabel", Loc ["STRING_OPTIONS_PLUGINS_OPTIONS"], "GameFontNormal", 12) + anchorFrame.descOptionsLabel:SetPoint("topleft", anchorFrame, "topleft", 510, y) end y = y - 30 @@ -3645,40 +3645,40 @@ do local allplugins_raid = _detalhes.RaidTables.NameTable for absName, pluginObject in pairs (allplugins_raid) do - local bframe = CreateFrame ("frame", "OptionsPluginRaidBG", anchorFrame, "BackdropTemplate") - bframe:SetSize (640, 20) - bframe:SetPoint ("topleft", anchorFrame, "topleft", 10, y) - bframe:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, insets = {left = 1, right = 1, top = 0, bottom = 1}}) - bframe:SetBackdropColor (.3, .3, .3, .3) - bframe:SetScript ("OnEnter", on_enter) - bframe:SetScript ("OnLeave", on_leave) + local bframe = CreateFrame("frame", "OptionsPluginRaidBG", anchorFrame, "BackdropTemplate") + bframe:SetSize(640, 20) + bframe:SetPoint("topleft", anchorFrame, "topleft", 10, y) + bframe:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, insets = {left = 1, right = 1, top = 0, bottom = 1}}) + bframe:SetBackdropColor(.3, .3, .3, .3) + bframe:SetScript("OnEnter", on_enter) + bframe:SetScript("OnLeave", on_leave) bframe.plugin = pluginObject bframe.id = i DF:NewImage (bframe, pluginObject.__icon, 18, 18, nil, nil, "raidPluginsIcon"..i, "$parentRaidPluginsIcon"..i) - bframe ["raidPluginsIcon"..i]:SetPoint ("topleft", anchorFrame, "topleft", 10, y) + bframe ["raidPluginsIcon"..i]:SetPoint("topleft", anchorFrame, "topleft", 10, y) - DF:NewLabel (bframe, _, "$parentRaidPluginsLabel"..i, "raidPluginsLabel"..i, pluginObject.__name) - bframe ["raidPluginsLabel"..i]:SetPoint ("left", bframe ["raidPluginsIcon"..i], "right", 2, 0) + DF:NewLabel(bframe, _, "$parentRaidPluginsLabel"..i, "raidPluginsLabel"..i, pluginObject.__name) + bframe ["raidPluginsLabel"..i]:SetPoint("left", bframe ["raidPluginsIcon"..i], "right", 2, 0) - DF:NewLabel (bframe, _, "$parentRaidPluginsLabel2"..i, "raidPluginsLabel2"..i, pluginObject.__author) - bframe ["raidPluginsLabel2"..i]:SetPoint ("topleft", anchorFrame, "topleft", 180, y-4) + DF:NewLabel(bframe, _, "$parentRaidPluginsLabel2"..i, "raidPluginsLabel2"..i, pluginObject.__author) + bframe ["raidPluginsLabel2"..i]:SetPoint("topleft", anchorFrame, "topleft", 180, y-4) - DF:NewLabel (bframe, _, "$parentRaidPluginsLabel3"..i, "raidPluginsLabel3"..i, pluginObject.__version) - bframe ["raidPluginsLabel3"..i]:SetPoint ("topleft", anchorFrame, "topleft", 290, y-4) + DF:NewLabel(bframe, _, "$parentRaidPluginsLabel3"..i, "raidPluginsLabel3"..i, pluginObject.__version) + bframe ["raidPluginsLabel3"..i]:SetPoint("topleft", anchorFrame, "topleft", 290, y-4) local plugin_stable = _detalhes:GetPluginSavedTable (absName) local plugin = _detalhes:GetPlugin (absName) DF:NewSwitch (bframe, _, "$parentRaidSlider"..i, "raidPluginsSlider"..i, 60, 20, _, _, plugin_stable.enabled, nil, nil, nil, nil, options_switch_template) tinsert (anchorFrame.plugin_widgets, bframe ["raidPluginsSlider"..i]) bframe ["raidPluginsSlider"..i].PluginName = absName - bframe ["raidPluginsSlider"..i]:SetPoint ("topleft", anchorFrame, "topleft", 415, y+1) + bframe ["raidPluginsSlider"..i]:SetPoint("topleft", anchorFrame, "topleft", 415, y+1) bframe ["raidPluginsSlider"..i]:SetAsCheckBox() bframe ["raidPluginsSlider"..i].OnSwitch = function(self, _, value) plugin_stable.enabled = value plugin.__enabled = value if (not value) then - for index, instancia in ipairs (_detalhes.tabela_instancias) do + for index, instancia in ipairs(_detalhes.tabela_instancias) do if (instancia.modo == 4) then -- 4 = raid if (instancia:IsEnabled()) then _detalhes:TrocaTabela (instancia, 0, 1, 1, nil, 2) @@ -3692,7 +3692,7 @@ do if (pluginObject.OpenOptionsPanel) then DF:NewButton (bframe, nil, "$parentOptionsButton"..i, "OptionsButton"..i, 86, 18, pluginObject.OpenOptionsPanel, nil, nil, nil, Loc ["STRING_OPTIONS_PLUGINS_OPTIONS"], nil, options_button_template) - bframe ["OptionsButton"..i]:SetPoint ("topleft", anchorFrame, "topleft", 510, y-0) + bframe ["OptionsButton"..i]:SetPoint("topleft", anchorFrame, "topleft", 510, y-0) bframe ["OptionsButton"..i]:SetTextColor (button_color_rgb) bframe ["OptionsButton"..i]:SetIcon ([[Interface\Buttons\UI-OptionsButton]], 14, 14, nil, {0, 1, 0, 1}, nil, 3) end @@ -3717,35 +3717,35 @@ do OpenOptionsPanel = false, } - local bframe = CreateFrame ("frame", "OptionsPluginToolbarBG", anchorFrame,"BackdropTemplate") - bframe:SetSize (640, 20) - bframe:SetPoint ("topleft", anchorFrame, "topleft", 10, y) - bframe:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, insets = {left = 1, right = 1, top = 0, bottom = 1}}) - bframe:SetBackdropColor (.3, .3, .3, .3) - bframe:SetScript ("OnEnter", on_enter) - bframe:SetScript ("OnLeave", on_leave) + local bframe = CreateFrame("frame", "OptionsPluginToolbarBG", anchorFrame,"BackdropTemplate") + bframe:SetSize(640, 20) + bframe:SetPoint("topleft", anchorFrame, "topleft", 10, y) + bframe:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, insets = {left = 1, right = 1, top = 0, bottom = 1}}) + bframe:SetBackdropColor(.3, .3, .3, .3) + bframe:SetScript("OnEnter", on_enter) + bframe:SetScript("OnLeave", on_leave) bframe.id = i bframe.hasDesc = allExistentRaidPlugins [o] [4] DF:NewImage (bframe, pluginObject.__icon, 18, 18, nil, nil, "toolbarPluginsIcon"..i, "$parentToolbarPluginsIcon"..i) - bframe ["toolbarPluginsIcon"..i]:SetPoint ("topleft", anchorFrame, "topleft", 10, y) + bframe ["toolbarPluginsIcon"..i]:SetPoint("topleft", anchorFrame, "topleft", 10, y) - DF:NewLabel (bframe, _, "$parentToolbarPluginsLabel"..i, "toolbarPluginsLabel"..i, pluginObject.__name) - bframe ["toolbarPluginsLabel"..i]:SetPoint ("left", bframe ["toolbarPluginsIcon"..i], "right", 2, 0) + DF:NewLabel(bframe, _, "$parentToolbarPluginsLabel"..i, "toolbarPluginsLabel"..i, pluginObject.__name) + bframe ["toolbarPluginsLabel"..i]:SetPoint("left", bframe ["toolbarPluginsIcon"..i], "right", 2, 0) bframe ["toolbarPluginsLabel"..i].color = notInstalledColor - DF:NewLabel (bframe, _, "$parentToolbarPluginsLabel2"..i, "toolbarPluginsLabel2"..i, pluginObject.__author) - bframe ["toolbarPluginsLabel2"..i]:SetPoint ("topleft", anchorFrame, "topleft", 180, y-4) + DF:NewLabel(bframe, _, "$parentToolbarPluginsLabel2"..i, "toolbarPluginsLabel2"..i, pluginObject.__author) + bframe ["toolbarPluginsLabel2"..i]:SetPoint("topleft", anchorFrame, "topleft", 180, y-4) bframe ["toolbarPluginsLabel2"..i].color = notInstalledColor - DF:NewLabel (bframe, _, "$parentToolbarPluginsLabel3"..i, "toolbarPluginsLabel3"..i, pluginObject.__version) - bframe ["toolbarPluginsLabel3"..i]:SetPoint ("topleft", anchorFrame, "topleft", 290, y-4) + DF:NewLabel(bframe, _, "$parentToolbarPluginsLabel3"..i, "toolbarPluginsLabel3"..i, pluginObject.__version) + bframe ["toolbarPluginsLabel3"..i]:SetPoint("topleft", anchorFrame, "topleft", 290, y-4) bframe ["toolbarPluginsLabel3"..i].color = notInstalledColor local installButton = DF:CreateButton (bframe, function() Details:CopyPaste (allExistentRaidPlugins [o] [5]) end, 120, 20, "Install") installButton:SetTemplate (options_button_template) - installButton:SetPoint ("topleft", anchorFrame, "topleft", 510, y-0) + installButton:SetPoint("topleft", anchorFrame, "topleft", 510, y-0) i = i + 1 y = y - 20 @@ -3755,26 +3755,26 @@ do y = y - 10 -- solo - DF:NewLabel (anchorFrame, _, "$parentSoloPluginsLabel", "soloLabel", Loc ["STRING_OPTIONS_PLUGINS_SOLO_ANCHOR"], "GameFontNormal", 16) - anchorFrame.soloLabel:SetPoint ("topleft", anchorFrame, "topleft", 10, y) + DF:NewLabel(anchorFrame, _, "$parentSoloPluginsLabel", "soloLabel", Loc ["STRING_OPTIONS_PLUGINS_SOLO_ANCHOR"], "GameFontNormal", 16) + anchorFrame.soloLabel:SetPoint("topleft", anchorFrame, "topleft", 10, y) y = y - 30 do - local descbar = anchorFrame:CreateTexture (nil, "artwork") - descbar:SetTexture (.3, .3, .3, .8) - descbar:SetPoint ("topleft", anchorFrame, "topleft", 5, y+3) - descbar:SetSize (650, 20) - DF:NewLabel (anchorFrame, _, "$parentDescNameLabel3", "descNameLabel", Loc ["STRING_OPTIONS_PLUGINS_NAME"], "GameFontNormal", 12) - anchorFrame.descNameLabel:SetPoint ("topleft", anchorFrame, "topleft", 15, y) - DF:NewLabel (anchorFrame, _, "$parentDescAuthorLabel3", "descAuthorLabel", Loc ["STRING_OPTIONS_PLUGINS_AUTHOR"], "GameFontNormal", 12) - anchorFrame.descAuthorLabel:SetPoint ("topleft", anchorFrame, "topleft", 180, y) - DF:NewLabel (anchorFrame, _, "$parentDescVersionLabel3", "descVersionLabel", Loc ["STRING_OPTIONS_PLUGINS_VERSION"], "GameFontNormal", 12) - anchorFrame.descVersionLabel:SetPoint ("topleft", anchorFrame, "topleft", 290, y) - DF:NewLabel (anchorFrame, _, "$parentDescEnabledLabel3", "descEnabledLabel", Loc ["STRING_ENABLED"], "GameFontNormal", 12) - anchorFrame.descEnabledLabel:SetPoint ("topleft", anchorFrame, "topleft", 400, y) - DF:NewLabel (anchorFrame, _, "$parentDescOptionsLabel3", "descOptionsLabel", Loc ["STRING_OPTIONS_PLUGINS_OPTIONS"], "GameFontNormal", 12) - anchorFrame.descOptionsLabel:SetPoint ("topleft", anchorFrame, "topleft", 510, y) + local descbar = anchorFrame:CreateTexture(nil, "artwork") + descbar:SetTexture(.3, .3, .3, .8) + descbar:SetPoint("topleft", anchorFrame, "topleft", 5, y+3) + descbar:SetSize(650, 20) + DF:NewLabel(anchorFrame, _, "$parentDescNameLabel3", "descNameLabel", Loc ["STRING_OPTIONS_PLUGINS_NAME"], "GameFontNormal", 12) + anchorFrame.descNameLabel:SetPoint("topleft", anchorFrame, "topleft", 15, y) + DF:NewLabel(anchorFrame, _, "$parentDescAuthorLabel3", "descAuthorLabel", Loc ["STRING_OPTIONS_PLUGINS_AUTHOR"], "GameFontNormal", 12) + anchorFrame.descAuthorLabel:SetPoint("topleft", anchorFrame, "topleft", 180, y) + DF:NewLabel(anchorFrame, _, "$parentDescVersionLabel3", "descVersionLabel", Loc ["STRING_OPTIONS_PLUGINS_VERSION"], "GameFontNormal", 12) + anchorFrame.descVersionLabel:SetPoint("topleft", anchorFrame, "topleft", 290, y) + DF:NewLabel(anchorFrame, _, "$parentDescEnabledLabel3", "descEnabledLabel", Loc ["STRING_ENABLED"], "GameFontNormal", 12) + anchorFrame.descEnabledLabel:SetPoint("topleft", anchorFrame, "topleft", 400, y) + DF:NewLabel(anchorFrame, _, "$parentDescOptionsLabel3", "descOptionsLabel", Loc ["STRING_OPTIONS_PLUGINS_OPTIONS"], "GameFontNormal", 12) + anchorFrame.descOptionsLabel:SetPoint("topleft", anchorFrame, "topleft", 510, y) end y = y - 30 @@ -3783,40 +3783,40 @@ do local allplugins_solo = _detalhes.SoloTables.NameTable for absName, pluginObject in pairs (allplugins_solo) do - local bframe = CreateFrame ("frame", "OptionsPluginSoloBG", anchorFrame,"BackdropTemplate") - bframe:SetSize (640, 20) - bframe:SetPoint ("topleft", anchorFrame, "topleft", 10, y) - bframe:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, insets = {left = 1, right = 1, top = 0, bottom = 1}}) - bframe:SetBackdropColor (.3, .3, .3, .3) - bframe:SetScript ("OnEnter", on_enter) - bframe:SetScript ("OnLeave", on_leave) + local bframe = CreateFrame("frame", "OptionsPluginSoloBG", anchorFrame,"BackdropTemplate") + bframe:SetSize(640, 20) + bframe:SetPoint("topleft", anchorFrame, "topleft", 10, y) + bframe:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, insets = {left = 1, right = 1, top = 0, bottom = 1}}) + bframe:SetBackdropColor(.3, .3, .3, .3) + bframe:SetScript("OnEnter", on_enter) + bframe:SetScript("OnLeave", on_leave) bframe.plugin = pluginObject bframe.id = i DF:NewImage (bframe, pluginObject.__icon, 18, 18, nil, nil, "soloPluginsIcon"..i, "$parentSoloPluginsIcon"..i) - bframe ["soloPluginsIcon"..i]:SetPoint ("topleft", anchorFrame, "topleft", 10, y) + bframe ["soloPluginsIcon"..i]:SetPoint("topleft", anchorFrame, "topleft", 10, y) - DF:NewLabel (bframe, _, "$parentSoloPluginsLabel"..i, "soloPluginsLabel"..i, pluginObject.__name) - bframe ["soloPluginsLabel"..i]:SetPoint ("left", bframe ["soloPluginsIcon"..i], "right", 2, 0) + DF:NewLabel(bframe, _, "$parentSoloPluginsLabel"..i, "soloPluginsLabel"..i, pluginObject.__name) + bframe ["soloPluginsLabel"..i]:SetPoint("left", bframe ["soloPluginsIcon"..i], "right", 2, 0) - DF:NewLabel (bframe, _, "$parentSoloPluginsLabel2"..i, "soloPluginsLabel2"..i, pluginObject.__author) - bframe ["soloPluginsLabel2"..i]:SetPoint ("topleft", anchorFrame, "topleft", 180, y-4) + DF:NewLabel(bframe, _, "$parentSoloPluginsLabel2"..i, "soloPluginsLabel2"..i, pluginObject.__author) + bframe ["soloPluginsLabel2"..i]:SetPoint("topleft", anchorFrame, "topleft", 180, y-4) - DF:NewLabel (bframe, _, "$parentSoloPluginsLabel3"..i, "soloPluginsLabel3"..i, pluginObject.__version) - bframe ["soloPluginsLabel3"..i]:SetPoint ("topleft", anchorFrame, "topleft", 290, y-4) + DF:NewLabel(bframe, _, "$parentSoloPluginsLabel3"..i, "soloPluginsLabel3"..i, pluginObject.__version) + bframe ["soloPluginsLabel3"..i]:SetPoint("topleft", anchorFrame, "topleft", 290, y-4) local plugin_stable = _detalhes:GetPluginSavedTable (absName) local plugin = _detalhes:GetPlugin (absName) DF:NewSwitch (bframe, _, "$parentSoloSlider"..i, "soloPluginsSlider"..i, 60, 20, _, _, plugin_stable.enabled, nil, nil, nil, nil, options_switch_template) tinsert (anchorFrame.plugin_widgets, bframe ["soloPluginsSlider"..i]) bframe ["soloPluginsSlider"..i].PluginName = absName - bframe ["soloPluginsSlider"..i]:SetPoint ("topleft", anchorFrame, "topleft", 415, y+1) + bframe ["soloPluginsSlider"..i]:SetPoint("topleft", anchorFrame, "topleft", 415, y+1) bframe ["soloPluginsSlider"..i]:SetAsCheckBox() bframe ["soloPluginsSlider"..i].OnSwitch = function(self, _, value) plugin_stable.enabled = value plugin.__enabled = value if (not value) then - for index, instancia in ipairs (_detalhes.tabela_instancias) do + for index, instancia in ipairs(_detalhes.tabela_instancias) do if (instancia.modo == 1 and instancia.baseframe) then -- 1 = solo _detalhes:TrocaTabela (instancia, 0, 1, 1, nil, 2) end @@ -3826,7 +3826,7 @@ do if (pluginObject.OpenOptionsPanel) then DF:NewButton (bframe, nil, "$parentOptionsButton"..i, "OptionsButton"..i, 86, 18, pluginObject.OpenOptionsPanel, nil, nil, nil, Loc ["STRING_OPTIONS_PLUGINS_OPTIONS"], nil, options_button_template) - bframe ["OptionsButton"..i]:SetPoint ("topleft", anchorFrame, "topleft", 510, y-0) + bframe ["OptionsButton"..i]:SetPoint("topleft", anchorFrame, "topleft", 510, y-0) bframe ["OptionsButton"..i]:SetTextColor (button_color_rgb) bframe ["OptionsButton"..i]:SetIcon ([[Interface\Buttons\UI-OptionsButton]], 14, 14, nil, {0, 1, 0, 1}, nil, 3) end @@ -3866,7 +3866,7 @@ do end local buildProfileMenuForAlwaysUse = function() local menu = {} - for index, profile_name in ipairs (_detalhes:GetProfileList()) do + for index, profile_name in ipairs(_detalhes:GetProfileList()) do menu [#menu+1] = {value = profile_name, label = profile_name, onclick = profile_selected_alwaysuse, icon = "Interface\\MINIMAP\\Vehicle-HammerGold-3"} end return menu @@ -3883,7 +3883,7 @@ do local buildProfileMenu = function(func) local menu = {} - for index, profileName in ipairs (_detalhes:GetProfileList()) do + for index, profileName in ipairs(_detalhes:GetProfileList()) do menu [#menu+1] = {value = profileName, label = profileName, onclick = selectProfile, icon = "Interface\\MINIMAP\\Vehicle-HammerGold-3"} end return menu @@ -3891,7 +3891,7 @@ do local buildProfileMenuToDelete = function() local menu = {} - for index, profileName in ipairs (_detalhes:GetProfileList()) do + for index, profileName in ipairs(_detalhes:GetProfileList()) do if (profileName ~= _detalhes:GetCurrentProfileName()) then menu [#menu+1] = {value = profileName, label = profileName, onclick = function()end, icon = [[Interface\Glues\LOGIN\Glues-CheckBox-Check]], color = {1, 1, 1}, iconcolor = {1, .9, .9, 0.8}} end @@ -3944,7 +3944,7 @@ do return _detalhes:Msg (Loc ["STRING_OPTIONS_PROFILE_FIELDEMPTY"]) end - profileNameString:SetText ("") + profileNameString:SetText("") profileNameString:ClearFocus() local new_profile = _detalhes:CreateProfile(profileName) @@ -4017,7 +4017,7 @@ do type = "execute", func = function(self) _detalhes:ShowImportWindow("", function(profileString) - if (type (profileString) ~= "string" or string.len (profileString) < 2) then + if (type(profileString) ~= "string" or string.len (profileString) < 2) then return end @@ -4619,14 +4619,14 @@ end do local buildSection = function(sectionFrame) - --> callback from the image editor + --callback from the image editor local callmeback = function(width, height, overlayColor, alpha, texCoords) editInstanceSetting(currentInstance, "InstanceWallpaper", nil, nil, alpha, texCoords, width, height, overlayColor) sectionFrame:UpdateWallpaperInfo() afterUpdate() end - --> select wallpaper + --select wallpaper local onSelectSecTexture = function(self, instance, texturePath) local textureOptions = sectionFrame.wallpaperOptions @@ -4723,40 +4723,40 @@ do --create preview local previewX, previewY = 460, -60 - local preview = sectionFrame:CreateTexture (nil, "overlay") + local preview = sectionFrame:CreateTexture(nil, "overlay") preview:SetDrawLayer ("artwork", 3) - preview:SetSize (256, 128) - preview:SetPoint ("topleft", sectionFrame, "topleft", previewX, previewY) + preview:SetSize(256, 128) + preview:SetPoint("topleft", sectionFrame, "topleft", previewX, previewY) --background white local whiteBackground = sectionFrame:CreateTexture(nil, "overlay") whiteBackground:SetDrawLayer("background") - whiteBackground:SetSize (255, 128) - whiteBackground:SetPoint ("topleft", sectionFrame, "topleft", previewX, previewY) + whiteBackground:SetSize(255, 128) + whiteBackground:SetPoint("topleft", sectionFrame, "topleft", previewX, previewY) whiteBackground:SetColorTexture(1, 1, 1, 1) --background grid local icon1 = DF:NewImage (sectionFrame, nil, 128, 64, "artwork", nil, nil, "$parentIcon1") - icon1:SetTexture ("Interface\\AddOns\\Details\\images\\icons") - icon1:SetPoint ("topleft", sectionFrame, "topleft", previewX, previewY) + icon1:SetTexture("Interface\\AddOns\\Details\\images\\icons") + icon1:SetPoint("topleft", sectionFrame, "topleft", previewX, previewY) icon1:SetDrawLayer ("artwork", 1) icon1:SetTexCoord (0.337890625, 0.5859375, 0.59375, 0.716796875-0.0009765625) --173 304 300 367 local icon2 = DF:NewImage (sectionFrame, nil, 128, 64, "artwork", nil, nil, "$parentIcon2") - icon2:SetTexture ("Interface\\AddOns\\Details\\images\\icons") - icon2:SetPoint ("left", icon1.widget, "right", -1, 0) + icon2:SetTexture("Interface\\AddOns\\Details\\images\\icons") + icon2:SetPoint("left", icon1.widget, "right", -1, 0) icon2:SetDrawLayer ("artwork", 1) icon2:SetTexCoord (0.337890625, 0.5859375, 0.59375, 0.716796875-0.0009765625) --173 304 300 367 local icon3 = DF:NewImage (sectionFrame, nil, 128, 64, "artwork", nil, nil, "$parentIcon3") - icon3:SetTexture ("Interface\\AddOns\\Details\\images\\icons") - icon3:SetPoint ("top", icon1.widget, "bottom") + icon3:SetTexture("Interface\\AddOns\\Details\\images\\icons") + icon3:SetPoint("top", icon1.widget, "bottom") icon3:SetDrawLayer ("artwork", 1) icon3:SetTexCoord (0.337890625, 0.5859375, 0.59375+0.0009765625, 0.716796875) --173 304 300 367 local icon4 = DF:NewImage (sectionFrame, nil, 128, 64, "artwork", nil, nil, "$parentIcon4") - icon4:SetTexture ("Interface\\AddOns\\Details\\images\\icons") - icon4:SetPoint ("left", icon3.widget, "right", -1, 0) + icon4:SetTexture("Interface\\AddOns\\Details\\images\\icons") + icon4:SetPoint("left", icon3.widget, "right", -1, 0) icon4:SetDrawLayer ("artwork", 1) icon4:SetTexCoord (0.337890625, 0.5859375, 0.59375+0.0009765625, 0.716796875) --173 304 300 367 @@ -4768,35 +4768,35 @@ do --corners local w, h = 20, 20 - local L1 = sectionFrame:CreateTexture (nil, "overlay") - L1:SetPoint ("topleft", preview, "topleft") - L1:SetTexture ("Interface\\AddOns\\Details\\images\\icons") + local L1 = sectionFrame:CreateTexture(nil, "overlay") + L1:SetPoint("topleft", preview, "topleft") + L1:SetTexture("Interface\\AddOns\\Details\\images\\icons") L1:SetTexCoord (0.13671875+0.0009765625, 0.234375, 0.29296875, 0.1953125+0.0009765625) - L1:SetSize (w, h) + L1:SetSize(w, h) L1:SetDrawLayer ("overlay", 2) L1:SetVertexColor (1, 1, 1, .8) - local L2 = sectionFrame:CreateTexture (nil, "overlay") - L2:SetPoint ("bottomleft", preview, "bottomleft") - L2:SetTexture ("Interface\\AddOns\\Details\\images\\icons") + local L2 = sectionFrame:CreateTexture(nil, "overlay") + L2:SetPoint("bottomleft", preview, "bottomleft") + L2:SetTexture("Interface\\AddOns\\Details\\images\\icons") L2:SetTexCoord (0.13671875+0.0009765625, 0.234375, 0.1953125+0.0009765625, 0.29296875) - L2:SetSize (w, h) + L2:SetSize(w, h) L2:SetDrawLayer ("overlay", 2) L2:SetVertexColor (1, 1, 1, .8) - local L3 = sectionFrame:CreateTexture (nil, "overlay") - L3:SetPoint ("bottomright", preview, "bottomright", 0, 0) - L3:SetTexture ("Interface\\AddOns\\Details\\images\\icons") + local L3 = sectionFrame:CreateTexture(nil, "overlay") + L3:SetPoint("bottomright", preview, "bottomright", 0, 0) + L3:SetTexture("Interface\\AddOns\\Details\\images\\icons") L3:SetTexCoord (0.234375, 0.13671875-0.0009765625, 0.1953125+0.0009765625, 0.29296875) - L3:SetSize (w, h) + L3:SetSize(w, h) L3:SetDrawLayer ("overlay", 5) L3:SetVertexColor (1, 1, 1, .8) - local L4 = sectionFrame:CreateTexture (nil, "overlay") - L4:SetPoint ("topright", preview, "topright", 0, 0) - L4:SetTexture ("Interface\\AddOns\\Details\\images\\icons") + local L4 = sectionFrame:CreateTexture(nil, "overlay") + L4:SetPoint("topright", preview, "topright", 0, 0) + L4:SetTexture("Interface\\AddOns\\Details\\images\\icons") L4:SetTexCoord (0.234375, 0.13671875-0.0009765625, 0.29296875, 0.1953125+0.0009765625) - L4:SetSize (w, h) + L4:SetSize(w, h) L4:SetDrawLayer ("overlay", 5) L4:SetVertexColor (1, 1, 1, .8) @@ -4804,13 +4804,13 @@ do function sectionFrame:UpdateWallpaperInfo() local wallpaper = currentInstance.wallpaper - preview:SetTexture (wallpaper.texture) + preview:SetTexture(wallpaper.texture) preview:SetTexCoord (unpack (wallpaper.texcoord)) preview:SetVertexColor (unpack (wallpaper.overlay)) preview:SetAlpha (wallpaper.alpha) end - --> wallpaper alignment + --wallpaper alignment local onSelectAnchor = function(_, instance, anchor) editInstanceSetting(currentInstance, "InstanceWallpaper", nil, anchor) afterUpdate() @@ -4832,7 +4832,7 @@ do return anchorMenu end - --> open image editor + --open image editor local startImageEdit = function() if (not currentInstance.wallpaper.texture) then Details:Msg("no texture to edit.") @@ -4856,17 +4856,17 @@ do end end - --> open image to use as wallpaper + --open image to use as wallpaper local loadImage = function() if (not DetailsLoadWallpaperImage) then - local f = CreateFrame ("frame", "DetailsLoadWallpaperImage", UIParent, "BackdropTemplate") - f:SetPoint ("center", UIParent, "center") + local f = CreateFrame("frame", "DetailsLoadWallpaperImage", UIParent, "BackdropTemplate") + f:SetPoint("center", UIParent, "center") f:SetFrameStrata ("FULLSCREEN") - f:SetSize (550, 170) + f:SetSize(550, 170) f:EnableMouse (true) f:SetMovable (true) - f:SetScript ("OnMouseDown", function(self, button) + f:SetScript("OnMouseDown", function(self, button) if (self.isMoving) then return end @@ -4877,7 +4877,7 @@ do self.isMoving = true end end) - f:SetScript ("OnMouseUp", function(self, button) + f:SetScript("OnMouseUp", function(self, button) if (self.isMoving and button == "LeftButton") then self:StopMovingOrSizing() self.isMoving = nil @@ -4890,17 +4890,17 @@ do tinsert (_G.UISpecialFrames, "DetailsLoadWallpaperImage") local t = f:CreateFontString (nil, "overlay", "GameFontNormal") - t:SetText (Loc ["STRING_OPTIONS_WALLPAPER_LOAD_EXCLAMATION"]) - t:SetPoint ("topleft", f, "topleft", 15, -25) - t:SetJustifyH ("left") + t:SetText(Loc ["STRING_OPTIONS_WALLPAPER_LOAD_EXCLAMATION"]) + t:SetPoint("topleft", f, "topleft", 15, -25) + t:SetJustifyH("left") f.t = t local filename = f:CreateFontString (nil, "overlay", "GameFontHighlightLeft") - filename:SetPoint ("topleft", f, "topleft", 15, -128) - filename:SetText (Loc ["STRING_OPTIONS_WALLPAPER_LOAD_FILENAME"]) + filename:SetPoint("topleft", f, "topleft", 15, -128) + filename:SetText(Loc ["STRING_OPTIONS_WALLPAPER_LOAD_FILENAME"]) local editbox = DF:NewTextEntry (f, nil, "$parentFileName", "FileName", 160, 20, function() end, nil, nil, nil, nil, options_dropdown_template) - editbox:SetPoint ("left", filename, "right", 2, 0) + editbox:SetPoint("left", filename, "right", 2, 0) editbox.tooltip = Loc ["STRING_OPTIONS_WALLPAPER_LOAD_FILENAME_DESC"] local okey_func = function() @@ -4917,21 +4917,21 @@ do sectionFrame:UpdateWallpaperInfo() end local okey = DF:NewButton (f, _, "$parentOkeyButton", nil, 105, 20, okey_func, nil, nil, nil, Loc ["STRING_OPTIONS_WALLPAPER_LOAD_OKEY"], 1, options_button_template) - okey:SetPoint ("left", editbox.widget, "right", 2, 0) + okey:SetPoint("left", editbox.widget, "right", 2, 0) local throubleshoot_func = function() if (t:GetText() == Loc ["STRING_OPTIONS_WALLPAPER_LOAD_EXCLAMATION"]) then - t:SetText (Loc ["STRING_OPTIONS_WALLPAPER_LOAD_TROUBLESHOOT_TEXT"]) + t:SetText(Loc ["STRING_OPTIONS_WALLPAPER_LOAD_TROUBLESHOOT_TEXT"]) else - _G.DetailsLoadWallpaperImage.t:SetText (Loc ["STRING_OPTIONS_WALLPAPER_LOAD_EXCLAMATION"]) + _G.DetailsLoadWallpaperImage.t:SetText(Loc ["STRING_OPTIONS_WALLPAPER_LOAD_EXCLAMATION"]) end end local throubleshoot = DF:NewButton (f, _, "$parentThroubleshootButton", nil, 105, 20, throubleshoot_func, nil, nil, nil, Loc ["STRING_OPTIONS_WALLPAPER_LOAD_TROUBLESHOOT"], 1, options_button_template) - throubleshoot:SetPoint ("left", okey, "right", 2, 0) + throubleshoot:SetPoint("left", okey, "right", 2, 0) --throubleshoot:InstallCustomTexture() end - _G.DetailsLoadWallpaperImage.t:SetText (Loc ["STRING_OPTIONS_WALLPAPER_LOAD_EXCLAMATION"]) + _G.DetailsLoadWallpaperImage.t:SetText(Loc ["STRING_OPTIONS_WALLPAPER_LOAD_EXCLAMATION"]) _G.DetailsLoadWallpaperImage:Show() end @@ -5043,7 +5043,7 @@ end do local buildSection = function(sectionFrame) - --> auto switch options + --auto switch options local Current_Switch_Func = function()end local buildSwitchMenu = function() @@ -5055,9 +5055,9 @@ do local attributes = _detalhes.sub_atributos local i = 1 - for atributo, sub_atributo in ipairs (attributes) do + for atributo, sub_atributo in ipairs(attributes) do local icones = sub_atributo.icones - for index, att_name in ipairs (sub_atributo.lista) do + for index, att_name in ipairs(sub_atributo.lista) do local texture, texcoord = unpack (icones [index]) tinsert (t, {value = i, label = att_name, onclick = Current_Switch_Func, icon = texture, texcoord = texcoord}) sectionFrame.lastSwitchList [i] = {atributo, index, i} @@ -5065,7 +5065,7 @@ do end end - for index, ptable in ipairs (_detalhes.RaidTables.Menu) do + for index, ptable in ipairs(_detalhes.RaidTables.Menu) do tinsert (t, {value = i, label = ptable [1], onclick = Current_Switch_Func, icon = ptable [2]}) sectionFrame.lastSwitchList [i] = {"raid", ptable [4], i} i = i + 1 @@ -5363,15 +5363,15 @@ do DF:BuildMenu(autoSwitchFrame, sectionOptions, startX, startY-20, heightSize, false, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template) - --> combat alpha modifier + --combat alpha modifier local right_start_at = 450 --anchor - DF:NewLabel (sectionFrame, _, "$parentHideInCombatAnchor", "hideInCombatAnchor", Loc ["STRING_OPTIONS_ALPHAMOD_ANCHOR"], "GameFontNormal") + DF:NewLabel(sectionFrame, _, "$parentHideInCombatAnchor", "hideInCombatAnchor", Loc ["STRING_OPTIONS_ALPHAMOD_ANCHOR"], "GameFontNormal") sectionFrame.hideInCombatAnchor:SetPoint("topleft", sectionFrame, "topleft", right_start_at, startY - 20) - --> hide in combat - DF:NewLabel (sectionFrame, _, "$parentCombatAlphaLabel", "combatAlphaLabel", Loc ["STRING_OPTIONS_COMBAT_ALPHA"], "GameFontHighlightLeft") + --hide in combat + DF:NewLabel(sectionFrame, _, "$parentCombatAlphaLabel", "combatAlphaLabel", Loc ["STRING_OPTIONS_COMBAT_ALPHA"], "GameFontHighlightLeft") local texCoords = {.9, 0.1, 0.1, .9} local typeCombatAlpha = { @@ -5462,7 +5462,7 @@ do Details.options.UpdateAutoHideSettings(currentInstance) - --> profile by spec + --profile by spec --[=[]] local spec1Table = {} @@ -5560,8 +5560,8 @@ do --raid tools if (not DetailsAnnounceSelectCooldownIgnored) then DetailsAnnounceSelectCooldownIgnored = CreateFrame("frame", "DetailsAnnounceSelectCooldownIgnored", UIParent, "BackdropTemplate") local f = DetailsAnnounceSelectCooldownIgnored - f:SetSize (400, 500) - f:SetPoint ("center", UIParent, "center", 0, 0) + f:SetSize(400, 500) + f:SetPoint("center", UIParent, "center", 0, 0) DF:ApplyStandardBackdrop(f) DF:CreateTitleBar(f, Loc ["STRING_OPTIONS_RT_IGNORE_TITLE"]) @@ -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() @@ -5601,12 +5601,12 @@ do --raid tools end end - f:SetScript ("OnHide", function(self) + f:SetScript("OnHide", function(self) self:Clear() end) function f:Clear() - for _, label in ipairs (self.labels) do + for _, label in ipairs(self.labels) do label.icon:Hide() label.text:Hide() label.switch:Hide() @@ -5616,14 +5616,14 @@ do --raid tools function f:CreateLabel() local L = { icon = DF:CreateImage (f, nil, 16, 16, "overlay", {0.1, 0.9, 0.1, 0.9}), - text = DF:CreateLabel (f, "", 10, "white", "GameFontHighlightSmall"), + text = DF:CreateLabel(f, "", 10, "white", "GameFontHighlightSmall"), } L.switch = DF:CreateSwitch (f, on_switch_func, false) - L.switch:SetPoint ("topleft", f, "topleft", 10, ((#f.labels*20)*-1)-55) - L.icon:SetPoint ("left", L.switch, "right", 2, 0) - L.text:SetPoint ("left", L.icon, "right", 2, 0) + L.switch:SetPoint("topleft", f, "topleft", 10, ((#f.labels*20)*-1)-55) + L.icon:SetPoint("left", L.switch, "right", 2, 0) + L.text:SetPoint("left", L.icon, "right", 2, 0) L.switch:SetAsCheckBox() L.switch:SetTemplate(options_switch_template) @@ -5637,7 +5637,7 @@ do --raid tools function f:Open() local _GetSpellInfo = _detalhes.getspellinfo --details api - for index, spellid in ipairs (_detalhes:GetCooldownList()) do + for index, spellid in ipairs(_detalhes:GetCooldownList()) do local name, _, icon = _GetSpellInfo(spellid) if (name) then local label = f.labels [index] or f:CreateLabel() @@ -5956,20 +5956,20 @@ do local button_width = 160 - --> streamer plugin - a.k.a. Action Tracker - --> title anchor - DF:NewLabel (sectionFrame, _, "$parentStreamerPluginAnchor", "streamerPluginAnchor", "Action Tracker", "GameFontNormal") + --streamer plugin - a.k.a. Action Tracker + --title anchor + DF:NewLabel(sectionFrame, _, "$parentStreamerPluginAnchor", "streamerPluginAnchor", "Action Tracker", "GameFontNormal") sectionFrame.streamerPluginAnchor:SetPoint("topleft", sectionFrame, "topleft", startX, startY - 20) - local streamerTitleDesc = DF:NewLabel (sectionFrame, _, "$parentStreamerTitleDescText", "StreamerTitleDescTextLabel", "Show the spells you are casting, allowing the viewer to follow your decision making and learn your rotation.", "GameFontNormal", 10, "white") - streamerTitleDesc:SetSize (270, 40) + local streamerTitleDesc = DF:NewLabel(sectionFrame, _, "$parentStreamerTitleDescText", "StreamerTitleDescTextLabel", "Show the spells you are casting, allowing the viewer to follow your decision making and learn your rotation.", "GameFontNormal", 10, "white") + streamerTitleDesc:SetSize(270, 40) streamerTitleDesc:SetJustifyV ("top") - streamerTitleDesc:SetPoint ("topleft", sectionFrame.streamerPluginAnchor, "bottomleft", 0, -4) + streamerTitleDesc:SetPoint("topleft", sectionFrame.streamerPluginAnchor, "bottomleft", 0, -4) local streamerTitleImage = DF:CreateImage (sectionFrame, [[Interface\AddOns\Details\images\icons2.blp]], 268*0.75, 59*0.75, "overlay", {0, 268/512, 454/512, 1}) - streamerTitleImage:SetPoint ("topleft", sectionFrame.streamerPluginAnchor, "bottomleft", 0, -40) + streamerTitleImage:SetPoint("topleft", sectionFrame.streamerPluginAnchor, "bottomleft", 0, -40) - --> get the plugin object + --get the plugin object local StreamerPlugin = Details:GetPlugin("DETAILS_PLUGIN_STREAM_OVERLAY") if (StreamerPlugin) then --get the plugin settings table @@ -6047,17 +6047,17 @@ do end) - --> event tracker - DF:NewLabel (sectionFrame, _, "$parentEventTrackerAnchor", "eventTrackerAnchor", "Event Tracker", "GameFontNormal") + --event tracker + DF:NewLabel(sectionFrame, _, "$parentEventTrackerAnchor", "eventTrackerAnchor", "Event Tracker", "GameFontNormal") sectionFrame.eventTrackerAnchor:SetPoint("topleft", sectionFrame, "topleft", startX, startY - 180) - local eventTrackerTitleDesc = DF:NewLabel (sectionFrame, _, "$parentEventTrackerTitleDescText", "EventTrackerTitleDescTextLabel", "Show what's happening near you so the viewer can follow what's going on. Show cooldowns, CC, spell interruption. Useful on any group content.", "GameFontNormal", 10, "white") + local eventTrackerTitleDesc = DF:NewLabel(sectionFrame, _, "$parentEventTrackerTitleDescText", "EventTrackerTitleDescTextLabel", "Show what's happening near you so the viewer can follow what's going on. Show cooldowns, CC, spell interruption. Useful on any group content.", "GameFontNormal", 10, "white") eventTrackerTitleDesc:SetJustifyV ("top") - eventTrackerTitleDesc:SetSize (270, 40) - eventTrackerTitleDesc:SetPoint ("topleft", sectionFrame.eventTrackerAnchor, "bottomleft", 0, -4) + eventTrackerTitleDesc:SetSize(270, 40) + eventTrackerTitleDesc:SetPoint("topleft", sectionFrame.eventTrackerAnchor, "bottomleft", 0, -4) local eventTrackerTitleImage = DF:CreateImage (sectionFrame, [[Interface\AddOns\Details\images\icons2]], 256, 50, "overlay", {0.5, 1, 134/512, 184/512}) - eventTrackerTitleImage:SetPoint ("topleft", sectionFrame.eventTrackerAnchor, "bottomleft", 0, -40) + eventTrackerTitleImage:SetPoint("topleft", sectionFrame.eventTrackerAnchor, "bottomleft", 0, -40) local enableEventTracker = function() Details.event_tracker.enabled = not Details.event_tracker.enabled @@ -6089,17 +6089,17 @@ do sectionFrame.actionTrackerOptionsButtton = actionTrackerOptionsButtton - --> arena kamehameha bar - DF:NewLabel (sectionFrame, _, "$parentCurrentDPSAnchor", "currentDPSAnchor", "Arena DPS Bar", "GameFontNormal") + --arena kamehameha bar + DF:NewLabel(sectionFrame, _, "$parentCurrentDPSAnchor", "currentDPSAnchor", "Arena DPS Bar", "GameFontNormal") sectionFrame.currentDPSAnchor:SetPoint("topleft", sectionFrame, "topleft", startX, startY - 340) - local currentDPSTitleDesc = DF:NewLabel (sectionFrame, _, "$parentCurrentDPSTitleDescText", "CurrentDPSTitleDescTextLabel", "Show a bar which grows to the side of the team doing most damage in the last 5 seconds.", "GameFontNormal", 10, "white") + local currentDPSTitleDesc = DF:NewLabel(sectionFrame, _, "$parentCurrentDPSTitleDescText", "CurrentDPSTitleDescTextLabel", "Show a bar which grows to the side of the team doing most damage in the last 5 seconds.", "GameFontNormal", 10, "white") currentDPSTitleDesc:SetJustifyV ("top") - currentDPSTitleDesc:SetSize (270, 40) - currentDPSTitleDesc:SetPoint ("topleft", sectionFrame.currentDPSAnchor, "bottomleft", 0, -4) + currentDPSTitleDesc:SetSize(270, 40) + currentDPSTitleDesc:SetPoint("topleft", sectionFrame.currentDPSAnchor, "bottomleft", 0, -4) local currentDPSTitleImage = DF:CreateImage (sectionFrame, [[Interface\AddOns\Details\images\icons2]], 256, 32, "overlay", {0/512, 256/512, 421/512, 453/512}) - currentDPSTitleImage:SetPoint ("topleft", sectionFrame.currentDPSAnchor, "bottomleft", 0, -40) + currentDPSTitleImage:SetPoint("topleft", sectionFrame.currentDPSAnchor, "bottomleft", 0, -40) local enableArenaDPS = function() Details.realtime_dps_meter.enabled = not Details.realtime_dps_meter.enabled @@ -6247,7 +6247,7 @@ do _detalhes:UserCustomSpellReset (index) end - --> custom spells panel + --custom spells panel local header = { {name = Loc ["STRING_OPTIONS_SPELL_INDEX"], width = 55, type = "text"}, {name = Loc ["STRING_OPTIONS_SPELL_NAME"], width = 310, type = "entry", func = name_entry_func}, @@ -6272,26 +6272,26 @@ do local panel = DF:NewFillPanel (sectionFrame, header, "$parentCustomSpellsFillPanel", "customSpellsFillPanel", 640, 462, total_lines, fill_row, false) panel:Refresh() - --> add - --> add panel + --add + --add panel local addframe = DF:NewPanel (sectionFrame, nil, "$parentCustomSpellsAddPanel", "customSpellsAddPanel", 644, 462) - addframe:SetPoint (startX, startY - 40) + addframe:SetPoint(startX, startY - 40) addframe:SetFrameLevel (7) DF:ApplyStandardBackdrop(addframe) addframe:Hide() - local spellid = DF:NewLabel (addframe, nil, "$parentSpellidLabel", "spellidLabel", Loc ["STRING_OPTIONS_SPELL_ADDSPELLID"]) - local spellname = DF:NewLabel (addframe, nil, "$parentSpellnameLabel", "spellnameLabel", Loc ["STRING_OPTIONS_SPELL_ADDNAME"]) - local spellicon = DF:NewLabel (addframe, nil, "$parentSpelliconLabel", "spelliconLabel", Loc ["STRING_OPTIONS_SPELL_ADDICON"]) + local spellid = DF:NewLabel(addframe, nil, "$parentSpellidLabel", "spellidLabel", Loc ["STRING_OPTIONS_SPELL_ADDSPELLID"]) + local spellname = DF:NewLabel(addframe, nil, "$parentSpellnameLabel", "spellnameLabel", Loc ["STRING_OPTIONS_SPELL_ADDNAME"]) + local spellicon = DF:NewLabel(addframe, nil, "$parentSpelliconLabel", "spelliconLabel", Loc ["STRING_OPTIONS_SPELL_ADDICON"]) local spellname_entry_func = function() end 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) + spellname_entry:SetPoint("left", spellname, "right", 2, 0) local spellid_entry_func = function(arg1, arg2, spellid) local spellname, _, icon = GetSpellInfo(spellid) if (spellname) then - spellname_entry:SetText (spellname) + spellname_entry:SetText(spellname) addframe.spellIconButton.icon.texture = icon else _detalhes:Msg (Loc ["STRING_OPTIONS_SPELL_NOTFOUND"]) @@ -6299,21 +6299,21 @@ do end local spellid_entry = DF:NewSpellEntry (addframe, spellid_entry_func, 160, 20, nil, nil, "spellidEntry", "$parentSpellidEntry") spellid_entry:SetTemplate (options_dropdown_template) - spellid_entry:SetPoint ("left", spellid, "right", 2, 0) + spellid_entry:SetPoint("left", spellid, "right", 2, 0) 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) local icon_button_icon = DF:NewImage (icon_button, [[Interface\ICONS\TEMP]], 19, 19, "background", nil, "icon", "$parentSpellIcon") - icon_button_icon:SetPoint (0, 0) + icon_button_icon:SetPoint(0, 0) icon_button:InstallCustomTexture() - icon_button:SetPoint ("left", spellicon, "right", 2, 0) + icon_button:SetPoint("left", spellicon, "right", 2, 0) - --> close button + --close button local closebutton = DF:NewButton (addframe, nil, "$parentAddCloseButton", "addClosebutton", 120, 20, function() addframe:Hide() end, nil, nil, nil, Loc ["STRING_OPTIONS_SPELL_CLOSE"], nil, options_button_template) - --> confirm add spell + --confirm add spell local addspell = function() local id = spellid_entry.text if (id == "") then @@ -6349,34 +6349,34 @@ do addspellbutton:SetIcon ([[Interface\Buttons\UI-CheckBox-Check]], 18, 18, nil, nil, nil, 4) closebutton:SetIcon ([[Interface\PetBattles\DeadPetIcon]], 14, 14, nil, nil, nil, 4) - addspellbutton:SetPoint ("bottomright", addframe, "bottomright", -5, 5) - closebutton:SetPoint ("right", addspellbutton, "left", -4, 0) + addspellbutton:SetPoint("bottomright", addframe, "bottomright", -5, 5) + closebutton:SetPoint("right", addspellbutton, "left", -4, 0) - spellid:SetPoint (50, -10) - spellname:SetPoint (50, -35) - spellicon:SetPoint (50, -60) + spellid:SetPoint(50, -10) + spellname:SetPoint(50, -35) + spellicon:SetPoint(50, -60) - --> open add panel button + --open add panel button local add = function() addframe:Show() end local addbutton = DF:NewButton (sectionFrame, nil, "$parentAddButton", "addbutton", 120, 20, add, nil, nil, nil, Loc ["STRING_OPTIONS_SPELL_ADDSPELL"], nil, options_button_template) - addbutton:SetPoint ("bottomright", panel, "topright", -00, 1) + addbutton:SetPoint("bottomright", panel, "topright", -00, 1) addbutton:SetIcon ([[Interface\PaperDollInfoFrame\Character-Plus]], 12, 12, nil, nil, nil, 4) - panel:SetPoint (startX, startY - 40) + panel:SetPoint(startX, startY - 40) - --> consilidade spells - DF:NewLabel (sectionFrame, _, "$parentConsolidadeSpellsLabel", "ConsolidadeSpellsLabel", Loc ["STRING_OPTIONSMENU_SPELLS_CONSOLIDATE"], "GameFontHighlightLeft") + --consilidade spells + DF:NewLabel(sectionFrame, _, "$parentConsolidadeSpellsLabel", "ConsolidadeSpellsLabel", Loc ["STRING_OPTIONSMENU_SPELLS_CONSOLIDATE"], "GameFontHighlightLeft") 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.ConsolidadeSpellsLabel:SetPoint("left", sectionFrame.ConsolidadeSpellsSwitch, "right", 3) sectionFrame.ConsolidadeSpellsSwitch:SetAsCheckBox() sectionFrame.ConsolidadeSpellsSwitch.OnSwitch = function(self, instance, value) _detalhes.override_spellids = value _detalhes:UpdateParserGears() end - sectionFrame.ConsolidadeSpellsSwitch:SetPoint (startX, startY - 20) + sectionFrame.ConsolidadeSpellsSwitch:SetPoint(startX, startY - 20) _detalhes:SetFontSize (sectionFrame.ConsolidadeSpellsLabel, 12) local sectionOptions = { @@ -6396,35 +6396,35 @@ end do local buildSection = function(sectionFrame) - --> title - local titulo_datacharts = DF:NewLabel (sectionFrame, _, "$parentTituloDataChartsText", "DataChartsLabel", Loc ["STRING_OPTIONS_DATACHARTTITLE"], "GameFontNormal", 16) - local titulo_datacharts_desc = DF:NewLabel (sectionFrame, _, "$parentDataChartsText2", "DataCharts2Label", Loc ["STRING_OPTIONS_DATACHARTTITLE_DESC"], "GameFontNormal", 10, "white") + --title + local titulo_datacharts = DF:NewLabel(sectionFrame, _, "$parentTituloDataChartsText", "DataChartsLabel", Loc ["STRING_OPTIONS_DATACHARTTITLE"], "GameFontNormal", 16) + local titulo_datacharts_desc = DF:NewLabel(sectionFrame, _, "$parentDataChartsText2", "DataCharts2Label", Loc ["STRING_OPTIONS_DATACHARTTITLE_DESC"], "GameFontNormal", 10, "white") titulo_datacharts_desc.width = 350 ---> warning +--warning if (not _detalhes:GetPlugin ("DETAILS_PLUGIN_CHART_VIEWER")) then - local label = DF:NewLabel (sectionFrame, _, "$parentPluginWarningLabel", "PluginWarningLabel", Loc ["STRING_OPTIONS_CHART_PLUGINWARNING"], "GameFontNormal") + local label = DF:NewLabel(sectionFrame, _, "$parentPluginWarningLabel", "PluginWarningLabel", Loc ["STRING_OPTIONS_CHART_PLUGINWARNING"], "GameFontNormal") local image = DF:NewImage (sectionFrame, [[Interface\DialogFrame\UI-Dialog-Icon-AlertNew]]) - label:SetPoint ("topright", sectionFrame, "topright", -42, -10) - label:SetJustifyH ("left") - label:SetWidth (160) - image:SetPoint ("right", label, "left", -7, 0) - image:SetSize (32, 32) + label:SetPoint("topright", sectionFrame, "topright", -42, -10) + label:SetJustifyH("left") + label:SetWidth(160) + image:SetPoint("right", label, "left", -7, 0) + image:SetSize(32, 32) end ---> panel +--panel local edit_name = function(index, name) _detalhes:TimeDataUpdate (index, name) sectionFrame.userTimeCaptureFillPanel:Refresh() end local big_code_editor = DF:NewSpecialLuaEditorEntry (sectionFrame, 683, 422, "bigCodeEditor", "$parentBigCodeEditor") - big_code_editor:SetPoint ("topleft", sectionFrame, "topleft", startX, startY - 70) + 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}) + 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) - big_code_editor:SetBackdropColor (0.5, 0.5, 0.5, 0.95) - big_code_editor:SetBackdropBorderColor (0, 0, 0, 1) + big_code_editor:SetBackdropColor(0.5, 0.5, 0.5, 0.95) + big_code_editor:SetBackdropBorderColor(0, 0, 0, 1) big_code_editor:Hide() local accept = function() @@ -6440,13 +6440,13 @@ do end local accept_changes = DF:NewButton (big_code_editor, nil, "$parentAccept", "acceptButton", 120, 20, accept, nil, nil) - accept_changes:SetPoint (0, 20) + accept_changes:SetPoint(0, 20) accept_changes:SetIcon([[Interface\Buttons\UI-CheckBox-Check]]) accept_changes:SetTemplate(options_button_template) accept_changes:SetText(Loc ["STRING_OPTIONS_CHART_SAVE"]) local cancel_changes = DF:NewButton (big_code_editor, nil, "$parentCancel", "CancelButton", 120, 20, cancel, nil, nil) - cancel_changes:SetPoint ("left", accept_changes, "right", 2, 0) + cancel_changes:SetPoint("left", accept_changes, "right", 2, 0) cancel_changes:SetIcon([[Interface\PetBattles\DeadPetIcon]]) cancel_changes:SetTemplate(options_button_template) cancel_changes:SetText(Loc ["STRING_OPTIONS_CHART_CANCEL"]) @@ -6456,11 +6456,11 @@ do if (data) then local func = data [2] - if (type (func) == "function") then + if (type(func) == "function") then return _detalhes:Msg (Loc ["STRING_OPTIONS_CHART_CODELOADED"]) end - big_code_editor:SetText (func) + big_code_editor:SetText(func) big_code_editor.original_code = func big_code_editor.index = index big_code_editor.is_export = nil @@ -6489,12 +6489,12 @@ do end local big_code_editor2 = DF:NewSpecialLuaEditorEntry (sectionFrame, 643, 402, "exportEditor", "$parentExportEditor", true) - big_code_editor2:SetPoint ("topleft", sectionFrame, "topleft", 7, -70) + 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}) + 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) - big_code_editor2:SetBackdropColor (0.5, 0.5, 0.5, 0.95) - big_code_editor2:SetBackdropBorderColor (0, 0, 0, 1) + big_code_editor2:SetBackdropColor(0.5, 0.5, 0.5, 0.95) + big_code_editor2:SetBackdropBorderColor(0, 0, 0, 1) big_code_editor2:Hide() local close_export_box = function() @@ -6503,9 +6503,9 @@ do end local close_export = DF:NewButton (big_code_editor2, nil, "$parentClose", "closeButton", 120, 20, close_export_box) - close_export:SetPoint (10, 18) + close_export:SetPoint(10, 18) close_export:SetIcon ([[Interface\Buttons\UI-CheckBox-Check]]) - close_export:SetText (Loc ["STRING_OPTIONS_CHART_CLOSE"]) + close_export:SetText(Loc ["STRING_OPTIONS_CHART_CLOSE"]) close_export:SetTemplate (options_button_template) local export_function = function(index) @@ -6513,13 +6513,13 @@ do if (data) then local encoded = Details:CompressData (data, "print") if (encoded) then - big_code_editor2:SetText (encoded) + big_code_editor2:SetText(encoded) big_code_editor2:Show() big_code_editor2.editbox:HighlightText() big_code_editor2.editbox:SetFocus (true) else - Details:Msg ("error exporting the time capture.") --localize-me + Details:Msg("error exporting the time capture.") --localize-me end end end @@ -6580,7 +6580,7 @@ do --DetailsOptionsWindowtab17UserTimeCapturesFillPanel local panel = DF:NewFillPanel (sectionFrame, header, "$parentUserTimeCapturesFillPanel", "userTimeCaptureFillPanel", 640, 382, total_lines, fill_row, false) - panel:SetHook ("OnMouseDown", function() + panel:SetHook("OnMouseDown", function() if (DetailsIconPickFrame and DetailsIconPickFrame:IsShown()) then DetailsIconPickFrame:Hide() end @@ -6588,34 +6588,34 @@ do panel:Refresh() - --> add panel + --add panel local addframe = DF:NewPanel (sectionFrame, nil, "$parentUserTimeCapturesAddPanel", "userTimeCaptureAddPanel", 683, 422) - addframe:SetPoint ("topleft", sectionFrame, "topleft", startX, startY - 70) + addframe:SetPoint("topleft", sectionFrame, "topleft", startX, startY - 70) addframe:SetFrameLevel (7) addframe:Hide() - addframe:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1,tile = 1, tileSize = 16}) - addframe:SetBackdropColor (0.5, 0.5, 0.5, 0.95) - addframe:SetBackdropBorderColor (0, 0, 0, 1) + addframe:SetBackdrop({bgFile = [[Interface\AddOns\Details\images\background]], edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1,tile = 1, tileSize = 16}) + addframe:SetBackdropColor(0.5, 0.5, 0.5, 0.95) + addframe:SetBackdropBorderColor(0, 0, 0, 1) - --> name - local capture_name = DF:NewLabel (addframe, nil, "$parentNameLabel", "nameLabel", Loc ["STRING_OPTIONS_CHART_ADDNAME"]) + --name + local capture_name = DF:NewLabel(addframe, nil, "$parentNameLabel", "nameLabel", Loc ["STRING_OPTIONS_CHART_ADDNAME"]) local capture_name_entry = DF:NewTextEntry (addframe, nil, "$parentNameEntry", "nameEntry", 160, 20, function() end, nil, nil, nil, nil, options_dropdown_template) capture_name_entry:SetMaxLetters (16) - capture_name_entry:SetPoint ("left", capture_name, "right", 2, 0) + capture_name_entry:SetPoint("left", capture_name, "right", 2, 0) - --> function - local capture_func = DF:NewLabel (addframe, nil, "$parentFunctionLabel", "functionLabel", Loc ["STRING_OPTIONS_CHART_ADDCODE"]) + --function + local capture_func = DF:NewLabel(addframe, nil, "$parentFunctionLabel", "functionLabel", Loc ["STRING_OPTIONS_CHART_ADDCODE"]) local capture_func_entry = DF:NewSpecialLuaEditorEntry (addframe.widget, 300, 200, "funcEntry", "$parentFuncEntry") - capture_func_entry:SetPoint ("topleft", capture_func.widget, "topright", 2, 0) - capture_func_entry:SetSize (500, 220) - 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) + capture_func_entry:SetPoint("topleft", capture_func.widget, "topright", 2, 0) + capture_func_entry:SetSize(500, 220) + 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) - --> icon - local capture_icon = DF:NewLabel (addframe, nil, "$parentIconLabel", "iconLabel", Loc ["STRING_OPTIONS_CHART_ADDICON"]) + --icon + local capture_icon = DF:NewLabel(addframe, nil, "$parentIconLabel", "iconLabel", Loc ["STRING_OPTIONS_CHART_ADDICON"]) local icon_button_func = function(texture) addframe.iconButton.iconTexture = texture addframe.iconButton:SetIcon(texture) @@ -6623,19 +6623,19 @@ do local capture_icon_button = DF:NewButton (addframe, nil, "$parentIconButton", "iconButton", 20, 20, function() DF:IconPick (icon_button_func, true) end, nil, nil, nil, nil, nil, options_button_template) capture_icon_button:SetIcon([[Interface\ICONS\TEMP]]) capture_icon_button:SetTemplate(options_button_template) - capture_icon_button:SetPoint ("left", capture_icon, "right", 2, 0) + capture_icon_button:SetPoint("left", capture_icon, "right", 2, 0) - --> author - local capture_author = DF:NewLabel (addframe, nil, "$parentAuthorLabel", "authorLabel", Loc ["STRING_OPTIONS_CHART_ADDAUTHOR"]) + --author + local capture_author = DF:NewLabel(addframe, nil, "$parentAuthorLabel", "authorLabel", Loc ["STRING_OPTIONS_CHART_ADDAUTHOR"]) local capture_author_entry = DF:NewTextEntry (addframe, nil, "$parentAuthorEntry", "authorEntry", 160, 20, function() end, nil, nil, nil, nil, options_dropdown_template) - capture_author_entry:SetPoint ("left", capture_author, "right", 2, 0) + capture_author_entry:SetPoint("left", capture_author, "right", 2, 0) - --> version - local capture_version = DF:NewLabel (addframe, nil, "$parentVersionLabel", "versionLabel", Loc ["STRING_OPTIONS_CHART_ADDVERSION"]) + --version + local capture_version = DF:NewLabel(addframe, nil, "$parentVersionLabel", "versionLabel", Loc ["STRING_OPTIONS_CHART_ADDVERSION"]) local capture_version_entry = DF:NewTextEntry (addframe, nil, "$parentVersionEntry", "versionEntry", 160, 20, function() end, nil, nil, nil, nil, options_dropdown_template) - capture_version_entry:SetPoint ("left", capture_version, "right", 2, 0) + capture_version_entry:SetPoint("left", capture_version, "right", 2, 0) - --> open add panel button + --open add panel button local add = function() addframe:Show() sectionFrame.importEditor:ClearFocus() @@ -6650,20 +6650,20 @@ do end local addbutton = DF:NewButton (sectionFrame, nil, "$parentAddButton", "addbutton", 120, 20, add, nil, nil, nil, Loc ["STRING_OPTIONS_CHART_ADD"], nil, options_button_template) - addbutton:SetPoint ("bottomright", panel, "topright", -30, 0) + addbutton:SetPoint("bottomright", panel, "topright", -30, 0) addbutton:SetIcon ([[Interface\PaperDollInfoFrame\Character-Plus]], 12, 12, nil, nil, nil, 4) - --> open import panel button + --open import panel button local importframe = DF:NewSpecialLuaEditorEntry (sectionFrame, 683, 422, "importEditor", "$parentImportEditor", true) local font, size, flag = importframe.editbox:GetFont() importframe.editbox:SetFont (font, 9, flag) - importframe:SetPoint ("topleft", sectionFrame, "topleft", startX, startY - 70) + importframe:SetPoint("topleft", sectionFrame, "topleft", startX, startY - 70) importframe:SetFrameLevel (sectionFrame:GetFrameLevel()+6) - importframe:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1,tile = 1, tileSize = 16}) + importframe:SetBackdrop({bgFile = [[Interface\AddOns\Details\images\background]], edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1,tile = 1, tileSize = 16}) DF:ReskinSlider(importframe.scroll) - importframe:SetBackdropColor (0.5, 0.5, 0.5, 0.95) - importframe:SetBackdropBorderColor (0, 0, 0, 1) + importframe:SetBackdropColor(0.5, 0.5, 0.5, 0.95) + importframe:SetBackdropBorderColor(0, 0, 0, 1) importframe:Hide() local doimport = function() @@ -6675,10 +6675,10 @@ do if (dataTable) then local unserialize = dataTable - if (type (unserialize) == "table") then + if (type(unserialize) == "table") then if (unserialize[1] and unserialize[2] and unserialize[3] and unserialize[4] and unserialize[5]) then local register = _detalhes:TimeDataRegister (unpack (unserialize)) - if (type (register) == "string") then + if (type(register) == "string") then _detalhes:Msg (register) end else @@ -6698,8 +6698,8 @@ do local accept_import = DF:NewButton (importframe, nil, "$parentAccept", "acceptButton", 120, 20, doimport) accept_import:SetIcon ([[Interface\Buttons\UI-CheckBox-Check]]) - accept_import:SetPoint (10, 18) - accept_import:SetText (Loc ["STRING_OPTIONS_CHART_IMPORT"]) + accept_import:SetPoint(10, 18) + accept_import:SetText(Loc ["STRING_OPTIONS_CHART_IMPORT"]) accept_import:SetTemplate (options_button_template) local cancelimport = function() @@ -6709,13 +6709,13 @@ do local cancel_changes = DF:NewButton (importframe, nil, "$parentCancel", "CancelButton", 120, 20, cancelimport) cancel_changes:SetIcon ([[Interface\PetBattles\DeadPetIcon]]) - cancel_changes:SetText (Loc ["STRING_OPTIONS_CHART_CANCEL"]) - cancel_changes:SetPoint (132, 18) + cancel_changes:SetText(Loc ["STRING_OPTIONS_CHART_CANCEL"]) + cancel_changes:SetPoint(132, 18) cancel_changes:SetTemplate (options_button_template) local import = function() importframe:Show() - importframe:SetText ("") + importframe:SetText("") importframe:SetFocus (true) addframe:Hide() big_code_editor:ClearFocus() @@ -6728,14 +6728,14 @@ do end local importbutton = DF:NewButton (sectionFrame, nil, "$parentImportButton", "importbutton", 120, 20, import, nil, nil, nil, Loc ["STRING_OPTIONS_CHART_IMPORT"], nil, options_button_template) - importbutton:SetPoint ("right", addbutton, "left", -4, 0) + importbutton:SetPoint("right", addbutton, "left", -4, 0) importbutton:SetIcon ([[Interface\Buttons\UI-GuildButton-PublicNote-Up]], 14, 14, nil, nil, nil, 4) - --> close button + --close button local closebutton = DF:NewButton (addframe, nil, "$parentAddCloseButton", "addClosebutton", 120, 20, function() addframe:Hide() end, nil, nil, nil, Loc ["STRING_OPTIONS_CHART_CLOSE"], nil, options_button_template) --closebutton:InstallCustomTexture() - --> confirm add capture + --confirm add capture local addcapture = function() local name = capture_name_entry.text if (name == "") then @@ -6766,7 +6766,7 @@ do capture_name_entry.text = "" capture_author_entry.text = "" capture_version_entry.text = "" - capture_func_entry:SetText ("") + capture_func_entry:SetText("") addframe.iconButton:SetTexture([[Interface\ICONS\TEMP]]) if (DetailsIconPickFrame and DetailsIconPickFrame:IsShown()) then @@ -6778,13 +6778,13 @@ do local addcapturebutton = DF:NewButton (addframe, nil, "$parentAddCaptureButton", "addCapturebutton", 120, 21, addcapture, nil, nil, nil, Loc ["STRING_OPTIONS_CHART_ADD2"], nil, options_button_template) - --> anchors + --anchors local start = 25 - capture_name:SetPoint (start, startY) - capture_icon:SetPoint (start, -55) - capture_author:SetPoint (start, -80) - capture_version:SetPoint (start, -105) - capture_func:SetPoint (start, -130) + capture_name:SetPoint(start, startY) + capture_icon:SetPoint(start, -55) + capture_author:SetPoint(start, -80) + capture_version:SetPoint(start, -105) + capture_func:SetPoint(start, -130) addcapturebutton:SetIcon ([[Interface\Buttons\UI-CheckBox-Check]], 18, 18, nil, nil, nil, 4) closebutton:SetIcon ([[Interface\PetBattles\DeadPetIcon]], 14, 14, nil, nil, nil, 4) @@ -6792,13 +6792,13 @@ do addcapturebutton:SetTemplate (options_button_template) closebutton:SetTemplate (options_button_template) - addcapturebutton:SetPoint ("bottomright", addframe, "bottomright", -5, 5) - closebutton:SetPoint ("right", addcapturebutton, "left", -4, 0) + addcapturebutton:SetPoint("bottomright", addframe, "bottomright", -5, 5) + closebutton:SetPoint("right", addcapturebutton, "left", -4, 0) ---> anchors - titulo_datacharts:SetPoint (startX, startY) - titulo_datacharts_desc:SetPoint (startX, startY - 20) - panel:SetPoint (startX, startY - 70) +--anchors + titulo_datacharts:SetPoint(startX, startY) + titulo_datacharts_desc:SetPoint(startX, startY - 20) + panel:SetPoint(startX, startY - 70) local sectionOptions = { diff --git a/frames/window_plater.lua b/frames/window_plater.lua index 39e22355..0518a294 100644 --- a/frames/window_plater.lua +++ b/frames/window_plater.lua @@ -28,19 +28,19 @@ function Details.OpenPlaterIntegrationWindow() local f = DetailsPlaterIntegrationPanel or DF:CreateSimplePanel (UIParent, 700, 480, "Details! Plater Nameplates Integration", "DetailsPlaterIntegrationPanel") --background - f.bg1 = f:CreateTexture (nil, "background") - f.bg1:SetTexture ([[Interface\AddOns\Details\images\background]], true) + f.bg1 = f:CreateTexture(nil, "background") + f.bg1:SetTexture([[Interface\AddOns\Details\images\background]], true) f.bg1:SetAlpha (0.8) f.bg1:SetVertexColor (0.27, 0.27, 0.27) f.bg1:SetVertTile (true) f.bg1:SetHorizTile (true) - f.bg1:SetSize (790, 454) + f.bg1:SetSize(790, 454) f.bg1:SetAllPoints() - f:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) - f:SetBackdropColor (.5, .5, .5, .7) - f:SetBackdropBorderColor (0, 0, 0, 1) + f:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) + f:SetBackdropColor(.5, .5, .5, .7) + f:SetBackdropBorderColor(0, 0, 0, 1) - --> anchor text function + --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 t = {} @@ -63,7 +63,7 @@ function Details.OpenPlaterIntegrationWindow() {type = "label", get = function() return "Add Real Time DPS Info in the Nameplate:" end, text_template = DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")}, - --> real time dps from all sources + --real time dps from all sources { type = "toggle", get = function() return Details.plater.realtime_dps_enabled end, @@ -73,7 +73,7 @@ function Details.OpenPlaterIntegrationWindow() Details:RefreshPlaterIntegration() if (not value) then - Details:Msg ("a /reload might be needed to disable this setting.") + Details:Msg("a /reload might be needed to disable this setting.") else if (Plater) then Plater.RefreshDBUpvalues() @@ -83,7 +83,7 @@ function Details.OpenPlaterIntegrationWindow() name = "Show Real Time Dps", desc = "Show Real Time DPS on the nameplate.\n\nReal time DPS is how much damage has been inflicted to the unit in the last 5 seconds.", }, - --> text size + --text size { type = "range", get = function() return Details.plater.realtime_dps_size end, @@ -99,7 +99,7 @@ function Details.OpenPlaterIntegrationWindow() name = "Text Size", desc = "Text Size", }, - --> text color + --text color { type = "color", get = function() @@ -117,7 +117,7 @@ function Details.OpenPlaterIntegrationWindow() name = "Text Color", text_template = options_text_template, }, - --> text shadow + --text shadow { type = "toggle", get = function() return Details.plater.realtime_dps_shadow end, @@ -130,7 +130,7 @@ function Details.OpenPlaterIntegrationWindow() name = "Text Shadow", desc = "Text Shadow", }, - --> text anchor + --text anchor --anchor location { type = "select", @@ -175,7 +175,7 @@ function Details.OpenPlaterIntegrationWindow() {type = "breakline"}, {type = "label", get = function() return "Add Real Time DPS Info Only From You in the Nameplate:" end, text_template = DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")}, - --> real time dps from the player only + --real time dps from the player only { type = "toggle", get = function() return Details.plater.realtime_dps_player_enabled end, @@ -185,7 +185,7 @@ function Details.OpenPlaterIntegrationWindow() Details:RefreshPlaterIntegration() if (not value) then - Details:Msg ("a /reload might be needed to disable this setting.") + Details:Msg("a /reload might be needed to disable this setting.") else if (Plater) then Plater.RefreshDBUpvalues() @@ -195,7 +195,7 @@ function Details.OpenPlaterIntegrationWindow() name = "Show Real Time Dps (From You)", desc = "Show Real Time DPS you are currently applying in the unit.\n\nReal time DPS is how much damage has been inflicted to the unit in the last 5 seconds.", }, - --> text size + --text size { type = "range", get = function() return Details.plater.realtime_dps_player_size end, @@ -211,7 +211,7 @@ function Details.OpenPlaterIntegrationWindow() name = "Text Size", desc = "Text Size", }, - --> text color + --text color { type = "color", get = function() @@ -229,7 +229,7 @@ function Details.OpenPlaterIntegrationWindow() name = "Text Color", text_template = options_text_template, }, - --> text shadow + --text shadow { type = "toggle", get = function() return Details.plater.realtime_dps_player_shadow end, @@ -242,7 +242,7 @@ function Details.OpenPlaterIntegrationWindow() name = "Text Shadow", desc = "Text Shadow", }, - --> text anchor + --text anchor --anchor location { type = "select", @@ -287,7 +287,7 @@ function Details.OpenPlaterIntegrationWindow() {type = "breakline"}, {type = "label", get = function() return "Add Total Damage Taken in the Nameplate:" end, text_template = DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")}, - --> total damage taken from all sources + --total damage taken from all sources { type = "toggle", get = function() return Details.plater.damage_taken_enabled end, @@ -297,7 +297,7 @@ function Details.OpenPlaterIntegrationWindow() Details:RefreshPlaterIntegration() if (not value) then - Details:Msg ("a /reload might be needed to disable this setting.") + Details:Msg("a /reload might be needed to disable this setting.") else if (Plater) then Plater.RefreshDBUpvalues() @@ -307,7 +307,7 @@ function Details.OpenPlaterIntegrationWindow() name = "Show Total Damage Taken", desc = "Show the total damage taken by the unit", }, - --> text size + --text size { type = "range", get = function() return Details.plater.damage_taken_size end, @@ -323,7 +323,7 @@ function Details.OpenPlaterIntegrationWindow() name = "Text Size", desc = "Text Size", }, - --> text color + --text color { type = "color", get = function() @@ -341,7 +341,7 @@ function Details.OpenPlaterIntegrationWindow() name = "Text Color", text_template = options_text_template, }, - --> text shadow + --text shadow { type = "toggle", get = function() return Details.plater.damage_taken_shadow end, @@ -354,7 +354,7 @@ function Details.OpenPlaterIntegrationWindow() name = "Text Shadow", desc = "Text Shadow", }, - --> text anchor + --text anchor --anchor location { type = "select", @@ -403,46 +403,46 @@ function Details.OpenPlaterIntegrationWindow() local options_slider_template = DF:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE") local options_button_template = DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE") - local titleBackground = CreateFrame ("frame", nil, f,"BackdropTemplate") - titleBackground:SetPoint ("topleft", f, "topleft", 10, -30) - titleBackground:SetPoint ("topright", f, "topright", -10, -30) - titleBackground:SetHeight (80) + local titleBackground = CreateFrame("frame", nil, f,"BackdropTemplate") + titleBackground:SetPoint("topleft", f, "topleft", 10, -30) + titleBackground:SetPoint("topright", f, "topright", -10, -30) + titleBackground:SetHeight(80) --background - titleBackground.bg1 = titleBackground:CreateTexture (nil, "background") - titleBackground.bg1:SetTexture ([[Interface\AddOns\Details\images\background]]) + titleBackground.bg1 = titleBackground:CreateTexture(nil, "background") + titleBackground.bg1:SetTexture([[Interface\AddOns\Details\images\background]]) titleBackground.bg1:SetAlpha (0.8) titleBackground.bg1:SetVertexColor (0.27, 0.27, 0.27) titleBackground.bg1:SetVertTile (true) titleBackground.bg1:SetHorizTile (true) - titleBackground.bg1:SetSize (790, 454) + titleBackground.bg1:SetSize(790, 454) titleBackground.bg1:SetAllPoints() - titleBackground:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) - titleBackground:SetBackdropColor (.5, .5, .5, .7) - titleBackground:SetBackdropBorderColor (0, 0, 0, 1) + titleBackground:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) + titleBackground:SetBackdropColor(.5, .5, .5, .7) + titleBackground:SetBackdropBorderColor(0, 0, 0, 1) - local platerTitle = DF:CreateLabel (titleBackground, "Plater Nameplates Integration", 16, "white") - local platerDesc1 = DF:CreateLabel (titleBackground, "Add DPS and Damage information directly into the nameplate", 11, "silver") - local platerDesc2 = DF:CreateLabel (titleBackground, "See how much damage the enemy is taking in real time!", 11, "silver") + local platerTitle = DF:CreateLabel(titleBackground, "Plater Nameplates Integration", 16, "white") + local platerDesc1 = DF:CreateLabel(titleBackground, "Add DPS and Damage information directly into the nameplate", 11, "silver") + local platerDesc2 = DF:CreateLabel(titleBackground, "See how much damage the enemy is taking in real time!", 11, "silver") local platerImage = DF:CreateImage (titleBackground, "Interface\\AddOns\\Details\\images\\plater_image") - platerImage:SetSize (256, 64) + platerImage:SetSize(256, 64) - platerImage:SetPoint ("topright", f, "topright", -150, -35) - platerTitle:SetPoint (10, -15) - platerDesc1:SetPoint (10, -35) - platerDesc2:SetPoint (10, -47) + platerImage:SetPoint("topright", f, "topright", -150, -35) + platerTitle:SetPoint(10, -15) + platerDesc1:SetPoint(10, -35) + platerDesc2:SetPoint(10, -47) DF:BuildMenu (f, menu_table, 10, -140, 460, true, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template) if (not Plater) then - for _, widget in ipairs (f.widget_list) do + for _, widget in ipairs(f.widget_list) do if (widget.Disable) then widget:Disable() end end - local PlaterDisabled1 = DF:CreateLabel (f, "Plater isn't installed! you may download it from the Curseforge app.", 16, "red") - PlaterDisabled1:SetPoint (10, -330) + local PlaterDisabled1 = DF:CreateLabel(f, "Plater isn't installed! you may download it from the Curseforge app.", 16, "red") + PlaterDisabled1:SetPoint(10, -330) end end diff --git a/frames/window_playerbreakdown.lua b/frames/window_playerbreakdown.lua index 6712c563..38ee7995 100644 --- a/frames/window_playerbreakdown.lua +++ b/frames/window_playerbreakdown.lua @@ -117,7 +117,7 @@ function _detalhes:AbreJanelaInfo (jogador, from_att_change, refresh, ShiftKeyDo _detalhes:FechaJanelaInfo() return - elseif (_type (_detalhes.row_singleclick_overwrite [self.atributo][self.sub_atributo]) == "function") then + elseif (_type(_detalhes.row_singleclick_overwrite [self.atributo][self.sub_atributo]) == "function") then if (from_att_change) then _detalhes:FechaJanelaInfo() return @@ -130,9 +130,9 @@ function _detalhes:AbreJanelaInfo (jogador, from_att_change, refresh, ShiftKeyDo return end - --> _detalhes.info_jogador armazena o jogador que esta sendo mostrado na janela de detalhes + --_detalhes.info_jogador armazena o jogador que esta sendo mostrado na janela de detalhes if (info.jogador and info.jogador == jogador and self and info.atributo and self.atributo == info.atributo and self.sub_atributo == info.sub_atributo and not refresh) then - _detalhes:FechaJanelaInfo() --> se clicou na mesma barra ent�o fecha a janela de detalhes + _detalhes:FechaJanelaInfo() --se clicou na mesma barra ent�o fecha a janela de detalhes return elseif (not jogador) then _detalhes:FechaJanelaInfo() @@ -140,25 +140,25 @@ 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 - barra.icone:SetTexture ("") + 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. + --passar os par�metros para dentro da tabela da janela. - info.ativo = true --> sinaliza o addon que a janela esta aberta - info.atributo = self.atributo --> instancia.atributo -> grava o atributo (damage, heal, etc) - 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.ativo = true --sinaliza o addon que a janela esta aberta + info.atributo = self.atributo --instancia.atributo -> grava o atributo (damage, heal, etc) + 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" @@ -166,20 +166,20 @@ function _detalhes:AbreJanelaInfo (jogador, from_att_change, refresh, ShiftKeyDo 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??? + 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 + --removendo o nome da realm do jogador if (nome:find ("-")) then nome = nome:gsub (("-.*"), "") end - if (info.instancia.atributo == 1 and info.instancia.sub_atributo == 6) then --> enemy + if (info.instancia.atributo == 1 and info.instancia.sub_atributo == 6) then --enemy atributo_nome = sub_atributos [info.atributo].lista [1] .. " " .. Loc ["STRING_ACTORFRAME_REPORTOF"] end - info.nome:SetText (nome) - info.atributo_nome:SetText (atributo_nome) + info.nome:SetText(nome) + info.atributo_nome:SetText(atributo_nome) local serial = jogador.serial local avatar @@ -188,13 +188,13 @@ function _detalhes:AbreJanelaInfo (jogador, from_att_change, refresh, ShiftKeyDo end if (avatar and avatar [1]) then - info.nome:SetText ((not _detalhes.ignore_nicktag and avatar [1]) or nome) + info.nome:SetText((not _detalhes.ignore_nicktag and avatar [1]) or nome) end if (avatar and avatar [2]) then - info.avatar:SetTexture (avatar [2]) - info.avatar_bg:SetTexture (avatar [4]) + info.avatar:SetTexture(avatar [2]) + info.avatar_bg:SetTexture(avatar [4]) if (avatar [5]) then info.avatar_bg:SetTexCoord (unpack (avatar [5])) end @@ -202,10 +202,10 @@ function _detalhes:AbreJanelaInfo (jogador, from_att_change, refresh, ShiftKeyDo info.avatar_bg:SetVertexColor (unpack (avatar [6])) end - info.avatar_nick:SetText (avatar [1] or nome) - info.avatar_attribute:SetText (atributo_nome) + 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_attribute:SetPoint("CENTER", info.avatar_nick, "CENTER", 0, 14) info.avatar:Show() info.avatar_bg:Show() info.avatar_bg:SetAlpha (.65) @@ -225,7 +225,7 @@ function _detalhes:AbreJanelaInfo (jogador, from_att_change, refresh, ShiftKeyDo info.atributo_nome:Show() end - info.atributo_nome:SetPoint ("CENTER", info.nome, "CENTER", 0, 14) + info.atributo_nome:SetPoint("CENTER", info.nome, "CENTER", 0, 14) info.no_targets:Hide() info.no_targets.text:Hide() @@ -243,8 +243,8 @@ function _detalhes:AbreJanelaInfo (jogador, from_att_change, refresh, ShiftKeyDo classe = "monster" end - --info.classe_icone:SetTexture ("Interface\\AddOns\\Details\\images\\"..classe:lower()) --> top left - info.classe_icone:SetTexture ("Interface\\AddOns\\Details\\images\\classes") --> top left + --info.classe_icone:SetTexture("Interface\\AddOns\\Details\\images\\"..classe:lower()) --top left + info.classe_icone:SetTexture("Interface\\AddOns\\Details\\images\\classes") --top left info.SetClassIcon (jogador, classe) if (_detalhes.player_details_window.skin == "WoWClassic") then @@ -363,22 +363,22 @@ function gump:TrocaBackgroundInfo() info ["right_background" .. i]:Show() end - if (info.atributo == 1) then --> DANO + 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 ("") + 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.targets:SetText(Loc ["STRING_TARGETS"] .. " " .. Loc ["STRING_ATTRIBUTE_DAMAGE_DPS"] .. ":") info.target_persecond = true else - info.targets:SetText (Loc ["STRING_TARGETS"] .. ":") + info.targets:SetText(Loc ["STRING_TARGETS"] .. ":") end - elseif (info.sub_atributo == 3) then --> damage taken + elseif (info.sub_atributo == 3) then --damage taken - --info.bg1_sec_texture:SetTexture ([[Interface\AddOns\Details\images\info_window_damagetaken]]) + --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() @@ -388,7 +388,7 @@ function gump:TrocaBackgroundInfo() info ["right_background" .. i]:Hide() end - info.targets:SetText (Loc ["STRING_TARGETS"] .. ":") + info.targets:SetText(Loc ["STRING_TARGETS"] .. ":") info.no_targets:Show() info.no_targets.text:Show() @@ -396,8 +396,8 @@ function gump:TrocaBackgroundInfo() 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]]) + 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() @@ -407,14 +407,14 @@ function gump:TrocaBackgroundInfo() info ["right_background" .. i]:Hide() end - info.targets:SetText (Loc ["STRING_SPELLS"] .. ":") + 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]]) + 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() @@ -424,26 +424,26 @@ function gump:TrocaBackgroundInfo() info ["right_background" .. i]:Hide() end - info.targets:SetText (Loc ["STRING_DAMAGE_TAKEN_FROM"]) + 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 ("") + 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.targets:SetText(Loc ["STRING_OVERHEALED"] .. ":") info.target_member = "overheal" info.target_text = Loc ["STRING_OVERHEALED"] .. ":" elseif (info.sub_atributo == 2) then - info.targets:SetText (Loc ["STRING_TARGETS"] .. " " .. Loc ["STRING_ATTRIBUTE_HEAL_HPS"] .. ":") + info.targets:SetText(Loc ["STRING_TARGETS"] .. " " .. Loc ["STRING_ATTRIBUTE_HEAL_HPS"] .. ":") info.target_persecond = true else - info.targets:SetText (Loc ["STRING_TARGETS"] .. ":") + info.targets:SetText(Loc ["STRING_TARGETS"] .. ":") end - elseif (info.sub_atributo == 4) then --> Healing taken + elseif (info.sub_atributo == 4) then --Healing taken info.bg1_sec_texture:SetColorTexture (.05, .05, .05, .4) info.bg3_sec_texture:Show() info.bg2_sec_texture:Show() @@ -453,7 +453,7 @@ function gump:TrocaBackgroundInfo() info ["right_background" .. i]:Hide() end - info.targets:SetText (Loc ["STRING_TARGETS"] .. ":") + info.targets:SetText(Loc ["STRING_TARGETS"] .. ":") info.no_targets:Show() info.no_targets.text:Show() @@ -462,31 +462,31 @@ function gump:TrocaBackgroundInfo() info.report_direita:Show() end - elseif (info.atributo == 3) then --> REGEN - info.bg1_sec_texture:SetTexture ("") + elseif (info.atributo == 3) then --REGEN + info.bg1_sec_texture:SetTexture("") info.tipo = 2 - info.targets:SetText ("Vindo de:") + info.targets:SetText("Vindo de:") - elseif (info.atributo == 4) then --> MISC - info.bg1_sec_texture:SetTexture ("") + elseif (info.atributo == 4) then --MISC + info.bg1_sec_texture:SetTexture("") info.tipo = 2 - info.targets:SetText (Loc ["STRING_TARGETS"] .. ":") + info.targets:SetText(Loc ["STRING_TARGETS"] .. ":") end end ---> self � qualquer coisa que chamar esta fun��o +--self � qualquer coisa que chamar esta fun��o ------------------------------------------------------------------------------------------------------------------------------ -- � chamado pelo click no X e pelo reset do historico function _detalhes:FechaJanelaInfo (fromEscape) - if (info.ativo) then --> se a janela tiver aberta + if (info.ativo) then --se a janela tiver aberta --playerDetailWindow:Hide() if (fromEscape) then - Details.FadeHandler.Fader (info, "in") + Details.FadeHandler.Fader(info, "in") else - Details.FadeHandler.Fader (info, 1) + Details.FadeHandler.Fader(info, 1) end - info.ativo = false --> sinaliza o addon que a janela esta agora fechada + info.ativo = false --sinaliza o addon que a janela esta agora fechada --_detalhes.info_jogador.detalhes = nil info.jogador = nil @@ -494,14 +494,14 @@ function _detalhes:FechaJanelaInfo (fromEscape) info.sub_atributo = nil info.instancia = nil - info.nome:SetText ("") - info.atributo_nome:SetText ("") + 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 ---> esconde todas as barras das skills na janela de info +--esconde todas as barras das skills na janela de info ------------------------------------------------------------------------------------------------------------------------------ function gump:HidaAllBarrasInfo() local barras = _detalhes.playerDetailWindow.barras1 @@ -512,7 +512,7 @@ function gump:HidaAllBarrasInfo() end end ---> esconde todas as barras dos alvos do jogador +--esconde todas as barras dos alvos do jogador ------------------------------------------------------------------------------------------------------------------------------ function gump:HidaAllBarrasAlvo() local barras = _detalhes.playerDetailWindow.barras2 @@ -521,20 +521,20 @@ function gump:HidaAllBarrasAlvo() end end ---> esconde as 5 barras a direita na janela de info +--esconde as 5 barras a direita na janela de info ------------------------------------------------------------------------------------------------------------------------------ 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 ("") + _detalhes.playerDetailWindow.spell_icone:SetTexture("") end ---> seta os scripts da janela de informa��es +--seta os scripts da janela de informa��es local mouse_down_func = function(self, button) if (button == "LeftButton") then info:StartMoving() @@ -554,21 +554,21 @@ end ------------------------------------------------------------------------------------------------------------------------------ local function seta_scripts (este_gump) - --> Janela - este_gump:SetScript ("OnMouseDown", mouse_down_func) - este_gump:SetScript ("OnMouseUp", mouse_up_func) + --Janela + este_gump:SetScript("OnMouseDown", mouse_down_func) + este_gump:SetScript("OnMouseUp", mouse_up_func) - este_gump.container_barras.gump:SetScript ("OnMouseDown", mouse_down_func) - este_gump.container_barras.gump:SetScript ("OnMouseUp", mouse_up_func) + 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) + este_gump.container_detalhes:SetScript("OnMouseDown", mouse_down_func) + este_gump.container_detalhes:SetScript("OnMouseUp", mouse_up_func) - este_gump.container_alvos.gump:SetScript ("OnMouseDown", mouse_down_func) - este_gump.container_alvos.gump:SetScript ("OnMouseUp", mouse_up_func) + este_gump.container_alvos.gump:SetScript("OnMouseDown", mouse_down_func) + este_gump.container_alvos.gump:SetScript("OnMouseUp", mouse_up_func) - --> bot�o fechar - este_gump.close_button:SetScript ("OnClick", function(self) + --bot�o fechar + este_gump.close_button:SetScript("OnClick", function(self) _detalhes:FechaJanelaInfo() end) end @@ -578,35 +578,35 @@ end ------------------------------------------------------------------------------------------------------------------------------ function gump:HidaDetalheInfo (index) local info = _detalhes.playerDetailWindow.grupos_detalhes [index] - info.nome:SetText ("") - info.nome2:SetText ("") - info.dano:SetText ("") - info.dano_porcento:SetText ("") - info.dano_media:SetText ("") - info.dano_dps:SetText ("") + info.nome:SetText("") + info.nome2:SetText("") + info.dano:SetText("") + info.dano_porcento:SetText("") + info.dano_media:SetText("") + info.dano_dps:SetText("") info.bg:Hide() end ---> cria a barra de detalhes a direita da janela de informa��es +--cria a barra de detalhes a direita da janela de informa��es ------------------------------------------------------------------------------------------------------------------------------ local detalhe_infobg_onenter = function(self) - Details.FadeHandler.Fader (self.overlay, "OUT") - Details.FadeHandler.Fader (self.reportar, "OUT") + Details.FadeHandler.Fader(self.overlay, "OUT") + Details.FadeHandler.Fader(self.reportar, "OUT") end local detalhe_infobg_onleave = function(self) - Details.FadeHandler.Fader (self.overlay, "IN") - Details.FadeHandler.Fader (self.reportar, "IN") + Details.FadeHandler.Fader(self.overlay, "IN") + Details.FadeHandler.Fader(self.reportar, "IN") end local detalhes_inforeport_onenter = function(self) - Details.FadeHandler.Fader (self:GetParent().overlay, "OUT") - Details.FadeHandler.Fader (self, "OUT") + Details.FadeHandler.Fader(self:GetParent().overlay, "OUT") + Details.FadeHandler.Fader(self, "OUT") end local detalhes_inforeport_onleave = function(self) - Details.FadeHandler.Fader (self:GetParent().overlay, "IN") - Details.FadeHandler.Fader (self, "IN") + Details.FadeHandler.Fader(self:GetParent().overlay, "IN") + Details.FadeHandler.Fader(self, "IN") end function gump:CriaDetalheInfo (index) @@ -616,8 +616,8 @@ function gump:CriaDetalheInfo (index) 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.bg:SetValue(100) + info.bg:SetSize(320, 47) info.nome = info.bg:CreateFontString (nil, "OVERLAY", "GameFontNormal") info.nome2 = info.bg:CreateFontString (nil, "OVERLAY", "GameFontHighlightSmall") @@ -626,27 +626,27 @@ function gump:CriaDetalheInfo (index) 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.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.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) + info.bg:SetScript("OnEnter", detalhe_infobg_onenter) + info.bg:SetScript("OnLeave", detalhe_infobg_onleave) - info.bg.reportar:SetScript ("OnEnter", detalhes_inforeport_onenter) - info.bg.reportar:SetScript ("OnLeave", detalhes_inforeport_onleave) + info.bg.reportar:SetScript("OnEnter", detalhes_inforeport_onenter) + info.bg.reportar:SetScript("OnLeave", detalhes_inforeport_onleave) - info.bg_end = info.bg:CreateTexture ("DetailsPlayerDetailsWindow_DetalheInfoBG_bg_end" .. index, "BACKGROUND") - info.bg_end:SetHeight (47) - info.bg_end:SetTexture ("Interface\\AddOns\\Details\\images\\bar_detalhes2_end") + info.bg_end = info.bg:CreateTexture("DetailsPlayerDetailsWindow_DetalheInfoBG_bg_end" .. index, "BACKGROUND") + info.bg_end:SetHeight(47) + info.bg_end:SetTexture("Interface\\AddOns\\Details\\images\\bar_detalhes2_end") _detalhes.playerDetailWindow.grupos_detalhes [index] = info end @@ -668,7 +668,7 @@ function info:SetDetailInfoConfigs (texture, color, x, y) end end ---> determina qual a pocis�o que a barra de detalhes vai ocupar +--determina qual a pocis�o que a barra de detalhes vai ocupar ------------------------------------------------------------------------------------------------------------------------------ function gump:SetaDetalheInfoAltura (index, xmod, ymod) local info = _detalhes.playerDetailWindow.grupos_detalhes [index] @@ -686,77 +686,77 @@ function gump:SetaDetalheInfoAltura (index, xmod, ymod) 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) + _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) + _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) + _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) + _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) + _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) + _detalhes.playerDetailWindow.right_background6:SetPoint("topleft", _detalhes.playerDetailWindow, "topleft", 357 + (xmod or 0), y) background = _detalhes.playerDetailWindow.right_background6 end - background:SetHeight (75) + 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.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.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: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: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.overlay:SetWidth(background:GetWidth() + 24) + info.bg.overlay:SetHeight(background:GetHeight() + 16) info.bg:Hide() end ---> seta o conte�do da barra de detalhes +--seta o conte�do da barra de detalhes ------------------------------------------------------------------------------------------------------------------------------ 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) + if (_type(p) == "table") then + info.bg:SetValue(p.p) info.bg:SetStatusBarColor (p.c[1], p.c[2], p.c[3], p.c[4] or 1) else - info.bg:SetValue (p) + info.bg:SetValue(p) info.bg:SetStatusBarColor (1, 1, 1, .5) end info.bg_end:Show() - info.bg_end:SetPoint ("LEFT", info.bg, "LEFT", (info.bg:GetValue() * (info.bg:GetWidth( ) / 100)) - 3, 0) -- 2.19 + info.bg_end:SetPoint("LEFT", info.bg, "LEFT", (info.bg:GetValue() * (info.bg:GetWidth( ) / 100)) - 3, 0) -- 2.19 info.bg:Show() end @@ -764,32 +764,32 @@ function gump:SetaDetalheInfoTexto (index, p, arg1, arg2, arg3, arg4, arg5, arg6 info.bg.PetIcon:Hide() info.bg.PetText:Hide() info.bg.PetDps:Hide() - Details.FadeHandler.Fader (info.bg.overlay, "IN") + Details.FadeHandler.Fader(info.bg.overlay, "IN") info.IsPet = false end if (arg1) then - info.nome:SetText (arg1) + info.nome:SetText(arg1) end if (arg2) then - info.dano:SetText (arg2) + info.dano:SetText(arg2) end if (arg3) then - info.dano_porcento:SetText (arg3) + info.dano_porcento:SetText(arg3) end if (arg4) then - info.dano_media:SetText (arg4) + info.dano_media:SetText(arg4) end if (arg5) then - info.dano_dps:SetText (arg5) + info.dano_dps:SetText(arg5) end if (arg6) then - info.nome2:SetText (arg6) + info.nome2:SetText(arg6) end info.nome:Show() @@ -801,7 +801,7 @@ function gump:SetaDetalheInfoTexto (index, p, arg1, arg2, arg3, arg4, arg5, arg6 end ---> cria as 5 caixas de detalhes infos que ser�o usados +--cria as 5 caixas de detalhes infos que ser�o usados ------------------------------------------------------------------------------------------------------------------------------ local function cria_barras_detalhes() _detalhes.playerDetailWindow.grupos_detalhes = {} @@ -812,31 +812,31 @@ local function cria_barras_detalhes() end ---> cria os textos em geral da janela info +--cria os textos em geral da janela info ------------------------------------------------------------------------------------------------------------------------------ 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.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"] .. ":") + este_gump.targets:SetPoint("TOPLEFT", este_gump, "TOPLEFT", 24, -273) + este_gump.targets:SetText(Loc ["STRING_TARGETS"] .. ":") - este_gump.avatar = este_gump:CreateTexture (nil, "overlay") - este_gump.avatar_bg = este_gump:CreateTexture (nil, "overlay") + este_gump.avatar = este_gump:CreateTexture(nil, "overlay") + este_gump.avatar_bg = este_gump:CreateTexture(nil, "overlay") este_gump.avatar_attribute = este_gump:CreateFontString (nil, "overlay", "GameFontHighlightSmall") este_gump.avatar_nick = este_gump:CreateFontString (nil, "overlay", "QuestFont_Large") 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: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_nick:SetPoint("TOPLEFT", este_gump, "TOPLEFT", 195, -54) este_gump.avatar:Hide() este_gump.avatar_bg:Hide() @@ -845,25 +845,25 @@ local function cria_textos (este_gump, SWW) end ---> esquerdo superior +--esquerdo superior local function cria_container_barras (este_gump, SWW) local container_barras_window = _CreateFrame ("ScrollFrame", "Details_Info_ContainerBarrasScroll", SWW, "BackdropTemplate") local container_barras = _CreateFrame ("Frame", "Details_Info_ContainerBarras", container_barras_window, "BackdropTemplate") - container_barras:SetAllPoints (container_barras_window) - container_barras:SetWidth (300) - container_barras:SetHeight (150) + container_barras:SetAllPoints(container_barras_window) + container_barras:SetWidth(300) + 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: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:SetPoint("TOPLEFT", este_gump, "TOPLEFT", 21, -76) - container_barras_window:SetScript ("OnSizeChanged", function(self) - container_barras:SetSize (self:GetSize()) + container_barras_window:SetScript("OnSizeChanged", function(self) + container_barras:SetSize(self:GetSize()) end) gump:NewScrollBar (container_barras_window, container_barras, 6, -17) @@ -885,13 +885,13 @@ function gump:JI_AtualizaContainerBarras (amt) if (amt >= 9 and container.ultimo ~= amt) then local tamanho = (CONST_BAR_HEIGHT + 1) * amt - container.gump:SetHeight (tamanho) + 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) + container.gump:SetHeight(140) container.scroll_ativo = false container.ultimo = 0 end @@ -903,50 +903,50 @@ function gump:JI_AtualizaContainerAlvos (amt) if (amt >= 6 and container.ultimo ~= amt) then local tamanho = (CONST_TARGET_HEIGHT + 1) * amt - container.gump:SetHeight (tamanho) + 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) + container.gump:SetHeight(100) container.scroll_ativo = false container.ultimo = 0 end end ---> container direita +--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: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:SetResizable(false) container_detalhes:SetMovable (true) este_gump.container_detalhes = container_detalhes end ---> esquerdo inferior +--esquerdo inferior local function cria_container_alvos (este_gump, SWW) local container_alvos_window = _CreateFrame ("ScrollFrame", "Details_Info_ContainerAlvosScroll", SWW, "BackdropTemplate") local container_alvos = _CreateFrame ("Frame", "Details_Info_ContainerAlvos", container_alvos_window, "BackdropTemplate") - container_alvos:SetAllPoints (container_alvos_window) - container_alvos:SetWidth (300) - container_alvos:SetHeight (100) + container_alvos:SetAllPoints(container_alvos_window) + container_alvos:SetWidth(300) + 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: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:SetPoint("BOTTOMLEFT", este_gump, "BOTTOMLEFT", 20, 6) --56 default - container_alvos_window:SetScript ("OnSizeChanged", function(self) - container_alvos:SetSize (self:GetSize()) + container_alvos_window:SetScript("OnSizeChanged", function(self) + container_alvos:SetSize(self:GetSize()) end) gump:NewScrollBar (container_alvos_window, container_alvos, 7, 4) @@ -1051,7 +1051,7 @@ function _detalhes:ApplyPDWSkin (skin_name) end function _detalhes:SetPlayerDetailsWindowTexture (texture) - DetailsPlayerDetailsWindow.bg1:SetTexture (texture) + DetailsPlayerDetailsWindow.bg1:SetTexture(texture) end function _detalhes:SetPDWBarConfig (texture) @@ -1061,13 +1061,13 @@ function _detalhes:SetPDWBarConfig (texture) _detalhes.player_details_window.bar_texture = texture local texture = SharedMedia:Fetch ("statusbar", texture) - for _, bar in ipairs (window.barras1) do + for _, bar in ipairs(window.barras1) do bar.textura:SetStatusBarTexture (texture) end - for _, bar in ipairs (window.barras2) do + for _, bar in ipairs(window.barras2) do bar.textura:SetStatusBarTexture (texture) end - for _, bar in ipairs (window.barras3) do + for _, bar in ipairs(window.barras3) do bar.textura:SetStatusBarTexture (texture) end end @@ -1075,20 +1075,20 @@ end local default_skin = function() local window = DetailsPlayerDetailsWindow - window.bg1:SetTexture ([[Interface\AddOns\Details\images\info_window_background]]) - window.bg1:SetSize (1024, 512) + window.bg1:SetTexture([[Interface\AddOns\Details\images\info_window_background]]) + window.bg1:SetSize(1024, 512) window.bg1:SetAlpha (1) window.bg1:SetVertexColor (1, 1, 1) - window:SetBackdrop (nil) - window:SetBackdropColor (1, 1, 1, 1) - window:SetBackdropBorderColor (1, 1, 1, 1) + window:SetBackdrop(nil) + window:SetBackdropColor(1, 1, 1, 1) + 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) - window.leftbars2_backgound:SetPoint ("bottomright", window.container_alvos, "bottomright", 3, 0) + 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) + window.leftbars2_backgound:SetPoint("bottomright", window.container_alvos, "bottomright", 3, 0) window.leftbars1_backgound:SetAlpha (1) window.leftbars2_backgound:SetAlpha (1) window.right_background1:SetAlpha (1) @@ -1100,83 +1100,83 @@ local default_skin = function() 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: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: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.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.options_button:SetPoint("topright", window, "topright", -26, -16) + window.options_button:SetSize(16, 16) - window.avatar:SetParent (window) + window.avatar:SetParent(window) _detalhes:SetPDWBarConfig ("Skyline") --bar container - window.container_barras:SetSize (300, 145) - window.container_barras:SetPoint ("TOPLEFT", window, "TOPLEFT", 20, -76) + 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) + 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") + 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) + 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) + window.topleft_report:SetPoint("BOTTOMLEFT", window.container_barras, "TOPLEFT", 33, 3) --no targets texture - window.no_targets:SetPoint ("BOTTOMLEFT", window, "BOTTOMLEFT", 20, 6) - window.no_targets:SetSize (301, 100) + 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) - window.bg2_sec_texture:SetTexture ([[Interface\Glues\CREDITS\Warlords\Shadowmoon_Color_jlo3]]) + 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) + window.bg2_sec_texture:SetTexture([[Interface\Glues\CREDITS\Warlords\Shadowmoon_Color_jlo3]]) window.bg2_sec_texture:SetDesaturated (true) window.bg2_sec_texture:SetAlpha (0.3) - 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) + 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 + 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 + 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) + 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 @@ -1186,88 +1186,88 @@ local default_skin = function() 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) + 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 + for index, barra in ipairs(window.barras3) do 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) + 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 --scrollbar - window.container_barras.cima:SetNormalTexture ("Interface\\BUTTONS\\UI-ScrollBar-ScrollUpButton-Up") - window.container_barras.cima:SetPushedTexture ("Interface\\BUTTONS\\UI-ScrollBar-ScrollUpButton-Down") + window.container_barras.cima:SetNormalTexture("Interface\\BUTTONS\\UI-ScrollBar-ScrollUpButton-Up") + window.container_barras.cima:SetPushedTexture("Interface\\BUTTONS\\UI-ScrollBar-ScrollUpButton-Down") window.container_barras.cima:SetDisabledTexture ("Interface\\BUTTONS\\UI-ScrollBar-ScrollUpButton-Disabled") window.container_barras.cima:GetNormalTexture():ClearAllPoints() window.container_barras.cima:GetPushedTexture():ClearAllPoints() window.container_barras.cima:GetDisabledTexture():ClearAllPoints() - window.container_barras.cima:GetNormalTexture():SetPoint ("center", window.container_barras.cima, "center", 0, 0) - window.container_barras.cima:GetPushedTexture():SetPoint ("center", window.container_barras.cima, "center", 0, 0) - 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.cima:GetNormalTexture():SetPoint("center", window.container_barras.cima, "center", 0, 0) + window.container_barras.cima:GetPushedTexture():SetPoint("center", window.container_barras.cima, "center", 0, 0) + 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: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") window.container_barras.baixo:GetNormalTexture():ClearAllPoints() window.container_barras.baixo:GetPushedTexture():ClearAllPoints() window.container_barras.baixo:GetDisabledTexture():ClearAllPoints() - window.container_barras.baixo:GetNormalTexture():SetPoint ("center", window.container_barras.baixo, "center", 0, 0) - window.container_barras.baixo:GetPushedTexture():SetPoint ("center", window.container_barras.baixo, "center", 0, 0) - 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.baixo:GetNormalTexture():SetPoint("center", window.container_barras.baixo, "center", 0, 0) + window.container_barras.baixo:GetPushedTexture():SetPoint("center", window.container_barras.baixo, "center", 0, 0) + 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:SetBackdrop(nil) window.container_barras.slider:Altura (117) window.container_barras.slider:cimaPoint (0, 1) window.container_barras.slider:baixoPoint (0, -3) - window.container_barras.slider.thumb:SetTexture ("Interface\\Buttons\\UI-ScrollBar-Knob") + window.container_barras.slider.thumb:SetTexture("Interface\\Buttons\\UI-ScrollBar-Knob") window.container_barras.slider.thumb:SetTexCoord (0, 1, 0, 1) - window.container_barras.slider.thumb:SetSize (29, 30) + 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") + window.container_alvos.cima:SetNormalTexture("Interface\\BUTTONS\\UI-ScrollBar-ScrollUpButton-Up") + window.container_alvos.cima:SetPushedTexture("Interface\\BUTTONS\\UI-ScrollBar-ScrollUpButton-Down") window.container_alvos.cima:SetDisabledTexture ("Interface\\BUTTONS\\UI-ScrollBar-ScrollUpButton-Disabled") window.container_alvos.cima:GetNormalTexture():ClearAllPoints() window.container_alvos.cima:GetPushedTexture():ClearAllPoints() window.container_alvos.cima:GetDisabledTexture():ClearAllPoints() - window.container_alvos.cima:GetNormalTexture():SetPoint ("center", window.container_alvos.cima, "center", 0, 0) - window.container_alvos.cima:GetPushedTexture():SetPoint ("center", window.container_alvos.cima, "center", 0, 0) - 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.cima:GetNormalTexture():SetPoint("center", window.container_alvos.cima, "center", 0, 0) + window.container_alvos.cima:GetPushedTexture():SetPoint("center", window.container_alvos.cima, "center", 0, 0) + 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: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") window.container_alvos.baixo:GetNormalTexture():ClearAllPoints() window.container_alvos.baixo:GetPushedTexture():ClearAllPoints() window.container_alvos.baixo:GetDisabledTexture():ClearAllPoints() - window.container_alvos.baixo:GetNormalTexture():SetPoint ("center", window.container_alvos.baixo, "center", 0, 0) - window.container_alvos.baixo:GetPushedTexture():SetPoint ("center", window.container_alvos.baixo, "center", 0, 0) - window.container_alvos.baixo:GetDisabledTexture():SetPoint ("center", window.container_alvos.baixo, "center", 0, 0) - window.container_alvos.baixo:SetSize (29, 32) - window.container_alvos.baixo:SetBackdrop (nil) + window.container_alvos.baixo:GetNormalTexture():SetPoint("center", window.container_alvos.baixo, "center", 0, 0) + window.container_alvos.baixo:GetPushedTexture():SetPoint("center", window.container_alvos.baixo, "center", 0, 0) + window.container_alvos.baixo:GetDisabledTexture():SetPoint("center", window.container_alvos.baixo, "center", 0, 0) + window.container_alvos.baixo:SetSize(29, 32) + window.container_alvos.baixo:SetBackdrop(nil) - window.container_alvos.slider:SetBackdrop (nil) + window.container_alvos.slider:SetBackdrop(nil) window.container_alvos.slider:Altura (88) window.container_alvos.slider:cimaPoint (0, 1) window.container_alvos.slider:baixoPoint (0, -3) - window.container_alvos.slider.thumb:SetTexture ("Interface\\Buttons\\UI-ScrollBar-Knob") + window.container_alvos.slider.thumb:SetTexture("Interface\\Buttons\\UI-ScrollBar-Knob") window.container_alvos.slider.thumb:SetTexCoord (0, 1, 0, 1) - window.container_alvos.slider.thumb:SetSize (29, 30) + window.container_alvos.slider.thumb:SetSize(29, 30) window.container_alvos.slider.thumb:SetVertexColor (1, 1, 1, 1) end @@ -1275,24 +1275,24 @@ _detalhes:InstallPDWSkin ("WoWClassic", {func = default_skin, author = "Details! local elvui_skin = function() local window = DetailsPlayerDetailsWindow - window.bg1:SetTexture ([[Interface\AddOns\Details\images\background]], true) + window.bg1:SetTexture([[Interface\AddOns\Details\images\background]], true) window.bg1:SetAlpha (0.7) window.bg1:SetVertexColor (0.27, 0.27, 0.27) window.bg1:SetVertTile (true) window.bg1:SetHorizTile (true) - window.bg1:SetSize (PLAYER_DETAILS_WINDOW_WIDTH, PLAYER_DETAILS_WINDOW_HEIGHT) + 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: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: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) @@ -1307,23 +1307,23 @@ local elvui_skin = function() local titlebar = window.extra_frames ["ElvUITitleBar"] if (not titlebar) then - titlebar = CreateFrame ("frame", nil, window, "BackdropTemplate") - titlebar:SetPoint ("topleft", window, "topleft", 2, -3) - titlebar:SetPoint ("topright", window, "topright", -2, -3) - titlebar:SetHeight (20) - titlebar:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) - titlebar:SetBackdropColor (.5, .5, .5, 1) - titlebar:SetBackdropBorderColor (0, 0, 0, 1) + titlebar = CreateFrame("frame", nil, window, "BackdropTemplate") + titlebar:SetPoint("topleft", window, "topleft", 2, -3) + titlebar:SetPoint("topright", window, "topright", -2, -3) + titlebar:SetHeight(20) + titlebar:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) + titlebar:SetBackdropColor(.5, .5, .5, 1) + titlebar:SetBackdropBorderColor(0, 0, 0, 1) window.extra_frames ["ElvUITitleBar"] = titlebar - local name_bg_texture = window:CreateTexture (nil, "background") - name_bg_texture:SetTexture ([[Interface\PetBattles\_PetBattleHorizTile]], true) + local name_bg_texture = window:CreateTexture(nil, "background") + name_bg_texture:SetTexture([[Interface\PetBattles\_PetBattleHorizTile]], true) name_bg_texture:SetHorizTile (true) name_bg_texture:SetTexCoord (0, 1, 126/256, 19/256) - name_bg_texture:SetPoint ("topleft", window, "topleft", 2, -22) - --name_bg_texture:SetPoint ("topright", window, "topright", -2, -22) - name_bg_texture:SetPoint ("bottomright", window, "bottomright") - name_bg_texture:SetHeight (54) + name_bg_texture:SetPoint("topleft", window, "topleft", 2, -22) + --name_bg_texture:SetPoint("topright", window, "topright", -2, -22) + name_bg_texture:SetPoint("bottomright", window, "bottomright") + name_bg_texture:SetHeight(54) name_bg_texture:SetVertexColor (0, 0, 0, 0.2) window.extra_frames ["ElvUINameTexture"] = name_bg_texture else @@ -1332,81 +1332,81 @@ local elvui_skin = function() 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: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: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: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.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.options_button:SetPoint("topright", window, "topright", -17, -7) + window.options_button:SetSize(12, 12) - window.avatar:SetParent (titlebar) + window.avatar:SetParent(titlebar) --bar container - window.container_barras:SetPoint (unpack (containerSettings.spells.point)) - window.container_barras:SetSize (containerSettings.spells.width, containerSettings.spells.height) + 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) + 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) + 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) + window.topleft_report:SetPoint("BOTTOMLEFT", window.container_barras, "TOPLEFT", 43, 2) --icons - window.apoio_icone_direito:SetBlendMode ("ADD") - window.apoio_icone_esquerdo:SetBlendMode ("ADD") + 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: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: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: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) --the 5 spell details blocks - not working - for i, infoblock in ipairs (_detalhes.playerDetailWindow.grupos_detalhes) do - infoblock.bg:SetSize (330, 47) + 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]) + 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 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) - window.bg1_sec_texture:SetWidth (337) - window.bg1_sec_texture:SetHeight (362) + window.bg1_sec_texture:SetPoint("topleft", window.bg1, "topleft", 446, -86) + window.bg1_sec_texture:SetWidth(337) + window.bg1_sec_texture:SetHeight(362) --container 3 bars local x_start = 56 @@ -1418,20 +1418,20 @@ local elvui_skin = function() 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", 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) + --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 + for index, barra in ipairs(window.barras3) do local y = (index-1) * 17 y = y*-1 - barra:SetPoint ("LEFT", janela, "LEFT", x_start, 0) - barra:SetPoint ("RIGHT", janela, "RIGHT", 62, 0) - barra:SetPoint ("TOP", janela, "TOP", 0, y+y_start) + 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 --scrollbar @@ -1442,23 +1442,23 @@ local elvui_skin = function() 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: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) + 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) - window.container_barras.cima:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]]}) - window.container_barras.cima:SetBackdropColor (0, 0, 0, 0.3) - window.container_barras.cima:SetBackdropBorderColor (0, 0, 0, 1) + window.container_barras.cima:SetSize(16, 16) + window.container_barras.cima:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]]}) + window.container_barras.cima:SetBackdropColor(0, 0, 0, 0.3) + window.container_barras.cima:SetBackdropBorderColor(0, 0, 0, 1) end do @@ -1468,38 +1468,38 @@ local elvui_skin = function() 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: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) + 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) + 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: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) - window.container_barras.baixo:SetBackdropBorderColor (0, 0, 0, 1) + 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) + window.container_barras.baixo:SetBackdropBorderColor(0, 0, 0, 1) end - 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: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: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:SetSize(12, 12) window.container_barras.slider.thumb:SetVertexColor (0.6, 0.6, 0.6, 0.95) -- @@ -1514,23 +1514,23 @@ local elvui_skin = function() 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: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) + 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) - f.cima:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]]}) - f.cima:SetBackdropColor (0, 0, 0, 0.3) - f.cima:SetBackdropBorderColor (0, 0, 0, 1) + f.cima:SetSize(16, 16) + f.cima:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]]}) + f.cima:SetBackdropColor(0, 0, 0, 0.3) + f.cima:SetBackdropBorderColor(0, 0, 0, 1) end do @@ -1542,38 +1542,38 @@ local elvui_skin = function() 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: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) + 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) + 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: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) - f.baixo:SetBackdropBorderColor (0, 0, 0, 1) + 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) + f.baixo:SetBackdropBorderColor(0, 0, 0, 1) end - 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: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: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:SetSize(12, 12) window.container_alvos.slider.thumb:SetVertexColor (0.6, 0.6, 0.6, 0.95) --class icon @@ -1583,19 +1583,19 @@ local elvui_skin = function() 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:SetTexture([[Interface\AddOns\Details\images\spec_icons_normal_alpha]]) window.classe_icone:SetTexCoord (_unpack (_detalhes.class_specs_coords [player.spec])) --esta_barra.icone_classe:SetVertexColor (1, 1, 1) else local coords = CLASS_ICON_TCOORDS [class] if (coords) then - info.classe_icone:SetTexture ([[Interface\Glues\CHARACTERCREATE\UI-CHARACTERCREATE-CLASSES]]) + info.classe_icone:SetTexture([[Interface\Glues\CHARACTERCREATE\UI-CHARACTERCREATE-CLASSES]]) 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:SetTexture("Interface\\AddOns\\Details\\images\\classes") info.classe_icone:SetTexCoord (c[1], c[2], c[3], c[4]) end end @@ -1603,10 +1603,10 @@ local elvui_skin = function() end _detalhes:InstallPDWSkin ("ElvUI", {func = elvui_skin, author = "Details! Team", version = "v1.0", desc = "Skin compatible with ElvUI addon."}) ---> search key: ~create ~inicio ~start +--search key: ~create ~inicio ~start function gump:CriaJanelaInfo() - --> cria a janela em si + --cria a janela em si local este_gump = info este_gump.Loaded = true @@ -1615,139 +1615,139 @@ function gump:CriaJanelaInfo() este_gump.extra_frames = {} - --> fehcar com o esc + --fehcar com o esc tinsert (UISpecialFrames, este_gump:GetName()) - --> propriedades da janela - este_gump:SetPoint ("CENTER", UIParent) + --propriedades da janela + este_gump:SetPoint("CENTER", UIParent) - este_gump:SetWidth (PLAYER_DETAILS_WINDOW_WIDTH) - este_gump:SetHeight (PLAYER_DETAILS_WINDOW_HEIGHT) + este_gump:SetWidth(PLAYER_DETAILS_WINDOW_WIDTH) + este_gump:SetHeight(PLAYER_DETAILS_WINDOW_HEIGHT) este_gump:EnableMouse (true) - este_gump:SetResizable (false) + este_gump:SetResizable(false) este_gump:SetMovable (true) - este_gump.SummaryWindowWidgets = CreateFrame ("frame", "DetailsPlayerDetailsWindowSummaryWidgets", este_gump, "BackdropTemplate") + este_gump.SummaryWindowWidgets = CreateFrame("frame", "DetailsPlayerDetailsWindowSummaryWidgets", este_gump, "BackdropTemplate") 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) + este_gump:SetScale(Details.player_details_window.scale) --classic: - --este_gump:SetWidth (590) - --este_gump:SetHeight (354) + --este_gump:SetWidth(590) + --este_gump:SetHeight(354) - --> joga a janela para a global + --joga a janela para a global _detalhes.playerDetailWindow = este_gump - --> icone da classe no canto esquerdo superior - este_gump.classe_icone = este_gump:CreateTexture (nil, "BACKGROUND") - este_gump.classe_icone:SetPoint ("TOPLEFT", este_gump, "TOPLEFT", 4, 0) - este_gump.classe_icone:SetWidth (64) - este_gump.classe_icone:SetHeight (64) + --icone da classe no canto esquerdo superior + este_gump.classe_icone = este_gump:CreateTexture(nil, "BACKGROUND") + este_gump.classe_icone:SetPoint("TOPLEFT", este_gump, "TOPLEFT", 4, 0) + este_gump.classe_icone:SetWidth(64) + este_gump.classe_icone:SetHeight(64) este_gump.classe_icone:SetDrawLayer ("BACKGROUND", 1) - --> complemento do icone - este_gump.classe_iconePlus = este_gump:CreateTexture (nil, "BACKGROUND") - este_gump.classe_iconePlus:SetPoint ("TOPLEFT", este_gump, "TOPLEFT", 4, 0) - este_gump.classe_iconePlus:SetWidth (64) - este_gump.classe_iconePlus:SetHeight (64) + --complemento do icone + este_gump.classe_iconePlus = este_gump:CreateTexture(nil, "BACKGROUND") + este_gump.classe_iconePlus:SetPoint("TOPLEFT", este_gump, "TOPLEFT", 4, 0) + 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) + --top left + este_gump.bg1 = este_gump:CreateTexture("DetailsPSWBackground", "BORDER") + este_gump.bg1:SetPoint("TOPLEFT", este_gump, "TOPLEFT", 0, 0) este_gump.bg1:SetDrawLayer ("BORDER", 1) - --> bot�o de fechar + --bot�o de fechar este_gump.close_button = _CreateFrame ("Button", nil, este_gump, "UIPanelCloseButton") - este_gump.close_button:SetWidth (32) - 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:SetWidth(32) + 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) - --> �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") + --�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 = 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 + --bot�o de op��es local open_options = function() _detalhes:OpenOptionsWindow (info.instancia, false, 6) _detalhes:OpenOptionsWindow (info.instancia, false, 6) end este_gump.options_button = gump:CreateButton (este_gump, open_options, 16, 16, nil, nil, nil, [[Interface\Buttons\UI-OptionsButton]]) - este_gump.options_button:SetPoint ("topright", este_gump, "topright", -26, -16) + este_gump.options_button:SetPoint("topright", este_gump, "topright", -26, -16) 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 + --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) + --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) - este_gump.spell_icone:SetHeight (34) + 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) + este_gump.spell_icone:SetHeight(34) 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") + --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: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.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") + este_gump.topright_text1:SetPoint("bottomright", este_gump, "topright", -18 - (94 * (1-1)), -36) + este_gump.topright_text1:SetJustifyH("right") _detalhes.gump:SetFontSize (este_gump.topright_text1, 10) 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:SetPoint("bottomright", este_gump, "topright", -18 - (94 * (1-1)), -48) + 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) + este_gump.topright_text1:SetText(text1) else - este_gump.topright_text1:SetText ("") + este_gump.topright_text1:SetText("") end if (text2) then - este_gump.topright_text2:SetText (text2) + este_gump.topright_text2:SetText(text2) else - este_gump.topright_text2:SetText ("") + este_gump.topright_text2:SetText("") end if (size and type (size) == "number") then @@ -1755,8 +1755,8 @@ function gump:CriaJanelaInfo() _detalhes.gump:SetFontSize (este_gump.topright_text2, size) end if (color) then - _detalhes.gump:SetFontColor (este_gump.topright_text1, color) - _detalhes.gump:SetFontColor (este_gump.topright_text2, color) + _detalhes.gump:SetFontColor(este_gump.topright_text1, color) + _detalhes.gump:SetFontColor(este_gump.topright_text2, color) end if (font) then _detalhes.gump:SetFontFace (este_gump.topright_text1, font) @@ -1773,136 +1773,136 @@ function gump:CriaJanelaInfo() 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") + local right_background1 = CreateFrame("frame", "DetailsPlayerDetailsWindow_right_background" .. i, SWW, "BackdropTemplate") right_background1:EnableMouse (false) - right_background1:SetPoint ("topleft", este_gump, "topleft", right_background_X, right_background_Y [i]) - right_background1:SetSize (220, 43) + right_background1:SetPoint("topleft", este_gump, "topleft", right_background_X, right_background_Y [i]) + right_background1:SetSize(220, 43) Details.gump:ApplyStandardBackdrop (right_background1) este_gump ["right_background" .. i] = right_background1 end -- fundos especiais de friendly fire e outros - este_gump.bg1_sec_texture = SWW:CreateTexture ("DetailsPlayerDetailsWindow_BG1_SEC_Texture", "BORDER") + este_gump.bg1_sec_texture = SWW:CreateTexture("DetailsPlayerDetailsWindow_BG1_SEC_Texture", "BORDER") este_gump.bg1_sec_texture:SetDrawLayer ("BORDER", 4) - 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.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 = 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) - este_gump.bg2_sec_texture:SetPoint ("bottomright", este_gump.bg1_sec_texture, "bottomright", -30, 0) - este_gump.bg2_sec_texture:SetTexture ([[Interface\Glues\CREDITS\Warlords\Shadowmoon_Color_jlo3]]) + este_gump.bg2_sec_texture:SetPoint("topleft", este_gump.bg1_sec_texture, "topleft", 8, 0) + este_gump.bg2_sec_texture:SetPoint("bottomright", este_gump.bg1_sec_texture, "bottomright", -30, 0) + este_gump.bg2_sec_texture:SetTexture([[Interface\Glues\CREDITS\Warlords\Shadowmoon_Color_jlo3]]) este_gump.bg2_sec_texture:SetDesaturated (true) este_gump.bg2_sec_texture:SetAlpha (0.3) este_gump.bg2_sec_texture:Hide() - este_gump.bg3_sec_texture = SWW:CreateTexture ("DetailsPlayerDetailsWindow_BG3_SEC_Texture", "BORDER") + este_gump.bg3_sec_texture = SWW:CreateTexture("DetailsPlayerDetailsWindow_BG3_SEC_Texture", "BORDER") este_gump.bg3_sec_texture:SetDrawLayer ("BORDER", 2) - este_gump.bg3_sec_texture:SetPoint ("topleft", este_gump.bg2_sec_texture, "topleft", 0, 0) - este_gump.bg3_sec_texture:SetPoint ("bottomright", este_gump.bg2_sec_texture, "bottomright", 0, 0) + este_gump.bg3_sec_texture:SetPoint("topleft", este_gump.bg2_sec_texture, "topleft", 0, 0) + 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) - este_gump.no_targets:SetTexture ([[Interface\QUESTFRAME\UI-QUESTLOG-EMPTY-TOPLEFT]]) + 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) + este_gump.no_targets:SetTexture([[Interface\QUESTFRAME\UI-QUESTLOG-EMPTY-TOPLEFT]]) este_gump.no_targets:SetTexCoord (0.015625, 1, 0.01171875, 0.390625) este_gump.no_targets:SetDesaturated (true) este_gump.no_targets:SetAlpha (.7) este_gump.no_targets.text = SWW:CreateFontString (nil, "overlay", "GameFontNormal") - este_gump.no_targets.text:SetPoint ("center", este_gump.no_targets, "center") - este_gump.no_targets.text:SetText (Loc ["STRING_NO_TARGET_BOX"]) + este_gump.no_targets.text:SetPoint("center", este_gump.no_targets, "center") + este_gump.no_targets.text:SetText(Loc ["STRING_NO_TARGET_BOX"]) este_gump.no_targets.text:SetTextColor (1, 1, 1, .4) este_gump.no_targets:Hide() - --> cria os textos da janela + --cria os textos da janela cria_textos (este_gump, SWW) - --> cria o frama que vai abrigar as barras das habilidades + --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 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 o container onde vai abrigar os alvos do jogador cria_container_alvos (este_gump, SWW) --- local leftbars1_backgound = SWW:CreateTexture (nil, "background") --- leftbars1_backgound:SetTexture ([[Interface\DialogFrame\UI-DialogBox-Background-Dark]]) --- leftbars1_backgound:SetSize (303, 149) +-- local leftbars1_backgound = SWW:CreateTexture(nil, "background") +-- leftbars1_backgound:SetTexture([[Interface\DialogFrame\UI-DialogBox-Background-Dark]]) +-- 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") + local leftbars1_backgound = CreateFrame("frame", "DetailsPlayerDetailsWindow_Left_SpellsBackground", SWW, "BackdropTemplate") leftbars1_backgound:EnableMouse (false) - leftbars1_backgound:SetSize (303, 149) + leftbars1_backgound:SetSize(303, 149) leftbars1_backgound:SetAlpha (alpha_bgs) 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") + local leftbars2_backgound = CreateFrame("frame", "DetailsPlayerDetailsWindow_Left_TargetBackground", SWW, "BackdropTemplate") leftbars2_backgound:EnableMouse (false) - leftbars2_backgound:SetSize (303, 122) + leftbars2_backgound:SetSize(303, 122) leftbars2_backgound:SetAlpha (alpha_bgs) 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) - leftbars2_backgound:SetPoint ("bottomright", este_gump.container_alvos, "bottomright", 3, 0) + 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) + leftbars2_backgound:SetPoint("bottomright", este_gump.container_alvos, "bottomright", 3, 0) - --> cria as 5 barras de detalhes a direita da janela + --cria as 5 barras de detalhes a direita da janela cria_barras_detalhes() - --> seta os scripts dos frames da janela + --seta os scripts dos frames da janela seta_scripts (este_gump) - --> vai armazenar os objetos das barras de habilidade + --vai armazenar os objetos das barras de habilidade este_gump.barras1 = {} - --> vai armazenar os objetos das barras de alvos + --vai armazenar os objetos das barras de alvos este_gump.barras2 = {} - --> vai armazenar os objetos das barras da caixa especial da direita + --vai armazenar os objetos das barras da caixa especial da direita este_gump.barras3 = {} este_gump.SetClassIcon = default_icon_change - --> bot�o de reportar da caixa da esquerda, onde fica as barras principais + --bot�o de reportar da caixa da esquerda, onde fica as barras principais este_gump.report_esquerda = gump:NewDetailsButton (SWW, este_gump, nil, _detalhes.Reportar, este_gump, 1, 16, 16, "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", nil, "DetailsJanelaInfoReport2") - --este_gump.report_esquerda:SetPoint ("BOTTOMLEFT", este_gump.container_barras, "TOPLEFT", 281, 3) - este_gump.report_esquerda:SetPoint ("BOTTOMLEFT", este_gump.container_barras, "TOPLEFT", 33, 3) + --este_gump.report_esquerda:SetPoint("BOTTOMLEFT", este_gump.container_barras, "TOPLEFT", 281, 3) + 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 + --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") - este_gump.report_alvos:SetPoint ("BOTTOMRIGHT", este_gump.container_alvos, "TOPRIGHT", -2, -1) - este_gump.report_alvos:SetFrameLevel (3) --> solved inactive problem + este_gump.report_alvos:SetPoint("BOTTOMRIGHT", este_gump.container_alvos, "TOPRIGHT", -2, -1) + este_gump.report_alvos:SetFrameLevel (3) --solved inactive problem - --> bot�o de reportar da caixa da direita, onde est�o os 5 quadrados + --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") - statusBar:SetPoint ("bottomright", este_gump, "bottomright") - statusBar:SetHeight (PLAYER_DETAILS_STATUSBAR_HEIGHT) + --statusbar + local statusBar = CreateFrame("frame", nil, este_gump, "BackdropTemplate") + statusBar:SetPoint("bottomleft", este_gump, "bottomleft") + statusBar:SetPoint("bottomright", este_gump, "bottomright") + 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) + statusBar.Text = DetailsFramework:CreateLabel(statusBar) + statusBar.Text:SetPoint("left", 2, 0) function este_gump:SetStatusbarText (text, fontSize, fontColor) if (not text) then @@ -1917,17 +1917,17 @@ function gump:CriaJanelaInfo() --set default text este_gump:SetStatusbarText() - --> apply default skin + --apply default skin _detalhes:ApplyPDWSkin() -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> tabs +--tabs local red = "FFFFAAAA" local green = "FFAAFFAA" - --> tabs: - --> tab default + --tabs: + --tab default local iconTableSummary = { texture = [[Interface\AddOns\Details\images\icons]], @@ -1946,7 +1946,7 @@ function gump:CriaJanelaInfo() end, nil, --[4] fill function function() --[5] onclick - for _, tab in _ipairs (Details:GetBreakdownTabsInUse()) do + for _, tab in _ipairs(Details:GetBreakdownTabsInUse()) do tab.frame:Hide() end end, @@ -1954,279 +1954,279 @@ function gump:CriaJanelaInfo() iconTableSummary --[7] icon table ) - --> search key: ~avoidance --> begining of avoidance tab + --search key: ~avoidance --begining of avoidance tab local avoidance_create = function(tab, frame) - --> Percent Desc + --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: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 + --SUMMARY - local summaryBox = CreateFrame ("frame", nil, frame, "BackdropTemplate") + local summaryBox = CreateFrame("frame", nil, frame, "BackdropTemplate") _detalhes.gump:ApplyStandardBackdrop (summaryBox) - summaryBox:SetPoint ("topleft", frame, "topleft", 10, -15) - summaryBox:SetSize (200, 160) + 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) + 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) - damagereceived:SetText ("Total Damage Taken:") --> localize-me + damagereceived:SetPoint("topleft", summaryBox, "topleft", 15, y) + damagereceived:SetText("Total Damage Taken:") --localize-me damagereceived:SetTextColor (.8, .8, .8, 1) local damagereceived_amt = summaryBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") - damagereceived_amt:SetPoint ("left", damagereceived, "right", 2, 0) - damagereceived_amt:SetText ("0") + 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 + 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") + damagepersecond_amt:SetPoint("left", damagepersecond, "right", 2, 0) + damagepersecond_amt:SetText("0") tab.damagepersecond = damagepersecond_amt 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: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") + 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 + 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") + absorbstotalpersecond_amt:SetPoint("left", absorbstotalpersecond, "right", 2, 0) + absorbstotalpersecond_amt:SetText("0") tab.absorbstotalpersecond = absorbstotalpersecond_amt - --> MELEE + --MELEE y = -5 - local meleeBox = CreateFrame ("frame", nil, frame, "BackdropTemplate") + local meleeBox = CreateFrame("frame", nil, frame, "BackdropTemplate") _detalhes.gump:ApplyStandardBackdrop (meleeBox) - meleeBox:SetPoint ("topleft", summaryBox, "bottomleft", 0, -5) - meleeBox:SetSize (200, 160) + meleeBox:SetPoint("topleft", summaryBox, "bottomleft", 0, -5) + meleeBox:SetSize(200, 160) local melee_text = meleeBox:CreateFontString (nil, "artwork", "GameFontNormal") - melee_text:SetText ("Melee") - melee_text :SetPoint ("topleft", meleeBox, "topleft", 5, y) + 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) - dodge:SetText ("Dodge:") --> localize-me + dodge:SetPoint("topleft", meleeBox, "topleft", 15, y) + dodge:SetText("Dodge:") --localize-me dodge:SetTextColor (.8, .8, .8, 1) local dodge_amt = meleeBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") - dodge_amt:SetPoint ("left", dodge, "right", 2, 0) - dodge_amt:SetText ("0") + 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 + 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") + 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) - parry:SetText ("Parry:") --> localize-me + parry:SetPoint("topleft", meleeBox, "topleft", 15, y) + parry:SetText("Parry:") --localize-me parry:SetTextColor (.8, .8, .8, 1) local parry_amt = meleeBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") - parry_amt:SetPoint ("left", parry, "right", 2, 0) - parry_amt:SetText ("0") + 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 + parrypersecond:SetPoint("topleft", meleeBox, "topleft", 20, y) + parrypersecond:SetText("Per Second:") --localize-me local parrypersecond_amt = meleeBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") - parrypersecond_amt:SetPoint ("left", parrypersecond, "right", 2, 0) - parrypersecond_amt:SetText ("0") + parrypersecond_amt:SetPoint("left", parrypersecond, "right", 2, 0) + parrypersecond_amt:SetText("0") tab.parrypersecond = parrypersecond_amt y = y - padding -- block local block = meleeBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") - block:SetPoint ("topleft", meleeBox, "topleft", 15, y) - block:SetText ("Block:") --> localize-me + block:SetPoint("topleft", meleeBox, "topleft", 15, y) + block:SetText("Block:") --localize-me block:SetTextColor (.8, .8, .8, 1) local block_amt = meleeBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") - block_amt:SetPoint ("left", block, "right", 2, 0) - block_amt:SetText ("0") + 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 + blockpersecond:SetPoint("topleft", meleeBox, "topleft", 20, y) + blockpersecond:SetText("Per Second:") --localize-me local blockpersecond_amt = meleeBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") - blockpersecond_amt:SetPoint ("left", blockpersecond, "right", 2, 0) - blockpersecond_amt:SetText ("0") + 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 + blockeddamage:SetPoint("topleft", meleeBox, "topleft", 20, y) + blockeddamage:SetText("Damage Blocked:") --localize-me local blockeddamage_amt = meleeBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") - blockeddamage_amt:SetPoint ("left", blockeddamage, "right", 2, 0) - blockeddamage_amt:SetText ("0") + blockeddamage_amt:SetPoint("left", blockeddamage, "right", 2, 0) + blockeddamage_amt:SetText("0") tab.blockeddamage_amt = blockeddamage_amt - --> ABSORBS + --ABSORBS y = -5 - local absorbsBox = CreateFrame ("frame", nil, frame, "BackdropTemplate") + local absorbsBox = CreateFrame("frame", nil, frame, "BackdropTemplate") _detalhes.gump:ApplyStandardBackdrop (absorbsBox) - absorbsBox:SetPoint ("topleft", summaryBox, "topright", 10, 0) - absorbsBox:SetSize (200, 160) + 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) + 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) - fullsbsorbed:SetText ("Full Absorbs:") --> localize-me + fullsbsorbed:SetPoint("topleft", absorbsBox, "topleft", 20, y) + fullsbsorbed:SetText("Full Absorbs:") --localize-me fullsbsorbed:SetTextColor (.8, .8, .8, 1) local fullsbsorbed_amt = absorbsBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") - fullsbsorbed_amt:SetPoint ("left", fullsbsorbed, "right", 2, 0) - fullsbsorbed_amt:SetText ("0") + 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) - partiallyabsorbed:SetText ("Partially Absorbed:") --> localize-me + partiallyabsorbed:SetPoint("topleft", absorbsBox, "topleft", 20, y) + partiallyabsorbed:SetText("Partially Absorbed:") --localize-me partiallyabsorbed:SetTextColor (.8, .8, .8, 1) local partiallyabsorbed_amt = absorbsBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") - partiallyabsorbed_amt:SetPoint ("left", partiallyabsorbed, "right", 2, 0) - partiallyabsorbed_amt:SetText ("0") + 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) - partiallyabsorbedpersecond:SetText ("Average:") --> localize-me + partiallyabsorbedpersecond:SetPoint("topleft", absorbsBox, "topleft", 25, y) + partiallyabsorbedpersecond:SetText("Average:") --localize-me local partiallyabsorbedpersecond_amt = absorbsBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") - partiallyabsorbedpersecond_amt:SetPoint ("left", partiallyabsorbedpersecond, "right", 2, 0) - partiallyabsorbedpersecond_amt:SetText ("0") + 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) - noabsorbs:SetText ("No Absorption:") --> localize-me + noabsorbs:SetPoint("topleft", absorbsBox, "topleft", 20, y) + noabsorbs:SetText("No Absorption:") --localize-me noabsorbs:SetTextColor (.8, .8, .8, 1) local noabsorbs_amt = absorbsBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") - noabsorbs_amt:SetPoint ("left", noabsorbs, "right", 2, 0) - noabsorbs_amt:SetText ("0") + noabsorbs_amt:SetPoint("left", noabsorbs, "right", 2, 0) + noabsorbs_amt:SetText("0") tab.noabsorbs = noabsorbs_amt - --> HEALING + --HEALING y = -5 - local healingBox = CreateFrame ("frame", nil, frame,"BackdropTemplate") + local healingBox = CreateFrame("frame", nil, frame,"BackdropTemplate") _detalhes.gump:ApplyStandardBackdrop (healingBox) - healingBox:SetPoint ("topleft", absorbsBox, "bottomleft", 0, -5) - healingBox:SetSize (200, 160) + healingBox:SetPoint("topleft", absorbsBox, "bottomleft", 0, -5) + healingBox:SetSize(200, 160) local healing_text = healingBox:CreateFontString (nil, "artwork", "GameFontNormal") - healing_text:SetText ("Healing") - healing_text :SetPoint ("topleft", healingBox, "topleft", 5, y) + 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) - selfhealing:SetText ("Self Healing:") --> localize-me + selfhealing:SetPoint("topleft", healingBox, "topleft", 20, y) + selfhealing:SetText("Self Healing:") --localize-me selfhealing:SetTextColor (.8, .8, .8, 1) local selfhealing_amt = healingBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") - selfhealing_amt:SetPoint ("left", selfhealing, "right", 2, 0) - selfhealing_amt:SetText ("0") + selfhealing_amt:SetPoint("left", selfhealing, "right", 2, 0) + selfhealing_amt:SetText("0") 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) - selfhealingpersecond:SetText ("Per Second:") --> localize-me + selfhealingpersecond:SetPoint("topleft", healingBox, "topleft", 25, y) + selfhealingpersecond:SetText("Per Second:") --localize-me local selfhealingpersecond_amt = healingBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") - selfhealingpersecond_amt:SetPoint ("left", selfhealingpersecond, "right", 2, 0) - selfhealingpersecond_amt:SetText ("0") + selfhealingpersecond_amt:SetPoint("left", selfhealingpersecond, "right", 2, 0) + selfhealingpersecond_amt:SetText("0") tab.selfhealingpersecond = selfhealingpersecond_amt y = y - padding 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 + healer:SetPoint("topleft", healingBox, "topleft", 20, y + ((i-1)*15)*-1) + healer:SetText("healer name:") --localize-me healer:SetTextColor (.8, .8, .8, 1) local healer_amt = healingBox:CreateFontString (nil, "artwork", "GameFontHighlightSmall") - healer_amt:SetPoint ("left", healer, "right", 2, 0) - healer_amt:SetText ("0") + healer_amt:SetPoint("left", healer, "right", 2, 0) + healer_amt:SetText("0") tab ["healer" .. i] = {healer, healer_amt} end @@ -2237,19 +2237,19 @@ function gump:CriaJanelaInfo() y = -5 - local spellsBox = CreateFrame ("frame", nil, frame,"BackdropTemplate") + local spellsBox = CreateFrame("frame", nil, frame,"BackdropTemplate") _detalhes.gump:ApplyStandardBackdrop (spellsBox) - spellsBox:SetPoint ("topleft", absorbsBox, "topright", 10, 0) - spellsBox:SetSize (346, 160 * 2 + 5) + 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) + spells_text:SetText("Spells") + spells_text :SetPoint("topleft", spellsBox, "topleft", 5, y) 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) + --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) GameTooltip:SetOwner (self, "ANCHOR_TOPLEFT") _detalhes:GameTooltipSetSpellByID (self.spellid) GameTooltip:Show() @@ -2257,7 +2257,7 @@ function gump:CriaJanelaInfo() end local frame_tooltip_onleave = function(self) if (self.spellid) then - self:SetBackdropColor (.5, .5, .5, .1) + self:SetBackdropColor(.5, .5, .5, .1) GameTooltip:Hide() end end @@ -2265,28 +2265,28 @@ function gump:CriaJanelaInfo() y = y - padding 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) + 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) + 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 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: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") + spell_amt:SetPoint("left", spell, "right", 2, 0) + spell_amt:SetText("0") tab ["spell" .. i] = {spell, spell_amt, icon, frame_tooltip} end @@ -2303,7 +2303,7 @@ function gump:CriaJanelaInfo() if (ps >= lastvalue) then local d = ps - lastvalue d = d / lastvalue * 100 - d = _math_floor (math.abs (d)) + d = _math_floor(math.abs (d)) if (d > 999) then d = "> 999" @@ -2317,7 +2317,7 @@ function gump:CriaJanelaInfo() else local d = lastvalue - ps d = d / max(ps, 0.001) * 100 - d = _math_floor (math.abs (d)) + d = _math_floor(math.abs (d)) if (d > 999) then d = "> 999" @@ -2348,7 +2348,7 @@ function gump:CriaJanelaInfo() n = n:gsub (("-.*"), "") end - --> damage taken + --damage taken local playerdamage = combat (1, player.nome) if (not playerdamage.avoidance) then @@ -2361,12 +2361,12 @@ function gump:CriaJanelaInfo() last_damage_received = last_actor.damage_taken / last_combat:GetCombatTime() end - tab.damagereceived:SetText (_detalhes:ToK2 (damagetaken)) + 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 .. ")") + tab.damagepersecond:SetText(_detalhes:comma_value (_math_floor(ps)) .. " (" .. diff .. ")") - --> absorbs + --absorbs local totalabsorbs = playerdamage.avoidance.overall.ABSORB_AMT local incomingtotal = damagetaken + totalabsorbs @@ -2375,55 +2375,55 @@ function gump:CriaJanelaInfo() last_total_absorbs = last_actor.avoidance.overall.ABSORB_AMT / last_combat:GetCombatTime() end - tab.absorbstotal:SetText (_detalhes:ToK2 (totalabsorbs) .. " (" .. _math_floor (totalabsorbs / incomingtotal * 100) .. "%)") + 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 .. ")") + tab.absorbstotalpersecond:SetText(_detalhes:comma_value (_math_floor(ps)) .. " (" .. diff .. ")") - --> dodge + --dodge local totaldodge = playerdamage.avoidance.overall.DODGE - tab.dodge:SetText (totaldodge) + 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 .. ")") + tab.dodgepersecond:SetText( string.format ("%.2f", ps) .. " (" .. diff .. ")") - --> parry + --parry local totalparry = playerdamage.avoidance.overall.PARRY - tab.parry:SetText (totalparry) + 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 .. ")") + tab.parrypersecond:SetText(string.format ("%.2f", ps) .. " (" .. diff .. ")") - --> block + --block local totalblock = playerdamage.avoidance.overall.BLOCKED_HITS - tab.block:SetText (totalblock) + 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.blockpersecond:SetText(string.format ("%.2f", ps) .. " (" .. diff .. ")") - tab.blockeddamage_amt:SetText (_detalhes:ToK2 (playerdamage.avoidance.overall.BLOCKED_AMT)) + tab.blockeddamage_amt:SetText(_detalhes:ToK2 (playerdamage.avoidance.overall.BLOCKED_AMT)) - --> absorb + --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) + 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 @@ -2433,25 +2433,25 @@ function gump:CriaJanelaInfo() end local ps, diff = getpercent (halfabsorb_amt, last_average, halfabsorb, true) - tab.partiallyabsorbedpersecond:SetText (_detalhes:comma_value (_math_floor (ps)) .. " (" .. diff .. ")") + tab.partiallyabsorbedpersecond:SetText(_detalhes:comma_value (_math_floor(ps)) .. " (" .. diff .. ")") else - tab.partiallyabsorbedpersecond:SetText ("0.00 (0%)") + tab.partiallyabsorbedpersecond:SetText("0.00 (0%)") end - --> healing + --healing local actor_heal = combat (2, player.nome) if (not actor_heal) then - tab.selfhealing:SetText ("0") - tab.selfhealingpersecond:SetText ("0 (0%)") + tab.selfhealing:SetText("0") + tab.selfhealingpersecond:SetText("0 (0%)") else local last_actor_heal = last_combat (2, player.nome) local este_alvo = actor_heal.targets [player.nome] if (este_alvo) then local heal_total = este_alvo - tab.selfhealing:SetText (_detalhes:ToK2 (heal_total)) + tab.selfhealing:SetText(_detalhes:ToK2 (heal_total)) if (last_actor_heal) then local este_alvo = last_actor_heal.targets [player.nome] @@ -2461,18 +2461,18 @@ function gump:CriaJanelaInfo() 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 .. ")") + tab.selfhealingpersecond:SetText(_detalhes:comma_value (_math_floor(ps)) .. " (" .. diff .. ")") else - tab.selfhealingpersecond:SetText ("0 (0%)") + tab.selfhealingpersecond:SetText("0 (0%)") end else - tab.selfhealingpersecond:SetText ("0 (0%)") + tab.selfhealingpersecond:SetText("0 (0%)") end else - tab.selfhealing:SetText ("0") - tab.selfhealingpersecond:SetText ("0 (0%)") + tab.selfhealing:SetText("0") + tab.selfhealingpersecond:SetText("0 (0%)") end @@ -2482,12 +2482,12 @@ function gump:CriaJanelaInfo() for actorName, _ in pairs (heal_from) do local thisActor = combat (2, actorName) - local targets = thisActor.targets --> targets is a container with target classes + 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 + table.sort (myReceivedHeal, _detalhes.Sort2) --Sort2 sort by second index for i = 1, 5 do local label1, label2 = unpack (tab ["healer" .. i]) @@ -2497,7 +2497,7 @@ function gump:CriaJanelaInfo() name = _detalhes:GetOnlyName (name) --name = _detalhes:RemoveOwnerName (name) - label1:SetText (name .. ":") + label1:SetText(name .. ":") local class = myReceivedHeal [i][3] if (class) then local c = RAID_CLASS_COLORS [class] @@ -2517,26 +2517,26 @@ function gump:CriaJanelaInfo() 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 .. ")") + label2:SetText( _detalhes:ToK2 (myReceivedHeal[i][2] or 0) .. " (" .. diff .. ")") else - label2:SetText ( _detalhes:ToK2 (myReceivedHeal[i][2] or 0)) + label2:SetText( _detalhes:ToK2 (myReceivedHeal[i][2] or 0)) end else - label2:SetText ( _detalhes:ToK2 (myReceivedHeal[i][2] or 0)) + label2:SetText( _detalhes:ToK2 (myReceivedHeal[i][2] or 0)) end else - label1:SetText ("-- -- -- --") + label1:SetText("-- -- -- --") label1:SetTextColor (.8, .8, .8, 1) - label2:SetText ("") + label2:SetText("") end end end - --> Spells - --> cooldowns + --Spells + --cooldowns local index_used = 1 local misc_player = combat (4, player.nome) local encounter_time = combat:GetCombatTime() @@ -2564,18 +2564,18 @@ function gump:CriaJanelaInfo() framebg.spellid = esta_habilidade[1] framebg:Show() - --> attempt to get the buff update + --attempt to get the buff update local spellInfo = buffUpdateSpells:GetSpell (framebg.spellid) if (spellInfo) then - label2:SetText (esta_habilidade[2] .. " (" .. floor (spellInfo.uptime / encounter_time * 100) .. "% uptime)") + label2:SetText(esta_habilidade[2] .. " (" .. floor (spellInfo.uptime / encounter_time * 100) .. "% uptime)") else - label2:SetText (esta_habilidade[2]) + label2:SetText(esta_habilidade[2]) end - --> update the line - label1:SetText (nome_magia .. ":") + --update the line + label1:SetText(nome_magia .. ":") - icon1:SetTexture (icone_magia) + icon1:SetTexture(icone_magia) icon1:SetTexCoord (0.0625, 0.953125, 0.0625, 0.953125) index_used = index_used + 1 @@ -2586,7 +2586,7 @@ function gump:CriaJanelaInfo() local cooldownInfo = DetailsFramework.CooldownsInfo - --> see cooldowns that other players used in this actor + --see cooldowns that other players used in this actor for playerName, _ in pairs (combat.raid_roster) do if (playerName ~= player.nome) then local miscPlayer = combat (4, playerName) @@ -2603,20 +2603,20 @@ function gump:CriaJanelaInfo() framebg.spellid = spellID framebg:Show() - --> attempt to get the buff update + --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)") + label2:SetText(amountCasted .. " (" .. "|cFFFFFF00" .. miscPlayer.nome .. "|r " .. floor (cooldownDuration / encounter_time * 100) .. "% uptime)") else - label2:SetText (amountCasted) + label2:SetText(amountCasted) end - --> update the line - label1:SetText (spellName .. ":") + --update the line + label1:SetText(spellName .. ":") - icon1:SetTexture (spellIcon) + icon1:SetTexture(spellIcon) icon1:SetTexCoord (0.0625, 0.953125, 0.0625, 0.953125) index_used = index_used + 1 @@ -2635,12 +2635,12 @@ function gump:CriaJanelaInfo() framebg.spellid = nil framebg:Hide() - label1:SetText ("") - label2:SetText ("") - icon1:SetTexture ("") + label1:SetText("") + label2:SetText("") + icon1:SetTexture("") end - --> habilidade usada para interromper + --habilidade usada para interromper @@ -2677,7 +2677,7 @@ function gump:CriaJanelaInfo() ) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> ~auras +--~auras local auras_tab_create = function(tab, frame) local DF = _detalhes.gump @@ -2704,12 +2704,12 @@ function gump:CriaJanelaInfo() GameTooltip:SetOwner (self, "ANCHOR_TOPRIGHT") _detalhes:GameTooltipSetSpellByID (self.spellID) GameTooltip:Show() - self:SetBackdropColor (1, 1, 1, .2) + self:SetBackdropColor(1, 1, 1, .2) end local line_onleave = function(self) GameTooltip:Hide() - self:SetBackdropColor (unpack (self.BackgroundColor)) + self:SetBackdropColor(unpack (self.BackgroundColor)) end local line_onclick = function(self) @@ -2726,18 +2726,18 @@ function gump:CriaJanelaInfo() --end 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) + 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) + 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 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") @@ -2751,12 +2751,12 @@ function gump:CriaJanelaInfo() 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) + 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 @@ -2765,13 +2765,13 @@ function gump:CriaJanelaInfo() line.Refresh = refresh --line.WaButton = waButton - name:SetJustifyH ("left") - uptime:SetJustifyH ("left") + name:SetJustifyH("left") + uptime:SetJustifyH("left") - apply:SetJustifyH ("center") - refresh:SetJustifyH ("center") - apply:SetWidth (26) - refresh:SetWidth (26) + apply:SetJustifyH("center") + refresh:SetJustifyH("center") + apply:SetWidth(26) + refresh:SetWidth(26) return line end @@ -2789,14 +2789,14 @@ function gump:CriaJanelaInfo() if (aura) then local line = self:GetLine (i) line.spellID = aura.spellID - line.Icon:SetTexture (aura [1]) + 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]) + 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) @@ -2805,10 +2805,10 @@ function gump:CriaJanelaInfo() --end if (i%2 == 0) then - line:SetBackdropColor (unpack (line_bg_color [1])) + line:SetBackdropColor(unpack (line_bg_color [1])) line.BackgroundColor = line_bg_color [1] else - line:SetBackdropColor (unpack (line_bg_color [2])) + line:SetBackdropColor(unpack (line_bg_color [2])) line.BackgroundColor = line_bg_color [2] end end @@ -2816,15 +2816,15 @@ function gump:CriaJanelaInfo() end local create_titledesc_frame = function(anchorWidget, desc) - local f = CreateFrame ("frame", nil, frame) - f:SetSize (40, 20) - f:SetPoint ("center", anchorWidget, "center") - f:SetScript ("OnEnter", function() + local f = CreateFrame("frame", nil, frame) + f:SetSize(40, 20) + f:SetPoint("center", anchorWidget, "center") + f:SetScript("OnEnter", function() GameTooltip:SetOwner (f, "ANCHOR_TOPRIGHT") GameTooltip:AddLine (desc) GameTooltip:Show() end) - f:SetScript ("OnLeave", function() + f:SetScript("OnLeave", function() GameTooltip:Hide() end) return f @@ -2832,25 +2832,25 @@ function gump:CriaJanelaInfo() - local buffLabel = DF:CreateLabel (frame, "Buff Name") - buffLabel:SetPoint (headerOffsetsBuffs[1], -10) - local uptimeLabel = DF:CreateLabel (frame, "Uptime") - uptimeLabel:SetPoint (headerOffsetsBuffs[2], -10) + 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) + 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) + 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) + --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) + buffScroll:SetPoint("topleft", frame, "topleft", 5, -30) for i = 1, scroll_line_amount do local line = buffScroll:CreateLine (scroll_createline) line.AuraType = "BUFF" @@ -2862,25 +2862,25 @@ function gump:CriaJanelaInfo() --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 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) + 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) + 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) + --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) + debuffScroll:SetPoint("topleft", frame, "topleft", debuffScrollStartX, -30) for i = 1, scroll_line_amount do local line = debuffScroll:CreateLine (scroll_createline) line.AuraType = "DEBUFF" @@ -2944,7 +2944,7 @@ function gump:CriaJanelaInfo() ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> ~compare +--~compare local target_texture = [[Interface\MINIMAP\TRACKING\Target]] local empty_text = "" @@ -2982,29 +2982,29 @@ function gump:CriaJanelaInfo() local bar_2 = frame2.bars [i] local bar_3 = frame3.bars [i] - bar [1]:SetTexture ("") - bar [2].lefttext:SetText (empty_text) + bar [1]:SetTexture("") + bar [2].lefttext:SetText(empty_text) bar [2].lefttext:SetTextColor (.5, .5, .5, 1) - bar [2].righttext:SetText ("") - bar [2].righttext2:SetText ("") - bar [2]:SetValue (0) - bar [2]:SetBackdropColor (1, 1, 1, 0) + bar [2].righttext:SetText("") + bar [2].righttext2:SetText("") + bar [2]:SetValue(0) + bar [2]:SetBackdropColor(1, 1, 1, 0) bar [3][4] = nil - bar_2 [1]:SetTexture ("") - bar_2 [2].lefttext:SetText (empty_text) + bar_2 [1]:SetTexture("") + bar_2 [2].lefttext:SetText(empty_text) bar_2 [2].lefttext:SetTextColor (.5, .5, .5, 1) - bar_2 [2].righttext:SetText ("") - bar_2 [2].righttext2:SetText ("") - bar_2 [2]:SetValue (0) - bar_2 [2]:SetBackdropColor (1, 1, 1, 0) + bar_2 [2].righttext:SetText("") + bar_2 [2].righttext2:SetText("") + bar_2 [2]:SetValue(0) + bar_2 [2]:SetBackdropColor(1, 1, 1, 0) bar_2 [3][4] = nil - bar_3 [1]:SetTexture ("") - bar_3 [2].lefttext:SetText (empty_text) + bar_3 [1]:SetTexture("") + bar_3 [2].lefttext:SetText(empty_text) bar_3 [2].lefttext:SetTextColor (.5, .5, .5, 1) - bar_3 [2].righttext:SetText ("") - bar_3 [2].righttext2:SetText ("") - bar_3 [2]:SetValue (0) - bar_3 [2]:SetBackdropColor (1, 1, 1, 0) + bar_3 [2].righttext:SetText("") + bar_3 [2].righttext2:SetText("") + bar_3 [2]:SetValue(0) + bar_3 [2]:SetBackdropColor(1, 1, 1, 0) bar_3 [3][4] = nil end @@ -3062,15 +3062,15 @@ function gump:CriaJanelaInfo() local target_name = data [1] - bar [1]:SetTexture (target_texture) + bar [1]:SetTexture(target_texture) bar [1]:SetDesaturated (true) bar [1]:SetAlpha (.7) - bar [2].lefttext:SetText (index .. ". " .. target_name) + 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) .. "%)" - bar [2]:SetValue (data [2] / top * 100) - --bar [2]:SetValue (100) + bar [2].righttext:SetText(_detalhes:ToK2Min (data [2])) -- .. " (" .. _math_floor(data [2] / total * 100) .. "%)" + bar [2]:SetValue(data [2] / top * 100) + --bar [2]:SetValue(100) bar [3][1] = player.nome --name bar [3][2] = target_name bar [3][3] = data [2] --total @@ -3082,7 +3082,7 @@ function gump:CriaJanelaInfo() local player_2_target_total local player_2_target_index - for index, t in _ipairs (player_2_target_pool) do + for index, t in _ipairs(player_2_target_pool) do if (t[1] == target_name) then player_2_target_total = t[2] player_2_target_index = index @@ -3091,36 +3091,36 @@ function gump:CriaJanelaInfo() end if (player_2_target_total) then - bar_2 [1]:SetTexture (target_texture) + 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: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 - up = _math_floor (up) + up = _math_floor(up) 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") + bar_2 [2].righttext2:SetText(_detalhes:ToK2Min (player_2_target_total)) + bar_2 [2].righttext:SetText(" |c" .. minor .. up .. "%|r") else local diff = player_2_target_total - data [2] local down = diff / data [2] * 100 - down = _math_floor (down) + down = _math_floor(down) if (down > 999) then down = "" .. 999 end - bar_2 [2].righttext2:SetText (_detalhes:ToK2Min (player_2_target_total)) - bar_2 [2].righttext:SetText (" |c" .. plus .. down .. "%|r") + 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 [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 @@ -3128,23 +3128,23 @@ function gump:CriaJanelaInfo() bar_2 [3][4] = player_2 else - bar_2 [1]:SetTexture ("") - bar_2 [2].lefttext:SetText (empty_text) + bar_2 [1]:SetTexture("") + bar_2 [2].lefttext:SetText(empty_text) bar_2 [2].lefttext:SetTextColor (.5, .5, .5, 1) - bar_2 [2].righttext:SetText ("") - bar_2 [2].righttext2:SetText ("") - bar_2 [2]:SetValue (0) - bar_2 [2]:SetBackdropColor (1, 1, 1, 0) + bar_2 [2].righttext:SetText("") + bar_2 [2].righttext2:SetText("") + bar_2 [2]:SetValue(0) + bar_2 [2]:SetBackdropColor(1, 1, 1, 0) bar_2 [3][4] = nil end else - bar_2 [1]:SetTexture ("") - bar_2 [2].lefttext:SetText (empty_text) + bar_2 [1]:SetTexture("") + bar_2 [2].lefttext:SetText(empty_text) bar_2 [2].lefttext:SetTextColor (.5, .5, .5, 1) - bar_2 [2].righttext:SetText ("") - bar_2 [2].righttext2:SetText ("") - bar_2 [2]:SetValue (0) - bar_2 [2]:SetBackdropColor (1, 1, 1, 0) + bar_2 [2].righttext:SetText("") + bar_2 [2].righttext2:SetText("") + bar_2 [2]:SetValue(0) + bar_2 [2]:SetBackdropColor(1, 1, 1, 0) bar_2 [3][4] = nil end @@ -3154,7 +3154,7 @@ function gump:CriaJanelaInfo() local player_3_target_total local player_3_target_index - for index, t in _ipairs (player_3_target_pool) do + for index, t in _ipairs(player_3_target_pool) do if (t[1] == target_name) then player_3_target_total = t[2] player_3_target_index = index @@ -3163,35 +3163,35 @@ function gump:CriaJanelaInfo() end if (player_3_target_total) then - bar_3 [1]:SetTexture (target_texture) + 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: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 - up = _math_floor (up) + up = _math_floor(up) if (up > 999) then up = "" .. 999 end - bar_3 [2].righttext2:SetText (_detalhes:ToK2Min (player_3_target_total)) - bar_3 [2].righttext:SetText (" |c" .. minor .. up .. "%|r") + bar_3 [2].righttext2:SetText(_detalhes:ToK2Min (player_3_target_total)) + bar_3 [2].righttext:SetText(" |c" .. minor .. up .. "%|r") else local diff = player_3_target_total - data [2] local down = diff / data [2] * 100 - down = _math_floor (down) + down = _math_floor(down) if (down > 999) then down = "" .. 999 end - bar_3 [2].righttext:SetText (_detalhes:ToK2Min (player_3_target_total)) - bar_3 [2].righttext:SetText (" |c" .. plus .. down .. "%|r") + 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 [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 @@ -3199,50 +3199,50 @@ function gump:CriaJanelaInfo() bar_3 [3][4] = player_3 else - bar_3 [1]:SetTexture ("") - bar_3 [2].lefttext:SetText (empty_text) + bar_3 [1]:SetTexture("") + bar_3 [2].lefttext:SetText(empty_text) bar_3 [2].lefttext:SetTextColor (.5, .5, .5, 1) - bar_3 [2].righttext:SetText ("") - bar_3 [2].righttext2:SetText ("") - bar_3 [2]:SetValue (0) - bar_3 [2]:SetBackdropColor (1, 1, 1, 0) + bar_3 [2].righttext:SetText("") + bar_3 [2].righttext2:SetText("") + bar_3 [2]:SetValue(0) + bar_3 [2]:SetBackdropColor(1, 1, 1, 0) bar_3 [3][4] = nil end else - bar_3 [1]:SetTexture ("") - bar_3 [2].lefttext:SetText (empty_text) + bar_3 [1]:SetTexture("") + bar_3 [2].lefttext:SetText(empty_text) bar_3 [2].lefttext:SetTextColor (.5, .5, .5, 1) - bar_3 [2].righttext:SetText ("") - bar_3 [2].righttext2:SetText ("") - bar_3 [2]:SetValue (0) - bar_3 [2]:SetBackdropColor (1, 1, 1, 0) + bar_3 [2].righttext:SetText("") + bar_3 [2].righttext2:SetText("") + bar_3 [2]:SetValue(0) + bar_3 [2]:SetBackdropColor(1, 1, 1, 0) bar_3 [3][4] = nil end else - bar [1]:SetTexture ("") - bar [2].lefttext:SetText (empty_text) + bar [1]:SetTexture("") + bar [2].lefttext:SetText(empty_text) bar [2].lefttext:SetTextColor (.5, .5, .5, 1) - bar [2].righttext:SetText ("") - bar [2].righttext2:SetText ("") - bar [2]:SetValue (0) - bar [2]:SetBackdropColor (1, 1, 1, 0) + bar [2].righttext:SetText("") + bar [2].righttext2:SetText("") + bar [2]:SetValue(0) + bar [2]:SetBackdropColor(1, 1, 1, 0) bar [3][4] = nil - bar_2 [1]:SetTexture ("") - bar_2 [2].lefttext:SetText (empty_text) + bar_2 [1]:SetTexture("") + bar_2 [2].lefttext:SetText(empty_text) bar_2 [2].lefttext:SetTextColor (.5, .5, .5, 1) - bar_2 [2].righttext:SetText ("") - bar_2 [2].righttext2:SetText ("") - bar_2 [2]:SetValue (0) - bar_2 [2]:SetBackdropColor (1, 1, 1, 0) + bar_2 [2].righttext:SetText("") + bar_2 [2].righttext2:SetText("") + bar_2 [2]:SetValue(0) + bar_2 [2]:SetBackdropColor(1, 1, 1, 0) bar_2 [3][4] = nil - bar_3 [1]:SetTexture ("") - bar_3 [2].lefttext:SetText (empty_text) + bar_3 [1]:SetTexture("") + bar_3 [2].lefttext:SetText(empty_text) bar_3 [2].lefttext:SetTextColor (.5, .5, .5, 1) - bar_3 [2].righttext:SetText ("") - bar_3 [2].righttext2:SetText ("") - bar_3 [2]:SetValue (0) - bar_3 [2]:SetBackdropColor (1, 1, 1, 0) + bar_3 [2].righttext:SetText("") + bar_3 [2].righttext2:SetText("") + bar_3 [2]:SetValue(0) + bar_3 [2]:SetBackdropColor(1, 1, 1, 0) bar_3 [3][4] = nil end end @@ -3258,7 +3258,7 @@ function gump:CriaJanelaInfo() end --main player pets - for petIndex, petName in _ipairs (player:Pets()) do + for petIndex, petName in _ipairs(player:Pets()) do local petActor = info.instancia.showing [player.tipo]:PegarCombatente (nil, petName) if (petActor) then for _spellid, _skill in _pairs (petActor:GetActorSpells()) do @@ -3293,7 +3293,7 @@ function gump:CriaJanelaInfo() player_2_spells_sorted [#player_2_spells_sorted+1] = {spelltable, spelltable.total} end --player 2 pets - for petIndex, petName in _ipairs (other_players [1]:Pets()) do + for petIndex, petName in _ipairs(other_players [1]:Pets()) do local petActor = info.instancia.showing [player.tipo]:PegarCombatente (nil, petName) if (petActor) then for _spellid, _skill in _pairs (petActor:GetActorSpells()) do @@ -3307,7 +3307,7 @@ function gump:CriaJanelaInfo() --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 @@ -3335,7 +3335,7 @@ function gump:CriaJanelaInfo() player_3_spells_sorted [#player_3_spells_sorted+1] = {spelltable, spelltable.total} end --player 3 pets - for petIndex, petName in _ipairs (other_players [2]:Pets()) do + for petIndex, petName in _ipairs(other_players [2]:Pets()) do local petActor = info.instancia.showing [player.tipo]:PegarCombatente (nil, petName) if (petActor) then for _spellid, _skill in _pairs (petActor:GetActorSpells()) do @@ -3346,7 +3346,7 @@ function gump:CriaJanelaInfo() 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 @@ -3371,23 +3371,23 @@ function gump:CriaJanelaInfo() end local petName = data [3] - bar [1]:SetTexture (icon) --bar[1] = spellicon bar[2] = statusbar + bar [1]:SetTexture(icon) --bar[1] = spellicon bar[2] = statusbar bar [1]:SetTexCoord (unpack (IconTexCoord)) --bar[1] = spellicon bar[2] = statusbar - bar [2]:SetBackdropColor (1, 1, 1, 0.1) + bar [2]:SetBackdropColor(1, 1, 1, 0.1) if (petName) then - bar [2].lefttext:SetText (index .. ". " .. name .. " (|cFFCCBBBB" .. petName:gsub (" <.*", "") .. "|r)") + bar [2].lefttext:SetText(index .. ". " .. name .. " (|cFFCCBBBB" .. petName:gsub (" <.*", "") .. "|r)") else - bar [2].lefttext:SetText (index .. ". " .. name) + bar [2].lefttext:SetText(index .. ". " .. name) end bar [2].lefttext:SetTextColor (1, 1, 1, 1) - bar [2].righttext:SetText (_detalhes:ToK2Min (data [2])) -- .. " (" .. _math_floor (data [2] / total * 100) .. "%)" - bar [2]:SetValue (data [2] / top * 100) - --bar [2]:SetValue (100) + bar [2].righttext:SetText(_detalhes:ToK2Min (data [2])) -- .. " (" .. _math_floor(data [2] / total * 100) .. "%)" + bar [2]:SetValue(data [2] / top * 100) + --bar [2]:SetValue(100) bar [3][1] = data [1].counter --tooltip hits bar [3][2] = data [2] / max(data [1].counter, 0.0001) --tooltip average - bar [3][3] = _math_floor (data [1].c_amt / max(data [1].counter, 0.0001) * 100) --tooltip critical + bar [3][3] = _math_floor(data [1].c_amt / max(data [1].counter, 0.0001) * 100) --tooltip critical bar [3][4] = spellid --player 2 @@ -3395,7 +3395,7 @@ function gump:CriaJanelaInfo() 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 + for _petIndex, _petName in _ipairs(player_2: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] @@ -3408,62 +3408,62 @@ function gump:CriaJanelaInfo() -- ~compare if (spell) then - bar_2 [1]:SetTexture (icon) + bar_2 [1]:SetTexture(icon) bar_2 [1]:SetTexCoord (unpack (IconTexCoord)) --bar[1] = spellicon bar[2] = statusbar - bar_2 [2].lefttext:SetText (player_2_spell_info [spellid] .. ". " .. name) + bar_2 [2].lefttext:SetText(player_2_spell_info [spellid] .. ". " .. name) 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) + 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%") + 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 local up = diff / spell.total * 100 - up = _math_floor (up) + up = _math_floor(up) if (up > 999) then up = "" .. 999 end - bar_2 [2].righttext2:SetText (_detalhes:ToK2Min (spell.total)) - bar_2 [2].righttext:SetText (" |c" .. minor .. up .. "%|r") + bar_2 [2].righttext2:SetText(_detalhes:ToK2Min (spell.total)) + bar_2 [2].righttext:SetText(" |c" .. minor .. up .. "%|r") else - bar_2 [2].righttext2:SetText ("0") - bar_2 [2].righttext:SetText ("+0%") + 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] local down = diff / data [2] * 100 - down = _math_floor (down) + down = _math_floor(down) if (down > 999) then down = "" .. 999 end - bar_2 [2].righttext2:SetText (_detalhes:ToK2Min (spell.total)) - bar_2 [2].righttext:SetText (" |c" .. plus .. down .. "%|r") + bar_2 [2].righttext2:SetText(_detalhes:ToK2Min (spell.total)) + bar_2 [2].righttext:SetText(" |c" .. plus .. down .. "%|r") else - bar_2 [2].righttext2:SetText ("0") - bar_2 [2].righttext:SetText ("+0%") + bar_2 [2].righttext2:SetText("0") + 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 [2]:SetValue(spell.total / player_2_top * 100) + bar_2 [2]:SetValue(100) bar_2 [3][1] = spell.counter --tooltip hits bar_2 [3][2] = spell.total / spell.counter --tooltip average - bar_2 [3][3] = _math_floor (spell.c_amt / spell.counter * 100) --tooltip critical - bar_2 [2]:SetBackdropColor (1, 1, 1, 0) + bar_2 [3][3] = _math_floor(spell.c_amt / spell.counter * 100) --tooltip critical + bar_2 [2]:SetBackdropColor(1, 1, 1, 0) else - bar_2 [1]:SetTexture ("") - bar_2 [2].lefttext:SetText (empty_text) + bar_2 [1]:SetTexture("") + bar_2 [2].lefttext:SetText(empty_text) bar_2 [2].lefttext:SetTextColor (.5, .5, .5, 1) - bar_2 [2].righttext:SetText ("") - bar_2 [2].righttext2:SetText ("") - bar_2 [2]:SetValue (0) - bar_2 [2]:SetBackdropColor (1, 1, 1, 0) + bar_2 [2].righttext:SetText("") + bar_2 [2].righttext2:SetText("") + bar_2 [2]:SetValue(0) + bar_2 [2]:SetBackdropColor(1, 1, 1, 0) end --player 3 @@ -3474,7 +3474,7 @@ function gump:CriaJanelaInfo() 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 + 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] @@ -3485,98 +3485,98 @@ function gump:CriaJanelaInfo() end if (spell) then - bar_3 [1]:SetTexture (icon) + bar_3 [1]:SetTexture(icon) bar_3 [1]:SetTexCoord (unpack (IconTexCoord)) --bar[1] = spellicon bar[2] = statusbar - bar_3 [2].lefttext:SetText (player_3_spell_info [spellid] .. ". " .. name) + bar_3 [2].lefttext:SetText(player_3_spell_info [spellid] .. ". " .. name) 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) + 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%") + 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 local up = diff / spell.total * 100 - up = _math_floor (up) + up = _math_floor(up) if (up > 999) then up = "" .. 999 end - bar_3 [2].righttext2:SetText (_detalhes:ToK2Min (spell.total)) - bar_3 [2].righttext:SetText (" |c" .. minor .. up .. "%|r") + bar_3 [2].righttext2:SetText(_detalhes:ToK2Min (spell.total)) + bar_3 [2].righttext:SetText(" |c" .. minor .. up .. "%|r") else - bar_3 [2].righttext2:SetText ("0") - bar_3 [2].righttext:SetText ("0%") + bar_3 [2].righttext2:SetText("0") + bar_3 [2].righttext:SetText("0%") end else if (data [2] > 0) then local diff = spell.total - data [2] local down = diff / data [2] * 100 - down = _math_floor (down) + down = _math_floor(down) if (down > 999) then down = "" .. 999 end - bar_3 [2].righttext2:SetText (_detalhes:ToK2Min (spell.total)) - bar_3 [2].righttext:SetText (" |c" .. plus .. down .. "%|r") + bar_3 [2].righttext2:SetText(_detalhes:ToK2Min (spell.total)) + bar_3 [2].righttext:SetText(" |c" .. plus .. down .. "%|r") else - bar_3 [2].righttext:SetText ("0") - bar_3 [2].righttext:SetText ("+0%") + bar_3 [2].righttext:SetText("0") + 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 [2]:SetValue(spell.total / player_3_top * 100) + bar_3 [2]:SetValue(100) bar_3 [3][1] = spell.counter --tooltip hits bar_3 [3][2] = spell.total / spell.counter --tooltip average - bar_3 [3][3] = _math_floor (spell.c_amt / spell.counter * 100) --tooltip critical + bar_3 [3][3] = _math_floor(spell.c_amt / spell.counter * 100) --tooltip critical else - bar_3 [1]:SetTexture ("") - bar_3 [2].lefttext:SetText (empty_text) + bar_3 [1]:SetTexture("") + bar_3 [2].lefttext:SetText(empty_text) bar_3 [2].lefttext:SetTextColor (.5, .5, .5, 1) - bar_3 [2].righttext:SetText ("") - bar_3 [2].righttext2:SetText ("") - bar_3 [2]:SetValue (0) - bar_3 [2]:SetBackdropColor (1, 1, 1, 0) + bar_3 [2].righttext:SetText("") + bar_3 [2].righttext2:SetText("") + bar_3 [2]:SetValue(0) + bar_3 [2]:SetBackdropColor(1, 1, 1, 0) end else - bar_3 [1]:SetTexture ("") - bar_3 [2].lefttext:SetText (empty_text) + bar_3 [1]:SetTexture("") + bar_3 [2].lefttext:SetText(empty_text) bar_3 [2].lefttext:SetTextColor (.5, .5, .5, 1) - bar_3 [2].righttext:SetText ("") - bar_3 [2].righttext2:SetText ("") - bar_3 [2]:SetValue (0) - bar_3 [2]:SetBackdropColor (1, 1, 1, 0) + bar_3 [2].righttext:SetText("") + bar_3 [2].righttext2:SetText("") + bar_3 [2]:SetValue(0) + bar_3 [2]:SetBackdropColor(1, 1, 1, 0) end else - bar [1]:SetTexture ("") - bar [2].lefttext:SetText (empty_text) + bar [1]:SetTexture("") + bar [2].lefttext:SetText(empty_text) bar [2].lefttext:SetTextColor (.5, .5, .5, 1) - bar [2].righttext:SetText ("") - bar [2]:SetValue (0) - bar [2]:SetBackdropColor (1, 1, 1, 0) + bar [2].righttext:SetText("") + bar [2]:SetValue(0) + bar [2]:SetBackdropColor(1, 1, 1, 0) local bar_2 = frame2.bars [i] - bar_2 [1]:SetTexture ("") - bar_2 [2].lefttext:SetText (empty_text) + bar_2 [1]:SetTexture("") + bar_2 [2].lefttext:SetText(empty_text) bar_2 [2].lefttext:SetTextColor (.5, .5, .5, 1) - bar_2 [2].righttext:SetText ("") - bar_2 [2].righttext2:SetText ("") - bar_2 [2]:SetValue (0) - bar_2 [2]:SetBackdropColor (1, 1, 1, 0) + bar_2 [2].righttext:SetText("") + bar_2 [2].righttext2:SetText("") + bar_2 [2]:SetValue(0) + bar_2 [2]:SetBackdropColor(1, 1, 1, 0) local bar_3 = frame3.bars [i] - bar_3 [1]:SetTexture ("") - bar_3 [2].lefttext:SetText (empty_text) + bar_3 [1]:SetTexture("") + bar_3 [2].lefttext:SetText(empty_text) bar_3 [2].lefttext:SetTextColor (.5, .5, .5, 1) - bar_3 [2].righttext:SetText ("") - bar_3 [2].righttext2:SetText ("") - bar_3 [2]:SetValue (0) - bar_3 [2]:SetBackdropColor (1, 1, 1, 0) + bar_3 [2].righttext:SetText("") + bar_3 [2].righttext2:SetText("") + bar_3 [2]:SetValue(0) + bar_3 [2]:SetBackdropColor(1, 1, 1, 0) end end - for index, spelltable in _ipairs (spells_sorted) do + for index, spelltable in _ipairs(spells_sorted) do end @@ -3609,7 +3609,7 @@ function gump:CriaJanelaInfo() local players_to_compare = tab.players local defaultPlayerName = _detalhes:GetOnlyName (player:Name()) - DetailsPlayerComparisonBox1.name_label:SetText (defaultPlayerName) + DetailsPlayerComparisonBox1.name_label:SetText(defaultPlayerName) local label2 = _G ["DetailsPlayerComparisonBox2"].name_label local label3 = _G ["DetailsPlayerComparisonBox3"].name_label @@ -3619,19 +3619,19 @@ function gump:CriaJanelaInfo() if (players_to_compare [1]) then local playerName = _detalhes:GetOnlyName (players_to_compare [1]:Name()) - label2:SetText (playerName) - label2_percent:SetText (defaultPlayerName .. " %") + label2:SetText(playerName) + label2_percent:SetText(defaultPlayerName .. " %") else - label2:SetText ("") - label2_percent:SetText ("") + label2:SetText("") + label2_percent:SetText("") end if (players_to_compare [2]) then local playerName = _detalhes:GetOnlyName (players_to_compare [2]:Name()) - label3:SetText (playerName) - label3_percent:SetText (defaultPlayerName .. " %") + label3:SetText(playerName) + label3_percent:SetText(defaultPlayerName .. " %") else - label3:SetText ("") - label3_percent:SetText ("") + label3:SetText("") + label3_percent:SetText("") end refresh_comparison_box (DetailsPlayerComparisonBox1) @@ -3658,9 +3658,9 @@ function gump:CriaJanelaInfo() 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) + 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) local actor1_total = bar1 [3] [3] local actor2_total = bar1 [3] [3] @@ -3724,59 +3724,59 @@ function gump:CriaJanelaInfo() local frame2_gotresults = false local frame3_gotresults = false - for index, spell in _ipairs (player_1_skills) do + 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]) - bar [1]:SetTexture (icon) + bar [1]:SetTexture(icon) bar [1]:SetTexCoord (unpack (IconTexCoord)) --bar[1] = spellicon bar[2] = statusbar - bar [2].lefttext:SetText (index .. ". " .. name) - bar [2].righttext:SetText (_detalhes:ToK2Min (spell [2])) - bar [2]:SetValue (spell [2]/player_1_top*100) - --bar [2]:SetValue (100) + bar [2].lefttext:SetText(index .. ". " .. name) + bar [2].righttext:SetText(_detalhes:ToK2Min (spell [2])) + 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 + for this_index, this_spell in _ipairs(player_2_skills) do if (spell [1] == this_spell[1]) then local bar = frame2.tooltip.bars [index] if (not bar) then bar = frame2.tooltip:CreateBar (index) end - bar [1]:SetTexture (icon) + bar [1]:SetTexture(icon) bar [1]:SetTexCoord (unpack (IconTexCoord)) --bar[1] = spellicon bar[2] = statusbar - bar [2].lefttext:SetText (this_index .. ". " .. name) + 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 - up = _math_floor (up) + up = _math_floor(up) if (up > 999) then up = "" .. 999 end - bar [2].righttext2:SetText (_detalhes:ToK2Min (this_spell [2])) - bar [2].righttext:SetText (" |c" .. minor .. up .. "%|r") + bar [2].righttext2:SetText(_detalhes:ToK2Min (this_spell [2])) + bar [2].righttext:SetText(" |c" .. minor .. up .. "%|r") else local diff = this_spell [2] - spell [2] local down = diff / spell [2] * 100 - down = _math_floor (down) + down = _math_floor(down) if (down > 999) then down = "" .. 999 end - bar [2].righttext2:SetText (_detalhes:ToK2Min (this_spell [2])) - bar [2].righttext:SetText (" |c" .. plus .. down .. "%|r") + bar [2].righttext2:SetText(_detalhes:ToK2Min (this_spell [2])) + bar [2].righttext:SetText(" |c" .. plus .. down .. "%|r") end - --bar [2]:SetValue (this_spell [2]/player_2_top*100) - bar [2]:SetValue (100) + --bar [2]:SetValue(this_spell [2]/player_2_top*100) + bar [2]:SetValue(100) found_skill = true frame2_gotresults = true break @@ -3787,10 +3787,10 @@ function gump:CriaJanelaInfo() if (not bar) then bar = frame2.tooltip:CreateBar (index) end - bar [1]:SetTexture ("") - bar [2].lefttext:SetText ("") - bar [2].righttext:SetText ("") - bar [2].righttext2:SetText ("") + bar [1]:SetTexture("") + bar [2].lefttext:SetText("") + bar [2].righttext:SetText("") + bar [2].righttext2:SetText("") bar [2].bg:Hide() end end @@ -3798,39 +3798,39 @@ function gump:CriaJanelaInfo() if (player_3) then local player_3_skill local found_skill = false - for this_index, this_spell in _ipairs (player_3_skills) do + for this_index, this_spell in _ipairs(player_3_skills) do if (spell [1] == this_spell[1]) then local bar = frame3.tooltip.bars [index] if (not bar) then bar = frame3.tooltip:CreateBar (index) end - bar [1]:SetTexture (icon) + bar [1]:SetTexture(icon) bar [1]:SetTexCoord (unpack (IconTexCoord)) --bar[1] = spellicon bar[2] = statusbar - bar [2].lefttext:SetText (this_index .. ". " .. name) + 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 - up = _math_floor (up) + up = _math_floor(up) if (up > 999) then up = "" .. 999 end - bar [2].righttext:SetText (_detalhes:ToK2Min (this_spell [2]) .. " |c" .. minor .. up .. "%|r") + bar [2].righttext:SetText(_detalhes:ToK2Min (this_spell [2]) .. " |c" .. minor .. up .. "%|r") else local diff = this_spell [2] - spell [2] local down = diff / spell [2] * 100 - down = _math_floor (down) + down = _math_floor(down) if (down > 999) then down = "" .. 999 end - bar [2].righttext2:SetText (_detalhes:ToK2Min (this_spell [2])) - bar [2].righttext:SetText (" |c" .. plus .. down .. "%|r") + bar [2].righttext2:SetText(_detalhes:ToK2Min (this_spell [2])) + bar [2].righttext:SetText(" |c" .. plus .. down .. "%|r") end - --bar [2]:SetValue (this_spell [2]/player_3_top*100) - bar [2]:SetValue (100) + --bar [2]:SetValue(this_spell [2]/player_3_top*100) + bar [2]:SetValue(100) found_skill = true frame3_gotresults = true break @@ -3841,19 +3841,19 @@ function gump:CriaJanelaInfo() if (not bar) then bar = frame3.tooltip:CreateBar (index) end - bar [1]:SetTexture ("") - bar [2].lefttext:SetText ("") - bar [2].righttext:SetText ("") - bar [2].righttext2:SetText ("") + bar [1]:SetTexture("") + bar [2].lefttext:SetText("") + bar [2].righttext:SetText("") + bar [2].righttext2:SetText("") 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) + 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() @@ -3895,9 +3895,9 @@ function gump:CriaJanelaInfo() local bar2 = frame2.bars [self.index] local bar3 = frame3.bars [self.index] - 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) + 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) local spellid = bar1[3][4] local player1 = frame1.player @@ -3922,48 +3922,48 @@ function gump:CriaJanelaInfo() 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 .. "%") + 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") + _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) + 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 - local minutos, segundos = _math_floor (spell.uptime/60), _math_floor (spell.uptime%60) + local minutos, segundos = _math_floor(spell.uptime/60), _math_floor(spell.uptime%60) player1_uptime = spell.uptime - frame1.tooltip.uptime_label3:SetText (minutos .. "m" .. segundos .. "s") - frame1.tooltip.uptime_label2:SetText (COMPARE_FIRSTPLAYER_PERCENT) - _detalhes.gump:SetFontColor (frame1.tooltip.uptime_label2, "gray") - _detalhes.gump:SetFontColor (frame1.tooltip.uptime_label3, "white") + frame1.tooltip.uptime_label3:SetText(minutos .. "m" .. segundos .. "s") + frame1.tooltip.uptime_label2:SetText(COMPARE_FIRSTPLAYER_PERCENT) + _detalhes.gump:SetFontColor(frame1.tooltip.uptime_label2, "gray") + _detalhes.gump:SetFontColor(frame1.tooltip.uptime_label3, "white") else - frame1.tooltip.uptime_label3:SetText (COMPARE_UNKNOWNDATA) - 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.uptime_label3:SetText(COMPARE_UNKNOWNDATA) + frame1.tooltip.uptime_label2:SetText(COMPARE_UNKNOWNDATA) + _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) + frame1.tooltip.casts_label3:SetText(amt_casts) + frame1.tooltip.casts_label2:SetText(COMPARE_FIRSTPLAYER_PERCENT) - _detalhes.gump:SetFontColor (frame1.tooltip.casts_label3, "white") + _detalhes.gump:SetFontColor(frame1.tooltip.casts_label3, "white") player1_casts = amt_casts else @@ -3972,10 +3972,10 @@ function gump:CriaJanelaInfo() for casted_spellid, amount in _pairs (player1_misc.spell_cast or {}) do 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) + frame1.tooltip.casts_label3:SetText(amount) + frame1.tooltip.casts_label2:SetText(COMPARE_FIRSTPLAYER_PERCENT) - _detalhes.gump:SetFontColor (frame1.tooltip.casts_label3, "white") + _detalhes.gump:SetFontColor(frame1.tooltip.casts_label3, "white") player1_casts = amount extra_search_found = true @@ -3984,23 +3984,23 @@ function gump:CriaJanelaInfo() end if (not extra_search_found) then - frame1.tooltip.casts_label3:SetText ("?") - frame1.tooltip.casts_label2:SetText ("?") + 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") + _detalhes.gump:SetFontColor(frame1.tooltip.casts_label3, "silver") + _detalhes.gump:SetFontColor(frame1.tooltip.casts_label2, "silver") end end else - frame1.tooltip.uptime_label3:SetText (COMPARE_UNKNOWNDATA) - 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.uptime_label3:SetText(COMPARE_UNKNOWNDATA) + 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") + 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() @@ -4015,63 +4015,63 @@ function gump:CriaJanelaInfo() if (hits > bar2[3][1]) then local diff = hits - bar2[3][1] local up = diff / bar2[3][1] * 100 - up = _math_floor (up) + up = _math_floor(up) if (up > 999) then up = "" .. 999 end - frame2.tooltip.hits_label3:SetText (bar2[3][1]) - frame2.tooltip.hits_label2:SetText (" |c" .. minor .. up .. "%|r") + frame2.tooltip.hits_label3:SetText(bar2[3][1]) + frame2.tooltip.hits_label2:SetText(" |c" .. minor .. up .. "%|r") else local diff = bar2[3][1] - hits local down = diff / hits * 100 - down = _math_floor (down) + down = _math_floor(down) if (down > 999) then down = "" .. 999 end - frame2.tooltip.hits_label3:SetText (bar2[3][1]) - frame2.tooltip.hits_label2:SetText (" |c" .. plus .. down .. "%|r") + 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] local up = diff / bar2[3][2] * 100 - up = _math_floor (up) + up = _math_floor(up) if (up > 999) then up = "" .. 999 end - frame2.tooltip.average_label3:SetText (_detalhes:ToK2Min (bar2[3][2])) - frame2.tooltip.average_label2:SetText (" |c" .. minor .. up .. "%|r") + frame2.tooltip.average_label3:SetText(_detalhes:ToK2Min (bar2[3][2])) + frame2.tooltip.average_label2:SetText(" |c" .. minor .. up .. "%|r") else local diff = bar2[3][2] - average local down = diff / average * 100 - down = _math_floor (down) + down = _math_floor(down) if (down > 999) then down = "" .. 999 end - frame2.tooltip.average_label3:SetText (_detalhes:ToK2Min (bar2[3][2])) - frame2.tooltip.average_label2:SetText (" |c" .. plus .. down .. "%|r") + 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 --[[ local percent = abs ((bar2[3][3] / critical * 100) -100) - percent = _math_floor (percent) + percent = _math_floor(percent) if (percent > 999) then up = "" .. 999 end - frame2.tooltip.crit_label3:SetText (bar2[3][3] .. "%") - frame2.tooltip.crit_label2:SetText (" |c" .. minor .. percent .. "%|r") + frame2.tooltip.crit_label3:SetText(bar2[3][3] .. "%") + frame2.tooltip.crit_label2:SetText(" |c" .. minor .. percent .. "%|r") --]] local diff = critical - bar2[3][3] diff = diff / bar2[3][3] * 100 - diff = _math_floor (diff) + diff = _math_floor(diff) if (diff > 999) then diff = "" .. 999 end - frame2.tooltip.crit_label3:SetText (bar2[3][3] .. "%") - frame2.tooltip.crit_label2:SetText (" |c" .. minor .. diff .. "%|r") + frame2.tooltip.crit_label3:SetText(bar2[3][3] .. "%") + frame2.tooltip.crit_label2:SetText(" |c" .. minor .. diff .. "%|r") else local diff = bar2[3][3] - critical local down = diff / math.max (critical, 0.1) * 100 @@ -4079,12 +4079,12 @@ function gump:CriaJanelaInfo() --print (diff, bar2[3][3], critical) --print (math.max (critical * 100, 0.1)) - down = _math_floor (down) + down = _math_floor(down) if (down > 999) then down = "" .. 999 end - frame2.tooltip.crit_label3:SetText (bar2[3][3] .. "%") - frame2.tooltip.crit_label2:SetText (" |c" .. plus .. down .. "%|r") + frame2.tooltip.crit_label3:SetText(bar2[3][3] .. "%") + frame2.tooltip.crit_label2:SetText(" |c" .. plus .. down .. "%|r") end --update and total casts @@ -4093,40 +4093,40 @@ function gump:CriaJanelaInfo() --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) + 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") + 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 - up = _math_floor (up) + up = _math_floor(up) if (up > 999) then up = "" .. 999 end - frame2.tooltip.uptime_label3:SetText (minutos .. "m" .. segundos .. "s") - frame2.tooltip.uptime_label2:SetText ("|c" .. minor .. up .. "%|r") + frame2.tooltip.uptime_label3:SetText(minutos .. "m" .. segundos .. "s") + frame2.tooltip.uptime_label2:SetText("|c" .. minor .. up .. "%|r") else local diff = spell.uptime - player1_uptime local down = diff / player1_uptime * 100 - down = _math_floor (down) + down = _math_floor(down) if (down > 999) then down = "" .. 999 end - frame2.tooltip.uptime_label3:SetText (minutos .. "m" .. segundos .. "s") - frame2.tooltip.uptime_label2:SetText ("|c" .. plus .. down .. "%|r") + 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") + _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") + 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 @@ -4144,42 +4144,42 @@ function gump:CriaJanelaInfo() if (amt_casts) then if (not player1_casts) then - frame2.tooltip.casts_label3:SetText (amt_casts) - frame2.tooltip.casts_label2:SetText (COMPARE_UNKNOWNDATA) + 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 - up = _math_floor (up) + up = _math_floor(up) if (up > 999) then up = "" .. 999 end - frame2.tooltip.casts_label3:SetText (amt_casts) - frame2.tooltip.casts_label2:SetText ("|c" .. minor .. up .. "%|r") + frame2.tooltip.casts_label3:SetText(amt_casts) + frame2.tooltip.casts_label2:SetText("|c" .. minor .. up .. "%|r") else local diff = amt_casts - player1_casts local down = diff / player1_casts * 100 - down = _math_floor (down) + down = _math_floor(down) if (down > 999) then down = "" .. 999 end - frame2.tooltip.casts_label3:SetText (amt_casts) - frame2.tooltip.casts_label2:SetText ("|c" .. plus .. down .. "%|r") + 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") + _detalhes.gump:SetFontColor(frame2.tooltip.casts_label3, "white") + _detalhes.gump:SetFontColor(frame2.tooltip.casts_label2, "white") else - frame2.tooltip.casts_label2:SetText ("?") - frame2.tooltip.casts_label3:SetText ("?") - _detalhes.gump:SetFontColor (frame2.tooltip.casts_label3, "gray") - _detalhes.gump:SetFontColor (frame2.tooltip.casts_label2, "gray") + frame2.tooltip.casts_label2:SetText("?") + frame2.tooltip.casts_label3:SetText("?") + _detalhes.gump:SetFontColor(frame2.tooltip.casts_label3, "gray") + _detalhes.gump:SetFontColor(frame2.tooltip.casts_label2, "gray") end else - frame2.tooltip.casts_label2:SetText (COMPARE_UNKNOWNDATA) - frame2.tooltip.casts_label2:SetText (COMPARE_UNKNOWNDATA) - frame2.tooltip.uptime_label3:SetText (COMPARE_UNKNOWNDATA) - frame2.tooltip.uptime_label2:SetText (COMPARE_UNKNOWNDATA) + frame2.tooltip.casts_label2:SetText(COMPARE_UNKNOWNDATA) + frame2.tooltip.casts_label2:SetText(COMPARE_UNKNOWNDATA) + frame2.tooltip.uptime_label3:SetText(COMPARE_UNKNOWNDATA) + frame2.tooltip.uptime_label2:SetText(COMPARE_UNKNOWNDATA) end frame2.tooltip:Show() @@ -4195,42 +4195,42 @@ function gump:CriaJanelaInfo() if (hits > bar3[3][1]) then local diff = hits - bar3[3][1] local up = diff / bar3[3][1] * 100 - up = _math_floor (up) + up = _math_floor(up) if (up > 999) then up = "" .. 999 end - frame3.tooltip.hits_label3:SetText (bar3[3][1]) - frame3.tooltip.hits_label2:SetText (" |c" .. minor .. up .. "%|r") + frame3.tooltip.hits_label3:SetText(bar3[3][1]) + frame3.tooltip.hits_label2:SetText(" |c" .. minor .. up .. "%|r") else local diff = bar3[3][1] - hits local down = diff / hits * 100 - down = _math_floor (down) + down = _math_floor(down) if (down > 999) then down = "" .. 999 end - frame3.tooltip.hits_label3:SetText (bar3[3][1]) - frame3.tooltip.hits_label2:SetText (" |c" .. plus .. down .. "%|r") + frame3.tooltip.hits_label3:SetText(bar3[3][1]) + frame3.tooltip.hits_label2:SetText(" |c" .. plus .. down .. "%|r") end --average if (average > bar3[3][2]) then local diff = average - bar3[3][2] local up = diff / bar3[3][2] * 100 - up = _math_floor (up) + up = _math_floor(up) if (up > 999) then up = "" .. 999 end - frame3.tooltip.average_label3:SetText (_detalhes:ToK2Min (bar3[3][2])) - frame3.tooltip.average_label2:SetText (" |c" .. minor .. up .. "%|r") + frame3.tooltip.average_label3:SetText(_detalhes:ToK2Min (bar3[3][2])) + frame3.tooltip.average_label2:SetText(" |c" .. minor .. up .. "%|r") else local diff = bar3[3][2] - average local down = diff / average * 100 - down = _math_floor (down) + down = _math_floor(down) if (down > 999) then down = "" .. 999 end - frame3.tooltip.average_label3:SetText (_detalhes:ToK2Min (bar3[3][2])) - frame3.tooltip.average_label2:SetText (" |c" .. plus .. down .. "%|r") + frame3.tooltip.average_label3:SetText(_detalhes:ToK2Min (bar3[3][2])) + frame3.tooltip.average_label2:SetText(" |c" .. plus .. down .. "%|r") end --critical @@ -4239,30 +4239,30 @@ function gump:CriaJanelaInfo() local percent = abs ((bar3[3][3] / critical * 100) -100) --local diff = critical - bar3[3][3] --local up = diff / bar3[3][3] * 100 - percent = _math_floor (percent) + percent = _math_floor(percent) if (percent > 999) then percent = "" .. 999 end - frame3.tooltip.crit_label3:SetText (bar3[3][3] .. "%") - frame3.tooltip.crit_label2:SetText (" |c" .. minor .. percent .. "%|r") + frame3.tooltip.crit_label3:SetText(bar3[3][3] .. "%") + frame3.tooltip.crit_label2:SetText(" |c" .. minor .. percent .. "%|r") --]] local diff = critical - bar3[3][3] diff = diff / bar3[3][3] * 100 - diff = _math_floor (diff) + diff = _math_floor(diff) if (diff > 999) then diff = "" .. 999 end - frame3.tooltip.crit_label3:SetText (bar3[3][3] .. "%") - frame3.tooltip.crit_label2:SetText (" |c" .. minor .. diff .. "%|r") + frame3.tooltip.crit_label3:SetText(bar3[3][3] .. "%") + frame3.tooltip.crit_label2:SetText(" |c" .. minor .. diff .. "%|r") else local diff = bar3[3][3] - critical local down = diff / math.max (critical, 0.1) * 100 - down = _math_floor (down) + down = _math_floor(down) if (down > 999) then down = "" .. 999 end - frame3.tooltip.crit_label3:SetText (bar3[3][3] .. "%") - frame3.tooltip.crit_label2:SetText (" |c" .. plus .. down .. "%|r") + frame3.tooltip.crit_label3:SetText(bar3[3][3] .. "%") + frame3.tooltip.crit_label2:SetText(" |c" .. plus .. down .. "%|r") end --uptime and casts @@ -4271,39 +4271,39 @@ function gump:CriaJanelaInfo() --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) + 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") + 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 - up = _math_floor (up) + up = _math_floor(up) if (up > 999) then up = "" .. 999 end - frame3.tooltip.uptime_label3:SetText (minutos .. "m" .. segundos .. "s") - frame3.tooltip.uptime_label2:SetText ("|c" .. minor .. up .. "%|r") + frame3.tooltip.uptime_label3:SetText(minutos .. "m" .. segundos .. "s") + frame3.tooltip.uptime_label2:SetText("|c" .. minor .. up .. "%|r") else local diff = spell.uptime - player1_uptime local down = diff / player1_uptime * 100 - down = _math_floor (down) + down = _math_floor(down) if (down > 999) then down = "" .. 999 end - frame3.tooltip.uptime_label3:SetText (minutos .. "m" .. segundos .. "s") - frame3.tooltip.uptime_label2:SetText ("|c" .. plus .. down .. "%|r") + 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") + _detalhes.gump:SetFontColor(frame3.tooltip.uptime_label3, "white") + _detalhes.gump:SetFontColor(frame3.tooltip.uptime_label2, "white") else - frame3.tooltip.uptime_label3:SetText (COMPARE_UNKNOWNDATA) - frame3.tooltip.uptime_label2:SetText (COMPARE_UNKNOWNDATA) - _detalhes.gump:SetFontColor (frame3.tooltip.uptime_label3, "gray") - _detalhes.gump:SetFontColor (frame3.tooltip.uptime_label2, "gray") + frame3.tooltip.uptime_label3:SetText(COMPARE_UNKNOWNDATA) + frame3.tooltip.uptime_label2:SetText(COMPARE_UNKNOWNDATA) + _detalhes.gump:SetFontColor(frame3.tooltip.uptime_label3, "gray") + _detalhes.gump:SetFontColor(frame3.tooltip.uptime_label2, "gray") end --total casts @@ -4322,41 +4322,41 @@ function gump:CriaJanelaInfo() if (amt_casts) then if (not player1_casts) then - frame3.tooltip.casts_label2:SetText (amt_casts) + frame3.tooltip.casts_label2:SetText(amt_casts) elseif (player1_casts > amt_casts) then local diff = player1_casts - amt_casts local up = diff / amt_casts * 100 - up = _math_floor (up) + up = _math_floor(up) if (up > 999) then up = "" .. 999 end - frame3.tooltip.casts_label3:SetText (amt_casts) - frame3.tooltip.casts_label2:SetText (" |c" .. minor .. up .. "%|r") + frame3.tooltip.casts_label3:SetText(amt_casts) + frame3.tooltip.casts_label2:SetText(" |c" .. minor .. up .. "%|r") else local diff = amt_casts - player1_casts local down = diff / player1_casts * 100 - down = _math_floor (down) + down = _math_floor(down) if (down > 999) then down = "" .. 999 end - frame3.tooltip.casts_label3:SetText (amt_casts) - frame3.tooltip.casts_label2:SetText (" |c" .. plus .. down .. "%|r") + 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") + _detalhes.gump:SetFontColor(frame3.tooltip.casts_label3, "white") + _detalhes.gump:SetFontColor(frame3.tooltip.casts_label2, "white") else - frame3.tooltip.casts_label2:SetText ("?") - frame3.tooltip.casts_label3:SetText ("?") - _detalhes.gump:SetFontColor (frame3.tooltip.casts_label3, "gray") - _detalhes.gump:SetFontColor (frame3.tooltip.casts_label2, "gray") + frame3.tooltip.casts_label2:SetText("?") + frame3.tooltip.casts_label3:SetText("?") + _detalhes.gump:SetFontColor(frame3.tooltip.casts_label3, "gray") + _detalhes.gump:SetFontColor(frame3.tooltip.casts_label2, "gray") 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) + 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() @@ -4389,33 +4389,33 @@ function gump:CriaJanelaInfo() 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 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") + local bar = CreateFrame("StatusBar", name, parent,"BackdropTemplate") bar.index = index - bar:SetPoint ("topleft", spellicon, "topright", 0, 0) - bar:SetPoint ("topright", parent, "topright", -4, y) + bar:SetPoint("topleft", spellicon, "topright", 0, 0) + bar:SetPoint("topright", parent, "topright", -4, y) 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: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:SetValue(100) + bar:SetHeight(14) bar.icon = spellicon if (is_target) then - bar:SetScript ("OnEnter", on_enter_target) - bar:SetScript ("OnLeave", on_leave_target) + bar:SetScript("OnEnter", on_enter_target) + bar:SetScript("OnLeave", on_leave_target) else - bar:SetScript ("OnEnter", on_enter) - bar:SetScript ("OnLeave", on_leave) + bar:SetScript("OnEnter", on_enter) + bar:SetScript("OnLeave", on_leave) end bar.lefttext = bar:CreateFontString (nil, "OVERLAY", "GameFontHighlightSmall") @@ -4424,15 +4424,15 @@ function gump:CriaJanelaInfo() 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:SetPoint("left", bar, "left", 4, 0) + bar.lefttext:SetJustifyH("left") bar.lefttext:SetTextColor (1, 1, 1, 1) bar.lefttext:SetNonSpaceWrap (true) bar.lefttext:SetWordWrap (false) if (main) then - bar.lefttext:SetWidth (180) + bar.lefttext:SetWidth(180) else - bar.lefttext:SetWidth (110) + bar.lefttext:SetWidth(110) end bar.righttext = bar:CreateFontString (nil, "OVERLAY", "GameFontHighlightSmall") @@ -4441,8 +4441,8 @@ function gump:CriaJanelaInfo() 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:SetPoint("right", bar, "right", -2, 0) + bar.righttext:SetJustifyH("right") bar.righttext:SetTextColor (1, 1, 1, 1) bar.righttext2 = bar:CreateFontString (nil, "OVERLAY", "GameFontHighlightSmall") @@ -4451,98 +4451,98 @@ function gump:CriaJanelaInfo() 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: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 tooltip = CreateFrame ("frame", name, UIParent,"BackdropTemplate") + 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: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]]) + 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) + 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:") - tooltip.casts_label:SetJustifyH ("left") + tooltip.casts_label:SetPoint("topleft", tooltip, "topleft", x_start, -2 + (y*0)) + tooltip.casts_label:SetText("Total Casts:") + tooltip.casts_label:SetJustifyH("left") tooltip.casts_label2 = tooltip:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - tooltip.casts_label2:SetPoint ("topright", tooltip, "topright", -x_start, -2 + (y*0)) - tooltip.casts_label2:SetText ("0") - tooltip.casts_label2:SetJustifyH ("right") + tooltip.casts_label2:SetPoint("topright", tooltip, "topright", -x_start, -2 + (y*0)) + tooltip.casts_label2:SetText("0") + tooltip.casts_label2:SetJustifyH("right") tooltip.casts_label3 = tooltip:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - tooltip.casts_label3:SetPoint ("topright", tooltip, "topright", -x_start - 46, -2 + (y*0)) - tooltip.casts_label3:SetText ("0") - tooltip.casts_label3:SetJustifyH ("right") + 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:") - tooltip.hits_label:SetJustifyH ("left") + tooltip.hits_label:SetPoint("topleft", tooltip, "topleft", x_start, -14 + (y*1)) + tooltip.hits_label:SetText("Total Hits:") + tooltip.hits_label:SetJustifyH("left") tooltip.hits_label2 = tooltip:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - tooltip.hits_label2:SetPoint ("topright", tooltip, "topright", -x_start, -14 + (y*1)) - tooltip.hits_label2:SetText ("0") - tooltip.hits_label2:SetJustifyH ("right") + tooltip.hits_label2:SetPoint("topright", tooltip, "topright", -x_start, -14 + (y*1)) + tooltip.hits_label2:SetText("0") + tooltip.hits_label2:SetJustifyH("right") tooltip.hits_label3 = tooltip:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - tooltip.hits_label3:SetPoint ("topright", tooltip, "topright", -x_start - 46, -14 + (y*1)) - tooltip.hits_label3:SetText ("0") - tooltip.hits_label3:SetJustifyH ("right") + 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:") - tooltip.average_label:SetJustifyH ("left") + tooltip.average_label:SetPoint("topleft", tooltip, "topleft", x_start, -26 + (y*2)) + tooltip.average_label:SetText("Average:") + tooltip.average_label:SetJustifyH("left") tooltip.average_label2 = tooltip:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - tooltip.average_label2:SetPoint ("topright", tooltip, "topright", -x_start, -26 + (y*2)) - tooltip.average_label2:SetText ("0") - tooltip.average_label2:SetJustifyH ("right") + tooltip.average_label2:SetPoint("topright", tooltip, "topright", -x_start, -26 + (y*2)) + tooltip.average_label2:SetText("0") + tooltip.average_label2:SetJustifyH("right") tooltip.average_label3 = tooltip:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - tooltip.average_label3:SetPoint ("topright", tooltip, "topright", -x_start - 46, -26 + (y*2)) - tooltip.average_label3:SetText ("0") - tooltip.average_label3:SetJustifyH ("right") + 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:") - tooltip.crit_label:SetJustifyH ("left") + tooltip.crit_label:SetPoint("topleft", tooltip, "topleft", x_start, -38 + (y*3)) + tooltip.crit_label:SetText("Critical:") + tooltip.crit_label:SetJustifyH("left") tooltip.crit_label2 = tooltip:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - tooltip.crit_label2:SetPoint ("topright", tooltip, "topright", -x_start, -38 + (y*3)) - tooltip.crit_label2:SetText ("0") - tooltip.crit_label2:SetJustifyH ("right") + tooltip.crit_label2:SetPoint("topright", tooltip, "topright", -x_start, -38 + (y*3)) + tooltip.crit_label2:SetText("0") + tooltip.crit_label2:SetJustifyH("right") tooltip.crit_label3 = tooltip:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - tooltip.crit_label3:SetPoint ("topright", tooltip, "topright", -x_start - 46, -38 + (y*3)) - tooltip.crit_label3:SetText ("0") - tooltip.crit_label3:SetJustifyH ("right") + 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:") - tooltip.uptime_label:SetJustifyH ("left") + tooltip.uptime_label:SetPoint("topleft", tooltip, "topleft", x_start, -50 + (y*4)) + tooltip.uptime_label:SetText("Uptime:") + tooltip.uptime_label:SetJustifyH("left") tooltip.uptime_label2 = tooltip:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - tooltip.uptime_label2:SetPoint ("topright", tooltip, "topright", -x_start, -50 + (y*4)) - tooltip.uptime_label2:SetText ("0") - tooltip.uptime_label2:SetJustifyH ("right") + tooltip.uptime_label2:SetPoint("topright", tooltip, "topright", -x_start, -50 + (y*4)) + tooltip.uptime_label2:SetText("0") + tooltip.uptime_label2:SetJustifyH("right") tooltip.uptime_label3 = tooltip:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - tooltip.uptime_label3:SetPoint ("topright", tooltip, "topright", -x_start - 46, -50 + (y*4)) - tooltip.uptime_label3:SetText ("0") - tooltip.uptime_label3:SetJustifyH ("right") + 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]] @@ -4551,11 +4551,11 @@ function gump:CriaJanelaInfo() 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) - bg_line1:SetPoint ("topleft", tooltip, "topleft", 0, -2 + (((i-1) * 12) * -1) + (y * (i-1)) + 2) - bg_line1:SetPoint ("topright", tooltip, "topright", -0, -2 + (((i-1) * 12) * -1) + (y * (i-1)) + 2) - bg_line1:SetHeight (bg_height + 4) + local bg_line1 = tooltip:CreateTexture(nil, "artwork") + bg_line1:SetTexture(bg_texture) + bg_line1:SetPoint("topleft", tooltip, "topleft", 0, -2 + (((i-1) * 12) * -1) + (y * (i-1)) + 2) + bg_line1:SetPoint("topright", tooltip, "topright", -0, -2 + (((i-1) * 12) * -1) + (y * (i-1)) + 2) + bg_line1:SetHeight(bg_height + 4) bg_line1:SetAlpha (bg_alpha) bg_line1:SetVertexColor (unpack (colors[i])) end @@ -4564,23 +4564,23 @@ function gump:CriaJanelaInfo() end 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) - tooltip:SetBackdropBorderColor (0, 0, 0, 1) - tooltip:SetSize (175, 67) + 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) + tooltip:SetBackdropBorderColor(0, 0, 0, 1) + tooltip:SetSize(175, 67) tooltip:SetFrameStrata ("tooltip") tooltip.bars = {} _detalhes.gump:CreateBorder (tooltip) function tooltip:Reset() - for index, bar in _ipairs (tooltip.bars) do - bar [1]:SetTexture ("") - bar [2].lefttext:SetText ("") - bar [2].righttext:SetText ("") - bar [2].righttext2:SetText ("") - bar [2]:SetValue (0) + for index, bar in _ipairs(tooltip.bars) do + bar [1]:SetTexture("") + bar [2].lefttext:SetText("") + bar [2].righttext:SetText("") + bar [2].righttext2:SetText("") + bar [2]:SetValue(0) bar [2].bg:Hide() end end @@ -4601,56 +4601,56 @@ function gump:CriaJanelaInfo() 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 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") + local bar = CreateFrame("StatusBar", name .. "Bar" .. index, parent, "BackdropTemplate") bar.index = index - bar:SetPoint ("topleft", spellicon, "topright", 0, 0) - bar:SetPoint ("topright", parent, "topright", -1, y) + bar:SetPoint("topleft", spellicon, "topright", 0, 0) + bar:SetPoint("topright", parent, "topright", -1, y) bar:SetStatusBarTexture ([[Interface\AddOns\Details\images\bar_serenity]]) bar:SetStatusBarColor (unpack (bar_color)) bar:SetMinMaxValues (0, 100) - bar:SetValue (0) - bar:SetHeight (14) + 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:SetPoint ("left", bar, "left", 2, 0) - bar.lefttext:SetJustifyH ("left") + 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) + bar.lefttext:SetWidth(110) else - bar.lefttext:SetWidth (80) + bar.lefttext:SetWidth(80) 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: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", -46, 0) - bar.righttext2:SetJustifyH ("right") + 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]]) + local bg_line1 = bar:CreateTexture(nil, "artwork") + bg_line1:SetTexture([[Interface\AddOns\Details\images\bar_background]]) bg_line1:SetAllPoints() bg_line1:SetAlpha (0.7) if (index % 2 == 0) then @@ -4665,25 +4665,25 @@ function gump:CriaJanelaInfo() return object end - local background = tooltip:CreateTexture (nil, "artwork") - background:SetTexture ([[Interface\SPELLBOOK\Spellbook-Page-1]]) + 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) + 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:SetSize (spell_compare_frame_width[1], spell_compare_frame_height) - frame1:SetPoint ("topleft", frame, "topleft", xLocation, yLocation) + local frame1 = CreateFrame("scrollframe", "DetailsPlayerComparisonBox1", frame, "FauxScrollFrameTemplate,BackdropTemplate") + 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) - frame1:SetBackdrop (frame_backdrop) - frame1:SetBackdropColor (unpack (frame_backdrop_color)) - frame1:SetBackdropBorderColor (unpack (frame_backdrop_border_color)) + 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) @@ -4691,11 +4691,11 @@ function gump:CriaJanelaInfo() frame1.bars = {} frame1.tab = tab frame1.tooltip = create_tooltip ("DetailsPlayerComparisonBox1Tooltip") - frame1.tooltip:SetWidth (spell_compare_frame_width[1]) + 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") + playername1:SetPoint("bottomleft", frame1, "topleft", 2, 0) + playername1:SetText("Player 1") frame1.name_label = playername1 --criar as barras do frame1 @@ -4704,19 +4704,19 @@ function gump:CriaJanelaInfo() 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:SetSize (spell_compare_frame_width[1], target_compare_frame_height) - target1:SetPoint ("topleft", frame1, "bottomleft", 0, -10) + local target1 = CreateFrame("scrollframe", "DetailsPlayerComparisonTarget1", frame, "FauxScrollFrameTemplate,BackdropTemplate") + 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) - target1:SetBackdrop (frame_backdrop) - target1:SetBackdropColor (unpack (frame_backdrop_color)) - target1:SetBackdropBorderColor (unpack (frame_backdrop_border_color)) + target1:SetBackdrop(frame_backdrop) + target1:SetBackdropColor(unpack (frame_backdrop_color)) + target1:SetBackdropBorderColor(unpack (frame_backdrop_border_color)) target1.bars = {} target1.tab = tab target1.tooltip = create_tooltip_target ("DetailsPlayerComparisonTarget1Tooltip") - target1.tooltip:SetWidth (spell_compare_frame_width[1]) + target1.tooltip:SetWidth(spell_compare_frame_width[1]) --override backdrop settings and use the framework defaults Details.gump:ApplyStandardBackdrop (target1) @@ -4728,41 +4728,41 @@ function gump:CriaJanelaInfo() -------------------------------------------- - local frame2 = CreateFrame ("frame", "DetailsPlayerComparisonBox2", frame,"BackdropTemplate") - local frame3 = CreateFrame ("frame", "DetailsPlayerComparisonBox3", frame,"BackdropTemplate") + 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: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)) + 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]) + 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") + 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: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)") - noPLayersToShow:SetSize (spell_compare_frame_width[2] - 10, spell_compare_frame_height) - noPLayersToShow:SetJustifyH ("center") + noPLayersToShow:SetPoint("center") + noPLayersToShow:SetText("There's no more players to compare (with the same class/spec)") + noPLayersToShow:SetSize(spell_compare_frame_width[2] - 10, spell_compare_frame_height) + noPLayersToShow:SetJustifyH("center") noPLayersToShow:SetJustifyV ("center") _detalhes.gump:SetFontSize (noPLayersToShow, 14) - _detalhes.gump:SetFontColor (noPLayersToShow, "gray") + _detalhes.gump:SetFontColor(noPLayersToShow, "gray") frame2.NoPLayersToShow = noPLayersToShow @@ -4774,15 +4774,15 @@ function gump:CriaJanelaInfo() end --cria o box dos targets - local target2 = CreateFrame ("frame", "DetailsPlayerComparisonTarget2", frame,"BackdropTemplate") - target2:SetSize (spell_compare_frame_width[2], target_compare_frame_height) - target2:SetPoint ("topleft", frame2, "bottomleft", 0, -10) - target2:SetBackdrop (frame_backdrop) - target2:SetBackdropColor (unpack (frame_backdrop_color)) - target2:SetBackdropBorderColor (unpack (frame_backdrop_border_color)) + local target2 = CreateFrame("frame", "DetailsPlayerComparisonTarget2", frame,"BackdropTemplate") + target2:SetSize(spell_compare_frame_width[2], target_compare_frame_height) + target2:SetPoint("topleft", frame2, "bottomleft", 0, -10) + target2:SetBackdrop(frame_backdrop) + target2:SetBackdropColor(unpack (frame_backdrop_color)) + target2:SetBackdropBorderColor(unpack (frame_backdrop_border_color)) target2.bars = {} target2.tooltip = create_tooltip_target ("DetailsPlayerComparisonTarget2Tooltip") - target2.tooltip:SetWidth (spell_compare_frame_width[2]) + target2.tooltip:SetWidth(spell_compare_frame_width[2]) --override backdrop settings and use the framework defaults Details.gump:ApplyStandardBackdrop (target2) @@ -4794,39 +4794,39 @@ function gump:CriaJanelaInfo() ----------------------------------------------------------------------- - 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)) + 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]) + 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") + 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: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") - noPLayersToShow:SetText ("There's no more players to compare (with the same class/spec)") - noPLayersToShow:SetSize (spell_compare_frame_width[2] - 10, spell_compare_frame_height) - noPLayersToShow:SetJustifyH ("center") + noPLayersToShow:SetPoint("center") + noPLayersToShow:SetText("There's no more players to compare (with the same class/spec)") + noPLayersToShow:SetSize(spell_compare_frame_width[2] - 10, spell_compare_frame_height) + noPLayersToShow:SetJustifyH("center") noPLayersToShow:SetJustifyV ("center") _detalhes.gump:SetFontSize (noPLayersToShow, 14) - _detalhes.gump:SetFontColor (noPLayersToShow, "gray") + _detalhes.gump:SetFontColor(noPLayersToShow, "gray") frame3.NoPLayersToShow = noPLayersToShow --criar as barras do frame3 @@ -4835,15 +4835,15 @@ function gump:CriaJanelaInfo() end --cria o box dos targets - local target3 = CreateFrame ("frame", "DetailsPlayerComparisonTarget3", frame,"BackdropTemplate") - target3:SetSize (spell_compare_frame_width[3], target_compare_frame_height) - target3:SetPoint ("topleft", frame3, "bottomleft", 0, -10) - target3:SetBackdrop (frame_backdrop) - target3:SetBackdropColor (unpack (frame_backdrop_color)) - target3:SetBackdropBorderColor (unpack (frame_backdrop_border_color)) + local target3 = CreateFrame("frame", "DetailsPlayerComparisonTarget3", frame,"BackdropTemplate") + target3:SetSize(spell_compare_frame_width[3], target_compare_frame_height) + target3:SetPoint("topleft", frame3, "bottomleft", 0, -10) + target3:SetBackdrop(frame_backdrop) + target3:SetBackdropColor(unpack (frame_backdrop_color)) + target3:SetBackdropBorderColor(unpack (frame_backdrop_border_color)) target3.bars = {} target3.tooltip = create_tooltip_target ("DetailsPlayerComparisonTarget3Tooltip") - target3.tooltip:SetWidth (spell_compare_frame_width[3]) + target3.tooltip:SetWidth(spell_compare_frame_width[3]) --override backdrop settings and use the framework defaults Details.gump:ApplyStandardBackdrop (target3) @@ -4876,7 +4876,7 @@ function gump:CriaJanelaInfo() local class = playerObject.classe local my_spells = {} local my_spells_total = 0 - --> build my spell list + --build my spell list for spellid, _ in _pairs (playerObject.spells._ActorTable) do my_spells [spellid] = true my_spells_total = my_spells_total + 1 @@ -4890,7 +4890,7 @@ function gump:CriaJanelaInfo() 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 @@ -4911,17 +4911,17 @@ function gump:CriaJanelaInfo() 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 (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) - flashAnimation:SetPoint ("bottomright", tabOBject.widget, "bottomright", -1, 1) + local flashAnimation = tabOBject:CreateTexture(nil, "overlay") + flashAnimation:SetPoint("topleft", tabOBject.widget, "topleft", 1, -1) + flashAnimation:SetPoint("bottomright", tabOBject.widget, "bottomright", -1, 1) flashAnimation:SetColorTexture (1, 1, 1) local flashHub = DetailsFramework:CreateAnimationHub (flashAnimation, function() flashAnimation:Show() end, function() flashAnimation:Hide() end) - DetailsFramework:CreateAnimation (flashHub, "alpha", 1, 1, 0, 0.3) - DetailsFramework:CreateAnimation (flashHub, "alpha", 2, 1, 0.45, 0) + DetailsFramework:CreateAnimation(flashHub, "alpha", 1, 1, 0, 0.3) + DetailsFramework:CreateAnimation(flashHub, "alpha", 2, 1, 0.45, 0) flashHub:SetLooping ("REPEAT") tabOBject.FlashAnimation = flashHub @@ -4969,11 +4969,11 @@ function gump:CriaJanelaInfo() if (not _detalhes:GetTutorialCVar ("DETAILS_INFO_TUTORIAL1")) then _detalhes:SetTutorialCVar ("DETAILS_INFO_TUTORIAL1", true) - local alert = CreateFrame ("frame", "DetailsInfoPopUp1", info, "DetailsHelpBoxTemplate") + local alert = CreateFrame("frame", "DetailsInfoPopUp1", info, "DetailsHelpBoxTemplate") alert.ArrowUP:Show() alert.ArrowGlowUP:Show() - alert.Text:SetText (Loc ["STRING_INFO_TUTORIAL_COMPARISON1"]) - alert:SetPoint ("bottom", tab.widget or tab, "top", 5, 28) + alert.Text:SetText(Loc ["STRING_INFO_TUTORIAL_COMPARISON1"]) + alert:SetPoint("bottom", tab.widget or tab, "top", 5, 28) alert:Show() end end @@ -4997,12 +4997,12 @@ function gump:CriaJanelaInfo() PixelUtil.SetPoint (tab, "bottomright", info, "topright", -514 + (buttonWidth * tabsShown), -72) end else - tab:SetSize (buttonTemplate.width, buttonTemplate.height) + tab:SetSize(buttonTemplate.width, buttonTemplate.height) if (tabsShown >= breakLine) then --next row of icons - tab:SetPoint ("bottomright", info, "topright", -514 + (buttonWidth * (secondRowIndex)), -50) + tab:SetPoint("bottomright", info, "topright", -514 + (buttonWidth * (secondRowIndex)), -50) secondRowIndex = secondRowIndex + 1 else - tab:SetPoint ("bottomright", info, "topright", -514 + (buttonWidth * tabsShown), -72) + tab:SetPoint("bottomright", info, "topright", -514 + (buttonWidth * tabsShown), -72) end end @@ -5014,23 +5014,23 @@ function gump:CriaJanelaInfo() end if (tabsShown < 2) then - tablePool[1]:SetPoint ("BOTTOMLEFT", info.container_barras, "TOPLEFT", 490 - (94 * (1-0)), 1) + tablePool[1]:SetPoint("BOTTOMLEFT", info.container_barras, "TOPLEFT", 490 - (94 * (1-0)), 1) end --selected by default tablePool[1]:Click() end - este_gump:SetScript ("OnHide", function(self) + este_gump:SetScript("OnHide", function(self) _detalhes:FechaJanelaInfo() - for _, tab in _ipairs (_detalhes.player_details_tabs) do + for _, tab in _ipairs(_detalhes.player_details_tabs) do tab:Hide() tab.frame:Hide() end end) - --DetailsInfoWindowTab1Text:SetText ("Avoidance") - este_gump.tipo = 1 --> tipo da janela // 1 = janela normal + --DetailsInfoWindowTab1Text:SetText("Avoidance") + este_gump.tipo = 1 --tipo da janela // 1 = janela normal return este_gump @@ -5049,7 +5049,7 @@ function _detalhes:CreatePlayerDetailsTab (tabname, localized_name, condition, f if (tabname == "Summary") then newTabButton:SetTemplate ("DETAILS_TAB_BUTTONSELECTED_TEMPLATE") end - newTabButton:SetText (localized_name) + newTabButton:SetText(localized_name) newTabButton:SetFrameStrata ("HIGH") newTabButton:SetFrameLevel (info:GetFrameLevel()+1) newTabButton:Hide() @@ -5061,8 +5061,8 @@ function _detalhes:CreatePlayerDetailsTab (tabname, localized_name, condition, f newTabButton.fillfunction = fillfunction newTabButton.last_actor = {} - newTabButton.frame = CreateFrame ("frame", "DetailsPDWTabFrame" .. tabname, UIParent,"BackdropTemplate") - newTabButton.frame:SetParent (info) + newTabButton.frame = CreateFrame("frame", "DetailsPDWTabFrame" .. tabname, UIParent,"BackdropTemplate") + newTabButton.frame:SetParent(info) newTabButton.frame:SetFrameStrata ("HIGH") newTabButton.frame:SetFrameLevel (info:GetFrameLevel()+5) newTabButton.frame:EnableMouse (true) @@ -5082,7 +5082,7 @@ function _detalhes:CreatePlayerDetailsTab (tabname, localized_name, condition, f end if (newTabButton.fillfunction) then - newTabButton.frame:SetScript ("OnShow", function() + newTabButton.frame:SetScript("OnShow", function() if (newTabButton.last_actor == info.jogador) then return end @@ -5104,12 +5104,12 @@ function _detalhes:CreatePlayerDetailsTab (tabname, localized_name, condition, f 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: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:SetPoint("TOPLEFT", info.container_barras, "TOPLEFT", 0, 2) + newTabButton.frame:SetPoint("bottomright", info, "bottomright", -3, 3) + newTabButton.frame:SetSize(569, 274) newTabButton.frame:Hide() @@ -5117,11 +5117,11 @@ function _detalhes:CreatePlayerDetailsTab (tabname, localized_name, condition, f _detalhes.player_details_tabs [#_detalhes.player_details_tabs+1] = newTabButton if (not onclick) then - --> hide all tabs + --hide all tabs newTabButton.OnShowFunc = function(self) self = self.MyObject or self - for _, tab in _ipairs (Details:GetBreakdownTabsInUse()) do + for _, tab in _ipairs(Details:GetBreakdownTabsInUse()) do tab.frame:Hide() tab:SetTemplate ("DETAILS_TAB_BUTTON_TEMPLATE") end @@ -5131,13 +5131,13 @@ function _detalhes:CreatePlayerDetailsTab (tabname, localized_name, condition, f info.selectedTab = self.tabname end - newTabButton:SetScript ("OnClick", newTabButton.OnShowFunc) + newTabButton:SetScript("OnClick", newTabButton.OnShowFunc) else - --> custom + --custom newTabButton.OnShowFunc = function(self) self = self.MyObject or self - for _, tab in _ipairs (Details:GetBreakdownTabsInUse()) do + for _, tab in _ipairs(Details:GetBreakdownTabsInUse()) do tab.frame:Hide() tab:SetTemplate ("DETAILS_TAB_BUTTON_TEMPLATE") end @@ -5153,18 +5153,18 @@ function _detalhes:CreatePlayerDetailsTab (tabname, localized_name, condition, f end end - newTabButton:SetScript ("OnClick", newTabButton.OnShowFunc) + 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 - for _, widget in ipairs (SummaryWidgets) do + for _, widget in ipairs(SummaryWidgets) do widget:Hide() end else - for _, widget in ipairs (SummaryWidgets) do + for _, widget in ipairs(SummaryWidgets) do widget:Show() end end @@ -5189,13 +5189,13 @@ function _detalhes.playerDetailWindow:monta_relatorio (botao) local report_lines - if (botao == 1) then --> bot�o da esquerda + if (botao == 1) then --bot�o da esquerda - if (atributo == 1 and sub_atributo == 4) then --> friendly fire + 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 + elseif (atributo == 1 and sub_atributo == 3) then --damage taken report_lines = {"Details!: " .. player.nome .. " " .. Loc ["STRING_ATTRIBUTE_DAMAGE_TAKEN"] .. ":"} else @@ -5204,13 +5204,13 @@ function _detalhes.playerDetailWindow:monta_relatorio (botao) 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 + 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 + elseif (type(spellid) == "number" and spellid > 10) then local link = GetSpellLink(spellid) report_lines [#report_lines+1] = index .. ". " .. link .. ": " .. barra.lineText4:GetText() else @@ -5225,7 +5225,7 @@ function _detalhes.playerDetailWindow:monta_relatorio (botao) end end - elseif (botao == 3) then --> bot�o dos alvos + elseif (botao == 3) then --bot�o dos alvos if (atributo == 1 and sub_atributo == 3) then print (Loc ["STRING_ACTORFRAME_NOTHING"]) @@ -5234,7 +5234,7 @@ function _detalhes.playerDetailWindow:monta_relatorio (botao) 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 + for index, barra in _ipairs(info.barras2) do if (barra:IsShown()) then report_lines [#report_lines+1] = barra.lineText1:GetText().." -> ".. barra.lineText4:GetText() end @@ -5243,9 +5243,9 @@ function _detalhes.playerDetailWindow:monta_relatorio (botao) end end - elseif (botao == 2) then --> bot�o da direita + elseif (botao == 2) then --bot�o da direita - --> diferentes tipos de amostragem na caixa 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 if (not player.detalhes) then @@ -5258,13 +5258,13 @@ function _detalhes.playerDetailWindow:monta_relatorio (botao) for i = 1, 5 do - --> pega os dados dos quadrados --> Aqui mostra o resumo de todos os quadrados... + --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 + local nome2 = caixa.nome2:GetText() --golpes if (nome2 and nome2 ~= "") then if (i == 1) then linha = linha..nome2.." / " @@ -5273,12 +5273,12 @@ function _detalhes.playerDetailWindow:monta_relatorio (botao) end end - local dano = caixa.dano:GetText() --> dano + local dano = caixa.dano:GetText() --dano if (dano and dano ~= "") then linha = linha..dano.." / " end - local media = caixa.dano_media:GetText() --> media + local media = caixa.dano_media:GetText() --media if (media and media ~= "") then linha = linha..media.." / " end @@ -5307,7 +5307,7 @@ function _detalhes.playerDetailWindow:monta_relatorio (botao) 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 @@ -5320,13 +5320,13 @@ function _detalhes.playerDetailWindow:monta_relatorio (botao) end end - elseif (botao >= 11) then --> primeira caixa dos detalhes + elseif (botao >= 11) then --primeira caixa dos detalhes botao = botao - 10 local nome - if (_type (spellid) == "string") then - --> is a pet + if (_type(spellid) == "string") then + --is a pet else nome = _GetSpellInfo(player.detalhes) local spelllink = GetSpellLink(player.detalhes) @@ -5344,7 +5344,7 @@ function _detalhes.playerDetailWindow:monta_relatorio (botao) local caixa = info.grupos_detalhes [botao] local linha = "" - local nome2 = caixa.nome2:GetText() --> golpes + local nome2 = caixa.nome2:GetText() --golpes if (nome2 and nome2 ~= "") then if (i == 1) then linha = linha..nome2.." / " @@ -5353,12 +5353,12 @@ function _detalhes.playerDetailWindow:monta_relatorio (botao) end end - local dano = caixa.dano:GetText() --> dano + local dano = caixa.dano:GetText() --dano if (dano and dano ~= "") then linha = linha..dano.." / " end - local media = caixa.dano_media:GetText() --> media + local media = caixa.dano_media:GetText() --media if (media and media ~= "") then linha = linha..media.." / " end @@ -5373,7 +5373,7 @@ function _detalhes.playerDetailWindow:monta_relatorio (botao) linha = linha..dano_porcento.." " end - --> remove a cor da school + --remove a cor da school linha = linha:gsub ("|c%x?%x?%x?%x?%x?%x?%x?%x?", "") linha = linha:gsub ("|r", "") @@ -5384,7 +5384,7 @@ function _detalhes.playerDetailWindow:monta_relatorio (botao) --local report_lines = {"Details! Relatorio para ".._detalhes.sub_atributos [self.atributo].lista [self.sub_atributo]} - --> pega o conte�do da janela da direita + --pega o conte�do da janela da direita return instancia:envia_relatorio (report_lines) end @@ -5405,25 +5405,25 @@ local row_on_enter = function(self) 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 + --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:SetBackdropColor (0.8, 0.8, 0.8, 0.3) + --troca a cor da barra enquanto o mouse estiver em cima dela + 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 + 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 (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 end GameTooltip:Show() - self:SetHeight (CONST_TARGET_HEIGHT + 1) + self:SetHeight(CONST_TARGET_HEIGHT + 1) return end @@ -5434,7 +5434,7 @@ local row_on_enter = function(self) elseif (self.isMain) then if (IsShiftKeyDown()) then - if (type (self.show) == "number") then + if (type(self.show) == "number") then GameTooltip:SetOwner (self, "ANCHOR_TOPRIGHT") GameTooltip:AddLine (Loc ["ABILITY_ID"] .. ": " .. self.show) GameTooltip:Show() @@ -5447,20 +5447,20 @@ local row_on_enter = function(self) 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 + --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 - info.mostrando_mouse_over = true --> o conteudo da direta esta sendo mostrado pq o mouse esta passando por cima do bagulho e n�o pq foi clicado - info.showing = self._index --> diz o index da barra que esta sendo mostrado na direita + --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 + info.mostrando_mouse_over = true --o conteudo da direta esta sendo mostrado pq o mouse esta passando por cima do bagulho e n�o pq foi clicado + info.showing = self._index --diz o index da barra que esta sendo mostrado na direita - info.jogador.detalhes = self.show --> minha tabela = jogador = jogador.detales = spellid ou nome que esta sendo mostrado na direita - info.jogador:MontaDetalhes (self.show, self, info.instancia) --> passa a spellid ou nome e a barra + info.jogador.detalhes = self.show --minha tabela = jogador = jogador.detales = spellid ou nome que esta sendo mostrado na direita + info.jogador:MontaDetalhes (self.show, self, info.instancia) --passa a spellid ou nome e a barra end end end @@ -5472,28 +5472,28 @@ local row_on_leave = function(self) self.mouse_over = false - --> diminui o tamanho da barra - self:SetHeight (CONST_BAR_HEIGHT) - --> volta com o alfa antigo da barra que era de 0.9 + --diminui o tamanho da barra + 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:SetBackdropBorderColor (0, 0, 0, 0) - self:SetBackdropColor (0, 0, 0, 0) + --volto o background ao normal + self:SetBackdrop(row_backdrop_onleave) + self:SetBackdropBorderColor(0, 0, 0, 0) + self:SetBackdropColor(0, 0, 0, 0) 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 + --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 + --remover o conte�do que estava sendo mostrado na direita if (info.mostrando_mouse_over) then info.mostrando = nil info.mostrando_mouse_over = false @@ -5504,7 +5504,7 @@ local row_on_leave = function(self) end elseif (self.isAlvo) then - self:SetHeight (CONST_TARGET_HEIGHT) + self:SetHeight(CONST_TARGET_HEIGHT) end end @@ -5515,8 +5515,8 @@ local row_on_mousedown = function(self, button) self.mouse_down = _GetTime() local x, y = _GetCursorPosition() - self.x = _math_floor (x) - self.y = _math_floor (y) + self.x = _math_floor(x) + self.y = _math_floor(y) if (button == "RightButton" and not info.isMoving) then _detalhes:FechaJanelaInfo() @@ -5538,27 +5538,27 @@ local row_on_mouseup = function(self, button) end local x, y = _GetCursorPosition() - x = _math_floor (x) - y = _math_floor (y) + x = _math_floor(x) + 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 + --setar os textos - if (self.isMain) then --> se n�o for uma barra de alvo + if (self.isMain) then --se n�o for uma barra de alvo 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 + 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 + --clicou na mesma barra 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 + --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 @@ -5573,7 +5573,7 @@ local row_on_mouseup = function(self, button) end end - --> nao tinha barras pressionadas + --nao tinha barras pressionadas info.mostrando_mouse_over = false self:SetAlpha (1) self.textura:SetStatusBarColor (129/255, 125/255, 69/255, 1) @@ -5587,11 +5587,11 @@ 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) + esta_barra:SetScript("OnEnter", row_on_enter) + esta_barra:SetScript("OnLeave", row_on_leave) - esta_barra:SetScript ("OnMouseDown", row_on_mousedown) - esta_barra:SetScript ("OnMouseUp", row_on_mouseup) + esta_barra:SetScript("OnMouseDown", row_on_mousedown) + esta_barra:SetScript("OnMouseUp", row_on_mouseup) end @@ -5724,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] @@ -5742,19 +5742,19 @@ 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 local cords = _detalhes.class_coords [class] if (info.target_persecond) then - GameTooltip:AddDoubleLine (index .. ". |TInterface\\AddOns\\Details\\images\\classes_small_alpha:14:14:0:0:128:128:"..cords[1]*128 ..":"..cords[2]*128 ..":"..cords[3]*128 ..":"..cords[4]*128 .."|t " .. target [1], _detalhes:comma_value ( _math_floor (target [2] / meu_tempo) ), 1, 1, 1, 1, 1, 1) + GameTooltip:AddDoubleLine (index .. ". |TInterface\\AddOns\\Details\\images\\classes_small_alpha:14:14:0:0:128:128:"..cords[1]*128 ..":"..cords[2]*128 ..":"..cords[3]*128 ..":"..cords[4]*128 .."|t " .. target [1], _detalhes:comma_value ( _math_floor(target [2] / meu_tempo) ), 1, 1, 1, 1, 1, 1) else GameTooltip:AddDoubleLine (index .. ". |TInterface\\AddOns\\Details\\images\\classes_small_alpha:14:14:0:0:128:128:"..cords[1]*128 ..":"..cords[2]*128 ..":"..cords[3]*128 ..":"..cords[4]*128 .."|t " .. target [1], SelectedToKFunction (_, target [2]), 1, 1, 1, 1, 1, 1) end else if (info.target_persecond) then - GameTooltip:AddDoubleLine (index .. ". " .. target [1], _detalhes:comma_value ( _math_floor (target [2] / meu_tempo)), 1, 1, 1, 1, 1, 1) + GameTooltip:AddDoubleLine (index .. ". " .. target [1], _detalhes:comma_value ( _math_floor(target [2] / meu_tempo)), 1, 1, 1, 1, 1, 1) else GameTooltip:AddDoubleLine (index .. ". " .. target [1], SelectedToKFunction (_, target [2]), 1, 1, 1, 1, 1, 1) end @@ -5865,10 +5865,10 @@ function gump:CriaNovaBarraInfo2(instancia, index) local janela = info.container_alvos.gump local esta_barra = _CreateFrame ("Button", "Details_infobox2_bar_"..index, info.container_alvos.gump, "BackdropTemplate") - esta_barra:SetHeight (CONST_TARGET_HEIGHT) + esta_barra:SetHeight(CONST_TARGET_HEIGHT) local y = (index-1) * (CONST_TARGET_HEIGHT + 1) - y = y*-1 --> baixo + y = y*-1 --baixo esta_barra:SetPoint("LEFT", janela, "LEFT", CONST_TARGET_HEIGHT, 0) esta_barra:SetPoint("RIGHT", janela, "RIGHT", 0, 0) @@ -5878,7 +5878,7 @@ function gump:CriaNovaBarraInfo2(instancia, index) esta_barra:EnableMouse (true) esta_barra:RegisterForClicks ("LeftButtonDown","RightButtonUp") - --> icone + --icone esta_barra.icone = esta_barra:CreateTexture(nil, "OVERLAY") esta_barra.icone:SetWidth(CONST_TARGET_HEIGHT) esta_barra.icone:SetHeight(CONST_TARGET_HEIGHT) @@ -5893,7 +5893,7 @@ function gump:CriaNovaBarraInfo2(instancia, index) SetBarraScripts(esta_barra, instancia, index) - info.barras2 [index] = esta_barra --> barra adicionada + info.barras2 [index] = esta_barra --barra adicionada return esta_barra end @@ -5910,15 +5910,15 @@ function gump:CriaNovaBarraInfo3 (instancia, index) local janela = info.container_detalhes - local esta_barra = CreateFrame ("Button", "Details_infobox3_bar_"..index, janela, "BackdropTemplate") - esta_barra:SetHeight (16) + 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) + --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) @@ -5926,11 +5926,11 @@ function gump:CriaNovaBarraInfo3 (instancia, index) CriaTexturaBarra(esta_barra) - --> icone - esta_barra.icone = esta_barra:CreateTexture (nil, "OVERLAY") - esta_barra.icone:SetWidth (14) - esta_barra.icone:SetHeight (14) - esta_barra.icone:SetPoint ("RIGHT", esta_barra.textura, "LEFT", 18, 0) + --icone + esta_barra.icone = esta_barra:CreateTexture(nil, "OVERLAY") + 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) @@ -5939,7 +5939,7 @@ function gump:CriaNovaBarraInfo3 (instancia, index) SetBarraScripts (esta_barra, instancia, index) - info.barras3 [index] = esta_barra --> barra adicionada + info.barras3 [index] = esta_barra --barra adicionada return esta_barra end diff --git a/frames/window_profiler.lua b/frames/window_profiler.lua index 605c047f..42dfc307 100644 --- a/frames/window_profiler.lua +++ b/frames/window_profiler.lua @@ -4,7 +4,7 @@ local L = _G.LibStub ("AceLocale-3.0"):GetLocale( "Details" ) function Details:OpenProfiler() - --> isn't first run, so just quit + --isn't first run, so just quit if (not Details.character_first_run) then return @@ -15,7 +15,7 @@ function Details:OpenProfiler() return else - --> check is this is the first run of the addon (after being installed) + --check is this is the first run of the addon (after being installed) local amount = 0 for name, profile in pairs (_detalhes_global.__profiles) do amount = amount + 1 @@ -26,26 +26,26 @@ function Details:OpenProfiler() end local f = Details:CreateWelcomePanel (nil, nil, 250, 300, true) - f:SetPoint ("right", UIParent, "right", -5, 0) + f:SetPoint("right", UIParent, "right", -5, 0) - local logo = f:CreateTexture (nil, "artwork") - logo:SetTexture ([[Interface\AddOns\Details\images\logotipo]]) - logo:SetSize (256*0.8, 128*0.8) - logo:SetPoint ("center", f, "center", 0, 0) - logo:SetPoint ("top", f, "top", 20, 20) + local logo = f:CreateTexture(nil, "artwork") + logo:SetTexture([[Interface\AddOns\Details\images\logotipo]]) + logo:SetSize(256*0.8, 128*0.8) + logo:SetPoint("center", f, "center", 0, 0) + logo:SetPoint("top", f, "top", 20, 20) local string_profiler = f:CreateFontString (nil, "artwork", "GameFontNormal") - string_profiler:SetPoint ("top", logo, "bottom", -20, 10) - string_profiler:SetText ("Profiler!") + string_profiler:SetPoint("top", logo, "bottom", -20, 10) + string_profiler:SetText("Profiler!") local string_profiler = f:CreateFontString (nil, "artwork", "GameFontNormal") - string_profiler:SetPoint ("topleft", f, "topleft", 10, -130) - string_profiler:SetText (L["STRING_OPTIONS_PROFILE_SELECTEXISTING"]) - string_profiler:SetWidth (230) + string_profiler:SetPoint("topleft", f, "topleft", 10, -130) + string_profiler:SetText(L["STRING_OPTIONS_PROFILE_SELECTEXISTING"]) + string_profiler:SetWidth(230) Details:SetFontSize (string_profiler, 11) - Details:SetFontColor (string_profiler, "white") + Details:SetFontColor(string_profiler, "white") - --> get the new profile name + --get the new profile name local current_profile = Details:GetCurrentProfileName() local on_select_profile = function(_, _, profilename) @@ -63,7 +63,7 @@ function Details:OpenProfiler() local t = { {value = current_profile, label = L["STRING_OPTIONS_PROFILE_USENEW"], onclick = on_select_profile, icon = [[Interface\FriendsFrame\UI-Toast-FriendRequestIcon]], texcoord = {4/32, 30/32, 4/32, 28/32}, iconcolor = "orange"} } - for _, profilename in ipairs (Details:GetProfileList()) do + for _, profilename in ipairs(Details:GetProfileList()) do if (profilename ~= current_profile) then t[#t+1] = {value = profilename, label = profilename, onclick = on_select_profile, icon = [[Interface\FriendsFrame\UI-Toast-FriendOnlineIcon]], texcoord = texcoord, iconcolor = "yellow"} end @@ -72,7 +72,7 @@ function Details:OpenProfiler() end local dropdown = Details.gump:NewDropDown (f, f, "DetailsProfilerProfileSelectorDropdown", "dropdown", 220, 20, fill_dropdown, 1) - dropdown:SetPoint (15, -190) + dropdown:SetPoint(15, -190) local confirm_func = function() if (current_profile ~= Details:GetCurrentProfileName()) then @@ -81,6 +81,6 @@ function Details:OpenProfiler() f:Hide() end local confirm = Details.gump:NewButton (f, f, "DetailsProfilerProfileConfirmButton", "button", 150, 20, confirm_func, nil, nil, nil, "Okey!") - confirm:SetPoint (50, -250) + confirm:SetPoint(50, -250) confirm:InstallCustomTexture() end \ No newline at end of file diff --git a/frames/window_report.lua b/frames/window_report.lua index 9fd846b4..b4e896cb 100644 --- a/frames/window_report.lua +++ b/frames/window_report.lua @@ -5,7 +5,7 @@ local Details = _G._detalhes local gump = Details.gump local _ ---> details API functions ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--details API functions ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- function Details:FastReportWindow(window) if (not DetailsReportWindow) then @@ -154,7 +154,7 @@ local _ Details.copypasteframe.EditBox:SetFocus(true) end ---> internal details report functions ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--internal details report functions ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- function Details:Reportar(param2, options, arg3, id) GameCooltip2:Hide() @@ -305,10 +305,10 @@ local createDropdown = function(thisFrame) end end - local channels = {GetChannelList()} --> coloca o resultado em uma tabela .. {id1, canal1, id2, canal2} + local channels = {GetChannelList()} --coloca o resultado em uma tabela .. {id1, canal1, id2, canal2} --09/august/2018: GetChannelList passed to return 3 values for each channel instead of 2 - for i = 1, #channels, 3 do --> total de canais + for i = 1, #channels, 3 do --total de canais reportChannelsTable[#reportChannelsTable + 1] = {iconsize = iconsize, value = "CHANNEL|" .. channels[i+1], label = channels[i] .. ". " .. channels[i+1], onclick = onClick, icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], texcoord = {0.3046875, 0.4453125, 0.109375, 0.390625}, iconcolor = {149/255, 112/255, 112/255}} end @@ -484,7 +484,7 @@ local createDropdown = function(thisFrame) editbox:SetText("") end - editbox.perdeu_foco = true --> isso aqui pra quando estiver editando e clicar em outra caixa + editbox.perdeu_foco = true --isso aqui pra quando estiver editando e clicar em outra caixa editbox:ClearFocus() end) @@ -608,7 +608,7 @@ local createDropdown = function(thisFrame) window.dropdown:SetPoint("topleft", window, "topleft", anchorX, -30) window.dropdown:SetBackdrop({bgFile = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]], edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, tile=true, tileSize = 64, insets = {left = 0, right = 0, top = 0, bottom = 0}}) - window.dropdown:SetBackdropBorderColor (0, 0, 0, 0.5) + window.dropdown:SetBackdropBorderColor(0, 0, 0, 0.5) window.dropdown:SetBackdropColor(0, 0, 0, 0.1) window.wisp_who:ClearAllPoints() @@ -619,7 +619,7 @@ local createDropdown = function(thisFrame) window.editbox:SetHeight(20) window.editbox:SetBackdrop({bgFile = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]], edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, tile=true, tileSize = 64, insets = {left = 0, right = 0, top = 0, bottom = 0}}) - window.editbox:SetBackdropBorderColor (0, 0, 0, 0.5) + window.editbox:SetBackdropBorderColor(0, 0, 0, 0.5) window.editbox:SetBackdropColor(0, 0, 0, 0.3) window.linhas_amt:ClearAllPoints() @@ -629,7 +629,7 @@ local createDropdown = function(thisFrame) window.slider:SetPoint("topleft", window.linhas_amt, "bottomleft", 0, -3) window.slider:SetBackdrop({bgFile = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]], edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, tile=true, tileSize = 64, insets = {left = 0, right = 0, top = 0, bottom = 0}}) - window.slider:SetBackdropBorderColor (0, 0, 0, 0.5) + window.slider:SetBackdropBorderColor(0, 0, 0, 0.5) window.slider:SetBackdropColor(0, 0, 0, 0.3) window.slider.thumb:SetTexture([[Interface\AddOns\Details\images\icons2]]) @@ -643,7 +643,7 @@ local createDropdown = function(thisFrame) reverse_checkbox:ClearAllPoints() reverse_checkbox:SetBackdrop({bgFile = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]], edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, tile=true, tileSize = 64, insets = {left = 0, right = 0, top = 0, bottom = 0}}) - reverse_checkbox:SetBackdropBorderColor (0, 0, 0, 0.5) + reverse_checkbox:SetBackdropBorderColor(0, 0, 0, 0.5) reverse_checkbox:SetBackdropColor(0, 0, 0, 0.3) reverse_checkbox:SetPoint("topleft", window.slider, "bottomleft", 0, -8) reverse_checkbox:SetSize(14, 14) @@ -665,7 +665,7 @@ local createDropdown = function(thisFrame) window:SetHeight(195) window:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1}) window:SetBackdropColor(1, 1, 1, 1) - window:SetBackdropBorderColor (0, 0, 0, 1) + window:SetBackdropBorderColor(0, 0, 0, 1) if (not window.widgets) then window.widgets = {} @@ -676,7 +676,7 @@ local createDropdown = function(thisFrame) titlebar:SetHeight(20) titlebar:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) titlebar:SetBackdropColor(.5, .5, .5, 1) - titlebar:SetBackdropBorderColor (0, 0, 0, 1) + titlebar:SetBackdropBorderColor(0, 0, 0, 1) local bg1 = window:CreateTexture(nil, "background") bg1:SetTexture([[Interface\AddOns\Details\images\background]], true) @@ -895,7 +895,7 @@ local createDropdown = function(thisFrame) --close button window.fechar = CreateFrame("Button", nil, window, "UIPanelCloseButton") window.fechar:SetScript("OnClick", function() - Details.FadeHandler.Fader (window, 1) + Details.FadeHandler.Fader(window, 1) Details.janela_report.ativa = false end) diff --git a/frames/window_rowtexteditor.lua b/frames/window_rowtexteditor.lua index 642a4d5a..e5940400 100644 --- a/frames/window_rowtexteditor.lua +++ b/frames/window_rowtexteditor.lua @@ -10,7 +10,7 @@ local windowWidth = 950 local scrollWidth = 825 local panel = Details:CreateWelcomePanel ("DetailsWindowOptionsBarTextEditor", nil, windowWidth, 600, true) -panel:SetPoint ("center", UIParent, "center") +panel:SetPoint("center", UIParent, "center") panel:Hide() panel:SetFrameStrata ("FULLSCREEN") DF:ApplyStandardBackdrop (panel) @@ -19,12 +19,12 @@ DF:CreateTitleBar (panel, "Details! Custom Line Text Editor") function panel:Open (text, callback, host, default) if (host) then panel:ClearAllPoints() - panel:SetPoint ("center", host, "center") + panel:SetPoint("center", host, "center") end text = text:gsub ("||", "|") panel.default_text = text - panel.editbox:SetText (text) + panel.editbox:SetText(text) panel.callback = callback panel.default = default or "" panel:Show() @@ -34,7 +34,7 @@ local y = -32 local buttonTemplate = DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE") local textentry = DF:NewSpecialLuaEditorEntry (panel, scrollWidth, 555, "editbox", "$parentEntry") -textentry:SetPoint ("topleft", panel, "topleft", 10, y) +textentry:SetPoint("topleft", panel, "topleft", 10, y) DF:ApplyStandardBackdrop (textentry) DF:SetFontSize (textentry.editbox, 14) DF:ReskinSlider(textentry.scroll) @@ -42,9 +42,9 @@ 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) local arg3_button = DF:NewButton (panel, nil, "$parentButton3", nil, 80, 20, function() textentry.editbox:Insert ("{data3}") end, nil, nil, nil, string.format (Loc ["STRING_OPTIONS_TEXTEDITOR_DATA"], "3"), 1) -arg1_button:SetPoint ("topright", panel, "topright", -12, y) -arg2_button:SetPoint ("topright", panel, "topright", -12, y - (20*1)) -arg3_button:SetPoint ("topright", panel, "topright", -12, y - (20*2)) +arg1_button:SetPoint("topright", panel, "topright", -12, y) +arg2_button:SetPoint("topright", panel, "topright", -12, y - (20*1)) +arg3_button:SetPoint("topright", panel, "topright", -12, y - (20*2)) arg1_button:SetTemplate (buttonTemplate) arg2_button:SetTemplate (buttonTemplate) arg3_button:SetTemplate (buttonTemplate) @@ -164,10 +164,10 @@ end local func_button = DF:NewButton (panel, nil, "$parentButton4", nil, 80, 20, function() textentry.editbox:Insert ("{func local player, combat = ...; return 0;}") end, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_FUNC"], 1) local color_button = DF:NewColorPickButton (panel, "$parentButton5", nil, color_func) -color_button:SetSize (80, 20) +color_button:SetSize(80, 20) color_button:SetTemplate (buttonTemplate) -func_button:SetPoint ("topright", panel, "topright", -12, y - (20*3)) +func_button:SetPoint("topright", panel, "topright", -12, y - (20*3)) func_button:SetTemplate (buttonTemplate) color_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_COLOR_TOOLTIP"] @@ -180,19 +180,19 @@ end local apply_button = DF:NewButton (panel, nil, "$parentApply", nil, 80, 20, function() panel.callback(panel.editbox:GetText()) end, nil, nil, nil, "Apply", 1) --localize-me apply_button:SetTemplate (buttonTemplate) -apply_button:SetPoint ("topright", panel, "topright", -14, -128) +apply_button:SetPoint("topright", panel, "topright", -14, -128) local ok_button = DF:NewButton (panel, nil, "$parentButtonOk", nil, 80, 20, done, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_DONE"], 1) ok_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_DONE_TOOLTIP"] ok_button:SetTemplate (buttonTemplate) -ok_button:SetPoint ("topright", panel, "topright", -14, -194) +ok_button:SetPoint("topright", panel, "topright", -14, -194) local reset_button = DF:NewButton (panel, nil, "$parentDefaultOk", nil, 80, 20, function() textentry.editbox:SetText(panel.default); panel.callback(panel.editbox:GetText()) end, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_RESET"], 1) reset_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_RESET_TOOLTIP"] reset_button:SetTemplate (buttonTemplate) -reset_button:SetPoint ("topright", panel, "topright", -14, -150) +reset_button:SetPoint("topright", panel, "topright", -14, -150) -local cancel_button = DF:NewButton (panel, nil, "$parentDefaultCancel", nil, 80, 20, function() textentry.editbox:SetText (panel.default_text); done(); end, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_CANCEL"], 1) +local cancel_button = DF:NewButton (panel, nil, "$parentDefaultCancel", nil, 80, 20, function() textentry.editbox:SetText(panel.default_text); done(); end, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_CANCEL"], 1) cancel_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_CANCEL_TOOLTIP"] cancel_button:SetTemplate (buttonTemplate) -cancel_button:SetPoint ("topright", panel, "topright", -14, -172) \ No newline at end of file +cancel_button:SetPoint("topright", panel, "topright", -14, -172) \ No newline at end of file diff --git a/frames/window_runcode.lua b/frames/window_runcode.lua index 9cecfe64..5094c7ba 100644 --- a/frames/window_runcode.lua +++ b/frames/window_runcode.lua @@ -32,24 +32,24 @@ function Details.OpenRunCodeWindow() local f = DetailsRunCodePanel or DF:CreateSimplePanel (UIParent, 700, 480, "Details! Run Code", "DetailsRunCodePanel") - --> lua editor + --lua editor local code_editor = DF:NewSpecialLuaEditorEntry (f, 885, 510, "text", "$parentCodeEditorWindow") f.CodeEditor = code_editor - code_editor:SetPoint ("topleft", f, "topleft", 20, -56) + code_editor:SetPoint("topleft", f, "topleft", 20, -56) - --> code editor appearance - code_editor.scroll:SetBackdrop (nil) - code_editor.editbox:SetBackdrop (nil) - code_editor:SetBackdrop (nil) + --code editor appearance + code_editor.scroll:SetBackdrop(nil) + code_editor.editbox:SetBackdrop(nil) + code_editor:SetBackdrop(nil) DF:ReskinSlider(code_editor.scroll) if (not code_editor.__background) then - code_editor.__background = code_editor:CreateTexture (nil, "background") + code_editor.__background = code_editor:CreateTexture(nil, "background") end - code_editor:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1}) - code_editor:SetBackdropBorderColor (0, 0, 0, 1) + code_editor:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1}) + code_editor:SetBackdropBorderColor(0, 0, 0, 1) code_editor.__background:SetColorTexture (0.2317647, 0.2317647, 0.2317647) code_editor.__background:SetVertexColor (0.27, 0.27, 0.27) @@ -58,20 +58,20 @@ function Details.OpenRunCodeWindow() code_editor.__background:SetHorizTile (true) code_editor.__background:SetAllPoints() - --> code compile error warning - local errortext_frame = CreateFrame ("frame", nil, code_editor,"BackdropTemplate") - errortext_frame:SetPoint ("bottomleft", code_editor, "bottomleft", 1, 1) - errortext_frame:SetPoint ("bottomright", code_editor, "bottomright", -1, 1) - errortext_frame:SetHeight (20) - errortext_frame:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - errortext_frame:SetBackdropBorderColor (0, 0, 0, 1) - errortext_frame:SetBackdropColor (0, 0, 0) + --code compile error warning + local errortext_frame = CreateFrame("frame", nil, code_editor,"BackdropTemplate") + errortext_frame:SetPoint("bottomleft", code_editor, "bottomleft", 1, 1) + errortext_frame:SetPoint("bottomright", code_editor, "bottomright", -1, 1) + errortext_frame:SetHeight(20) + errortext_frame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + errortext_frame:SetBackdropBorderColor(0, 0, 0, 1) + errortext_frame:SetBackdropColor(0, 0, 0) DF:CreateFlashAnimation (errortext_frame) - local errortext_label = DF:CreateLabel (errortext_frame, "", DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")) + local errortext_label = DF:CreateLabel(errortext_frame, "", DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")) errortext_label.textcolor = "red" - errortext_label:SetPoint ("left", errortext_frame, "left", 3, 0) + errortext_label:SetPoint("left", errortext_frame, "left", 3, 0) code_editor.NextCodeCheck = 0.33 code_editor:HookScript ("OnUpdate", function(self, deltaTime) @@ -96,15 +96,15 @@ function Details.OpenRunCodeWindow() end end) - --> script selector + --script selector local on_select_CodeType_option = function(self, fixedParameter, value) - --> set the current editing code type + --set the current editing code type f.EditingCode = Details.RunCodeTypes [value].Value f.EditingCodeKey = Details.RunCodeTypes [value].ProfileKey - --> load the code for the event + --load the code for the event local code = Details.run_code [f.EditingCodeKey] - code_editor:SetText (code) + code_editor:SetText(code) end local build_CodeType_dropdown_options = function() @@ -118,13 +118,13 @@ function Details.OpenRunCodeWindow() return t end - local code_type_label = DF:CreateLabel (f, "Event:", DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")) + local code_type_label = DF:CreateLabel(f, "Event:", DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")) local code_type_dropdown = DF:CreateDropDown (f, build_CodeType_dropdown_options, 1, 160, 20, "CodeTypeDropdown", _, DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) - code_type_dropdown:SetPoint ("left", code_type_label, "right", 2, 0) + code_type_dropdown:SetPoint("left", code_type_label, "right", 2, 0) code_type_dropdown:SetFrameLevel (code_editor:GetFrameLevel() + 10) - code_type_label:SetPoint ("bottomleft", code_editor, "topleft", 0, 8) + code_type_label:SetPoint("bottomleft", code_editor, "topleft", 0, 8) - --> create save button + --create save button local save_script = function() local code = code_editor:GetText() local func, errortext = loadstring (code, "Q") @@ -132,11 +132,11 @@ function Details.OpenRunCodeWindow() if (func) then Details.run_code [f.EditingCodeKey] = code Details:RecompileAutoRunCode() - Details:Msg ("Code saved!") + Details:Msg("Code saved!") code_editor:ClearFocus() else errortext_frame:Flash (0.2, 0.2, 0.4, true, nil, nil, "NONE") - Details:Msg ("Can't save the code: it has errors.") + Details:Msg("Can't save the code: it has errors.") end end @@ -144,20 +144,20 @@ function Details.OpenRunCodeWindow() local save_script_button = DF:CreateButton (f, save_script, 120, 20, "Save", -1, nil, nil, nil, nil, nil, DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE"), DF:GetTemplate ("font", "PLATER_BUTTON")) save_script_button:SetIcon ([[Interface\BUTTONS\UI-Panel-ExpandButton-Up]], 20, 20, "overlay", {0.1, .9, 0.1, .9}) - save_script_button:SetPoint ("topright", code_editor, "bottomright", 0, button_y) + save_script_button:SetPoint("topright", code_editor, "bottomright", 0, button_y) - --> create cancel button + --create cancel button local cancel_script = function() - code_editor:SetText (Details.run_code [f.EditingCodeKey]) - Details:Msg ("Code cancelled!") + code_editor:SetText(Details.run_code [f.EditingCodeKey]) + Details:Msg("Code cancelled!") code_editor:ClearFocus() end local cancel_script_button = DF:CreateButton (f, cancel_script, 120, 20, "Cancel", -1, nil, nil, nil, nil, nil, DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE"), DF:GetTemplate ("font", "PLATER_BUTTON")) cancel_script_button:SetIcon ([[Interface\BUTTONS\UI-Panel-MinimizeButton-Up]], 20, 20, "overlay", {0.1, .9, 0.1, .9}) - cancel_script_button:SetPoint ("topleft", code_editor, "bottomleft", 0, button_y) + cancel_script_button:SetPoint("topleft", code_editor, "bottomleft", 0, button_y) - --> create run now button + --create run now button local execute_script = function() local script = code_editor:GetText() @@ -173,17 +173,17 @@ function Details.OpenRunCodeWindow() local run_script_button = DF:CreateButton (f, execute_script, 120, 20, "Test Code", -1, nil, nil, nil, nil, nil, DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE"), DF:GetTemplate ("font", "PLATER_BUTTON")) run_script_button:SetIcon ([[Interface\BUTTONS\UI-SpellbookIcon-NextPage-Up]], 20, 20, "overlay", {0.05, 0.95, 0.05, 0.95}) - run_script_button:SetPoint ("bottomright", code_editor, "topright", 0, 3) + run_script_button:SetPoint("bottomright", code_editor, "topright", 0, 3) end DetailsPluginContainerWindow.OpenPlugin (DetailsRunCodePanel) DetailsRunCodePanel.CodeTypeDropdown:Select (1, true) - --> show the initialization code when showing up this window + --show the initialization code when showing up this window DetailsRunCodePanel.EditingCode = Details.RunCodeTypes [1].Value DetailsRunCodePanel.EditingCodeKey = Details.RunCodeTypes [1].ProfileKey local code = Details.run_code [DetailsRunCodePanel.EditingCodeKey] - DetailsRunCodePanel.CodeEditor:SetText (code) + DetailsRunCodePanel.CodeEditor:SetText(code) end diff --git a/frames/window_scrolldamage.lua b/frames/window_scrolldamage.lua index 7e875203..a15d5c2f 100644 --- a/frames/window_scrolldamage.lua +++ b/frames/window_scrolldamage.lua @@ -7,11 +7,11 @@ local _ function Details:ScrollDamage() if (not DetailsScrollDamage) then DetailsScrollDamage = DetailsFramework:CreateSimplePanel(UIParent) - DetailsScrollDamage:SetSize (427 - 40 - 20 - 20, 505 - 150 + 20 + 40) + DetailsScrollDamage:SetSize(427 - 40 - 20 - 20, 505 - 150 + 20 + 40) DetailsScrollDamage:SetTitle ("Details! Scroll Damage (/details scroll)") DetailsScrollDamage.Data = {} DetailsScrollDamage:ClearAllPoints() - DetailsScrollDamage:SetPoint ("left", UIParent, "left", 10, 0) + DetailsScrollDamage:SetPoint("left", UIParent, "left", 10, 0) DetailsScrollDamage:Hide() local scroll_width = 395 - 40 - 20 - 20 diff --git a/frames/window_statistics.lua b/frames/window_statistics.lua index 09d0f4d3..d0837803 100644 --- a/frames/window_statistics.lua +++ b/frames/window_statistics.lua @@ -10,7 +10,7 @@ local Loc = _G.LibStub("AceLocale-3.0"):GetLocale("Details") local CONST_GUILD_SYNC = "GS" function Details:InitializeRaidHistoryWindow() - local DetailsRaidHistoryWindow = CreateFrame ("frame", "DetailsRaidHistoryWindow", UIParent,"BackdropTemplate") + local DetailsRaidHistoryWindow = CreateFrame("frame", "DetailsRaidHistoryWindow", UIParent,"BackdropTemplate") DetailsRaidHistoryWindow.Frame = DetailsRaidHistoryWindow DetailsRaidHistoryWindow.__name = Loc ["STRING_STATISTICS"] DetailsRaidHistoryWindow.real_name = "DETAILS_STATISTICS" @@ -33,14 +33,14 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild DetailsRaidHistoryWindow.Initialized = true - local f = DetailsRaidHistoryWindow or CreateFrame ("frame", "DetailsRaidHistoryWindow", UIParent,"BackdropTemplate") --, "ButtonFrameTemplate" - f:SetPoint ("center", UIParent, "center") + local f = DetailsRaidHistoryWindow or CreateFrame("frame", "DetailsRaidHistoryWindow", UIParent,"BackdropTemplate") --, "ButtonFrameTemplate" + f:SetPoint("center", UIParent, "center") f:SetFrameStrata ("HIGH") f:SetToplevel (true) f:SetMovable (true) - f:SetWidth (850) - f:SetHeight (500) + f:SetWidth(850) + f:SetHeight(500) tinsert (UISpecialFrames, "DetailsRaidHistoryWindow") function f.OpenDB() @@ -65,54 +65,54 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild f.Mode = 2 - f.bg1 = f:CreateTexture (nil, "background") - f.bg1:SetTexture ([[Interface\AddOns\Details\images\background]], true) + f.bg1 = f:CreateTexture(nil, "background") + f.bg1:SetTexture([[Interface\AddOns\Details\images\background]], true) f.bg1:SetAlpha (0.7) f.bg1:SetVertexColor (0.27, 0.27, 0.27) f.bg1:SetVertTile (true) f.bg1:SetHorizTile (true) - f.bg1:SetSize (790, 454) + f.bg1:SetSize(790, 454) f.bg1:SetAllPoints() - f:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) - f:SetBackdropColor (.5, .5, .5, .5) - f:SetBackdropBorderColor (0, 0, 0, 1) + f:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) + f:SetBackdropColor(.5, .5, .5, .5) + f:SetBackdropBorderColor(0, 0, 0, 1) local titlebar = DF:CreateTitleBar(f, "Details! " .. Loc ["STRING_STATISTICS"]) if (not Details:GetTutorialCVar ("HISTORYPANEL_TUTORIAL")) then - local tutorialFrame = CreateFrame ("frame", "$parentTutorialFrame",f,"BackdropTemplate") - tutorialFrame:SetPoint ("center", f, "center") + local tutorialFrame = CreateFrame("frame", "$parentTutorialFrame",f,"BackdropTemplate") + tutorialFrame:SetPoint("center", f, "center") tutorialFrame:SetFrameStrata ("DIALOG") - tutorialFrame:SetSize (400, 300) - tutorialFrame:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16, + tutorialFrame:SetSize(400, 300) + tutorialFrame:SetBackdrop({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}, edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize=1}) - tutorialFrame:SetBackdropColor (0, 0, 0, 1) + tutorialFrame:SetBackdropColor(0, 0, 0, 1) - tutorialFrame.Title = DF:CreateLabel (tutorialFrame, "Statistics" , 12, "orange") --curse localization isn't adding new strings (and I deleted the old one) - tutorialFrame.Title:SetPoint ("top", tutorialFrame, "top", 0, -5) + tutorialFrame.Title = DF:CreateLabel(tutorialFrame, "Statistics" , 12, "orange") --curse localization isn't adding new strings (and I deleted the old one) + tutorialFrame.Title:SetPoint("top", tutorialFrame, "top", 0, -5) - tutorialFrame.Desc = DF:CreateLabel (tutorialFrame, Loc ["STRING_GUILDDAMAGERANK_TUTORIAL_DESC"], 12) + tutorialFrame.Desc = DF:CreateLabel(tutorialFrame, Loc ["STRING_GUILDDAMAGERANK_TUTORIAL_DESC"], 12) tutorialFrame.Desc.width = 370 - tutorialFrame.Desc:SetPoint ("topleft", tutorialFrame, "topleft", 10, -45) + tutorialFrame.Desc:SetPoint("topleft", tutorialFrame, "topleft", 10, -45) local closeButton = DF:CreateButton (tutorialFrame, function() Details:SetTutorialCVar ("HISTORYPANEL_TUTORIAL", true); tutorialFrame:Hide() end, 80, 20, Loc ["STRING_OPTIONS_CHART_CLOSE"]) - closeButton:SetPoint ("bottom", tutorialFrame, "bottom", 0, 10) + closeButton:SetPoint("bottom", tutorialFrame, "bottom", 0, 10) closeButton:SetTemplate (DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) end - --> background - local background = f:CreateTexture ("$parentBackgroundImage", "border") + --background + local background = f:CreateTexture("$parentBackgroundImage", "border") background:SetAlpha (0.3) - background:SetPoint ("topleft", f, "topleft", 6, -65) - background:SetPoint ("bottomright", f, "bottomright", -10, 28) + background:SetPoint("topleft", f, "topleft", 6, -65) + background:SetPoint("bottomright", f, "bottomright", -10, 28) - --> separate menu and main list - local div = f:CreateTexture (nil, "artwork") - div:SetTexture ([[Interface\ACHIEVEMENTFRAME\UI-Achievement-MetalBorder-Left]]) + --separate menu and main list + local div = f:CreateTexture(nil, "artwork") + div:SetTexture([[Interface\ACHIEVEMENTFRAME\UI-Achievement-MetalBorder-Left]]) div:SetAlpha (0.1) - div:SetPoint ("topleft", f, "topleft", 180, -64) - div:SetHeight (574) + div:SetPoint("topleft", f, "topleft", 180, -64) + div:SetHeight(574) --select history or guild rank local options_switch_template = DF:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE") @@ -120,16 +120,16 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild local options_button_template = DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE") local selectKillTimeline = function() - f.GuildRankCheckBox:SetValue (false) - f.HistoryCheckBox:SetValue (true) + f.GuildRankCheckBox:SetValue(false) + f.HistoryCheckBox:SetValue(true) f.Mode = 1 _G.DetailsRaidHistoryWindow:Refresh() f.ReportButton:Hide() end local selectGuildRank = function() - f.HistoryCheckBox:SetValue (false) - f.GuildRankCheckBox:SetValue (true) + f.HistoryCheckBox:SetValue(false) + f.GuildRankCheckBox:SetValue(true) _G.DetailsRaidHistoryWindow.select_player:Select (1, true) f.select_player2:Hide() f.select_player2_label:Hide() @@ -142,19 +142,19 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild local HistoryCheckBox, HistoryLabel = DF:CreateSwitch (f, selectKillTimeline, false, 18, 18, "", "", "HistoryCheckBox", nil, nil, nil, nil, Loc ["STRING_GUILDDAMAGERANK_SHOWHISTORY"], options_switch_template) --, options_text_template HistoryLabel:ClearAllPoints() HistoryCheckBox:ClearAllPoints() - HistoryCheckBox:SetPoint ("topleft", f, "topleft", 100, -34) - HistoryLabel:SetPoint ("left", HistoryCheckBox, "right", 2, 0) + HistoryCheckBox:SetPoint("topleft", f, "topleft", 100, -34) + HistoryLabel:SetPoint("left", HistoryCheckBox, "right", 2, 0) HistoryCheckBox:SetAsCheckBox() --guildrank local GuildRankCheckBox, GuildRankLabel = DF:CreateSwitch (f, selectGuildRank, true, 18, 18, "", "", "GuildRankCheckBox", nil, nil, nil, nil, Loc ["STRING_GUILDDAMAGERANK_SHOWRANK"], options_switch_template) --, options_text_template GuildRankLabel:ClearAllPoints() GuildRankCheckBox:ClearAllPoints() - GuildRankCheckBox:SetPoint ("topleft", f, "topleft", 240, -34) - GuildRankLabel:SetPoint ("left", GuildRankCheckBox, "right", 2, 0) + GuildRankCheckBox:SetPoint("topleft", f, "topleft", 240, -34) + GuildRankLabel:SetPoint("left", GuildRankCheckBox, "right", 2, 0) GuildRankCheckBox:SetAsCheckBox() - --> guild sync + --guild sync local doGuildSync = function() f.RequestedAmount = 0 f.DownloadedAmount = 0 @@ -166,35 +166,35 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild f.GuildSyncButton:Disable() if (not f.SyncTexture) then - local workingFrame = CreateFrame ("frame", nil, f,"BackdropTemplate") + local workingFrame = CreateFrame("frame", nil, f,"BackdropTemplate") f.WorkingFrame = workingFrame - workingFrame:SetSize (1, 1) - f.SyncTextureBackground = workingFrame:CreateTexture (nil, "border") - f.SyncTextureBackground:SetPoint ("bottomright", f, "bottomright", -5, -1) - f.SyncTextureBackground:SetTexture ([[Interface\COMMON\StreamBackground]]) - f.SyncTextureBackground:SetSize (32, 32) - f.SyncTextureCircle = workingFrame:CreateTexture (nil, "artwork") - f.SyncTextureCircle:SetPoint ("center", f.SyncTextureBackground, "center", 0, 0) - f.SyncTextureCircle:SetTexture ([[Interface\COMMON\StreamCircle]]) - f.SyncTextureCircle:SetSize (32, 32) - f.SyncTextureGrade = workingFrame:CreateTexture (nil, "overlay") - f.SyncTextureGrade:SetPoint ("center", f.SyncTextureBackground, "center", 0, 0) - f.SyncTextureGrade:SetTexture ([[Interface\COMMON\StreamFrame]]) - f.SyncTextureGrade:SetSize (32, 32) + workingFrame:SetSize(1, 1) + f.SyncTextureBackground = workingFrame:CreateTexture(nil, "border") + f.SyncTextureBackground:SetPoint("bottomright", f, "bottomright", -5, -1) + f.SyncTextureBackground:SetTexture([[Interface\COMMON\StreamBackground]]) + f.SyncTextureBackground:SetSize(32, 32) + f.SyncTextureCircle = workingFrame:CreateTexture(nil, "artwork") + f.SyncTextureCircle:SetPoint("center", f.SyncTextureBackground, "center", 0, 0) + f.SyncTextureCircle:SetTexture([[Interface\COMMON\StreamCircle]]) + f.SyncTextureCircle:SetSize(32, 32) + f.SyncTextureGrade = workingFrame:CreateTexture(nil, "overlay") + f.SyncTextureGrade:SetPoint("center", f.SyncTextureBackground, "center", 0, 0) + f.SyncTextureGrade:SetTexture([[Interface\COMMON\StreamFrame]]) + f.SyncTextureGrade:SetSize(32, 32) local animationHub = DF:CreateAnimationHub (workingFrame) animationHub:SetLooping ("Repeat") f.WorkingAnimation = animationHub - local rotation = DF:CreateAnimation (animationHub, "ROTATION", 1, 3, -360) + local rotation = DF:CreateAnimation(animationHub, "ROTATION", 1, 3, -360) rotation:SetTarget (f.SyncTextureCircle) f.SyncText = workingFrame:CreateFontString (nil, "border", "GameFontNormal") - f.SyncText:SetPoint ("right", f.SyncTextureBackground, "left", 0, 0) - f.SyncText:SetText ("working") + f.SyncText:SetPoint("right", f.SyncTextureBackground, "left", 0, 0) + f.SyncText:SetText("working") local endAnimationHub = DF:CreateAnimationHub (workingFrame, nil, function() workingFrame:Hide() end) - DF:CreateAnimation (endAnimationHub, "ALPHA", 1, 0.5, 1, 0) + DF:CreateAnimation(endAnimationHub, "ALPHA", 1, 0.5, 1, 0) f.EndAnimationHub = endAnimationHub end @@ -215,10 +215,10 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild end local GuildSyncButton = DF:CreateButton (f, doGuildSync, 130, 20, Loc ["STRING_GUILDDAMAGERANK_SYNCBUTTONTEXT"], nil, nil, nil, "GuildSyncButton", nil, nil, options_button_template, options_text_template) - GuildSyncButton:SetPoint ("topright", f, "topright", -20, -34) + GuildSyncButton:SetPoint("topright", f, "topright", -20, -34) GuildSyncButton:SetIcon ([[Interface\GLUES\CharacterSelect\RestoreButton]], 12, 12, "overlay", {0.2, .8, 0.2, .8}, nil, 4) - --> listen to comm events + --listen to comm events local eventListener = Details:CreateEventListener() function eventListener:OnCommReceived (event, length, prefix, playerName, realmName, detailsVersion, guildSyncID, data) @@ -239,7 +239,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild f.DownloadedSize = f.DownloadedSize + length local downloadSpeed = f.DownloadedSize / (time() - f.SyncStartTime) - f.SyncText:SetText ("working [downloading " .. f.DownloadedAmount .. "/" .. f.RequestedAmount .. ", " .. format ("%.2f", downloadSpeed/1024) .. "Kbps]") + f.SyncText:SetText("working [downloading " .. f.DownloadedAmount .. "/" .. f.RequestedAmount .. ", " .. format ("%.2f", downloadSpeed/1024) .. "Kbps]") end end end @@ -252,7 +252,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild --requested to download a selected list of encounter tables elseif (guildSyncID == "G") then f.RequestedAmount = f.RequestedAmount + #missingIDs - f.SyncText:SetText ("working [downloading " .. f.DownloadedAmount .. "/" .. f.RequestedAmount .. "]") + f.SyncText:SetText("working [downloading " .. f.DownloadedAmount .. "/" .. f.RequestedAmount .. "]") end end end @@ -260,7 +260,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild eventListener:RegisterEvent ("COMM_EVENT_RECEIVED", "OnCommReceived") eventListener:RegisterEvent ("COMM_EVENT_SENT", "OnCommSent") - --> report results + --report results function f.BuildReport() if (f.LatestResourceTable) then local reportFunc = function(IsCurrent, IsReverse, AmtLines) @@ -291,7 +291,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild end local ReportButton = DF:CreateButton (f, f.BuildReport, 130, 20, Loc ["STRING_OPTIONS_REPORT_ANCHOR"]:gsub (":", ""), nil, nil, nil, "ReportButton", nil, nil, options_button_template, options_text_template) - ReportButton:SetPoint ("right", GuildSyncButton, "left", -2, 0) + ReportButton:SetPoint("right", GuildSyncButton, "left", -2, 0) ReportButton:SetIcon ([[Interface\GLUES\CharacterSelect\RestoreButton]], 12, 12, "overlay", {0.2, .8, 0.2, .8}, nil, 4) -- @@ -313,8 +313,8 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild end end - --> window script handlers - f:SetScript ("OnMouseDown", function(self, button) + --window script handlers + f:SetScript("OnMouseDown", function(self, button) if (self.isMoving) then return end @@ -326,15 +326,15 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild end end) - f:SetScript ("OnMouseUp", function(self, button) + f:SetScript("OnMouseUp", function(self, button) if (self.isMoving and button == "LeftButton") then self:StopMovingOrSizing() self.isMoving = nil end end) - f:SetScript ("OnHide", function() - --> save latest shown state + f:SetScript("OnHide", function() + --save latest shown state f.LatestSelection = f.LatestSelection or {} f.LatestSelection.Raid = DetailsRaidHistoryWindow.select_raid.value f.LatestSelection.Boss = DetailsRaidHistoryWindow.select_boss.value @@ -362,7 +362,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild end end - --> select raid: + --select raid: local onRaidSelect = function(_, _, raid) Details.rank_window.last_raid = raid f:UpdateDropdowns (true) @@ -372,10 +372,10 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild return raidList end local raid_dropdown = DF:CreateDropDown (f, buildRaidList, 1, dropdownWidth, 20, "select_raid") - local raid_string = DF:CreateLabel (f, Loc ["STRING_GUILDDAMAGERANK_RAID"] .. ":", _, _, "GameFontNormal", "select_raid_label") + local raid_string = DF:CreateLabel(f, Loc ["STRING_GUILDDAMAGERANK_RAID"] .. ":", _, _, "GameFontNormal", "select_raid_label") raid_dropdown:SetTemplate (DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) - --> select boss: + --select boss: local on_boss_select = function(_, _, boss) on_select() end @@ -383,10 +383,10 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild return bossList end local boss_dropdown = DF:CreateDropDown (f, build_boss_list, 1, dropdownWidth, 20, "select_boss") - local boss_string = DF:CreateLabel (f, Loc ["STRING_GUILDDAMAGERANK_BOSS"] .. ":", _, _, "GameFontNormal", "select_boss_label") + local boss_string = DF:CreateLabel(f, Loc ["STRING_GUILDDAMAGERANK_BOSS"] .. ":", _, _, "GameFontNormal", "select_boss_label") boss_dropdown:SetTemplate (DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) - --> select difficulty: + --select difficulty: local on_diff_select = function(_, _, diff) Details.rank_window.last_difficulty = diff on_select() @@ -396,10 +396,10 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild return difficultyList end local diff_dropdown = DF:CreateDropDown (f, build_diff_list, 1, dropdownWidth, 20, "select_diff") - local diff_string = DF:CreateLabel (f, Loc ["STRING_GUILDDAMAGERANK_DIFF"] .. ":", _, _, "GameFontNormal", "select_diff_label") + local diff_string = DF:CreateLabel(f, Loc ["STRING_GUILDDAMAGERANK_DIFF"] .. ":", _, _, "GameFontNormal", "select_diff_label") diff_dropdown:SetTemplate (DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) - --> select role: + --select role: local on_role_select = function(_, _, role) on_select() end @@ -410,10 +410,10 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild } end local role_dropdown = DF:CreateDropDown (f, build_role_list, 1, dropdownWidth, 20, "select_role") - local role_string = DF:CreateLabel (f, Loc ["STRING_GUILDDAMAGERANK_ROLE"] .. ":", _, _, "GameFontNormal", "select_role_label") + local role_string = DF:CreateLabel(f, Loc ["STRING_GUILDDAMAGERANK_ROLE"] .. ":", _, _, "GameFontNormal", "select_role_label") role_dropdown:SetTemplate (DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) - --> select guild: + --select guild: local on_guild_select = function(_, _, guild) on_select() end @@ -421,10 +421,10 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild return guildList end local guild_dropdown = DF:CreateDropDown (f, build_guild_list, 1, dropdownWidth, 20, "select_guild") - local guild_string = DF:CreateLabel (f, Loc ["STRING_GUILDDAMAGERANK_GUILD"] .. ":", _, _, "GameFontNormal", "select_guild_label") + local guild_string = DF:CreateLabel(f, Loc ["STRING_GUILDDAMAGERANK_GUILD"] .. ":", _, _, "GameFontNormal", "select_guild_label") guild_dropdown:SetTemplate (DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) - --> select playerbase: + --select playerbase: local on_player_select = function(_, _, player) on_select() end @@ -435,10 +435,10 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild } end local player_dropdown = DF:CreateDropDown (f, build_player_list, 1, dropdownWidth, 20, "select_player") - local player_string = DF:CreateLabel (f, Loc ["STRING_GUILDDAMAGERANK_PLAYERBASE"] .. ":", _, _, "GameFontNormal", "select_player_label") + local player_string = DF:CreateLabel(f, Loc ["STRING_GUILDDAMAGERANK_PLAYERBASE"] .. ":", _, _, "GameFontNormal", "select_player_label") player_dropdown:SetTemplate (DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) - --> select player: + --select player: local onPlayer2Select = function(_, _, player) f.latest_player_selected = player f:BuildPlayerTable (player) @@ -448,7 +448,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild local t = {} local alreadyListed = {} if (encounterTable) then - for encounterIndex, encounter in ipairs (encounterTable) do + for encounterIndex, encounter in ipairs(encounterTable) do if (encounter.guild == guild) then local roleTable = encounter [role] for playerName, _ in pairs (roleTable) do @@ -465,7 +465,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild return t end local player2_dropdown = DF:CreateDropDown (f, build_player2_list, 1, dropdownWidth, 20, "select_player2") - local player2_string = DF:CreateLabel (f, Loc ["STRING_GUILDDAMAGERANK_PLAYERBASE_PLAYER"] .. ":", _, _, "GameFontNormal", "select_player2_label") + local player2_string = DF:CreateLabel(f, Loc ["STRING_GUILDDAMAGERANK_PLAYERBASE_PLAYER"] .. ":", _, _, "GameFontNormal", "select_player2_label") player2_dropdown:SetTemplate (DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) function f:UpdateDropdowns(DoNotSelectRaid) @@ -510,7 +510,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild elseif (difficulty == 16) then local alreadyHave = false - for i, t in ipairs (difficultyList) do + for i, t in ipairs(difficultyList) do if (t.label == "Mythic") then alreadyHave = true end @@ -540,7 +540,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild end end - for index, encounter in ipairs (encounterTable) do + for index, encounter in ipairs(encounterTable) do local guild = encounter.guild if (not guildRepeated [guild]) then tinsert (guildList, {value = guild, label = guild, icon = icon, onclick = on_guild_select}) @@ -578,13 +578,13 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild wipe (bossList) for difficulty, encounterIdTable in pairs (db) do - if (type (difficulty) == "number") then + if (type(difficulty) == "number") then if (difficulty == 14) then --tinsert (difficultyList, {value = 14, label = "Normal", icon = icon, onclick = on_diff_select}) --print ("has normal encounter") elseif (difficulty == 15) then local alreadyHave = false - for i, t in ipairs (difficultyList) do + for i, t in ipairs(difficultyList) do if (t.label == "Heroic") then alreadyHave = true end @@ -594,7 +594,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild end elseif (difficulty == 16) then local alreadyHave = false - for i, t in ipairs (difficultyList) do + for i, t in ipairs(difficultyList) do if (t.label == "Mythic") then alreadyHave = true end @@ -636,39 +636,39 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild boss_dropdown:Refresh() end - --> anchors: - raid_string:SetPoint ("topleft", f, "topleft", 10, -70) - raid_dropdown:SetPoint ("topleft", f, "topleft", 10, -85) + --anchors: + raid_string:SetPoint("topleft", f, "topleft", 10, -70) + raid_dropdown:SetPoint("topleft", f, "topleft", 10, -85) - boss_string:SetPoint ("topleft", f, "topleft", 10, -110) - boss_dropdown:SetPoint ("topleft", f, "topleft", 10, -125) + boss_string:SetPoint("topleft", f, "topleft", 10, -110) + boss_dropdown:SetPoint("topleft", f, "topleft", 10, -125) - diff_string:SetPoint ("topleft", f, "topleft", 10, -150) - diff_dropdown:SetPoint ("topleft", f, "topleft", 10, -165) + diff_string:SetPoint("topleft", f, "topleft", 10, -150) + diff_dropdown:SetPoint("topleft", f, "topleft", 10, -165) - role_string:SetPoint ("topleft", f, "topleft", 10, -190) - role_dropdown:SetPoint ("topleft", f, "topleft", 10, -205) + role_string:SetPoint("topleft", f, "topleft", 10, -190) + role_dropdown:SetPoint("topleft", f, "topleft", 10, -205) - guild_string:SetPoint ("topleft", f, "topleft", 10, -230) - guild_dropdown:SetPoint ("topleft", f, "topleft", 10, -245) + guild_string:SetPoint("topleft", f, "topleft", 10, -230) + guild_dropdown:SetPoint("topleft", f, "topleft", 10, -245) - player_string:SetPoint ("topleft", f, "topleft", 10, -270) - player_dropdown:SetPoint ("topleft", f, "topleft", 10, -285) + player_string:SetPoint("topleft", f, "topleft", 10, -270) + player_dropdown:SetPoint("topleft", f, "topleft", 10, -285) - player2_string:SetPoint ("topleft", f, "topleft", 10, -310) - player2_dropdown:SetPoint ("topleft", f, "topleft", 10, -325) + player2_string:SetPoint("topleft", f, "topleft", 10, -310) + player2_dropdown:SetPoint("topleft", f, "topleft", 10, -325) player2_string:Hide() player2_dropdown:Hide() - --> refresh the window: + --refresh the window: function f:BuildPlayerTable (playerName) local encounterTable, guild, role = unpack (f.build_player2_data or {}) local data = {} - if (type (playerName) == "string" and string.len (playerName) > 1) then - for encounterIndex, encounter in ipairs (encounterTable) do + if (type(playerName) == "string" and string.len (playerName) > 1) then + for encounterIndex, encounter in ipairs(encounterTable) do if (encounter.guild == guild) then local roleTable = encounter [role] @@ -687,7 +687,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild end end - --> update graphic + --update graphic if (not f.gframe) then local onenter = function(self) @@ -707,7 +707,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild GameCooltip:Hide() end f.gframe = DF:CreateGFrame (f, 650, 400, 35, onenter, onleave, "gframe", "$parentGF") - f.gframe:SetPoint ("topleft", f, "topleft", 190, -65) + f.gframe:SetPoint("topleft", f, "topleft", 190, -65) end f.gframe:Reset() @@ -717,7 +717,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild end local fillpanel = DF:NewFillPanel (f, {}, "$parentFP", "fillpanel", 710, 501, false, false, true, nil) - fillpanel:SetPoint ("topleft", f, "topleft", 195, -65) + fillpanel:SetPoint("topleft", f, "topleft", 195, -65) function f:BuildGuildRankTable (encounterTable, guild, role) @@ -729,7 +729,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild local playerScore = {} --get the best of each player - for encounterIndex, encounter in ipairs (encounterTable) do + for encounterIndex, encounter in ipairs(encounterTable) do if (encounter.guild == guild) then local roleTable = encounter [role] @@ -789,7 +789,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild table.sort (sortTable, function(a, b) return a[8] > b[8] end) - --> add the number before the player name + --add the number before the player name for i = 1, #sortTable do local t = sortTable [i] t [1] = i .. ". " .. t [1] @@ -816,7 +816,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild local player_class = {} local amt_encounters = 0 - for encounterIndex, encounter in ipairs (encounterTable) do + for encounterIndex, encounter in ipairs(encounterTable) do if (encounter.guild == guild) then local roleTable = encounter [role] @@ -854,10 +854,10 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild end end - --> sort alphabetical + --sort alphabetical table.sort (players, function(a, b) return a[1] < b[1] end) - for index, playerTable in ipairs (players) do + for index, playerTable in ipairs(players) do for i = #playerTable, amt_encounters do tinsert (playerTable, "") end @@ -876,11 +876,11 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild fillpanel:UpdateRows (header) fillpanel:Refresh() - fillpanel:SetPoint ("topleft", f, "topleft", 200, -65) + fillpanel:SetPoint("topleft", f, "topleft", 200, -65) end function f:Refresh (player_name) - --> build the main table + --build the main table local diff = diff_dropdown.value local boss = boss_dropdown.value local role = role_dropdown.value @@ -895,7 +895,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild if (diffTable) then local encounters = diffTable [boss] if (encounters) then - if (player == 1) then --> raid + if (player == 1) then --raid fillpanel:Show() if (f.gframe) then f.gframe:Hide() @@ -904,7 +904,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild player2_dropdown:Hide() f:BuildRaidTable (encounters, guild, role) - elseif (player == 2) then --> only one player + elseif (player == 2) then --only one player fillpanel:Hide() if (f.gframe) then f.gframe:Show() @@ -925,7 +925,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild f:BuildPlayerTable (player2_dropdown.value) end else - if (player == 1) then --> raid + if (player == 1) then --raid fillpanel:Show() if (f.gframe) then f.gframe:Hide() @@ -934,7 +934,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild player2_dropdown:Hide() f:BuildRaidTable ({}, guild, role) - elseif (player == 2) then --> only one player + elseif (player == 2) then --only one player fillpanel:Hide() if (f.gframe) then f.gframe:Show() @@ -955,8 +955,8 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild local statsWindow = _G.DetailsRaidHistoryWindow - --> table means some button send the request - nil for other ways - if (type (_raid) == "table" or (not _raid and not _boss and not _difficulty and not _role and not _guild and not _player_base and not _player_name)) then + --table means some button send the request - nil for other ways + if (type(_raid) == "table" or (not _raid and not _boss and not _difficulty and not _role and not _guild and not _player_base and not _player_name)) then local f = statsWindow if (f.LatestSelection) then _raid = f.LatestSelection.Raid @@ -997,12 +997,12 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild statsWindow.Mode = _history_type if (statsWindow.Mode == 1) then --overall - statsWindow.HistoryCheckBox:SetValue (true) - statsWindow.GuildRankCheckBox:SetValue (false) + statsWindow.HistoryCheckBox:SetValue(true) + statsWindow.GuildRankCheckBox:SetValue(false) elseif (statsWindow.Mode == 2) then --guild rank - statsWindow.GuildRankCheckBox:SetValue (true) - statsWindow.HistoryCheckBox:SetValue (false) + statsWindow.GuildRankCheckBox:SetValue(true) + statsWindow.HistoryCheckBox:SetValue(false) end end @@ -1028,7 +1028,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild end if (_guild) then - if (type (_guild) == "boolean") then + if (type(_guild) == "boolean") then _guild = GetGuildInfo ("player") end statsWindow.select_guild:Select (_guild) diff --git a/frames/window_switch.lua b/frames/window_switch.lua index 4c6c48fa..ec4b3bea 100644 --- a/frames/window_switch.lua +++ b/frames/window_switch.lua @@ -170,78 +170,78 @@ do while (text_width > 104) do local text = font_string:GetText() text = strsub (text, 1, #text-1) - font_string:SetText (text) + font_string:SetText(text) text_width = font_string:GetStringWidth() end end 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") - button.texture:SetPoint ("left", 0, 0) - button.texture:SetSize (icon_size, icon_size) + local button = CreateFrame("button", "DetailsAllAttributesFrame" .. attribute .. sub_attribute, allDisplaysFrame) + button:SetSize(130, 16) + button.texture = button:CreateTexture(nil, "overlay") + button.texture:SetPoint("left", 0, 0) + button.texture:SetSize(icon_size, icon_size) - local texture_highlight_frame = CreateFrame ("button", "DetailsAllAttributesFrame" .. attribute .. sub_attribute .. "IconFrame", button) - texture_highlight_frame:SetSize (icon_size, icon_size) - texture_highlight_frame:SetPoint ("left", 0, 0) + local texture_highlight_frame = CreateFrame("button", "DetailsAllAttributesFrame" .. attribute .. sub_attribute .. "IconFrame", button) + texture_highlight_frame:SetSize(icon_size, icon_size) + texture_highlight_frame:SetPoint("left", 0, 0) texture_highlight_frame.texture = button.texture texture_highlight_frame.MainFrame = button button.text = button:CreateFontString (nil, "overlay", "GameFontNormal") - button.text:SetPoint ("left", button.texture, "right", 2, 0) + button.text:SetPoint("left", button.texture, "right", 2, 0) button.attribute = attribute button.sub_attribute = sub_attribute - button:SetPoint ("topleft", x, y) + button:SetPoint("topleft", x, y) Details:SetFontSize(button.text, Details.all_switch_config.font_size) - Details:SetFontColor (button.text, text_color) + Details:SetFontColor(button.text, text_color) - button:SetScript ("OnClick", on_click_all_switch_button) - button:SetScript ("OnEnter", on_enter_all_switch_button) - button:SetScript ("OnLeave", on_leave_all_switch_button) + button:SetScript("OnClick", on_click_all_switch_button) + button:SetScript("OnEnter", on_enter_all_switch_button) + button:SetScript("OnLeave", on_leave_all_switch_button) - texture_highlight_frame:SetScript ("OnClick", on_click_all_switch_button) - texture_highlight_frame:SetScript ("OnEnter", on_enter_all_switch_button_icon) - texture_highlight_frame:SetScript ("OnLeave", on_leave_all_switch_button_icon) + texture_highlight_frame:SetScript("OnClick", on_click_all_switch_button) + texture_highlight_frame:SetScript("OnEnter", on_enter_all_switch_button_icon) + texture_highlight_frame:SetScript("OnLeave", on_leave_all_switch_button_icon) button:RegisterForClicks ("LeftButtonDown", "RightButtonDown") return button end - allDisplaysFrame:SetScript ("OnShow", function() + allDisplaysFrame:SetScript("OnShow", function() if (not allDisplaysFrame.already_built) then local x, y = 8, -8 allDisplaysFrame.higher_counter = 0 for attribute = 1, Details.atributos[0] do - --> localized attribute name + --localized attribute name local loc_attribute_name = Details.atributos.lista [attribute] - local title_icon = allDisplaysFrame:CreateTexture (nil, "overlay") - title_icon:SetPoint ("topleft", x, y) + local title_icon = allDisplaysFrame:CreateTexture(nil, "overlay") + title_icon:SetPoint("topleft", x, y) local texture, l, r, t, b = Details:GetAttributeIcon (attribute) - title_icon:SetTexture (texture) + title_icon:SetTexture(texture) title_icon:SetTexCoord (l, r, t, b) - title_icon:SetSize (18, 18) + title_icon:SetSize(18, 18) local title_str = allDisplaysFrame:CreateFontString (nil, "overlay", "GameFontNormal") - title_str:SetPoint ("left", title_icon, "right", 2, 0) - title_str:SetText (loc_attribute_name) + title_str:SetPoint("left", title_icon, "right", 2, 0) + title_str:SetText(loc_attribute_name) y = y - 20 allDisplaysFrame.buttons [attribute] = {} for i = 1, #Details.sub_atributos [attribute].lista do - --> localized sub attribute name + --localized sub attribute name local loc_sub_attribute_name = Details.sub_atributos [attribute].lista [i] local button = create_all_switch_button (attribute, i, x, y) - button.text:SetText (loc_sub_attribute_name) + button.text:SetText(loc_sub_attribute_name) Details:SetFontSize(button.text, Details.all_switch_config.font_size) allDisplaysFrame.check_text_size (button.text) - button.texture:SetTexture (Details.sub_atributos [attribute].icones [i] [1]) + button.texture:SetTexture(Details.sub_atributos [attribute].icones [i] [1]) button.texture:SetTexCoord (unpack (Details.sub_atributos [attribute].icones [i] [2])) tinsert (allDisplaysFrame.buttons [attribute], button) y = y - 17 @@ -255,33 +255,33 @@ do y = -8 end - --> prepare for scripts + --prepare for scripts allDisplaysFrame.x = x allDisplaysFrame.y = -8 allDisplaysFrame.buttons [Details.atributos[0]+1] = {} - local title_icon = allDisplaysFrame:CreateTexture (nil, "overlay") + local title_icon = allDisplaysFrame:CreateTexture(nil, "overlay") local texture, l, r, t, b = Details:GetAttributeIcon (Details.atributos[0]+1) title_icon:SetTexture([[Interface\AddOns\Details\images\icons]]) title_icon:SetTexCoord(412/512, 441/512, 43/512, 79/512) title_icon:SetVertexColor(.7, .6, .5, 1) title_icon:SetSize(16, 16) local title_str = allDisplaysFrame:CreateFontString (nil, "overlay", "GameFontNormal") - title_str:SetPoint ("left", title_icon, "right", 2, 0) - title_str:SetText ("Scripts") + title_str:SetPoint("left", title_icon, "right", 2, 0) + title_str:SetText("Scripts") - title_icon:SetPoint ("topleft", allDisplaysFrame.x, allDisplaysFrame.y) + title_icon:SetPoint("topleft", allDisplaysFrame.x, allDisplaysFrame.y) allDisplaysFrame.y = allDisplaysFrame.y - 20 allDisplaysFrame.title_custom = title_icon allDisplaysFrame.already_built = true - --> prepare for plugins + --prepare for plugins allDisplaysFrame.buttons[6] = {} local title_icon = allDisplaysFrame:CreateTexture(nil, "overlay") - title_icon:SetTexture ([[Interface\AddOns\Details\images\modo_icones]]) + title_icon:SetTexture([[Interface\AddOns\Details\images\modo_icones]]) title_icon:SetTexCoord (32/256*3, 32/256*4, 0, 1) - title_icon:SetSize (16, 16) + title_icon:SetSize(16, 16) local title_str = allDisplaysFrame:CreateFontString(nil, "overlay", "GameFontNormal") title_str:SetPoint("left", title_icon, "right", 2, 0) @@ -290,9 +290,9 @@ do allDisplaysFrame.title_scripts = title_icon end - --> update scripts + --update scripts local custom_index = Details.atributos[0]+1 - for _, button in ipairs (allDisplaysFrame.buttons [custom_index]) do + for _, button in ipairs(allDisplaysFrame.buttons [custom_index]) do button:Hide() end @@ -306,11 +306,11 @@ do end local custom = Details.custom [i] - button.text:SetText (custom.name) + button.text:SetText(custom.name) Details:SetFontSize(button.text, Details.all_switch_config.font_size) allDisplaysFrame.check_text_size (button.text) - button.texture:SetTexture (custom.icon) + button.texture:SetTexture(custom.icon) button.texture:SetTexCoord (0.078125, 0.921875, 0.078125, 0.921875) button:Show() @@ -321,20 +321,20 @@ do allDisplaysFrame.higher_counter = #Details.custom end - --> update plugins + --update plugins local script_index = Details.atributos[0]+2 local button_index = 1 allDisplaysFrame.x = allDisplaysFrame.x + 130 allDisplaysFrame.y = -28 - for _, button in ipairs (allDisplaysFrame.buttons[script_index]) do + for _, button in ipairs(allDisplaysFrame.buttons[script_index]) do button:Hide() end --build raid plugins list local raidPlugins = Details.RaidTables:GetAvailablePlugins() if (#raidPlugins >= 0) then - for i, ptable in ipairs (raidPlugins) do + for i, ptable in ipairs(raidPlugins) do --if a plugin has the member 'NoMenu', it won't be shown on menus to select plugins if (ptable[3].__enabled and not ptable[3].NoMenu) then --PluginName, PluginIcon, PluginObject, PluginAbsoluteName @@ -353,7 +353,7 @@ do Details:SetFontSize(button.text, Details.all_switch_config.font_size) allDisplaysFrame.check_text_size(button.text) - button.texture:SetTexture (ptable[2]) + button.texture:SetTexture(ptable[2]) button.texture:SetTexCoord (0.078125, 0.921875, 0.078125, 0.921875) button:Show() @@ -385,14 +385,14 @@ do --they aren't called anymore on showing and hiding the bookmark frame --show animation local animHub = Details.gump:CreateAnimationHub (bookmarkFrame, function() bookmarkFrame:Show() end) - Details.gump:CreateAnimation (animHub, "scale", 1, 0.04, 0, 1, 1, 1, "LEFT", 0, 0) - Details.gump:CreateAnimation (animHub, "alpha", 1, 0.04, 0, 1) + Details.gump:CreateAnimation(animHub, "scale", 1, 0.04, 0, 1, 1, 1, "LEFT", 0, 0) + Details.gump:CreateAnimation(animHub, "alpha", 1, 0.04, 0, 1) bookmarkFrame.ShowAnimation = animHub --hide animation local animHub = Details.gump:CreateAnimationHub (bookmarkFrame, function() bookmarkFrame:Show() end, function() bookmarkFrame:Hide() end) - Details.gump:CreateAnimation (animHub, "scale", 1, 0.04, 1, 1, 0, 1, "RIGHT", 0, 0) - Details.gump:CreateAnimation (animHub, "alpha", 1, 0.04, 1, 0) + Details.gump:CreateAnimation(animHub, "scale", 1, 0.04, 1, 1, 0, 1, "RIGHT", 0, 0) + Details.gump:CreateAnimation(animHub, "alpha", 1, 0.04, 1, 0) bookmarkFrame.HideAnimation = animHub --------------------------------------------------------------------------------------------------------------------------- @@ -512,17 +512,17 @@ function Details.switch:ShowMe(instancia) end local on_enter = function(self) - --self.MyObject.this_background:SetBlendMode ("ADD") - --self.MyObject.boss_texture:SetBlendMode ("ADD") + --self.MyObject.this_background:SetBlendMode("ADD") + --self.MyObject.boss_texture:SetBlendMode("ADD") end local on_leave = function(self) - self.MyObject.this_background:SetBlendMode ("BLEND") - self.MyObject.boss_texture:SetBlendMode ("BLEND") + self.MyObject.this_background:SetBlendMode("BLEND") + self.MyObject.boss_texture:SetBlendMode("BLEND") end function Details.switch:CreateSegmentBlock() - local s = gump:CreateLabel (Details.switch.frame) + local s = gump:CreateLabel(Details.switch.frame) Details:SetFontSize (s, 9) local index = #Details.switch.segments_blocks @@ -533,19 +533,19 @@ function Details.switch:ShowMe(instancia) end local button = gump:CreateButton (Details.switch.frame, segment_switch, 100, 20, "", index) - button:SetPoint ("topleft", s, "topleft", -17, 0) - button:SetPoint ("bottomright", s, "bottomright", 0, 0) + button:SetPoint("topleft", s, "topleft", -17, 0) + button:SetPoint("bottomright", s, "bottomright", 0, 0) button:SetClickFunction (segment_switch, nil, nil, "right") local boss_texture = gump:CreateImage (button, nil, 16, 16) - boss_texture:SetPoint ("right", s, "left", -2, 0) + boss_texture:SetPoint("right", s, "left", -2, 0) - local background = button:CreateTexture (nil, "background") - background:SetTexture ("Interface\\SPELLBOOK\\Spellbook-Parts") + local background = button:CreateTexture(nil, "background") + background:SetTexture("Interface\\SPELLBOOK\\Spellbook-Parts") background:SetTexCoord (0.31250000, 0.96484375, 0.37109375, 0.52343750) - background:SetWidth (85) - background:SetPoint ("topleft", s.widget, "topleft", -16, 3) - background:SetPoint ("bottomright", s.widget, "bottomright", -3, -5) + background:SetWidth(85) + background:SetPoint("topleft", s.widget, "topleft", -16, 3) + background:SetPoint("bottomright", s.widget, "bottomright", -3, -5) button.this_background = background button.boss_texture = boss_texture.widget @@ -554,8 +554,8 @@ function Details.switch:ShowMe(instancia) s.button = button s.background = background - button:SetScript ("OnEnter", on_enter) - button:SetScript ("OnLeave", on_leave) + button:SetScript("OnEnter", on_enter) + button:SetScript("OnLeave", on_leave) s.HideMe = hide_label s.ShowMe = show_label @@ -574,7 +574,7 @@ function Details.switch:ShowMe(instancia) end function Details.switch:ClearSegmentBlocks() - for _, block in ipairs (Details.switch.segments_blocks) do + for _, block in ipairs(Details.switch.segments_blocks) do block:HideMe() end end @@ -600,8 +600,8 @@ function Details.switch:ShowMe(instancia) for horizontal = 1, horizontal_amt do local button = Details.switch:GetSegmentBlock (i) - button:SetPoint ("topleft", frame, "topleft", x + 16, -y) - button:SetSize (size - 22, 12) + button:SetPoint("topleft", frame, "topleft", x + 16, -y) + button:SetSize(size - 22, 12) button:ShowMe() i = i + 1 @@ -616,18 +616,18 @@ function Details.switch:ShowMe(instancia) Details.switch.segments_blocks = {} - --> current and overall + --current and overall Details.switch:CreateSegmentBlock() Details.switch:CreateSegmentBlock() local block1 = Details.switch:GetSegmentBlock (1) - block1:SetText (Loc["STRING_CURRENTFIGHT"]) - block1.texture:SetTexture ([[Interface\Scenarios\ScenariosParts]]) + block1:SetText(Loc["STRING_CURRENTFIGHT"]) + block1.texture:SetTexture([[Interface\Scenarios\ScenariosParts]]) block1.texture:SetTexCoord (55/512, 81/512, 368/512, 401/512) local block2 = Details.switch:GetSegmentBlock (2) - block2:SetText (Loc["STRING_SEGMENT_OVERALL"]) - block2.texture:SetTexture ([[Interface\Scenarios\ScenariosParts]]) + block2:SetText(Loc["STRING_SEGMENT_OVERALL"]) + block2.texture:SetTexture([[Interface\Scenarios\ScenariosParts]]) block2.texture:SetTexCoord (55/512, 81/512, 368/512, 401/512) end @@ -642,33 +642,33 @@ function Details.switch:ShowMe(instancia) local block = Details.switch:GetSegmentBlock (i) local enemy, color, raid_type, killed, is_trash, portrait, background, background_coords = Details:GetSegmentInfo (segment_index) - block:SetText ("#" .. segment_index .. " " .. enemy) + block:SetText("#" .. segment_index .. " " .. enemy) if (combat.is_boss and combat.instance_type == "raid") then local L, R, T, B, Texture = Details:GetBossIcon (combat.is_boss.mapid, combat.is_boss.index) if (L) then - block.texture:SetTexture (Texture) + block.texture:SetTexture(Texture) block.texture:SetTexCoord (L, R, T, B) else - block.texture:SetTexture ([[Interface\Scenarios\ScenarioIcon-Boss]]) + block.texture:SetTexture([[Interface\Scenarios\ScenarioIcon-Boss]]) end else - block.texture:SetTexture ([[Interface\Scenarios\ScenarioIcon-Boss]]) + block.texture:SetTexture([[Interface\Scenarios\ScenarioIcon-Boss]]) end block:ShowMe() segment_index = segment_index + 1 end - Details.switch.frame:SetScale (instancia.window_scale) + Details.switch.frame:SetScale(instancia.window_scale) Details.switch:ResizeSegmentBlocks() for i = segment_index+2, #Details.switch.segments_blocks do Details.switch.segments_blocks [i]:HideMe() end - Details.switch.frame:SetPoint ("topleft", instancia.baseframe, "topleft", 0, 1) - Details.switch.frame:SetPoint ("bottomright", instancia.baseframe, "bottomright", 0, 1) + Details.switch.frame:SetPoint("topleft", instancia.baseframe, "topleft", 0, 1) + Details.switch.frame:SetPoint("bottomright", instancia.baseframe, "bottomright", 0, 1) Details.switch.frame:Show() return @@ -679,7 +679,7 @@ function Details.switch:ShowMe(instancia) end end - --> check if there is some custom contidional + --check if there is some custom contidional if (instancia.atributo == 5) then local custom_object = instancia:GetCustomObject() if (custom_object and custom_object.OnSwitchShow) then @@ -690,8 +690,8 @@ function Details.switch:ShowMe(instancia) end end - Details.switch.frame:SetPoint ("topleft", instancia.baseframe, "topleft", 0, 1) - Details.switch.frame:SetPoint ("bottomright", instancia.baseframe, "bottomright", 0, 1) + Details.switch.frame:SetPoint("topleft", instancia.baseframe, "topleft", 0, 1) + Details.switch.frame:SetPoint("bottomright", instancia.baseframe, "bottomright", 0, 1) local altura = instancia.baseframe:GetHeight() local mostrar_quantas = floor (altura / Details.switch.button_height) * 2 @@ -729,7 +729,7 @@ function Details.switch:ShowMe(instancia) Details.switch:Resize (precisa_mostrar) Details.switch:Update() - Details.switch.frame:SetScale (instancia.window_scale) + Details.switch.frame:SetScale(instancia.window_scale) Details.switch.frame:Show() Details.switch:Resize (precisa_mostrar) @@ -953,9 +953,9 @@ function Details.switch:Update() local textColor = "white" if (options and options.sub_atributo) then - if (options.atributo == 5) then --> custom + if (options.atributo == 5) then --custom local CustomObject = Details.custom [options.sub_atributo] - if (not CustomObject) then --> ele j� foi deletado + if (not CustomObject) then --ele j� foi deletado icone = [[Interface\AddOns\Details\images\icons]] coords = add_coords name = Loc["STRING_SWITCH_CLICKME"] @@ -968,7 +968,7 @@ function Details.switch:Update() vcolor = vertex_color_default end - elseif (options.atributo == "plugin") then --> plugin + elseif (options.atributo == "plugin") then --plugin local plugin = Details:GetPlugin (options.sub_atributo) if (plugin) then @@ -976,7 +976,7 @@ function Details.switch:Update() local raidPlugins = Details.RaidTables:GetAvailablePlugins() local isAvailable = false if (#raidPlugins >= 0) then - for i, ptable in ipairs (raidPlugins) do + for i, ptable in ipairs(raidPlugins) do --check if the plugin is available if (ptable[4] == plugin.real_name) then isAvailable = true @@ -1076,9 +1076,9 @@ function Details.switch:Update() FauxScrollFrame_Update(DetailsSwitchPanelScroll, ceil (40 / Details.switch.vertical_amt) , Details.switch.horizontal_amt, 20) end -local scroll = CreateFrame ("scrollframe", "DetailsSwitchPanelScroll", DetailsSwitchPanel, "FauxScrollFrameTemplate") +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 a58a0187..624b91c3 100644 --- a/frames/window_wa.lua +++ b/frames/window_wa.lua @@ -1,10 +1,10 @@ local _detalhes = _G._detalhes local L = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) ---> default weaktable +--default weaktable _detalhes.weaktable = {__mode = "v"} ---> globals +--globals --[[global]] DETAILS_WA_AURATYPE_ICON = 1 --[[global]] DETAILS_WA_AURATYPE_TEXT = 2 --[[global]] DETAILS_WA_AURATYPE_BAR = 3 @@ -1421,12 +1421,12 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n --print (aura_type, spellid, use_spellid, spellname, name, icon_texture, target, stacksize, sound, chat, icon_text, icon_glow, encounter_id, group, icon_size, other_values) - --> check if wa is installed + --check if wa is installed if (not WeakAuras or not WeakAurasSaved) then return end - --> check if there is a group for our auras + --check if there is a group for our auras --[=[ if (not WeakAurasSaved.displays ["Details! Aura Group"]) then local group = _detalhes.table.copy ({}, group_prototype) @@ -1443,7 +1443,7 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n return Details:Msg("feature disabled due to 9.0 changes.") end - --> create the icon table + --create the icon table local new_aura icon_size = icon_size or 40 @@ -1482,10 +1482,10 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n new_aura.trigger.custom = new_aura.trigger.custom:gsub ("@spellid", spellid) new_aura.trigger.custom = new_aura.trigger.custom:gsub ("@spell_casted", icon_text) - --> size + --size new_aura.fontSize = min (icon_size, 24) - --> combat only + --combat only if (in_combat) then new_aura.load.use_combat = true else @@ -1528,10 +1528,10 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n new_aura.trigger.custom = new_aura.trigger.custom:gsub ("@spellid", spellid) new_aura.trigger.custom = new_aura.trigger.custom:gsub ("@title", icon_text) - --> size + --size new_aura.fontSize = min (icon_size, 24) - --> combat only + --combat only if (in_combat) then new_aura.load.use_combat = true else @@ -1540,7 +1540,7 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n elseif (other_values.dbm_timer_id or other_values.bw_timer_id) then --boss mods - --> create the default aura table + --create the default aura table if (aura_type == "icon") then new_aura = _detalhes.table.copy ({}, icon_dbm_timerbar_prototype) elseif (aura_type == "aurabar") then @@ -1549,7 +1549,7 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n new_aura = _detalhes.table.copy ({}, text_dbm_timerbar_prototype) end - --> text and icon + --text and icon if (aura_type == "aurabar") then icon_text = icon_text:gsub ("= ", "") icon_text = icon_text:gsub (" =", "") @@ -1561,7 +1561,7 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n new_aura.displayIcon = icon_texture end - --> size + --size if (aura_type == "icon") then new_aura.width = icon_size new_aura.height = icon_size @@ -1572,7 +1572,7 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n new_aura.fontSize = min (icon_size, 72) end - --> trigger + --trigger if (aura_type == "text") then local init_start = [[ aura_env.ability_text = "@text" @@ -1768,7 +1768,7 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n _detalhes.table.overwrite (new_aura, add) end - --> combat only + --combat only if (in_combat) then new_aura.load = new_aura.load or {} new_aura.load.use_combat = true @@ -1782,7 +1782,7 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n tinsert (new_aura.trigger.spellIds, spellid) end - --> if is a regular aura without using spells ids + --if is a regular aura without using spells ids if (not use_spellid) then new_aura.trigger.useExactSpellId = false new_aura.useName = true @@ -1793,7 +1793,7 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n new_aura.auraspellids = {tostring(spellid)} end - --> check stack size + --check stack size if (stacksize and stacksize >= 1) then stacksize = floor (stacksize) local add = _detalhes.table.copy ({}, stack_prototype) @@ -1801,7 +1801,7 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n _detalhes.table.overwrite (new_aura, add) end - --> icon text + --icon text if (icon_text and icon_text ~= "") then if (aura_type == "text") then new_aura.displayText = icon_text @@ -1812,7 +1812,7 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n end end - --> size + --size if (aura_type == "icon") then new_aura.width = icon_size new_aura.height = icon_size @@ -1827,14 +1827,14 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n new_aura.id = name new_aura.displayIcon = icon_texture - --> load by encounter id + --load by encounter id if (encounter_id) then new_aura.load = new_aura.load or {} new_aura.load.use_encounterid = true new_aura.load.encounterid = tostring (encounter_id) end - --> using sound + --using sound if (sound and type (sound) == "table") then local add = _detalhes.table.copy ({}, sound_prototype_custom) add.actions.start.sound_path = sound.sound_path @@ -1847,14 +1847,14 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n _detalhes.table.overwrite (new_aura, add) end - --> chat message + --chat message if (chat and chat ~= "") then local add = _detalhes.table.copy ({}, chat_prototype) add.actions.start.message = chat _detalhes.table.overwrite (new_aura, add) end - --> check if already exists a aura with this name + --check if already exists a aura with this name if (WeakAurasSaved.displays [new_aura.id]) then for i = 2, 100 do if (not WeakAurasSaved.displays [new_aura.id .. " (" .. i .. ")"]) then @@ -1864,7 +1864,7 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n end end - --> check is is using glow effect + --check is is using glow effect if (icon_glow) then local add = _detalhes.table.copy ({}, glow_prototype) add.actions.start.glow_frame = "WeakAuras:" .. new_aura.id @@ -1876,16 +1876,16 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n new_aura.cooldownTextEnabled = true end - --> add the aura on a group + --add the aura on a group if (group) then new_aura.parent = group if (new_aura.regionType == "icon") then - --> adjust the width and height of the new aura following the existing auras on the group + --adjust the width and height of the new aura following the existing auras on the group local normalWidth, normalHeight, amount = 0, 0, 0 local allAurasInTheGroup = WeakAurasSaved.displays [group].controlledChildren - for index, auraname in ipairs (allAurasInTheGroup) do + for index, auraname in ipairs(allAurasInTheGroup) do local auraObject = WeakAurasSaved.displays [auraname] if (auraObject and auraObject.regionType == "icon") then amount = amount + 1 @@ -1907,10 +1907,10 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n new_aura.parent = nil end - --> add the aura + --add the aura WeakAuras.Add (new_aura) - --> check if the options panel has loaded + --check if the options panel has loaded local options_frame = WeakAuras.OptionsFrame and WeakAuras.OptionsFrame() if (options_frame) then if (options_frame and not options_frame:IsShown()) then @@ -1936,7 +1936,7 @@ end -- text_size 72 function _detalhes:InitializeAuraCreationWindow() if true then return end - local DetailsAuraPanel = CreateFrame ("frame", "DetailsAuraPanel", UIParent,"BackdropTemplate") + local DetailsAuraPanel = CreateFrame("frame", "DetailsAuraPanel", UIParent,"BackdropTemplate") DetailsAuraPanel.Frame = DetailsAuraPanel DetailsAuraPanel.__name = L["STRING_CREATEAURA"] DetailsAuraPanel.real_name = "DETAILS_CREATEAURA" @@ -1968,7 +1968,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr DetailsAuraPanel.Initialized = true - --> check if there is a group for our auras + --check if there is a group for our auras if (WeakAuras and WeakAurasSaved) then if (not WeakAurasSaved.displays ["Details! Aura Group"]) then local group = _detalhes.table.copy ({}, group_prototype) @@ -1980,26 +1980,26 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr end end - local f = DetailsAuraPanel or CreateFrame ("frame", "DetailsAuraPanel", UIParent,"BackdropTemplate") - f:SetSize (800, 600) - f:SetPoint ("center", UIParent, "center", 0, 150) + local f = DetailsAuraPanel or CreateFrame("frame", "DetailsAuraPanel", UIParent,"BackdropTemplate") + f:SetSize(800, 600) + f:SetPoint("center", UIParent, "center", 0, 150) f:SetFrameStrata ("DIALOG") f:EnableMouse (true) f:SetMovable (true) f:SetToplevel (true) --background - f.bg1 = f:CreateTexture (nil, "background") - f.bg1:SetTexture ([[Interface\AddOns\Details\images\background]], true) + f.bg1 = f:CreateTexture(nil, "background") + f.bg1:SetTexture([[Interface\AddOns\Details\images\background]], true) f.bg1:SetAlpha (0.8) f.bg1:SetVertexColor (0.27, 0.27, 0.27) f.bg1:SetVertTile (true) f.bg1:SetHorizTile (true) - f.bg1:SetSize (790, 454) + f.bg1:SetSize(790, 454) f.bg1:SetAllPoints() - f:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) - f:SetBackdropColor (.5, .5, .5, .7) - f:SetBackdropBorderColor (0, 0, 0, 1) + f:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) + f:SetBackdropColor(.5, .5, .5, .7) + f:SetBackdropBorderColor(0, 0, 0, 1) --register to libwindow local LibWindow = LibStub ("LibWindow-1.1") @@ -2008,40 +2008,40 @@ 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 end) --titlebar - f.TitleBar = CreateFrame ("frame", "$parentTitleBar", f,"BackdropTemplate") - f.TitleBar:SetPoint ("topleft", f, "topleft", 2, -3) - f.TitleBar:SetPoint ("topright", f, "topright", -2, -3) - f.TitleBar:SetHeight (20) - f.TitleBar:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - f.TitleBar:SetBackdropColor (.2, .2, .2, 1) - f.TitleBar:SetBackdropBorderColor (0, 0, 0, 1) + f.TitleBar = CreateFrame("frame", "$parentTitleBar", f,"BackdropTemplate") + f.TitleBar:SetPoint("topleft", f, "topleft", 2, -3) + f.TitleBar:SetPoint("topright", f, "topright", -2, -3) + f.TitleBar:SetHeight(20) + f.TitleBar:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + f.TitleBar:SetBackdropColor(.2, .2, .2, 1) + f.TitleBar:SetBackdropBorderColor(0, 0, 0, 1) --close button - f.Close = CreateFrame ("button", "$parentCloseButton", f, "BackdropTemplate") - f.Close:SetPoint ("right", f.TitleBar, "right", -2, 0) - f.Close:SetSize (16, 16) + f.Close = CreateFrame("button", "$parentCloseButton", f, "BackdropTemplate") + f.Close:SetPoint("right", f.TitleBar, "right", -2, 0) + f.Close:SetSize(16, 16) - f.Close:SetNormalTexture ([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) - f.Close:SetHighlightTexture ([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) - f.Close:SetPushedTexture ([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) + f.Close:SetNormalTexture([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) + f.Close:SetHighlightTexture([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) + f.Close:SetPushedTexture([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) f.Close:GetNormalTexture():SetDesaturated(true) f.Close:GetHighlightTexture():SetDesaturated(true) f.Close:GetPushedTexture():SetDesaturated(true) f.Close:SetAlpha (0.7) - f.Close:SetScript ("OnClick", function() f:Hide() end) + f.Close:SetScript("OnClick", function() f:Hide() end) --title f.Title = f.TitleBar:CreateFontString ("$parentTitle", "overlay", "GameFontNormal") - f.Title:SetPoint ("center", f.TitleBar, "center") - f.Title:SetText ("Details! Create Aura") + f.Title:SetPoint("center", f.TitleBar, "center") + f.Title:SetText("Details! Create Aura") local fw = _detalhes:GetFramework() @@ -2052,10 +2052,10 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr local button_template = fw:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE") --aura name - local name_label = fw:CreateLabel (f, "Aura Name: ", nil, nil, "GameFontNormal") + local name_label = fw:CreateLabel(f, "Aura Name: ", nil, nil, "GameFontNormal") local name_textentry = fw:CreateTextEntry (f, _detalhes.empty_function, 150, 20, "AuraName", "$parentAuraName") name_textentry:SetTemplate (slider_template) - name_textentry:SetPoint ("left", name_label, "right", 2, 0) + name_textentry:SetPoint("left", name_label, "right", 2, 0) f.name = name_textentry --aura type @@ -2073,18 +2073,18 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr return aura_type_table end local aura_type = fw:CreateDropDown (f, aura_type_options, 1, 150, 20, "AuraTypeDropdown", "$parentAuraTypeDropdown") - local aura_type_label = fw:CreateLabel (f, "Aura Type: ", nil, nil, "GameFontNormal") - aura_type:SetPoint ("left", aura_type_label, "right", 2, 0) + local aura_type_label = fw:CreateLabel(f, "Aura Type: ", nil, nil, "GameFontNormal") + aura_type:SetPoint("left", aura_type_label, "right", 2, 0) aura_type:Hide() local Icon_IconAuraType = fw:CreateImage (f, [[Interface\AddOns\Details\images\icons2]], 32, 32, "overlay", {200/512, 232/512, 336/512, 368/512}, nil, nil) - Icon_IconAuraType:SetPoint ("topleft", aura_type_label, "bottomleft", 10, -16) + Icon_IconAuraType:SetPoint("topleft", aura_type_label, "bottomleft", 10, -16) local Icon_StatusbarAuraType = fw:CreateImage (f, [[Interface\AddOns\Details\images\icons2]], 92, 12, "overlay", {235/512, 327/512, 336/512, 348/512}, nil, nil) - Icon_StatusbarAuraType:SetPoint ("topleft", aura_type_label, "bottomleft", 60, -26) + Icon_StatusbarAuraType:SetPoint("topleft", aura_type_label, "bottomleft", 60, -26) local Icon_TextOnlyAuraType = fw:CreateImage (f, [[Interface\AddOns\Details\images\icons2]], 57, 8, "overlay", {250/512, 306/512, 360/512, 367/512}, nil, nil) - Icon_TextOnlyAuraType:SetPoint ("topleft", aura_type_label, "bottomleft", 170, -28) + Icon_TextOnlyAuraType:SetPoint("topleft", aura_type_label, "bottomleft", 170, -28) local AuraTypeSelectedColor = {1, 1, 1, 0.3} local AuraTypeBorderColor = {.3, .3, .3, 0.5} @@ -2092,7 +2092,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr local OnSelectAuraType = function(self, fixedParam, auraType, noUpdate) - if (type (auraType) == "number") then + if (type(auraType) == "number") then if (auraType == 1) then auraType = "icon" elseif (auraType == 2) then @@ -2102,57 +2102,57 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr end end - f.IconAuraTypeButton:SetBackdropColor (0, 0, 0, 0.05) - f.StatusbarAuraTypeButton:SetBackdropColor (0, 0, 0, 0.05) - f.TextOnlyAuraTypeButton:SetBackdropColor (0, 0, 0, 0.05) + f.IconAuraTypeButton:SetBackdropColor(0, 0, 0, 0.05) + f.StatusbarAuraTypeButton:SetBackdropColor(0, 0, 0, 0.05) + f.TextOnlyAuraTypeButton:SetBackdropColor(0, 0, 0, 0.05) - f.IconAuraTypeButton:SetBackdropBorderColor (unpack (AuraTypeBorderColor)) - f.StatusbarAuraTypeButton:SetBackdropBorderColor (unpack (AuraTypeBorderColor)) - f.TextOnlyAuraTypeButton:SetBackdropBorderColor (unpack (AuraTypeBorderColor)) + f.IconAuraTypeButton:SetBackdropBorderColor(unpack (AuraTypeBorderColor)) + f.StatusbarAuraTypeButton:SetBackdropBorderColor(unpack (AuraTypeBorderColor)) + f.TextOnlyAuraTypeButton:SetBackdropBorderColor(unpack (AuraTypeBorderColor)) if (auraType == "icon") then - f.IconAuraTypeButton:SetBackdropColor (unpack (AuraTypeSelectedColor)) - f.IconAuraTypeButton:SetBackdropBorderColor (unpack (AuraTypeBorderSelectedColor)) + f.IconAuraTypeButton:SetBackdropColor(unpack (AuraTypeSelectedColor)) + f.IconAuraTypeButton:SetBackdropBorderColor(unpack (AuraTypeBorderSelectedColor)) elseif (auraType == "aurabar") then - f.StatusbarAuraTypeButton:SetBackdropColor (unpack (AuraTypeSelectedColor)) - f.StatusbarAuraTypeButton:SetBackdropBorderColor (unpack (AuraTypeBorderSelectedColor)) + f.StatusbarAuraTypeButton:SetBackdropColor(unpack (AuraTypeSelectedColor)) + f.StatusbarAuraTypeButton:SetBackdropBorderColor(unpack (AuraTypeBorderSelectedColor)) elseif (auraType == "text") then - f.TextOnlyAuraTypeButton:SetBackdropColor (unpack (AuraTypeSelectedColor)) - f.TextOnlyAuraTypeButton:SetBackdropBorderColor (unpack (AuraTypeBorderSelectedColor)) + f.TextOnlyAuraTypeButton:SetBackdropColor(unpack (AuraTypeSelectedColor)) + f.TextOnlyAuraTypeButton:SetBackdropBorderColor(unpack (AuraTypeBorderSelectedColor)) end - aura_type:SetValue (auraType) + aura_type:SetValue(auraType) if (f.UpdateLabels and not noUpdate) then f:UpdateLabels() end end f.OnSelectAuraType = OnSelectAuraType - local AuraTypeBackground = f:CreateTexture (nil, "border") + local AuraTypeBackground = f:CreateTexture(nil, "border") AuraTypeBackground:SetColorTexture (.4, .4, .4, .1) - AuraTypeBackground:SetHeight (64) - AuraTypeBackground:SetPoint ("topleft", f, "topleft", 10, -79) - AuraTypeBackground:SetPoint ("topright", f, "topright", -10, -79) + AuraTypeBackground:SetHeight(64) + AuraTypeBackground:SetPoint("topleft", f, "topleft", 10, -79) + AuraTypeBackground:SetPoint("topright", f, "topright", -10, -79) local Icon_IconAuraTypeButton = fw:CreateButton (f, OnSelectAuraType, 46, 46, "", "icon", nil, nil, "IconAuraTypeButton") local Icon_StatusbarAuraTypeButton = fw:CreateButton (f, OnSelectAuraType, 100, 46, "", "aurabar", nil, nil, "StatusbarAuraTypeButton") local Icon_TextOnlyAuraTypeButton = fw:CreateButton (f, OnSelectAuraType, 69, 46, "", "text", nil, nil, "TextOnlyAuraTypeButton") - Icon_IconAuraTypeButton:SetPoint ("center", Icon_IconAuraType, "center") - Icon_StatusbarAuraTypeButton:SetPoint ("center", Icon_StatusbarAuraType, "center") - Icon_TextOnlyAuraTypeButton:SetPoint ("center", Icon_TextOnlyAuraType, "center") + Icon_IconAuraTypeButton:SetPoint("center", Icon_IconAuraType, "center") + Icon_StatusbarAuraTypeButton:SetPoint("center", Icon_StatusbarAuraType, "center") + Icon_TextOnlyAuraTypeButton:SetPoint("center", Icon_TextOnlyAuraType, "center") - Icon_IconAuraTypeButton:SetBackdrop ({edgeFile = [[Interface\AddOns\Details\images\dotted]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - Icon_IconAuraTypeButton:SetBackdropColor (unpack (AuraTypeSelectedColor)) - Icon_IconAuraTypeButton:SetBackdropBorderColor (unpack (AuraTypeBorderColor)) + Icon_IconAuraTypeButton:SetBackdrop({edgeFile = [[Interface\AddOns\Details\images\dotted]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + Icon_IconAuraTypeButton:SetBackdropColor(unpack (AuraTypeSelectedColor)) + Icon_IconAuraTypeButton:SetBackdropBorderColor(unpack (AuraTypeBorderColor)) - Icon_StatusbarAuraTypeButton:SetBackdrop ({edgeFile = [[Interface\AddOns\Details\images\dotted]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - Icon_StatusbarAuraTypeButton:SetBackdropColor (0, 0, 0, 0.05) - Icon_StatusbarAuraTypeButton:SetBackdropBorderColor (unpack (AuraTypeBorderColor)) + Icon_StatusbarAuraTypeButton:SetBackdrop({edgeFile = [[Interface\AddOns\Details\images\dotted]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + Icon_StatusbarAuraTypeButton:SetBackdropColor(0, 0, 0, 0.05) + Icon_StatusbarAuraTypeButton:SetBackdropBorderColor(unpack (AuraTypeBorderColor)) - Icon_TextOnlyAuraTypeButton:SetBackdrop ({edgeFile = [[Interface\AddOns\Details\images\dotted]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - Icon_TextOnlyAuraTypeButton:SetBackdropColor (0, 0, 0, 0.05) - Icon_TextOnlyAuraTypeButton:SetBackdropBorderColor (unpack (AuraTypeBorderColor)) + Icon_TextOnlyAuraTypeButton:SetBackdrop({edgeFile = [[Interface\AddOns\Details\images\dotted]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + Icon_TextOnlyAuraTypeButton:SetBackdropColor(0, 0, 0, 0.05) + Icon_TextOnlyAuraTypeButton:SetBackdropBorderColor(unpack (AuraTypeBorderColor)) --trigger list --target @@ -2185,8 +2185,8 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr return aura_on_table end local aura_on = fw:CreateDropDown (f, aura_on_options, 1, 150, 20, "AuraOnDropdown", "$parentAuraOnDropdown") - local aura_on_label = fw:CreateLabel (f, "Trigger On: ", nil, nil, "GameFontNormal") - aura_on:SetPoint ("left", aura_on_label, "right", 2, 0) + local aura_on_label = fw:CreateLabel(f, "Trigger On: ", nil, nil, "GameFontNormal") + aura_on:SetPoint("left", aura_on_label, "right", 2, 0) aura_on:Hide() local triggerList = { @@ -2206,9 +2206,9 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr local SetTriggerState = function(triggerID) for i = 1, #triggerList do - triggerList[i].checkBox:SetValue (false) + triggerList[i].checkBox:SetValue(false) if (triggerList[i].value == triggerID) then - triggerList[i].checkBox:SetValue (true) + triggerList[i].checkBox:SetValue(true) end end end @@ -2218,7 +2218,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr local OnChangeTriggerState = function(self, triggerID, state) SetTriggerState (triggerID) - aura_on:SetValue (triggerID) + aura_on:SetValue(triggerID) if (f.UpdateLabels) then f:UpdateLabels() @@ -2231,10 +2231,10 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr checkBox:SetAsCheckBox() checkBox:SetFixedParameter (triggerList [i].value) - checkBox:SetSize (20, 20) - checkBox:SetPoint ("topleft", aura_on_label, "bottomleft", 0, 12 + (-i*20)) - local label = fw:CreateLabel (f, triggerList [i].name) - label:SetPoint ("left", checkBox, "right", 2, 0) + checkBox:SetSize(20, 20) + checkBox:SetPoint("topleft", aura_on_label, "bottomleft", 0, 12 + (-i*20)) + local label = fw:CreateLabel(f, triggerList [i].name) + label:SetPoint("left", checkBox, "right", 2, 0) triggerList [i].checkBox = checkBox end @@ -2243,39 +2243,39 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr --spellname - local spellname_label = fw:CreateLabel (f, "Spell Name: ", nil, nil, "GameFontNormal") + local spellname_label = fw:CreateLabel(f, "Spell Name: ", nil, nil, "GameFontNormal") local spellname_textentry = fw:CreateTextEntry (f, _detalhes.empty_function, 150, 20, "SpellName", "$parentSpellName") spellname_textentry:SetTemplate (slider_template) - spellname_textentry:SetPoint ("left", spellname_label, "right", 2, 0) + spellname_textentry:SetPoint("left", spellname_label, "right", 2, 0) f.spellname = spellname_textentry spellname_textentry.tooltip = "Spell/Debuff/Buff to be tracked." --spellid - local auraid_label = fw:CreateLabel (f, "Spell Id: ", nil, nil, "GameFontNormal") + local auraid_label = fw:CreateLabel(f, "Spell Id: ", nil, nil, "GameFontNormal") local auraid_textentry = fw:CreateTextEntry (f, _detalhes.empty_function, 150, 20, "AuraSpellId", "$parentAuraSpellId") auraid_textentry:SetTemplate (slider_template) auraid_textentry:Disable() - auraid_textentry:SetPoint ("left", auraid_label, "right", 2, 0) + auraid_textentry:SetPoint("left", auraid_label, "right", 2, 0) --use spellid - local usespellid_label = fw:CreateLabel (f, "Use SpellId: ", nil, nil, "GameFontNormal") + local usespellid_label = fw:CreateLabel(f, "Use SpellId: ", nil, nil, "GameFontNormal") local aura_use_spellid = fw:CreateSwitch (f, function(_, _, state) if (state) then auraid_textentry:Enable() else auraid_textentry:Disable() end end, false, nil, nil, nil, nil, "UseSpellId") aura_use_spellid:SetTemplate (fw:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE")) aura_use_spellid:SetAsCheckBox() - aura_use_spellid:SetPoint ("left", usespellid_label, "right", 2, 0) + aura_use_spellid:SetPoint("left", usespellid_label, "right", 2, 0) aura_use_spellid.tooltip = "Use the spell id instead of the spell name, for advanced users." --in combat only - local incombat_label = fw:CreateLabel (f, "Only in Combat: ", nil, nil, "GameFontNormal") + local incombat_label = fw:CreateLabel(f, "Only in Combat: ", nil, nil, "GameFontNormal") local aura_incombat = fw:CreateSwitch (f, function(_, _, state) end, true, nil, nil, nil, nil, "UseInCombat") aura_incombat:SetTemplate (fw:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE")) aura_incombat:SetAsCheckBox() - aura_incombat:SetPoint ("left", incombat_label, "right", 2, 0) + aura_incombat:SetPoint("left", incombat_label, "right", 2, 0) aura_incombat.tooltip = "Only active when in combat." --aura icon - local icon_label = fw:CreateLabel (f, "Icon: ", nil, nil, "GameFontNormal") + local icon_label = fw:CreateLabel(f, "Icon: ", nil, nil, "GameFontNormal") local icon_button_func = function(texture) f.IconButton.icon.texture = texture end @@ -2283,30 +2283,30 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr local icon_button_icon = fw:NewImage (icon_pick_button, [[Interface\ICONS\TEMP]], 19, 19, "background", nil, "icon", "$parentIcon") icon_pick_button:InstallCustomTexture() - icon_pick_button:SetPoint ("left", icon_label, "right", 2, 0) - icon_button_icon:SetPoint ("left", icon_label, "right", 2, 0) + icon_pick_button:SetPoint("left", icon_label, "right", 2, 0) + icon_button_icon:SetPoint("left", icon_label, "right", 2, 0) f.icon = icon_button_icon --is cooldown - local iscooldown_label = fw:CreateLabel (f, "Cooldown Animation: ", nil, nil, "GameFontNormal") + local iscooldown_label = fw:CreateLabel(f, "Cooldown Animation: ", nil, nil, "GameFontNormal") local aura_iscooldown = fw:CreateSwitch (f, function(_, _, state) end, true, nil, nil, nil, nil, "IsCooldown") aura_iscooldown:SetTemplate (fw:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE")) aura_iscooldown:SetAsCheckBox() - aura_iscooldown:SetPoint ("left", iscooldown_label, "right", 2, 0) + aura_iscooldown:SetPoint("left", iscooldown_label, "right", 2, 0) aura_iscooldown.tooltip = "Only active when in combat." --stack local stack_slider = fw:NewSlider (f, f, "$parentStackSlider", "StackSlider", 150, 20, 0, 30, 1, 0, true) stack_slider.useDecimals = true stack_slider:SetTemplate (slider_template) - local stack_label = fw:CreateLabel (f, "Trigger Stack Size: ", nil, nil, "GameFontNormal") - stack_slider:SetPoint ("left", stack_label, "right", 2, 0) + local stack_label = fw:CreateLabel(f, "Trigger Stack Size: ", nil, nil, "GameFontNormal") + stack_slider:SetPoint("left", stack_label, "right", 2, 0) stack_slider.tooltip = "Minimum amount of stacks to trigger the aura." --sound effect local play_sound = function(self, fixedParam, file) - if (type (file) == "table") then + if (type(file) == "table") then PlaySoundFile (file.sound_path, "Master") else PlaySoundFile (file, "Master") @@ -2385,10 +2385,10 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr table.sort (sounds, sort) - for _, sound in ipairs (sounds) do - if (sound.name:find ("D_")) then --> details sound + for _, sound in ipairs(sounds) do + if (sound.name:find ("D_")) then --details sound tinsert (t, {color = "orange", label = sound.name, value = sound.file, icon = [[Interface\Buttons\UI-GuildButton-MOTD-Up]], onclick = play_sound, iconsize = iconsize}) - elseif (sound.gamesound) then --> game sound + elseif (sound.gamesound) then --game sound tinsert (t, {color = "yellow", label = sound.name, value = {sound_path = sound.file}, icon = [[Interface\Buttons\UI-GuildButton-MOTD-Up]], onclick = play_sound, iconsize = iconsize}) else tinsert (t, {label = sound.name, value = sound.file, icon = [[Interface\Buttons\UI-GuildButton-MOTD-Up]], onclick = play_sound, iconsize = iconsize}) @@ -2398,26 +2398,26 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr end local sound_effect = fw:CreateDropDown (f, sound_options, 1, 150, 20, "SoundEffectDropdown", "$parentSoundEffectDropdown") sound_effect:SetTemplate (slider_template) - local sound_effect_label = fw:CreateLabel (f, "Play Sound: ", nil, nil, "GameFontNormal") - sound_effect:SetPoint ("left", sound_effect_label, "right", 2, 0) + local sound_effect_label = fw:CreateLabel(f, "Play Sound: ", nil, nil, "GameFontNormal") + sound_effect:SetPoint("left", sound_effect_label, "right", 2, 0) sound_effect.tooltip = "Sound played when the aura triggers." --say something - local say_something_label = fw:CreateLabel (f, "/Say on Trigger: ", nil, nil, "GameFontNormal") + local say_something_label = fw:CreateLabel(f, "/Say on Trigger: ", nil, nil, "GameFontNormal") local say_something = fw:CreateTextEntry (f, _detalhes.empty_function, 150, 20, "SaySomething", "$parentSaySomething") say_something:SetTemplate (slider_template) - say_something:SetPoint ("left", say_something_label, "right", 2, 0) + say_something:SetPoint("left", say_something_label, "right", 2, 0) say_something.tooltip = "Your character /say this phrase when the aura triggers." --aura text - local aura_text_label = fw:CreateLabel (f, "Aura Text: ", nil, nil, "GameFontNormal") + local aura_text_label = fw:CreateLabel(f, "Aura Text: ", nil, nil, "GameFontNormal") local aura_text = fw:CreateTextEntry (f, _detalhes.empty_function, 150, 20, "AuraText", "$parentAuraText") aura_text:SetTemplate (slider_template) - aura_text:SetPoint ("left", aura_text_label, "right", 2, 0) + aura_text:SetPoint("left", aura_text_label, "right", 2, 0) aura_text.tooltip = "Text shown at aura's icon right side." --apply glow - local useglow_label = fw:CreateLabel (f, "Glow Effect: ", nil, nil, "GameFontNormal") + local useglow_label = fw:CreateLabel(f, "Glow Effect: ", nil, nil, "GameFontNormal") local useglow = fw:CreateSwitch (f, function(self, _, state) if (state and self.glow_test) then self.glow_test:Show() @@ -2432,26 +2432,26 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr useglow:SetTemplate (fw:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE")) useglow:SetAsCheckBox() - useglow:SetPoint ("left", useglow_label, "right", 2, 0) + useglow:SetPoint("left", useglow_label, "right", 2, 0) useglow.tooltip = "Do not rename the aura on WeakAuras options panel or the glow effect may not work." - useglow.glow_test = CreateFrame ("frame", "DetailsAuraTextGlowTest", useglow.widget, "ActionBarButtonSpellActivationAlert") - useglow.glow_test:SetPoint ("topleft", useglow.widget, "topleft", -20, 2) - useglow.glow_test:SetPoint ("bottomright", useglow.widget, "bottomright", 20, -2) + useglow.glow_test = CreateFrame("frame", "DetailsAuraTextGlowTest", useglow.widget, "ActionBarButtonSpellActivationAlert") + useglow.glow_test:SetPoint("topleft", useglow.widget, "topleft", -20, 2) + useglow.glow_test:SetPoint("bottomright", useglow.widget, "bottomright", 20, -2) useglow.glow_test:Hide() --encounter id - local encounterid_label = fw:CreateLabel (f, "Encounter ID: ", nil, nil, "GameFontNormal") + local encounterid_label = fw:CreateLabel(f, "Encounter ID: ", nil, nil, "GameFontNormal") local encounterid = fw:CreateTextEntry (f, _detalhes.empty_function, 150, 20, "EncounterIdText", "$parentEncounterIdText") encounterid:SetTemplate (slider_template) - encounterid:SetPoint ("left", encounterid_label, "right", 2, 0) + encounterid:SetPoint("left", encounterid_label, "right", 2, 0) encounterid.tooltip = "Only load this aura for this raid encounter." --size local icon_size_slider = fw:NewSlider (f, f, "$parentIconSizeSlider", "IconSizeSlider", 150, 20, 8, 256, 1, 64) - local icon_size_label = fw:CreateLabel (f, "Size: ", nil, nil, "GameFontNormal") + local icon_size_label = fw:CreateLabel(f, "Size: ", nil, nil, "GameFontNormal") icon_size_slider:SetTemplate (slider_template) - icon_size_slider:SetPoint ("left", icon_size_label, "right", 2, 0) + icon_size_slider:SetPoint("left", icon_size_label, "right", 2, 0) icon_size_slider.tooltip = "Icon size, width and height." --aura addon @@ -2464,8 +2464,8 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr end local aura_addon = fw:CreateDropDown (f, addon_options, 1, 150, 20, "AuraAddonDropdown", "$parentAuraAddonDropdown") aura_addon:SetTemplate (slider_template) - local aura_addon_label = fw:CreateLabel (f, "Addon: ", nil, nil, "GameFontNormal") - aura_addon:SetPoint ("left", aura_addon_label, "right", 2, 0) + local aura_addon_label = fw:CreateLabel(f, "Addon: ", nil, nil, "GameFontNormal") + aura_addon:SetPoint("left", aura_addon_label, "right", 2, 0) --weakauras - group @@ -2489,10 +2489,10 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr return t end - local weakauras_folder_label = fw:CreateLabel (f, "WeakAuras Group: ", nil, nil, "GameFontNormal") + local weakauras_folder_label = fw:CreateLabel(f, "WeakAuras Group: ", nil, nil, "GameFontNormal") local weakauras_folder = fw:CreateDropDown (f, weakauras_folder_options, 1, 150, 20, "WeakaurasFolderDropdown", "$parentWeakaurasFolder") weakauras_folder:SetTemplate (slider_template) - weakauras_folder:SetPoint ("left", weakauras_folder_label, "right", 2, 0) + weakauras_folder:SetPoint("left", weakauras_folder_label, "right", 2, 0) --make new group local create_wa_group = function() @@ -2536,18 +2536,18 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr weakauras_folder:Select (groupName) end - local weakauras_newgroup_label = fw:CreateLabel (f, "New WeakAuras Group: ", nil, nil, "GameFontNormal") + local weakauras_newgroup_label = fw:CreateLabel(f, "New WeakAuras Group: ", nil, nil, "GameFontNormal") local weakauras_newgroup_textentry = fw:CreateTextEntry (f, create_wa_group, 150, 20, "NewWeakaurasGroupTextEntry", "$parentNewWeakaurasGroup") weakauras_newgroup_textentry:SetTemplate (slider_template) - weakauras_newgroup_textentry:SetPoint ("left", weakauras_newgroup_label, "right", 2, 0) + weakauras_newgroup_textentry:SetPoint("left", weakauras_newgroup_label, "right", 2, 0) f.weakauras_newgroup = weakauras_newgroup_textentry weakauras_newgroup_textentry.tooltip = "Enter the name of the new group" local weakauras_newgroup_button = fw:CreateButton (f, create_wa_group, 106, 20, "Create Group") weakauras_newgroup_button:SetTemplate (slider_template) weakauras_newgroup_button:SetTemplate (_detalhes.gump:GetTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) - weakauras_newgroup_button:SetWidth (100) - weakauras_newgroup_button:SetPoint ("left", weakauras_newgroup_textentry, "right", 2, 0) + weakauras_newgroup_button:SetWidth(100) + weakauras_newgroup_button:SetPoint("left", weakauras_newgroup_textentry, "right", 2, 0) --create @@ -2589,11 +2589,11 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr local create_button = fw:CreateButton (f, create_func, 106, 20, L["STRING_CREATEAURA"]) create_button:SetTemplate (slider_template) create_button:SetTemplate (_detalhes.gump:GetTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) - create_button:SetWidth (160) + create_button:SetWidth(160) local cancel_button = fw:CreateButton (f, function() name_textentry:ClearFocus(); f:Hide() end, 106, 20, "Cancel") cancel_button:SetTemplate (_detalhes.gump:GetTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) - cancel_button:SetWidth (160) + cancel_button:SetWidth(160) create_button:SetIcon ([[Interface\Buttons\UI-CheckBox-Check]], nil, nil, nil, {0.125, 0.875, 0.125, 0.875}, nil, 4, 2) @@ -2604,36 +2604,36 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr local y_start = 21 --aura name and the type - name_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*1) + (25)) * -1) - aura_type_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*2) + (25)) * -1) + name_label:SetPoint("topleft", f, "topleft", x_start, ((y_start*1) + (25)) * -1) + aura_type_label:SetPoint("topleft", f, "topleft", x_start, ((y_start*2) + (25)) * -1) --triggers - aura_on_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*4) + (65)) * -1) - stack_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*17) + (65)) * -1) - encounterid_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*18) + (65)) * -1) + aura_on_label:SetPoint("topleft", f, "topleft", x_start, ((y_start*4) + (65)) * -1) + stack_label:SetPoint("topleft", f, "topleft", x_start, ((y_start*17) + (65)) * -1) + encounterid_label:SetPoint("topleft", f, "topleft", x_start, ((y_start*18) + (65)) * -1) --about the spell - spellname_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*20) + (45)) * -1) - usespellid_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*21) + (45)) * -1) - auraid_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*22) + (45)) * -1) - incombat_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*23) + (45)) * -1) + spellname_label:SetPoint("topleft", f, "topleft", x_start, ((y_start*20) + (45)) * -1) + usespellid_label:SetPoint("topleft", f, "topleft", x_start, ((y_start*21) + (45)) * -1) + auraid_label:SetPoint("topleft", f, "topleft", x_start, ((y_start*22) + (45)) * -1) + incombat_label:SetPoint("topleft", f, "topleft", x_start, ((y_start*23) + (45)) * -1) --configuration - icon_label:SetPoint ("topleft", f, "topleft", x2_start, ((y_start*6) + (47)) * -1) - sound_effect_label:SetPoint ("topleft", f, "topleft", x2_start, ((y_start*7) + (47)) * -1) - say_something_label:SetPoint ("topleft", f, "topleft", x2_start, ((y_start*8) + (47)) * -1) - aura_text_label:SetPoint ("topleft", f, "topleft", x2_start, ((y_start*9) + (47)) * -1) - useglow_label:SetPoint ("topleft", f, "topleft", x2_start, ((y_start*10) + (47)) * -1) - iscooldown_label:SetPoint ("topleft", f, "topleft", x2_start, ((y_start*11) + (47)) * -1) - icon_size_label:SetPoint ("topleft", f, "topleft", x2_start, ((y_start*12) + (47)) * -1) + icon_label:SetPoint("topleft", f, "topleft", x2_start, ((y_start*6) + (47)) * -1) + sound_effect_label:SetPoint("topleft", f, "topleft", x2_start, ((y_start*7) + (47)) * -1) + say_something_label:SetPoint("topleft", f, "topleft", x2_start, ((y_start*8) + (47)) * -1) + aura_text_label:SetPoint("topleft", f, "topleft", x2_start, ((y_start*9) + (47)) * -1) + useglow_label:SetPoint("topleft", f, "topleft", x2_start, ((y_start*10) + (47)) * -1) + iscooldown_label:SetPoint("topleft", f, "topleft", x2_start, ((y_start*11) + (47)) * -1) + icon_size_label:SetPoint("topleft", f, "topleft", x2_start, ((y_start*12) + (47)) * -1) - aura_addon_label:SetPoint ("topleft", f, "topleft", x2_start, ((y_start*17) + (60)) * -1) - weakauras_folder_label:SetPoint ("topleft", f, "topleft", x2_start, ((y_start*18) + (60)) * -1) - weakauras_newgroup_label:SetPoint ("topleft", f, "topleft", x2_start, ((y_start*19) + (60)) * -1) + aura_addon_label:SetPoint("topleft", f, "topleft", x2_start, ((y_start*17) + (60)) * -1) + weakauras_folder_label:SetPoint("topleft", f, "topleft", x2_start, ((y_start*18) + (60)) * -1) + weakauras_newgroup_label:SetPoint("topleft", f, "topleft", x2_start, ((y_start*19) + (60)) * -1) - create_button:SetPoint ("topleft", f, "topleft", x2_start, ((y_start*21) + (60)) * -1) - cancel_button:SetPoint ("left", create_button, "right", 20, 0) + create_button:SetPoint("topleft", f, "topleft", x2_start, ((y_start*21) + (60)) * -1) + cancel_button:SetPoint("left", create_button, "right", 20, 0) function f:UpdateLabels() @@ -2642,7 +2642,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr f.StackSlider:Enable() f.StackSlider.tooltip = "Minimum amount of stacks to trigger the aura." - f.StackSlider:SetValue (0) + f.StackSlider:SetValue(0) f.SpellName:Enable() f.UseSpellId:Enable() f.AuraSpellId:Enable() @@ -2654,41 +2654,41 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr f.IconButton:Enable() f.AuraOnDropdown:Enable() f.AuraText:Enable() - f.AuraText:SetText ("") + f.AuraText:SetText("") aura_text_label.text = "Aura Text: " f.UseGlow:Enable() f.IsCooldown:Enable() if (aura_type == "icon") then - aura_text_label:SetText ("Icon Text: ") - icon_size_label:SetText ("Width/Height: ") - f.IconSizeSlider:SetValue (64) + aura_text_label:SetText("Icon Text: ") + icon_size_label:SetText("Width/Height: ") + f.IconSizeSlider:SetValue(64) elseif (aura_type == "text") then - aura_text_label:SetText ("Text: ") - icon_size_label:SetText ("Font Size: ") - f.IconSizeSlider:SetValue (12) + aura_text_label:SetText("Text: ") + icon_size_label:SetText("Font Size: ") + f.IconSizeSlider:SetValue(12) f.IsCooldown:Disable() elseif (aura_type == "aurabar") then - aura_text_label:SetText ("Left Text: ") - icon_size_label:SetText ("Bar Width: ") - f.IconSizeSlider:SetValue (250) + aura_text_label:SetText("Left Text: ") + icon_size_label:SetText("Bar Width: ") + f.IconSizeSlider:SetValue(250) f.IsCooldown:Disable() end if (trigger >= 1 and trigger <= 19) then --buff and debuff - stack_label:SetText ("Trigger Stack Size: ") + stack_label:SetText("Trigger Stack Size: ") elseif (trigger >= 20 and trigger <= 29) then --cast end cast start - stack_label:SetText ("Cast Duration: ") - f.StackSlider:SetValue (2) + stack_label:SetText("Cast Duration: ") + f.StackSlider:SetValue(2) elseif (trigger >= 30 and trigger <= 39) then --boss mods - stack_label:SetText ("Trigger Remaining Time:") - f.StackSlider:SetValue (4) + stack_label:SetText("Trigger Remaining Time:") + f.StackSlider:SetValue(4) f.StackSlider.tooltip = "Will trigger when the bar remaining time reach this value." - f.IconSizeSlider:SetValue (64) + f.IconSizeSlider:SetValue(64) f.SpellName:Disable() f.UseSpellId:Disable() @@ -2704,19 +2704,19 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr f.SaySomething:Disable() f.IconButton:Disable() f.UseGlow:Disable() - icon_size_label:SetText ("Text Size: ") - f.IconSizeSlider:SetValue (11) + icon_size_label:SetText("Text Size: ") + f.IconSizeSlider:SetValue(11) if (trigger == 41) then - f.AuraText:SetText ("=Not Interrupted!=") + f.AuraText:SetText("=Not Interrupted!=") aura_text_label.text = "Not Interrupted: " elseif (trigger == 42) then - f.AuraText:SetText (DetailsAuraPanel.name.text:gsub ("%(d!%)", "") .. "Dispells") + f.AuraText:SetText(DetailsAuraPanel.name.text:gsub ("%(d!%)", "") .. "Dispells") aura_text_label.text = "Title Text: " end end if (DetailsAuraPanel.other_values and DetailsAuraPanel.other_values.text) then - DetailsAuraPanel.AuraText:SetText (DetailsAuraPanel.other_values.text) + DetailsAuraPanel.AuraText:SetText(DetailsAuraPanel.other_values.text) end end @@ -2732,10 +2732,10 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr DetailsAuraPanel.WeakaurasFolderDropdown:Refresh() if (encounterid) then DetailsAuraPanel.WeakaurasFolderDropdown:Select ("Details! Aura Group") - DetailsAuraPanel.IconSizeSlider:SetValue (128) + DetailsAuraPanel.IconSizeSlider:SetValue(128) else DetailsAuraPanel.WeakaurasFolderDropdown:Select (1, true) - DetailsAuraPanel.IconSizeSlider:SetValue (64) + DetailsAuraPanel.IconSizeSlider:SetValue(64) end if (DetailsAuraPanel.other_values.dbm_timer_id or DetailsAuraPanel.other_values.bw_timer_id) then @@ -2743,7 +2743,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr end if (DetailsAuraPanel.other_values.text_size) then - DetailsAuraPanel.IconSizeSlider:SetValue (DetailsAuraPanel.other_values.text_size) + DetailsAuraPanel.IconSizeSlider:SetValue(DetailsAuraPanel.other_values.text_size) end spellname = spellname or "" @@ -2755,12 +2755,12 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr DetailsAuraPanel.UseGlow.glow_test.animIn:Stop() DetailsAuraPanel.UseGlow.glow_test.animOut:Play() - DetailsAuraPanel.UseGlow:SetValue (false) + DetailsAuraPanel.UseGlow:SetValue(false) - DetailsAuraPanel.StackSlider:SetValue (0) + DetailsAuraPanel.StackSlider:SetValue(0) DetailsAuraPanel.SoundEffectDropdown:Select (1, true) - DetailsAuraPanel.AuraText:SetText (DetailsAuraPanel.other_values.text or "") - DetailsAuraPanel.SaySomething:SetText ("") + DetailsAuraPanel.AuraText:SetText(DetailsAuraPanel.other_values.text or "") + DetailsAuraPanel.SaySomething:SetText("") if (triggertype and type (triggertype) == "number") then DetailsAuraPanel.AuraOnDropdown:Select (triggertype, true) diff --git a/frames/window_welcome.lua b/frames/window_welcome.lua index e620670d..bbc6ec63 100644 --- a/frames/window_welcome.lua +++ b/frames/window_welcome.lua @@ -20,14 +20,14 @@ function _detalhes:OpenWelcomeWindow() local instance = _detalhes.tabela_instancias [1] window = _detalhes:CreateWelcomePanel ("DetailsWelcomeWindow", UIParent) - window:SetPoint ("center", UIParent, "center", -200, 0) - window:SetBackdropColor (0, 0, 0, 0.75) - window:SetWidth (612) - window:SetHeight (315) + window:SetPoint("center", UIParent, "center", -200, 0) + window:SetBackdropColor(0, 0, 0, 0.75) + window:SetWidth(612) + window:SetHeight(315) window:SetMovable (true) - window:SetScript ("OnMouseDown", function() window:StartMoving() end) - window:SetScript ("OnMouseUp", function() window:StopMovingOrSizing() end) - window:SetScript ("OnHide", function() + window:SetScript("OnMouseDown", function() window:StartMoving() end) + window:SetScript("OnMouseUp", function() window:StopMovingOrSizing() end) + window:SetScript("OnHide", function() _detalhes.tabela_historico:resetar() if (DetailsFramework.IsClassicWow()) then @@ -39,65 +39,65 @@ function _detalhes:OpenWelcomeWindow() end) - local rodape_bg = window:CreateTexture (nil, "artwork") - rodape_bg:SetPoint ("bottomleft", window, "bottomleft", 11, 12) - rodape_bg:SetPoint ("bottomright", window, "bottomright", -11, 12) - rodape_bg:SetTexture ([[Interface\Tooltips\UI-Tooltip-Background]]) - rodape_bg:SetHeight (25) + local rodape_bg = window:CreateTexture(nil, "artwork") + rodape_bg:SetPoint("bottomleft", window, "bottomleft", 11, 12) + rodape_bg:SetPoint("bottomright", window, "bottomright", -11, 12) + rodape_bg:SetTexture([[Interface\Tooltips\UI-Tooltip-Background]]) + rodape_bg:SetHeight(25) rodape_bg:SetVertexColor (0, 0, 0, 1) - local logotipo = window:CreateTexture (nil, "overlay") - logotipo:SetPoint ("topleft", window, "topleft", 16, -20) - logotipo:SetTexture ([[Interface\Addons\Details\images\logotipo]]) + local logotipo = window:CreateTexture(nil, "overlay") + logotipo:SetPoint("topleft", window, "topleft", 16, -20) + logotipo:SetTexture([[Interface\Addons\Details\images\logotipo]]) logotipo:SetTexCoord (0.07421875, 0.73828125, 0.51953125, 0.890625) - logotipo:SetWidth (186) - logotipo:SetHeight (50) + logotipo:SetWidth(186) + logotipo:SetHeight(50) - local cancel = CreateFrame ("Button", nil, window) - cancel:SetWidth (22) - cancel:SetHeight (22) - cancel:SetPoint ("bottomleft", window, "bottomleft", 12, 14) + local cancel = CreateFrame("Button", nil, window) + cancel:SetWidth(22) + cancel:SetHeight(22) + cancel:SetPoint("bottomleft", window, "bottomleft", 12, 14) cancel:SetFrameLevel (window:GetFrameLevel()+1) - cancel:SetPushedTexture ([[Interface\Buttons\UI-GroupLoot-Pass-Down]]) - cancel:SetHighlightTexture ([[Interface\Buttons\UI-GROUPLOOT-PASS-HIGHLIGHT]]) - cancel:SetNormalTexture ([[Interface\Buttons\UI-GroupLoot-Pass-Up]]) - cancel:SetScript ("OnClick", function() window:Hide() end) + cancel:SetPushedTexture([[Interface\Buttons\UI-GroupLoot-Pass-Down]]) + cancel:SetHighlightTexture([[Interface\Buttons\UI-GROUPLOOT-PASS-HIGHLIGHT]]) + cancel:SetNormalTexture([[Interface\Buttons\UI-GroupLoot-Pass-Up]]) + cancel:SetScript("OnClick", function() window:Hide() end) cancel:GetNormalTexture():SetDesaturated (true) cancel:Disable() local cancelText = cancel:CreateFontString (nil, "overlay", "GameFontNormal") cancelText:SetTextColor (1, 1, 1) - cancelText:SetPoint ("left", cancel, "right", 2, 0) - cancelText:SetText (Loc ["STRING_WELCOME_69"]) + cancelText:SetPoint("left", cancel, "right", 2, 0) + cancelText:SetText(Loc ["STRING_WELCOME_69"]) - local forward = CreateFrame ("button", nil, window) - forward:SetWidth (26) - forward:SetHeight (26) - forward:SetPoint ("bottomright", window, "bottomright", -14, 13) + local forward = CreateFrame("button", nil, window) + forward:SetWidth(26) + forward:SetHeight(26) + forward:SetPoint("bottomright", window, "bottomright", -14, 13) forward:SetFrameLevel (window:GetFrameLevel()+1) - forward:SetPushedTexture ([[Interface\Buttons\UI-SpellbookIcon-NextPage-Down]]) - forward:SetHighlightTexture ([[Interface\Buttons\UI-SpellbookIcon-NextPage-Up]]) - forward:SetNormalTexture ([[Interface\Buttons\UI-SpellbookIcon-NextPage-Up]]) + forward:SetPushedTexture([[Interface\Buttons\UI-SpellbookIcon-NextPage-Down]]) + forward:SetHighlightTexture([[Interface\Buttons\UI-SpellbookIcon-NextPage-Up]]) + forward:SetNormalTexture([[Interface\Buttons\UI-SpellbookIcon-NextPage-Up]]) forward:SetDisabledTexture ([[Interface\Buttons\UI-SpellbookIcon-NextPage-Disabled]]) - local backward = CreateFrame ("button", nil, window) - backward:SetWidth (26) - backward:SetHeight (26) - backward:SetPoint ("bottomright", window, "bottomright", -38, 13) - backward:SetPushedTexture ([[Interface\Buttons\UI-SpellbookIcon-PrevPage-Down]]) - backward:SetHighlightTexture ([[Interface\Buttons\UI-SpellbookIcon-PrevPage-Up]]) - backward:SetNormalTexture ([[Interface\Buttons\UI-SpellbookIcon-PrevPage-Up]]) + local backward = CreateFrame("button", nil, window) + backward:SetWidth(26) + backward:SetHeight(26) + backward:SetPoint("bottomright", window, "bottomright", -38, 13) + backward:SetPushedTexture([[Interface\Buttons\UI-SpellbookIcon-PrevPage-Down]]) + backward:SetHighlightTexture([[Interface\Buttons\UI-SpellbookIcon-PrevPage-Up]]) + backward:SetNormalTexture([[Interface\Buttons\UI-SpellbookIcon-PrevPage-Up]]) backward:SetDisabledTexture ([[Interface\Buttons\UI-SpellbookIcon-PrevPage-Disabled]]) - forward:SetScript ("OnClick", function() + forward:SetScript("OnClick", function() if (index < #pages) then - for _, widget in ipairs (pages [index]) do + for _, widget in ipairs(pages [index]) do widget:Hide() end index = index + 1 - for _, widget in ipairs (pages [index]) do + for _, widget in ipairs(pages [index]) do widget:Show() end @@ -108,15 +108,15 @@ function _detalhes:OpenWelcomeWindow() end end) - backward:SetScript ("OnClick", function() + backward:SetScript("OnClick", function() if (index > 1) then - for _, widget in ipairs (pages [index]) do + for _, widget in ipairs(pages [index]) do widget:Hide() end index = index - 1 - for _, widget in ipairs (pages [index]) do + for _, widget in ipairs(pages [index]) do widget:Show() end @@ -130,7 +130,7 @@ function _detalhes:OpenWelcomeWindow() function _detalhes:WelcomeSetLoc() local instance = _detalhes.tabela_instancias [1] instance.baseframe:ClearAllPoints() - instance.baseframe:SetPoint ("left", DetailsWelcomeWindow, "right", 10, 0) + instance.baseframe:SetPoint("left", DetailsWelcomeWindow, "right", 10, 0) DetailsWelcomeWindow.SetLocTimer = nil end DetailsWelcomeWindow.SetLocTimer = _detalhes:ScheduleTimer ("WelcomeSetLoc", 12) @@ -138,10 +138,10 @@ function _detalhes:OpenWelcomeWindow() --/script local f=CreateFrame("frame");local g=false;f:SetScript("OnUpdate",function(s,e)if not g then local r=math.random for i=1,2500000 do local a=r(1,1000000);a=a+1 end g=true else print(string.format("cpu: %.3f",e));f:SetScript("OnUpdate",nil)end end) function _detalhes:CalcCpuPower() - local f = CreateFrame ("frame") + 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 @@ -170,14 +170,14 @@ function _detalhes:OpenWelcomeWindow() end - --> overriting the results + --overriting the results _detalhes.update_speed = 0.3 _detalhes.use_row_animations = true - DetailsWelcomeWindowSliderUpdateSpeed.MyObject:SetValue (_detalhes.update_speed) - DetailsWelcomeWindowAnimateSlider.MyObject:SetValue (_detalhes.use_row_animations) + DetailsWelcomeWindowSliderUpdateSpeed.MyObject:SetValue(_detalhes.update_speed) + DetailsWelcomeWindowAnimateSlider.MyObject:SetValue(_detalhes.use_row_animations) - f:SetScript ("OnUpdate", nil) + f:SetScript("OnUpdate", nil) end end) end @@ -201,7 +201,7 @@ function _detalhes:OpenWelcomeWindow() local savedObject = {} for key, value in pairs (instance) do if (_detalhes.instance_defaults [key] ~= nil) then - if (type (value) == "table") then + if (type(value) == "table") then savedObject [key] = Details.CopyTable (value) else savedObject [key] = value @@ -217,81 +217,81 @@ function _detalhes:OpenWelcomeWindow() -- frame alert - local frame_alert = CreateFrame ("frame", nil, window) - frame_alert:SetPoint ("topright", window) + local frame_alert = CreateFrame("frame", nil, window) + frame_alert:SetPoint("topright", window) function _detalhes:StopPlayStretchAlert() frame_alert.alert.animIn:Stop() frame_alert.alert.animOut:Play() _detalhes.stopwelcomealert = nil end - frame_alert.alert = CreateFrame ("frame", "DetailsWelcomeWindowAlert", UIParent, "ActionBarButtonSpellActivationAlert") + frame_alert.alert = CreateFrame("frame", "DetailsWelcomeWindowAlert", UIParent, "ActionBarButtonSpellActivationAlert") frame_alert.alert:SetFrameStrata ("FULLSCREEN") frame_alert.alert:Hide() local window_openned_at = time() -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> page 1 +--page 1 - --> introduction + --introduction - local angel = window:CreateTexture (nil, "border") - angel:SetPoint ("bottomright", window, "bottomright") - angel:SetTexture ([[Interface\TUTORIALFRAME\UI-TUTORIALFRAME-SPIRITREZ]]) + local angel = window:CreateTexture(nil, "border") + angel:SetPoint("bottomright", window, "bottomright") + angel:SetTexture([[Interface\TUTORIALFRAME\UI-TUTORIALFRAME-SPIRITREZ]]) angel:SetTexCoord (0.162109375, 0.591796875, 0, 1) - angel:SetWidth (442) - angel:SetHeight (256) + angel:SetWidth(442) + angel:SetHeight(256) angel:SetAlpha (.2) local texto1 = window:CreateFontString (nil, "overlay", "GameFontNormal") - texto1:SetPoint ("topleft", window, "topleft", 13, -220) - texto1:SetText (Loc ["STRING_WELCOME_1"]) - texto1:SetJustifyH ("left") + texto1:SetPoint("topleft", window, "topleft", 13, -220) + texto1:SetText(Loc ["STRING_WELCOME_1"]) + texto1:SetJustifyH("left") pages [#pages+1] = {texto1, angel} -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> Skins Page page 2 +--Skins Page page 2 --SKINS - local bg55 = window:CreateTexture (nil, "overlay") - bg55:SetTexture ([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]]) - bg55:SetPoint ("bottomright", window, "bottomright", -10, 10) - bg55:SetHeight (125*3) - bg55:SetWidth (89*3) + local bg55 = window:CreateTexture(nil, "overlay") + bg55:SetTexture([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]]) + bg55:SetPoint("bottomright", window, "bottomright", -10, 10) + bg55:SetHeight(125*3) + bg55:SetWidth(89*3) bg55:SetAlpha (.05) bg55:SetTexCoord (1, 0, 0, 1) local texto55 = window:CreateFontString (nil, "overlay", "GameFontNormal") - texto55:SetPoint ("topleft", window, "topleft", 20, -80) - texto55:SetText (Loc ["STRING_WELCOME_42"]) + texto55:SetPoint("topleft", window, "topleft", 20, -80) + texto55:SetText(Loc ["STRING_WELCOME_42"]) local texto555 = window:CreateFontString (nil, "overlay", "GameFontNormal") - texto555:SetText (Loc ["STRING_WELCOME_45"]) + texto555:SetText(Loc ["STRING_WELCOME_45"]) texto555:SetTextColor (1, 1, 1, 1) - local changemind = g:NewLabel (window, _, "$parentChangeMind55Label", "changemind55Label", Loc ["STRING_WELCOME_2"], "GameFontNormal", 9, "orange") - window.changemind55Label:SetPoint ("center", window, "center") - window.changemind55Label:SetPoint ("bottom", window, "bottom", 0, 19) + local changemind = g:NewLabel(window, _, "$parentChangeMind55Label", "changemind55Label", Loc ["STRING_WELCOME_2"], "GameFontNormal", 9, "orange") + window.changemind55Label:SetPoint("center", window, "center") + window.changemind55Label:SetPoint("bottom", window, "bottom", 0, 19) window.changemind55Label.align = "|" local texto_appearance = window:CreateFontString (nil, "overlay", "GameFontNormal") - texto_appearance:SetPoint ("topleft", window, "topleft", 30, -110) - texto_appearance:SetText (Loc ["STRING_WELCOME_43"]) - texto_appearance:SetWidth (460) - texto_appearance:SetHeight (100) - texto_appearance:SetJustifyH ("left") + texto_appearance:SetPoint("topleft", window, "topleft", 30, -110) + texto_appearance:SetText(Loc ["STRING_WELCOME_43"]) + texto_appearance:SetWidth(460) + texto_appearance:SetHeight(100) + texto_appearance:SetJustifyH("left") texto_appearance:SetJustifyV ("top") texto_appearance:SetTextColor (1, 1, 1, 1) - local skins_image = window:CreateTexture (nil, "overlay") - skins_image:SetTexture ([[Interface\Addons\Details\images\icons2]]) - skins_image:SetPoint ("topright", window, "topright", -50, -24) - skins_image:SetWidth (214*0.7) - skins_image:SetHeight (133*0.7) + local skins_image = window:CreateTexture(nil, "overlay") + skins_image:SetTexture([[Interface\Addons\Details\images\icons2]]) + skins_image:SetPoint("topright", window, "topright", -50, -24) + skins_image:SetWidth(214*0.7) + skins_image:SetHeight(133*0.7) skins_image:SetTexCoord (0, 0.41796875, 0, 0.259765625) --0, 0, 214 133 --skin @@ -300,9 +300,9 @@ local window_openned_at = time() if (instance1 and instance1:IsEnabled()) then instance1:ChangeSkin (skin_name) window.FontDropdown:Select (instance1.row_info.font_face) - window.BarHeightSlider:SetValue (instance1.row_info.height) - window.TextSizeSlider:SetValue (instance1.row_info.font_size) - window.ShowPercentCheckBox:SetValue (instance1.row_info.textR_show_data [3]) + window.BarHeightSlider:SetValue(instance1.row_info.height) + window.TextSizeSlider:SetValue(instance1.row_info.font_size) + window.ShowPercentCheckBox:SetValue(instance1.row_info.textR_show_data [3]) end local instance2 = _detalhes:GetInstance (2) if (instance2 and instance2:IsEnabled()) then @@ -323,19 +323,19 @@ local window_openned_at = time() skin_dropdown:SetTemplate (g:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) skin_dropdown.tooltip = Loc ["STRING_WELCOME_58"] - local skin_label = g:NewLabel (window, _, "$parentSkinLabel", "skinLabel", Loc ["STRING_OPTIONS_INSTANCE_SKIN"] .. ":", "GameFontNormal") - skin_dropdown:SetPoint ("left", skin_label, "right", 2) - skin_label:SetPoint ("topleft", window, "topleft", 30, -133) + local skin_label = g:NewLabel(window, _, "$parentSkinLabel", "skinLabel", Loc ["STRING_OPTIONS_INSTANCE_SKIN"] .. ":", "GameFontNormal") + skin_dropdown:SetPoint("left", skin_label, "right", 2) + skin_label:SetPoint("topleft", window, "topleft", 30, -133) - --> alphabet selection + --alphabet selection local texto_alphabet = window:CreateFontString (nil, "overlay", "GameFontNormal") - texto_alphabet:SetPoint ("topleft", window, "topleft", 30, -110) - texto_alphabet:SetText (Loc ["STRING_WELCOME_73"]) --"Select the Alphabet or Region:" - texto_alphabet:SetJustifyH ("left") + texto_alphabet:SetPoint("topleft", window, "topleft", 30, -110) + texto_alphabet:SetText(Loc ["STRING_WELCOME_73"]) --"Select the Alphabet or Region:" + texto_alphabet:SetJustifyH("left") texto_alphabet:SetJustifyV ("top") texto_alphabet:SetTextColor (1, 1, 1) - texto_alphabet:SetPoint ("topleft", skin_label.widget, "bottomleft", 0, -20) + texto_alphabet:SetPoint("topleft", skin_label.widget, "bottomleft", 0, -20) local allAlphabetCheckBoxes = {} local allAlphabetLabels = {} @@ -343,13 +343,13 @@ local window_openned_at = time() local onSelectAlphabet = function(self, fixedParameter, value) if (not value) then - self:SetValue (true) + self:SetValue(true) return end - for index, checkBox in ipairs (allAlphabetCheckBoxes) do + for index, checkBox in ipairs(allAlphabetCheckBoxes) do if (checkBox ~= self) then - checkBox:SetValue (false) + checkBox:SetValue(false) end end @@ -422,68 +422,68 @@ local window_openned_at = time() end --Latin Alphabet - g:NewLabel (window, _, "$parentLatinAlphabetLabel", "LatinAlphabetLabel", Loc["STRING_WELCOME_74"], "GameFontHighlightLeft") + g:NewLabel(window, _, "$parentLatinAlphabetLabel", "LatinAlphabetLabel", Loc["STRING_WELCOME_74"], "GameFontHighlightLeft") g:NewSwitch (window, _, "$parentLatinAlphabetCheckBox", "LatinAlphabetCheckBox", 20, 20, _, _, true) window.LatinAlphabetCheckBox:SetAsCheckBox() window.LatinAlphabetCheckBox:SetFixedParameter (1) window.LatinAlphabetCheckBox:SetTemplate (g:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE")) window.LatinAlphabetCheckBox.OnSwitch = onSelectAlphabet - window.LatinAlphabetLabel:SetPoint ("left", window.LatinAlphabetCheckBox, "right", 2, 0) + window.LatinAlphabetLabel:SetPoint("left", window.LatinAlphabetCheckBox, "right", 2, 0) tinsert (allAlphabetCheckBoxes, window.LatinAlphabetCheckBox) tinsert (allAlphabetLabels, window.LatinAlphabetLabel) --Russian - g:NewLabel (window, _, "$parentCyrillicAlphabetLabel", "CyrillicAlphabetLabel", Loc["STRING_WELCOME_75"], "GameFontHighlightLeft") + g:NewLabel(window, _, "$parentCyrillicAlphabetLabel", "CyrillicAlphabetLabel", Loc["STRING_WELCOME_75"], "GameFontHighlightLeft") g:NewSwitch (window, _, "$parentCyrillicAlphabetCheckBox", "CyrillicAlphabetCheckBox", 20, 20, _, _, false) window.CyrillicAlphabetCheckBox:SetAsCheckBox() window.CyrillicAlphabetCheckBox:SetFixedParameter (2) window.CyrillicAlphabetCheckBox:SetTemplate (g:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE")) window.CyrillicAlphabetCheckBox.OnSwitch = onSelectAlphabet - window.CyrillicAlphabetLabel:SetPoint ("left", window.CyrillicAlphabetCheckBox, "right", 2, 0) + window.CyrillicAlphabetLabel:SetPoint("left", window.CyrillicAlphabetCheckBox, "right", 2, 0) tinsert (allAlphabetCheckBoxes, window.CyrillicAlphabetCheckBox) tinsert (allAlphabetLabels, window.CyrillicAlphabetLabel) --Chinese - g:NewLabel (window, _, "$parentChinaAlphabetLabel", "ChinaAlphabetLabel", Loc["STRING_WELCOME_76"], "GameFontHighlightLeft") + g:NewLabel(window, _, "$parentChinaAlphabetLabel", "ChinaAlphabetLabel", Loc["STRING_WELCOME_76"], "GameFontHighlightLeft") g:NewSwitch (window, _, "$parentChinaCheckBox", "ChinaCheckBox", 20, 20, _, _, false) window.ChinaCheckBox:SetAsCheckBox() window.ChinaCheckBox:SetFixedParameter (3) window.ChinaCheckBox:SetTemplate (g:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE")) window.ChinaCheckBox.OnSwitch = onSelectAlphabet - window.ChinaAlphabetLabel:SetPoint ("left", window.ChinaCheckBox, "right", 2, 0) + window.ChinaAlphabetLabel:SetPoint("left", window.ChinaCheckBox, "right", 2, 0) tinsert (allAlphabetCheckBoxes, window.ChinaCheckBox) tinsert (allAlphabetLabels, window.ChinaAlphabetLabel) --Korea - g:NewLabel (window, _, "$parentKoreanAlphabetLabel", "KoreanAlphabetLabel", Loc["STRING_WELCOME_77"], "GameFontHighlightLeft") + g:NewLabel(window, _, "$parentKoreanAlphabetLabel", "KoreanAlphabetLabel", Loc["STRING_WELCOME_77"], "GameFontHighlightLeft") g:NewSwitch (window, _, "$parentKoreanCheckBox", "KoreanCheckBox", 20, 20, _, _, false) window.KoreanCheckBox:SetAsCheckBox() window.KoreanCheckBox:SetFixedParameter (4) window.KoreanCheckBox:SetTemplate (g:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE")) window.KoreanCheckBox.OnSwitch = onSelectAlphabet - window.KoreanAlphabetLabel:SetPoint ("left", window.KoreanCheckBox, "right", 2, 0) + window.KoreanAlphabetLabel:SetPoint("left", window.KoreanCheckBox, "right", 2, 0) tinsert (allAlphabetCheckBoxes, window.KoreanCheckBox) tinsert (allAlphabetLabels, window.KoreanAlphabetLabel) --Taiwan - g:NewLabel (window, _, "$parentTaiwanAlphabetLabel", "TaiwanAlphabetLabel", Loc["STRING_WELCOME_78"], "GameFontHighlightLeft") + g:NewLabel(window, _, "$parentTaiwanAlphabetLabel", "TaiwanAlphabetLabel", Loc["STRING_WELCOME_78"], "GameFontHighlightLeft") g:NewSwitch (window, _, "$parentTaiwanCheckBox", "TaiwanCheckBox", 20, 20, _, _, false) window.TaiwanCheckBox:SetAsCheckBox() window.TaiwanCheckBox:SetFixedParameter (5) window.TaiwanCheckBox:SetTemplate (g:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE")) window.TaiwanCheckBox.OnSwitch = onSelectAlphabet - window.TaiwanAlphabetLabel:SetPoint ("left", window.TaiwanCheckBox, "right", 2, 0) + window.TaiwanAlphabetLabel:SetPoint("left", window.TaiwanCheckBox, "right", 2, 0) tinsert (allAlphabetCheckBoxes, window.TaiwanCheckBox) tinsert (allAlphabetLabels, window.TaiwanAlphabetLabel) - window.LatinAlphabetCheckBox:SetPoint ("topleft", texto_alphabet, "bottomleft", 0, -10) - window.CyrillicAlphabetCheckBox:SetPoint ("topleft", window.LatinAlphabetCheckBox, "bottomleft", 0, -2) - window.ChinaCheckBox:SetPoint ("topleft", window.CyrillicAlphabetCheckBox, "bottomleft", 0, -2) - window.KoreanCheckBox:SetPoint ("topleft", texto_alphabet, "bottomleft", 175, -10) - window.TaiwanCheckBox:SetPoint ("topleft", window.KoreanCheckBox, "bottomleft", 0, -2) + window.LatinAlphabetCheckBox:SetPoint("topleft", texto_alphabet, "bottomleft", 0, -10) + window.CyrillicAlphabetCheckBox:SetPoint("topleft", window.LatinAlphabetCheckBox, "bottomleft", 0, -2) + window.ChinaCheckBox:SetPoint("topleft", window.CyrillicAlphabetCheckBox, "bottomleft", 0, -2) + window.KoreanCheckBox:SetPoint("topleft", texto_alphabet, "bottomleft", 175, -10) + window.TaiwanCheckBox:SetPoint("topleft", window.KoreanCheckBox, "bottomleft", 0, -2) - --> buttons + --buttons local padding = -4 local buttonWidth = 160 @@ -491,8 +491,8 @@ local window_openned_at = time() 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) - newwindow.baseframe:SetPoint ("bottomleft", _detalhes.tabela_instancias[1].baseframe, "bottomright", 50, 0) + newwindow.baseframe:SetPoint("topleft", _detalhes.tabela_instancias[1].baseframe, "topright", 50, 0) + newwindow.baseframe:SetPoint("bottomleft", _detalhes.tabela_instancias[1].baseframe, "bottomright", 50, 0) newwindow:SaveMainWindowPosition() newwindow:RestoreMainWindowPosition() end @@ -502,7 +502,7 @@ local window_openned_at = time() local create_window_button = g:CreateButton (window, new_window, buttonWidth, 20, Loc["STRING_WELCOME_79"]) create_window_button:SetTemplate (g:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) create_window_button:SetIcon ([[Interface\FriendsFrame\UI-FriendsList-Large-Up]], nil, nil, nil, {5/32, 26/32, 6/32, 26/32}, nil, 4, 2) - create_window_button:SetPoint ("topright", window, "topright", -100, -137) + create_window_button:SetPoint("topright", window, "topright", -100, -137) if (#_detalhes.tabela_instancias == 2) then create_window_button:Disable() @@ -518,7 +518,7 @@ local window_openned_at = time() instance:InstanceColor (r, g, b, instance.menu_alpha.onleave, nil, true) if (_detalhes.options_group_edit) then - for _, this_instance in ipairs (instance:GetInstanceGroup()) do + for _, this_instance in ipairs(instance:GetInstanceGroup()) do if (this_instance ~= instance) then this_instance:InstanceColor (r, g, b, instance.menu_alpha.onleave, nil, true) end @@ -530,7 +530,7 @@ local window_openned_at = time() instance:InstanceColor (r, g, b, a, nil, true) if (_detalhes.options_group_edit) then - for _, this_instance in ipairs (instance:GetInstanceGroup()) do + for _, this_instance in ipairs(instance:GetInstanceGroup()) do if (this_instance ~= instance) then this_instance:InstanceColor (r, g, b, a, nil, true) end @@ -551,18 +551,18 @@ local window_openned_at = time() local window_color = g:CreateButton (window, change_color, buttonWidth, 20, Loc ["STRING_OPTIONS_CHANGECOLOR"]) window_color:SetTemplate (g:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) - window_color:SetPoint ("topleft", create_window_button, "bottomleft", 0, padding) + window_color:SetPoint("topleft", create_window_button, "bottomleft", 0, padding) window_color:SetIcon ([[Interface\AddOns\Details\images\icons]], 14, 14, nil, {434/512, 466/512, 277/512, 307/512}, nil, 4, 2) --bar height - g:NewLabel (window, _, "$parentBarHeightLabel", "BarHeightLabel", Loc ["STRING_OPTIONS_BAR_HEIGHT"] .. ":", "GameFontNormal") - window.BarHeightLabel:SetPoint ("topleft", window_color, "bottomleft", 0, -4 + padding) + g:NewLabel(window, _, "$parentBarHeightLabel", "BarHeightLabel", Loc ["STRING_OPTIONS_BAR_HEIGHT"] .. ":", "GameFontNormal") + window.BarHeightLabel:SetPoint("topleft", window_color, "bottomleft", 0, -4 + padding) -- g:NewSlider (window, _, "$parentBarHeightSpeed", "BarHeightSlider", 160, 20, 8, 24, 1, 14) --parent, container, name, member, w, h, min, max, step, defaultv - window.BarHeightSlider:SetPoint ("left", window.BarHeightLabel, "right", 2, 0) + 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) @@ -575,14 +575,14 @@ local window_openned_at = time() end) --text size - g:NewLabel (window, _, "$parentTextSizeLabel", "TextSizeLabel", Loc ["STRING_OPTIONS_TEXT_SIZE"] .. ":", "GameFontNormal") - window.TextSizeLabel:SetPoint ("topleft", window.BarHeightLabel, "bottomleft", 0, -4 + padding) + g:NewLabel(window, _, "$parentTextSizeLabel", "TextSizeLabel", Loc ["STRING_OPTIONS_TEXT_SIZE"] .. ":", "GameFontNormal") + window.TextSizeLabel:SetPoint("topleft", window.BarHeightLabel, "bottomleft", 0, -4 + padding) -- g:NewSlider (window, _, "$parentTextSizeSpeed", "TextSizeSlider", 160, 20, 10, 20, 1, 14) --parent, container, name, member, w, h, min, max, step, defaultv - window.TextSizeSlider:SetPoint ("left", window.TextSizeLabel, "right", 2, 0) + 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) @@ -622,12 +622,12 @@ local window_openned_at = time() font_dropdown:SetTemplate (g:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) font_dropdown.tooltip = Loc ["STRING_WELCOME_58"] - local font_label = g:NewLabel (window, _, "$parentFontLabel", "FontLabel", Loc ["STRING_OPTIONS_TEXT_FONT"], "GameFontNormal") - font_dropdown:SetPoint ("left", font_label, "right", 2) - font_label:SetPoint ("topleft", window.TextSizeLabel, "bottomleft", 0, -4 + padding) + local font_label = g:NewLabel(window, _, "$parentFontLabel", "FontLabel", Loc ["STRING_OPTIONS_TEXT_FONT"], "GameFontNormal") + font_dropdown:SetPoint("left", font_label, "right", 2) + font_label:SetPoint("topleft", window.TextSizeLabel, "bottomleft", 0, -4 + padding) --show percent - g:NewLabel (window, _, "$parentShowPercentLabel", "ShowPercentLabel", Loc ["STRING_OPTIONS_TEXT_SHOW_PERCENT"], "GameFontNormal") + g:NewLabel(window, _, "$parentShowPercentLabel", "ShowPercentLabel", Loc ["STRING_OPTIONS_TEXT_SHOW_PERCENT"], "GameFontNormal") g:NewSwitch (window, _, "$parentShowPercentCheckBox", "ShowPercentCheckBox", 20, 20, _, _, false) window.ShowPercentCheckBox:SetAsCheckBox() window.ShowPercentCheckBox:SetFixedParameter (1) @@ -655,14 +655,14 @@ local window_openned_at = time() end end - window.ShowPercentLabel:SetPoint ("topleft", font_label.widget, "bottomleft", 0, -4 + padding) - window.ShowPercentCheckBox:SetPoint ("left", window.ShowPercentLabel, "right", 2, 0) + window.ShowPercentLabel:SetPoint("topleft", font_label.widget, "bottomleft", 0, -4 + padding) + window.ShowPercentCheckBox:SetPoint("left", window.ShowPercentLabel, "right", 2, 0) local created_test_bars = 0 - local skins_frame_alert = CreateFrame ("frame", nil, window) + local skins_frame_alert = CreateFrame("frame", nil, window) skins_frame_alert:Hide() - skins_frame_alert:SetScript ("OnShow", function() + skins_frame_alert:SetScript("OnShow", function() if (created_test_bars < 2) then _detalhes:CreateTestBars() created_test_bars = created_test_bars + 1 @@ -676,95 +676,95 @@ local window_openned_at = time() end) pages [#pages+1] = {skins_frame_alert, bg55, texto55, texto_alphabet, texto555, skins_image, changemind, texto_appearance, font_label, font_dropdown, skin_dropdown, skin_label, create_window_button, window_color, window.BarHeightLabel, window.BarHeightSlider, window.TextSizeLabel, window.TextSizeSlider, window.ShowPercentLabel, window.ShowPercentCheckBox} - for i, widget in ipairs (allAlphabetCheckBoxes) do + for i, widget in ipairs(allAlphabetCheckBoxes) do tinsert (pages [#pages], widget) end - for i, widget in ipairs (allAlphabetLabels) do + for i, widget in ipairs(allAlphabetLabels) do tinsert (pages [#pages], widget) end - for _, widget in ipairs (pages[#pages]) do + for _, widget in ipairs(pages[#pages]) do widget:Hide() end -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> numeral system page 3 +--numeral system page 3 - local numeral_image = window:CreateTexture (nil, "overlay") + local numeral_image = window:CreateTexture(nil, "overlay") - numeral_image:SetTexture ([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]]) - numeral_image:SetPoint ("bottomright", window, "bottomright", -10, 10) - numeral_image:SetHeight (125*3)--125 - numeral_image:SetWidth (89*3)--82 + numeral_image:SetTexture([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]]) + numeral_image:SetPoint("bottomright", window, "bottomright", -10, 10) + numeral_image:SetHeight(125*3)--125 + numeral_image:SetWidth(89*3)--82 numeral_image:SetAlpha (.05) numeral_image:SetTexCoord (1, 0, 0, 1) - g:NewLabel (window, _, "$parentChangeMindNumeralLabel", "changemindNumeralLabel", Loc ["STRING_WELCOME_2"], "GameFontNormal", 9, "orange") - window.changemindNumeralLabel:SetPoint ("center", window, "center") - window.changemindNumeralLabel:SetPoint ("bottom", window, "bottom", 0, 19) + g:NewLabel(window, _, "$parentChangeMindNumeralLabel", "changemindNumeralLabel", Loc ["STRING_WELCOME_2"], "GameFontNormal", 9, "orange") + window.changemindNumeralLabel:SetPoint("center", window, "center") + window.changemindNumeralLabel:SetPoint("bottom", window, "bottom", 0, 19) window.changemindNumeralLabel.align = "|" local texto2Numeral = window:CreateFontString (nil, "overlay", "GameFontNormal") - texto2Numeral:SetPoint ("topleft", window, "topleft", 20, -80) - texto2Numeral:SetText (Loc ["STRING_NUMERALSYSTEM_DESC"] .. ":") + texto2Numeral:SetPoint("topleft", window, "topleft", 20, -80) + texto2Numeral:SetText(Loc ["STRING_NUMERALSYSTEM_DESC"] .. ":") --numeral 1 - western - g:NewLabel (window, _, "$parentWesternNumbersLabel", "WesternNumbersLabel", Loc ["STRING_NUMERALSYSTEM_ARABIC_WESTERN"] .. ": " .. Loc ["STRING_NUMERALSYSTEM_ARABIC_WESTERN_DESC"], "GameFontHighlightLeft") + g:NewLabel(window, _, "$parentWesternNumbersLabel", "WesternNumbersLabel", Loc ["STRING_NUMERALSYSTEM_ARABIC_WESTERN"] .. ": " .. Loc ["STRING_NUMERALSYSTEM_ARABIC_WESTERN_DESC"], "GameFontHighlightLeft") local WesternNumbersCheckbox = g:NewSwitch (window, _, "WesternNumbersCheckbox", "WesternNumbersCheckbox", 20, 20, _, _, true) WesternNumbersCheckbox:SetAsCheckBox() WesternNumbersCheckbox:SetFixedParameter (1) WesternNumbersCheckbox:SetTemplate (g:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE")) - WesternNumbersCheckbox:SetPoint ("topleft", window, "topleft", 40, -130) - window.WesternNumbersLabel:SetPoint ("left", WesternNumbersCheckbox, "right", 2, 0) + WesternNumbersCheckbox:SetPoint("topleft", window, "topleft", 40, -130) + window.WesternNumbersLabel:SetPoint("left", WesternNumbersCheckbox, "right", 2, 0) --numeral 2 asian - g:NewLabel (window, _, "$parentAsianNumbersLabel", "AsianNumbersLabel", Loc ["STRING_NUMERALSYSTEM_MYRIAD_EASTASIA"] .. ": " .. Loc ["STRING_NUMERALSYSTEM_ARABIC_MYRIAD_EASTASIA"], "GameFontHighlightLeft") + g:NewLabel(window, _, "$parentAsianNumbersLabel", "AsianNumbersLabel", Loc ["STRING_NUMERALSYSTEM_MYRIAD_EASTASIA"] .. ": " .. Loc ["STRING_NUMERALSYSTEM_ARABIC_MYRIAD_EASTASIA"], "GameFontHighlightLeft") local AsianNumbersCheckbox = g:NewSwitch (window, _, "AsianNumbersCheckbox", "AsianNumbersCheckbox", 20, 20, _, _, true) AsianNumbersCheckbox:SetAsCheckBox() AsianNumbersCheckbox:SetFixedParameter (2) AsianNumbersCheckbox:SetTemplate (g:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE")) - AsianNumbersCheckbox:SetPoint ("topleft", window, "topleft", 40, -200) - window.AsianNumbersLabel:SetPoint ("left", AsianNumbersCheckbox, "right", 2, 0) + AsianNumbersCheckbox:SetPoint("topleft", window, "topleft", 40, -200) + window.AsianNumbersLabel:SetPoint("left", AsianNumbersCheckbox, "right", 2, 0) --western on clicks WesternNumbersCheckbox.OnSwitch = function() - WesternNumbersCheckbox:SetValue (true) - AsianNumbersCheckbox:SetValue (false) + WesternNumbersCheckbox:SetValue(true) + AsianNumbersCheckbox:SetValue(false) _detalhes.numerical_system = 1 _detalhes:SelectNumericalSystem() end --asian on click AsianNumbersCheckbox.OnSwitch = function() - AsianNumbersCheckbox:SetValue (true) - WesternNumbersCheckbox:SetValue (false) + AsianNumbersCheckbox:SetValue(true) + WesternNumbersCheckbox:SetValue(false) _detalhes.numerical_system = 2 _detalhes:SelectNumericalSystem() end - local sword_icon2 = window:CreateTexture (nil, "overlay") - sword_icon2:SetTexture ([[Interface\Addons\Details\images\icons2]]) - sword_icon2:SetPoint ("topright", window, "topright", -30, -10) - sword_icon2:SetSize (128*1.4, 64*1.4) + local sword_icon2 = window:CreateTexture(nil, "overlay") + sword_icon2:SetTexture([[Interface\Addons\Details\images\icons2]]) + sword_icon2:SetPoint("topright", window, "topright", -30, -10) + sword_icon2:SetSize(128*1.4, 64*1.4) sword_icon2:SetTexCoord (330/512, 509/512, 437/512, 509/512) sword_icon2:SetDrawLayer ("overlay", 2) - local thedude2 = window:CreateTexture (nil, "overlay") - --thedude2:SetTexture ([[Interface\TUTORIALFRAME\UI-TutorialFrame-TheDude]]) - thedude2:SetPoint ("bottomright", sword_icon, "bottomleft", 70, 19) - thedude2:SetWidth (128*1.0) - thedude2:SetHeight (128*1.0) + local thedude2 = window:CreateTexture(nil, "overlay") + --thedude2:SetTexture([[Interface\TUTORIALFRAME\UI-TutorialFrame-TheDude]]) + thedude2:SetPoint("bottomright", sword_icon, "bottomleft", 70, 19) + thedude2:SetWidth(128*1.0) + thedude2:SetHeight(128*1.0) thedude2:SetTexCoord (0, 1, 0, 1) thedude2:SetDrawLayer ("overlay", 3) local NumeralType1_text = window:CreateFontString (nil, "overlay", "GameFontNormal") - NumeralType1_text:SetText ("1K = 1.000 |cFFFFCC00| |r10K = 10.000 |cFFFFCC00| |r100K = 100.000 |cFFFFCC00| |r1M = 1.000.000") - NumeralType1_text:SetWidth (500) - NumeralType1_text:SetHeight (40) - NumeralType1_text:SetJustifyH ("left") + NumeralType1_text:SetText("1K = 1.000 |cFFFFCC00| |r10K = 10.000 |cFFFFCC00| |r100K = 100.000 |cFFFFCC00| |r1M = 1.000.000") + NumeralType1_text:SetWidth(500) + NumeralType1_text:SetHeight(40) + NumeralType1_text:SetJustifyH("left") NumeralType1_text:SetJustifyV ("top") NumeralType1_text:SetTextColor (.8, .8, .8, 1) - NumeralType1_text:SetPoint ("topleft", window, "topleft", 40, -150) + NumeralType1_text:SetPoint("topleft", window, "topleft", 40, -150) local NumeralType2_text = window:CreateFontString (nil, "overlay", "GameFontNormal") @@ -772,7 +772,7 @@ local window_openned_at = time() local asian1K, asian10K, asian1B = _detalhes.gump:GetAsianNumberSymbols() local asianNumerals = "1" .. asian1K .. " = 1.000 \n1" .. asian10K .. " = 10.000 \n10" .. asian10K .. " = 100.000 \n100" .. asian10K .. " = 1.000.000" - --> if region is western it'll be using Korean symbols, set a font on the dropdown so it won't show ????? + --if region is western it'll be using Korean symbols, set a font on the dropdown so it won't show ????? local clientRegion = _detalhes.gump:GetClientRegion() if (clientRegion == "western" or clientRegion == "russia") then _detalhes.gump:SetFontFace (NumeralType2_text, _detalhes.gump:GetBestFontForLanguage ("koKR")) @@ -781,145 +781,145 @@ local window_openned_at = time() _detalhes.gump:SetFontFace (NumeralType2_text, _detalhes.gump:GetBestFontForLanguage()) end - --> set the text - NumeralType2_text:SetText (asianNumerals) + --set the text + NumeralType2_text:SetText(asianNumerals) - NumeralType2_text:SetWidth (500) - NumeralType2_text:SetHeight (80) - NumeralType2_text:SetJustifyH ("left") + NumeralType2_text:SetWidth(500) + NumeralType2_text:SetHeight(80) + NumeralType2_text:SetJustifyH("left") NumeralType2_text:SetJustifyV ("top") NumeralType2_text:SetTextColor (.8, .8, .8, 1) - NumeralType2_text:SetPoint ("topleft", window, "topleft", 40, -220) + NumeralType2_text:SetPoint("topleft", window, "topleft", 40, -220) - if (_detalhes.numerical_system == 1) then --> west - WesternNumbersCheckbox:SetValue (true) - AsianNumbersCheckbox:SetValue (false) - elseif (_detalhes.numerical_system == 2) then --> east - WesternNumbersCheckbox:SetValue (false) - AsianNumbersCheckbox:SetValue (true) + if (_detalhes.numerical_system == 1) then --west + WesternNumbersCheckbox:SetValue(true) + AsianNumbersCheckbox:SetValue(false) + elseif (_detalhes.numerical_system == 2) then --east + WesternNumbersCheckbox:SetValue(false) + AsianNumbersCheckbox:SetValue(true) end pages [#pages+1] = {thedude2, sword_icon2, numeral_image, texto2Numeral, NumeralType1_text, NumeralType2_text, window.changemindNumeralLabel, window.AsianNumbersLabel, AsianNumbersCheckbox, window.WesternNumbersLabel, WesternNumbersCheckbox} - for _, widget in ipairs (pages[#pages]) do + for _, widget in ipairs(pages[#pages]) do widget:Hide() end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> page 4 +--page 4 -- DPS effective or active - local ampulheta = window:CreateTexture (nil, "overlay") - ampulheta:SetTexture ([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]]) - ampulheta:SetPoint ("bottomright", window, "bottomright", -10, 10) - ampulheta:SetHeight (125*3)--125 - ampulheta:SetWidth (89*3)--82 + local ampulheta = window:CreateTexture(nil, "overlay") + ampulheta:SetTexture([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]]) + ampulheta:SetPoint("bottomright", window, "bottomright", -10, 10) + ampulheta:SetHeight(125*3)--125 + ampulheta:SetWidth(89*3)--82 ampulheta:SetAlpha (.05) ampulheta:SetTexCoord (1, 0, 0, 1) - g:NewLabel (window, _, "$parentChangeMind2Label", "changemind2Label", Loc ["STRING_WELCOME_2"], "GameFontNormal", 9, "orange") - window.changemind2Label:SetPoint ("center", window, "center") - window.changemind2Label:SetPoint ("bottom", window, "bottom", 0, 19) + g:NewLabel(window, _, "$parentChangeMind2Label", "changemind2Label", Loc ["STRING_WELCOME_2"], "GameFontNormal", 9, "orange") + window.changemind2Label:SetPoint("center", window, "center") + window.changemind2Label:SetPoint("bottom", window, "bottom", 0, 19) window.changemind2Label.align = "|" local texto2 = window:CreateFontString (nil, "overlay", "GameFontNormal") - texto2:SetPoint ("topleft", window, "topleft", 20, -80) - texto2:SetText (Loc ["STRING_WELCOME_3"]) + texto2:SetPoint("topleft", window, "topleft", 20, -80) + texto2:SetText(Loc ["STRING_WELCOME_3"]) --chronometer checkbox - g:NewLabel (window, _, "$parentChronometerLabel", "ChronometerLabel", Loc ["STRING_WELCOME_4"], "GameFontHighlightLeft") + g:NewLabel(window, _, "$parentChronometerLabel", "ChronometerLabel", Loc ["STRING_WELCOME_4"], "GameFontHighlightLeft") local chronometer = g:NewSwitch (window, _, "WelcomeWindowChronometer", "WelcomeWindowChronometer", 20, 20, _, _, true) chronometer:SetAsCheckBox() chronometer:SetFixedParameter (1) chronometer:SetTemplate (g:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE")) - window.ChronometerLabel:SetPoint ("left", chronometer, "right", 2, 0) + window.ChronometerLabel:SetPoint("left", chronometer, "right", 2, 0) --continuouses checkbox - g:NewLabel (window, _, "$parentContinuousLabel", "ContinuousLabel", Loc ["STRING_WELCOME_5"], "GameFontHighlightLeft") + g:NewLabel(window, _, "$parentContinuousLabel", "ContinuousLabel", Loc ["STRING_WELCOME_5"], "GameFontHighlightLeft") local continuous = g:NewSwitch (window, _, "WelcomeWindowContinuous", "WelcomeWindowContinuous", 20, 20, _, _, true) continuous:SetAsCheckBox() continuous:SetFixedParameter (1) continuous:SetTemplate (g:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE")) - window.ContinuousLabel:SetPoint ("left", continuous, "right", 2, 0) + window.ContinuousLabel:SetPoint("left", continuous, "right", 2, 0) --on clkich chronomoeter checkbox chronometer.OnSwitch = function() - chronometer:SetValue (true) - continuous:SetValue (false) + chronometer:SetValue(true) + continuous:SetValue(false) _detalhes.time_type = 1 end --on click continuous check box continuous.OnSwitch = function() - continuous:SetValue (true) - chronometer:SetValue (false) + continuous:SetValue(true) + chronometer:SetValue(false) _detalhes.time_type = 2 end - chronometer:SetPoint ("topleft", window, "topleft", 40, -130) - continuous:SetPoint ("topleft", window, "topleft", 40, -200) + chronometer:SetPoint("topleft", window, "topleft", 40, -130) + continuous:SetPoint("topleft", window, "topleft", 40, -200) - local sword_icon = window:CreateTexture (nil, "overlay") - sword_icon:SetTexture ([[Interface\TUTORIALFRAME\UI-TutorialFrame-AttackCursor]]) - sword_icon:SetPoint ("topright", window, "topright", -15, -30) - sword_icon:SetWidth (64*1.4) - sword_icon:SetHeight (64*1.4) + local sword_icon = window:CreateTexture(nil, "overlay") + sword_icon:SetTexture([[Interface\TUTORIALFRAME\UI-TutorialFrame-AttackCursor]]) + sword_icon:SetPoint("topright", window, "topright", -15, -30) + sword_icon:SetWidth(64*1.4) + sword_icon:SetHeight(64*1.4) sword_icon:SetTexCoord (1, 0, 0, 1) sword_icon:SetDrawLayer ("overlay", 2) - local thedude = window:CreateTexture (nil, "overlay") - thedude:SetTexture ([[Interface\TUTORIALFRAME\UI-TutorialFrame-TheDude]]) - thedude:SetPoint ("bottomright", sword_icon, "bottomleft", 70, 19) - thedude:SetWidth (128*1.0) - thedude:SetHeight (128*1.0) + local thedude = window:CreateTexture(nil, "overlay") + thedude:SetTexture([[Interface\TUTORIALFRAME\UI-TutorialFrame-TheDude]]) + thedude:SetPoint("bottomright", sword_icon, "bottomleft", 70, 19) + thedude:SetWidth(128*1.0) + thedude:SetHeight(128*1.0) thedude:SetTexCoord (0, 1, 0, 1) thedude:SetDrawLayer ("overlay", 3) local chronometer_text = window:CreateFontString (nil, "overlay", "GameFontNormal") - chronometer_text:SetText (Loc ["STRING_WELCOME_6"]) - chronometer_text:SetWidth (360) - chronometer_text:SetHeight (40) - chronometer_text:SetJustifyH ("left") + chronometer_text:SetText(Loc ["STRING_WELCOME_6"]) + chronometer_text:SetWidth(360) + chronometer_text:SetHeight(40) + chronometer_text:SetJustifyH("left") chronometer_text:SetJustifyV ("top") chronometer_text:SetTextColor (.8, .8, .8, 1) - chronometer_text:SetPoint ("topleft", window.ChronometerLabel.widget, "topright", 20, 0) + chronometer_text:SetPoint("topleft", window.ChronometerLabel.widget, "topright", 20, 0) local continuous_text = window:CreateFontString (nil, "overlay", "GameFontNormal") - continuous_text:SetText (Loc ["STRING_WELCOME_7"]) - continuous_text:SetWidth (340) - continuous_text:SetHeight (40) - continuous_text:SetJustifyH ("left") + continuous_text:SetText(Loc ["STRING_WELCOME_7"]) + continuous_text:SetWidth(340) + continuous_text:SetHeight(40) + continuous_text:SetJustifyH("left") continuous_text:SetJustifyV ("top") continuous_text:SetTextColor (.8, .8, .8, 1) - continuous_text:SetPoint ("topleft", window.ContinuousLabel.widget, "topright", 20, 0) + continuous_text:SetPoint("topleft", window.ContinuousLabel.widget, "topright", 20, 0) - if (_detalhes.time_type == 1) then --> chronometer - chronometer:SetValue (true) - continuous:SetValue (false) - elseif (_detalhes.time_type == 2) then --> continuous - chronometer:SetValue (false) - continuous:SetValue (true) + if (_detalhes.time_type == 1) then --chronometer + chronometer:SetValue(true) + continuous:SetValue(false) + elseif (_detalhes.time_type == 2) then --continuous + chronometer:SetValue(false) + continuous:SetValue(true) end local pleasewait = window:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - pleasewait:SetPoint ("bottomright", forward, "topright") + pleasewait:SetPoint("bottomright", forward, "topright") - local free_frame3 = CreateFrame ("frame", nil, window) + local free_frame3 = CreateFrame("frame", nil, window) function _detalhes:FreeTutorialFrame3() if (window_openned_at+10 > time()) then pleasewait:Show() forward:Disable() - pleasewait:SetText ("wait... " .. window_openned_at + 10 - time()) + pleasewait:SetText("wait... " .. window_openned_at + 10 - time()) else pleasewait:Hide() - pleasewait:SetText ("") + pleasewait:SetText("") forward:Enable() _detalhes:CancelTimer (window.free_frame3_schedule) window.free_frame3_schedule = nil end end - free_frame3:SetScript ("OnShow", function() + free_frame3:SetScript("OnShow", function() if (window_openned_at-10 > time()) then forward:Disable() if (window.free_frame3_schedule) then @@ -929,69 +929,69 @@ local window_openned_at = time() window.free_frame3_schedule = _detalhes:ScheduleRepeatingTimer ("FreeTutorialFrame3", 1) end end) - free_frame3:SetScript ("OnHide", function() + free_frame3:SetScript("OnHide", function() if (window.free_frame3_schedule) then _detalhes:CancelTimer (window.free_frame3_schedule) window.free_frame3_schedule = nil - pleasewait:SetText ("") + pleasewait:SetText("") pleasewait:Hide() end end) pages [#pages+1] = {pleasewait, free_frame3, thedude, sword_icon, ampulheta, texto2, chronometer, continuous, chronometer_text, continuous_text, window.changemind2Label, window.ContinuousLabel, window.ChronometerLabel} - for _, widget in ipairs (pages[#pages]) do + for _, widget in ipairs(pages[#pages]) do widget:Hide() end -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> page 4 +--page 4 -- UPDATE SPEED - local bg = window:CreateTexture (nil, "overlay") - bg:SetTexture ([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]]) - bg:SetPoint ("bottomright", window, "bottomright", -10, 10) - bg:SetHeight (125*3)--125 - bg:SetWidth (89*3)--82 + local bg = window:CreateTexture(nil, "overlay") + bg:SetTexture([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]]) + bg:SetPoint("bottomright", window, "bottomright", -10, 10) + bg:SetHeight(125*3)--125 + bg:SetWidth(89*3)--82 bg:SetAlpha (.05) bg:SetTexCoord (1, 0, 0, 1) - g:NewLabel (window, _, "$parentChangeMind4Label", "changemind4Label", Loc ["STRING_WELCOME_11"], "GameFontNormal", 9, "orange") - window.changemind4Label:SetPoint ("center", window, "center") - window.changemind4Label:SetPoint ("bottom", window, "bottom", 0, 19) + g:NewLabel(window, _, "$parentChangeMind4Label", "changemind4Label", Loc ["STRING_WELCOME_11"], "GameFontNormal", 9, "orange") + window.changemind4Label:SetPoint("center", window, "center") + window.changemind4Label:SetPoint("bottom", window, "bottom", 0, 19) window.changemind4Label.align = "|" local texto4 = window:CreateFontString (nil, "overlay", "GameFontNormal") - texto4:SetPoint ("topleft", window, "topleft", 20, -80) - texto4:SetText (Loc ["STRING_WELCOME_41"]) + texto4:SetPoint("topleft", window, "topleft", 20, -80) + texto4:SetText(Loc ["STRING_WELCOME_41"]) local interval_text = window:CreateFontString (nil, "overlay", "GameFontNormal") - interval_text:SetText (Loc ["STRING_WELCOME_12"]) - interval_text:SetWidth (460) - interval_text:SetHeight (40) - interval_text:SetJustifyH ("left") + interval_text:SetText(Loc ["STRING_WELCOME_12"]) + interval_text:SetWidth(460) + interval_text:SetHeight(40) + interval_text:SetJustifyH("left") interval_text:SetJustifyV ("top") interval_text:SetTextColor (1, 1, 1, .9) - interval_text:SetPoint ("topleft", window, "topleft", 30, -110) + interval_text:SetPoint("topleft", window, "topleft", 30, -110) local dance_text = window:CreateFontString (nil, "overlay", "GameFontNormal") - dance_text:SetText ("") --loc removed - dance_text:SetWidth (460) - dance_text:SetHeight (40) - dance_text:SetJustifyH ("left") + dance_text:SetText("") --loc removed + dance_text:SetWidth(460) + dance_text:SetHeight(40) + dance_text:SetJustifyH("left") dance_text:SetJustifyV ("top") dance_text:SetTextColor (1, 1, 1, 1) - dance_text:SetPoint ("topleft", window, "topleft", 30, -175) + dance_text:SetPoint("topleft", window, "topleft", 30, -175) --------------- Update Speed - g:NewLabel (window, _, "$parentUpdateSpeedLabel", "updatespeedLabel", Loc ["STRING_OPTIONS_WINDOWSPEED"] .. ":", "GameFontNormal") - window.updatespeedLabel:SetPoint (31, -150) + g:NewLabel(window, _, "$parentUpdateSpeedLabel", "updatespeedLabel", Loc ["STRING_OPTIONS_WINDOWSPEED"] .. ":", "GameFontNormal") + window.updatespeedLabel:SetPoint(31, -150) -- g:NewSlider (window, _, "$parentSliderUpdateSpeed", "updatespeedSlider", 160, 20, 0.050, 3, 0.050, _detalhes.update_speed, true) --parent, container, name, member, w, h, min, max, step, defaultv - window.updatespeedSlider:SetPoint ("left", window.updatespeedLabel, "right", 2, 0) + window.updatespeedSlider:SetPoint("left", window.updatespeedLabel, "right", 2, 0) window.updatespeedSlider:SetTemplate (g:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE")) window.updatespeedSlider:SetThumbSize (50) window.updatespeedSlider.useDecimals = true @@ -1011,19 +1011,19 @@ local window_openned_at = time() end) updateColor(window.updatespeedSlider, _detalhes.update_speed) - window.updatespeedSlider:SetHook ("OnEnter", function() + window.updatespeedSlider:SetHook("OnEnter", function() return true end) window.updatespeedSlider.tooltip = Loc ["STRING_WELCOME_15"] --------------- Animate Rows - g:NewLabel (window, _, "$parentAnimateLabel", "animateLabel", Loc ["STRING_OPTIONS_ANIMATEBARS"] .. ":", "GameFontNormal") - window.animateLabel:SetPoint (31, -170) + g:NewLabel(window, _, "$parentAnimateLabel", "animateLabel", Loc ["STRING_OPTIONS_ANIMATEBARS"] .. ":", "GameFontNormal") + window.animateLabel:SetPoint(31, -170) -- 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:SetPoint("left",window.animateLabel, "right", 2, 0) + window.animateSlider.OnSwitch = function(self, _, value) --slider, fixedValue, sliderValue (false, true) _detalhes:SetUseAnimations (value) end @@ -1033,12 +1033,12 @@ local window_openned_at = time() --------------- Fast Hps/Dps Updates --[ - g:NewLabel (window, _, "$parentDpsHpsLabel", "DpsHpsLabel", Loc ["STRING_WELCOME_63"] .. ":", "GameFontNormal") - window.DpsHpsLabel:SetPoint (31, -190) + g:NewLabel(window, _, "$parentDpsHpsLabel", "DpsHpsLabel", Loc ["STRING_WELCOME_63"] .. ":", "GameFontNormal") + window.DpsHpsLabel:SetPoint(31, -190) -- 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:SetPoint("left",window.DpsHpsLabel, "right", 2, 0) + window.DpsHpsSlider.OnSwitch = function(self, _, value) --slider, fixedValue, sliderValue (false, true) _detalhes:GetInstance(1):FastPSUpdate (value) end @@ -1048,35 +1048,35 @@ local window_openned_at = time() --window.DpsHpsSlider.tooltip = Loc ["STRING_WELCOME_64"] --]] --------------- Max Segments - -- g:NewLabel (window, _, "$parentSliderLabel", "segmentsLabel", Loc ["STRING_WELCOME_21"] .. ":", "GameFontNormal") - -- window.segmentsLabel:SetPoint (31, -210) + -- g:NewLabel(window, _, "$parentSliderLabel", "segmentsLabel", Loc ["STRING_WELCOME_21"] .. ":", "GameFontNormal") + -- window.segmentsLabel:SetPoint(31, -210) -- -- 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:SetPoint("left", window.segmentsLabel, "right", 2, 0) + -- window.segmentsSlider:SetHook("OnValueChange", function(self, _, amount) --slider, fixedValue, sliderValue -- _detalhes.segments_amount = math.floor (amount) -- end) -- window.segmentsSlider.tooltip = Loc ["STRING_WELCOME_22"] -------------- - local mech_icon = window:CreateTexture (nil, "overlay") - mech_icon:SetTexture ([[Interface\Vehicles\UI-Vehicles-Endcap-Alliance]]) - mech_icon:SetPoint ("topright", window, "topright", -15, -15) - mech_icon:SetWidth (128*0.9) - mech_icon:SetHeight (128*0.9) + local mech_icon = window:CreateTexture(nil, "overlay") + mech_icon:SetTexture([[Interface\Vehicles\UI-Vehicles-Endcap-Alliance]]) + mech_icon:SetPoint("topright", window, "topright", -15, -15) + mech_icon:SetWidth(128*0.9) + mech_icon:SetHeight(128*0.9) mech_icon:SetAlpha (0.8) - local mech_icon2 = window:CreateTexture (nil, "overlay") - mech_icon2:SetTexture ([[Interface\Vehicles\UI-Vehicles-Trim-Alliance]]) - mech_icon2:SetPoint ("topright", window, "topright", -10, -151) - mech_icon2:SetWidth (128*1.0) - mech_icon2:SetHeight (128*0.6) + local mech_icon2 = window:CreateTexture(nil, "overlay") + mech_icon2:SetTexture([[Interface\Vehicles\UI-Vehicles-Trim-Alliance]]) + mech_icon2:SetPoint("topright", window, "topright", -10, -151) + mech_icon2:SetWidth(128*1.0) + mech_icon2:SetHeight(128*0.6) mech_icon2:SetAlpha (0.6) mech_icon2:SetTexCoord (0, 1, 40/128, 1) mech_icon2:SetDrawLayer ("overlay", 2) - local update_frame_alert = CreateFrame ("frame", nil, window) - update_frame_alert:SetScript ("OnShow", function() + local update_frame_alert = CreateFrame("frame", nil, window) + update_frame_alert:SetScript("OnShow", function() _detalhes.tabela_historico:resetar() created_test_bars = 0 @@ -1096,7 +1096,7 @@ local window_openned_at = time() instance:SetMode (3) end) - update_frame_alert:SetScript ("OnHide", function() + update_frame_alert:SetScript("OnHide", function() _detalhes:StopTestBarUpdate() _detalhes.parser_functions:ZONE_CHANGED_NEW_AREA() @@ -1109,52 +1109,52 @@ local window_openned_at = time() -- window.segmentsLabel, window.segmentsSlider, pages [#pages+1] = {update_frame_alert, mech_icon2, mech_icon, bg, texto4, interval_text, dance_text, window.updatespeedLabel, window.updatespeedSlider, window.animateLabel, window.animateSlider, window.changemind4Label, window.DpsHpsLabel, window.DpsHpsSlider} - for _, widget in ipairs (pages[#pages]) do + for _, widget in ipairs(pages[#pages]) do widget:Hide() end -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> page 6 +--page 6 -- stretcher - local bg6 = window:CreateTexture (nil, "overlay") - bg6:SetTexture ([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]]) - bg6:SetPoint ("bottomright", window, "bottomright", -10, 10) - bg6:SetHeight (125*3)--125 - bg6:SetWidth (89*3)--82 + local bg6 = window:CreateTexture(nil, "overlay") + bg6:SetTexture([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]]) + bg6:SetPoint("bottomright", window, "bottomright", -10, 10) + bg6:SetHeight(125*3)--125 + bg6:SetWidth(89*3)--82 bg6:SetAlpha (.1) bg6:SetTexCoord (1, 0, 0, 1) local texto5 = window:CreateFontString (nil, "overlay", "GameFontNormal") - texto5:SetPoint ("topleft", window, "topleft", 20, -80) - texto5:SetText (Loc ["STRING_WELCOME_26"]) + texto5:SetPoint("topleft", window, "topleft", 20, -80) + texto5:SetText(Loc ["STRING_WELCOME_26"]) local texto_stretch = window:CreateFontString (nil, "overlay", "GameFontNormal") - texto_stretch:SetPoint ("topleft", window, "topleft", 181, -105) - texto_stretch:SetText (Loc ["STRING_WELCOME_27"]) - texto_stretch:SetWidth (310) - texto_stretch:SetHeight (100) - texto_stretch:SetJustifyH ("left") + texto_stretch:SetPoint("topleft", window, "topleft", 181, -105) + texto_stretch:SetText(Loc ["STRING_WELCOME_27"]) + texto_stretch:SetWidth(310) + texto_stretch:SetHeight(100) + texto_stretch:SetJustifyH("left") texto_stretch:SetJustifyV ("top") texto_stretch:SetTextColor (1, 1, 1, 1) - local stretch_image = window:CreateTexture (nil, "overlay") - stretch_image:SetTexture ([[Interface\Addons\Details\images\icons]]) - stretch_image:SetPoint ("right", texto_stretch, "left", -12, 0) - stretch_image:SetWidth (144) - stretch_image:SetHeight (61) + local stretch_image = window:CreateTexture(nil, "overlay") + stretch_image:SetTexture([[Interface\Addons\Details\images\icons]]) + stretch_image:SetPoint("right", texto_stretch, "left", -12, 0) + stretch_image:SetWidth(144) + stretch_image:SetHeight(61) stretch_image:SetTexCoord (0.716796875, 1, 0.876953125, 1) - local stretch_frame_alert = CreateFrame ("frame", nil, window) - stretch_frame_alert:SetScript ("OnHide", function() + local stretch_frame_alert = CreateFrame("frame", nil, window) + stretch_frame_alert:SetScript("OnHide", function() _detalhes:StopPlayStretchAlert() end) - stretch_frame_alert:SetScript ("OnShow", function() + stretch_frame_alert:SetScript("OnShow", function() local instance = _detalhes:GetInstance (1) - _detalhes.OnEnterMainWindow (instance) + _detalhes.OnEnterMainWindow(instance) instance.baseframe.button_stretch:SetAlpha (1) - frame_alert.alert:SetPoint ("topleft", instance.baseframe.button_stretch, "topleft", -20, 6) - frame_alert.alert:SetPoint ("bottomright", instance.baseframe.button_stretch, "bottomright", 20, -14) + frame_alert.alert:SetPoint("topleft", instance.baseframe.button_stretch, "topleft", -20, 6) + frame_alert.alert:SetPoint("bottomright", instance.baseframe.button_stretch, "bottomright", 20, -14) frame_alert.alert.animOut:Stop() frame_alert.alert.animIn:Play() @@ -1167,51 +1167,51 @@ local window_openned_at = time() pages [#pages+1] = {bg6, texto5, stretch_image, texto_stretch, stretch_frame_alert} - for _, widget in ipairs (pages[#pages]) do + for _, widget in ipairs(pages[#pages]) do widget:Hide() end -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> page 7 +--page 7 -- window button - local bg6 = window:CreateTexture (nil, "overlay") - bg6:SetTexture ([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]]) - bg6:SetPoint ("bottomright", window, "bottomright", -10, 10) - bg6:SetHeight (125*3)--125 - bg6:SetWidth (89*3)--82 + local bg6 = window:CreateTexture(nil, "overlay") + bg6:SetTexture([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]]) + bg6:SetPoint("bottomright", window, "bottomright", -10, 10) + bg6:SetHeight(125*3)--125 + bg6:SetWidth(89*3)--82 bg6:SetAlpha (.1) bg6:SetTexCoord (1, 0, 0, 1) local texto6 = window:CreateFontString (nil, "overlay", "GameFontNormal") - texto6:SetPoint ("topleft", window, "topleft", 20, -80) - texto6:SetText (Loc ["STRING_WELCOME_28"]) + texto6:SetPoint("topleft", window, "topleft", 20, -80) + texto6:SetText(Loc ["STRING_WELCOME_28"]) local texto_instance_button = window:CreateFontString (nil, "overlay", "GameFontNormal") - texto_instance_button:SetPoint ("topleft", window, "topleft", 25, -105) - texto_instance_button:SetText (Loc ["STRING_WELCOME_29"]) - texto_instance_button:SetWidth (270) - texto_instance_button:SetHeight (100) - texto_instance_button:SetJustifyH ("left") + texto_instance_button:SetPoint("topleft", window, "topleft", 25, -105) + texto_instance_button:SetText(Loc ["STRING_WELCOME_29"]) + texto_instance_button:SetWidth(270) + texto_instance_button:SetHeight(100) + texto_instance_button:SetJustifyH("left") texto_instance_button:SetJustifyV ("top") texto_instance_button:SetTextColor (1, 1, 1, 1) - local instance_button_image = window:CreateTexture (nil, "overlay") - instance_button_image:SetTexture ([[Interface\Addons\Details\images\icons]]) - instance_button_image:SetPoint ("topright", window, "topright", -16, -70) - instance_button_image:SetWidth (198) - instance_button_image:SetHeight (141) + local instance_button_image = window:CreateTexture(nil, "overlay") + instance_button_image:SetTexture([[Interface\Addons\Details\images\icons]]) + instance_button_image:SetPoint("topright", window, "topright", -16, -70) + instance_button_image:SetWidth(198) + instance_button_image:SetHeight(141) instance_button_image:SetTexCoord (0.328125, 0.71484375, 0.724609375, 1) - local instance_frame_alert = CreateFrame ("frame", nil, window) - instance_frame_alert:SetScript ("OnHide", function() + local instance_frame_alert = CreateFrame("frame", nil, window) + instance_frame_alert:SetScript("OnHide", function() _detalhes:StopPlayStretchAlert() end) - instance_frame_alert:SetScript ("OnShow", function() + instance_frame_alert:SetScript("OnShow", function() local instance = _detalhes:GetInstance (1) - frame_alert.alert:SetPoint ("topleft", instance.baseframe.cabecalho.modo_selecao.widget, "topleft", -8, 6) - frame_alert.alert:SetPoint ("bottomright", instance.baseframe.cabecalho.modo_selecao.widget, "bottomright", 8, -6) + frame_alert.alert:SetPoint("topleft", instance.baseframe.cabecalho.modo_selecao.widget, "topleft", -8, 6) + frame_alert.alert:SetPoint("bottomright", instance.baseframe.cabecalho.modo_selecao.widget, "bottomright", 8, -6) frame_alert.alert.animOut:Stop() frame_alert.alert.animIn:Play() @@ -1223,67 +1223,67 @@ local window_openned_at = time() pages [#pages+1] = {bg6, texto6, instance_button_image, texto_instance_button, instance_frame_alert} - for _, widget in ipairs (pages[#pages]) do + for _, widget in ipairs(pages[#pages]) do widget:Hide() end -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> page 8 +--page 8 -- bookmark - local bg7 = window:CreateTexture (nil, "overlay") - bg7:SetTexture ([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]]) - bg7:SetPoint ("bottomright", window, "bottomright", -10, 10) - bg7:SetHeight (125*3)--125 - bg7:SetWidth (89*3)--82 + local bg7 = window:CreateTexture(nil, "overlay") + bg7:SetTexture([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]]) + bg7:SetPoint("bottomright", window, "bottomright", -10, 10) + bg7:SetHeight(125*3)--125 + bg7:SetWidth(89*3)--82 bg7:SetAlpha (.1) bg7:SetTexCoord (1, 0, 0, 1) local texto7 = window:CreateFontString (nil, "overlay", "GameFontNormal") - texto7:SetPoint ("topleft", window, "topleft", 20, -80) - texto7:SetText (Loc ["STRING_WELCOME_30"]) + texto7:SetPoint("topleft", window, "topleft", 20, -80) + texto7:SetText(Loc ["STRING_WELCOME_30"]) local texto_shortcut = window:CreateFontString (nil, "overlay", "GameFontNormal") - texto_shortcut:SetPoint ("topleft", window, "topleft", 25, -105) - texto_shortcut:SetText (Loc ["STRING_WELCOME_31"]) - texto_shortcut:SetWidth (290) - texto_shortcut:SetHeight (160) - texto_shortcut:SetJustifyH ("left") + texto_shortcut:SetPoint("topleft", window, "topleft", 25, -105) + texto_shortcut:SetText(Loc ["STRING_WELCOME_31"]) + texto_shortcut:SetWidth(290) + texto_shortcut:SetHeight(160) + texto_shortcut:SetJustifyH("left") texto_shortcut:SetJustifyV ("top") texto_shortcut:SetTextColor (1, 1, 1, 1) - local shortcut_image2 = window:CreateTexture (nil, "overlay") - shortcut_image2:SetTexture ([[Interface\Addons\Details\images\icons]]) - shortcut_image2:SetPoint ("topright", window, "topright", -22, -87) - shortcut_image2:SetWidth (165) - shortcut_image2:SetHeight (119) + local shortcut_image2 = window:CreateTexture(nil, "overlay") + shortcut_image2:SetTexture([[Interface\Addons\Details\images\icons]]) + shortcut_image2:SetPoint("topright", window, "topright", -22, -87) + shortcut_image2:SetWidth(165) + shortcut_image2:SetHeight(119) shortcut_image2:SetTexCoord (2/512, 167/512, 306/512, 425/512) local instance1 = _detalhes:GetInstance (1) - local bookmark_frame = CreateFrame ("frame", "WelcomeBookmarkFrame", window,"BackdropTemplate") - bookmark_frame:SetPoint ("topleft", instance1.baseframe, "topleft") - bookmark_frame:SetPoint ("bottomright", instance1.baseframe, "bottomright") - bookmark_frame:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 64}) - bookmark_frame:SetBackdropColor (0, 0, 0, 0.8) + local bookmark_frame = CreateFrame("frame", "WelcomeBookmarkFrame", window,"BackdropTemplate") + bookmark_frame:SetPoint("topleft", instance1.baseframe, "topleft") + bookmark_frame:SetPoint("bottomright", instance1.baseframe, "bottomright") + bookmark_frame:SetBackdrop({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 64}) + bookmark_frame:SetBackdropColor(0, 0, 0, 0.8) local desc_anchor_topleft = _detalhes.gump:NewImage (bookmark_frame, [[Interface\AddOns\Details\images\options_window]], 75, 106, "artwork", {0.19921875, 0.2724609375, 0.6796875, 0.783203125}, "descAnchorBottomLeftImage", "$parentDescAnchorBottomLeftImage") --204 696 279 802 - desc_anchor_topleft:SetPoint ("topleft", bookmark_frame, "topleft", -5, 5) + desc_anchor_topleft:SetPoint("topleft", bookmark_frame, "topleft", -5, 5) local desc_anchor_bottomleft = _detalhes.gump:NewImage (bookmark_frame, [[Interface\AddOns\Details\images\options_window]], 75, 106, "artwork", {0.2724609375, 0.19921875, 0.783203125, 0.6796875}, "descAnchorTopLeftImage", "$parentDescAnchorTopLeftImage") --204 696 279 802 - desc_anchor_bottomleft:SetPoint ("bottomright", bookmark_frame, "bottomright", 5, -5) + desc_anchor_bottomleft:SetPoint("bottomright", bookmark_frame, "bottomright", 5, -5) local bmf_string = bookmark_frame:CreateFontString ("overlay", nil, "GameFontNormal") - bmf_string:SetPoint ("center", bookmark_frame, "center") - bmf_string:SetText (Loc ["STRING_WELCOME_65"]) + bmf_string:SetPoint("center", bookmark_frame, "center") + bmf_string:SetText(Loc ["STRING_WELCOME_65"]) local bg_string = _detalhes.gump:NewImage (bookmark_frame, [[Interface\ACHIEVEMENTFRAME\UI-Achievement-RecentHeader]], 256, 32, "border", {0, 1, 0, 23/32}) - bg_string:SetPoint ("left", bookmark_frame, "left", 0, 0) - bg_string:SetPoint ("right", bookmark_frame, "right", 0, 0) - bg_string:SetPoint ("center", bmf_string, "center", 0, 0) + bg_string:SetPoint("left", bookmark_frame, "left", 0, 0) + 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() @@ -1292,90 +1292,90 @@ local window_openned_at = time() pages [#pages+1] = {bg7, texto7, shortcut_image2, texto_shortcut, bookmark_frame} - for _, widget in ipairs (pages[#pages]) do + for _, widget in ipairs(pages[#pages]) do widget:Hide() end -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> page 9 +--page 9 -- group windows - local bg77 = window:CreateTexture (nil, "overlay") - bg77:SetTexture ([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]]) - bg77:SetPoint ("bottomright", window, "bottomright", -10, 10) - bg77:SetHeight (125*3)--125 - bg77:SetWidth (89*3)--82 + local bg77 = window:CreateTexture(nil, "overlay") + bg77:SetTexture([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]]) + bg77:SetPoint("bottomright", window, "bottomright", -10, 10) + bg77:SetHeight(125*3)--125 + bg77:SetWidth(89*3)--82 bg77:SetAlpha (.1) bg77:SetTexCoord (1, 0, 0, 1) local texto77 = window:CreateFontString (nil, "overlay", "GameFontNormal") - texto77:SetPoint ("topleft", window, "topleft", 20, -80) - texto77:SetText (Loc ["STRING_WELCOME_32"]) + texto77:SetPoint("topleft", window, "topleft", 20, -80) + texto77:SetText(Loc ["STRING_WELCOME_32"]) local texto_snap = window:CreateFontString (nil, "overlay", "GameFontNormal") - texto_snap:SetPoint ("topleft", window, "topleft", 25, -101) - texto_snap:SetText (Loc ["STRING_WELCOME_66"]) - texto_snap:SetWidth (160) - texto_snap:SetHeight (110) - texto_snap:SetJustifyH ("left") + texto_snap:SetPoint("topleft", window, "topleft", 25, -101) + texto_snap:SetText(Loc ["STRING_WELCOME_66"]) + texto_snap:SetWidth(160) + texto_snap:SetHeight(110) + texto_snap:SetJustifyH("left") texto_snap:SetJustifyV ("top") texto_snap:SetTextColor (1, 1, 1, 1) local fonte, _, flags = texto_snap:GetFont() texto_snap:SetFont (fonte, 11, flags) - local snap_image1 = window:CreateTexture (nil, "overlay") - snap_image1:SetTexture ([[Interface\Addons\Details\images\icons]]) - snap_image1:SetPoint ("topright", window, "topright", -12, -95) - snap_image1:SetWidth (310) - snap_image1:SetHeight (102) + local snap_image1 = window:CreateTexture(nil, "overlay") + snap_image1:SetTexture([[Interface\Addons\Details\images\icons]]) + snap_image1:SetPoint("topright", window, "topright", -12, -95) + snap_image1:SetWidth(310) + snap_image1:SetHeight(102) snap_image1:SetTexCoord (0, 0.60546875, 191/512, 293/512) - local group_frame_alert = CreateFrame ("frame", nil, window) - group_frame_alert:SetScript ("OnShow", function() + local group_frame_alert = CreateFrame("frame", nil, window) + group_frame_alert:SetScript("OnShow", function() _detalhes.tabela_historico:resetar() created_test_bars = 0 end) pages [#pages+1] = {bg77, texto77, snap_image1, texto_snap, group_frame_alert} - for _, widget in ipairs (pages[#pages]) do + for _, widget in ipairs(pages[#pages]) do widget:Hide() end -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> page 10 +--page 10 -- tooltip shift alt ctrl - local bg88 = window:CreateTexture (nil, "overlay") - bg88:SetTexture ([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]]) - bg88:SetPoint ("bottomright", window, "bottomright", -10, 10) - bg88:SetHeight (125*3)--125 - bg88:SetWidth (89*3)--82 + local bg88 = window:CreateTexture(nil, "overlay") + bg88:SetTexture([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]]) + bg88:SetPoint("bottomright", window, "bottomright", -10, 10) + bg88:SetHeight(125*3)--125 + bg88:SetWidth(89*3)--82 bg88:SetAlpha (.1) bg88:SetTexCoord (1, 0, 0, 1) local texto88 = window:CreateFontString (nil, "overlay", "GameFontNormal") - texto88:SetPoint ("topleft", window, "topleft", 20, -80) - texto88:SetText (Loc ["STRING_WELCOME_34"]) + texto88:SetPoint("topleft", window, "topleft", 20, -80) + texto88:SetText(Loc ["STRING_WELCOME_34"]) local texto_micro_display = window:CreateFontString (nil, "overlay", "GameFontNormal") - texto_micro_display:SetPoint ("topleft", window, "topleft", 25, -101) - texto_micro_display:SetText (Loc ["STRING_WELCOME_67"]) - texto_micro_display:SetWidth (300) - texto_micro_display:SetHeight (110) - texto_micro_display:SetJustifyH ("left") + texto_micro_display:SetPoint("topleft", window, "topleft", 25, -101) + texto_micro_display:SetText(Loc ["STRING_WELCOME_67"]) + texto_micro_display:SetWidth(300) + texto_micro_display:SetHeight(110) + texto_micro_display:SetJustifyH("left") texto_micro_display:SetJustifyV ("top") texto_micro_display:SetTextColor (1, 1, 1, 1) - local micro_image1 = window:CreateTexture (nil, "overlay") - micro_image1:SetTexture ([[Interface\Addons\Details\images\icons]]) - micro_image1:SetPoint ("topright", window, "topright", -15, -70) - micro_image1:SetWidth (186) - micro_image1:SetHeight (100) + local micro_image1 = window:CreateTexture(nil, "overlay") + micro_image1:SetTexture([[Interface\Addons\Details\images\icons]]) + micro_image1:SetPoint("topright", window, "topright", -15, -70) + micro_image1:SetWidth(186) + micro_image1:SetHeight(100) micro_image1:SetTexCoord (326/512, 1, 85/512, 185/512) - local tooltip_frame = CreateFrame ("frame", nil, window) - tooltip_frame:SetScript ("OnShow", function(self) + local tooltip_frame = CreateFrame("frame", nil, window) + tooltip_frame:SetScript("OnShow", function(self) _detalhes.tabela_historico:resetar() created_test_bars = 0 @@ -1434,7 +1434,7 @@ local window_openned_at = time() current_combat.totals_grupo [1] = total_damage current_combat.totals [1] = total_damage - for _, instance in ipairs (_detalhes.tabela_instancias) do + for _, instance in ipairs(_detalhes.tabela_instancias) do if (instance:IsEnabled()) then instance:InstanceReset() end @@ -1444,8 +1444,8 @@ local window_openned_at = time() local bar1 = _detalhes:GetInstance(1):GetRow(1) - frame_alert.alert:SetPoint ("topleft", bar1, "topleft", -60, 8) - frame_alert.alert:SetPoint ("bottomright", bar1, "bottomright", 60, -10) + frame_alert.alert:SetPoint("topleft", bar1, "topleft", -60, 8) + frame_alert.alert:SetPoint("bottomright", bar1, "bottomright", 60, -10) frame_alert.alert.animOut:Stop() frame_alert.alert.animIn:Play() @@ -1456,84 +1456,84 @@ local window_openned_at = time() end) - tooltip_frame:SetScript ("OnHide", function() + tooltip_frame:SetScript("OnHide", function() _detalhes:StopPlayStretchAlert() end) pages [#pages+1] = {bg88, texto88, micro_image1, texto_micro_display, tooltip_frame} - for _, widget in ipairs (pages[#pages]) do + for _, widget in ipairs(pages[#pages]) do widget:Hide() end -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> page 11 +--page 11 - local bg11 = window:CreateTexture (nil, "overlay") - bg11:SetTexture ([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]]) - bg11:SetPoint ("bottomright", window, "bottomright", -10, 10) - bg11:SetHeight (125*3)--125 - bg11:SetWidth (89*3)--82 + local bg11 = window:CreateTexture(nil, "overlay") + bg11:SetTexture([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]]) + bg11:SetPoint("bottomright", window, "bottomright", -10, 10) + bg11:SetHeight(125*3)--125 + bg11:SetWidth(89*3)--82 bg11:SetAlpha (.1) bg11:SetTexCoord (1, 0, 0, 1) local texto11 = window:CreateFontString (nil, "overlay", "GameFontNormal") - texto11:SetPoint ("topleft", window, "topleft", 20, -80) - texto11:SetText (Loc ["STRING_WELCOME_36"]) + texto11:SetPoint("topleft", window, "topleft", 20, -80) + texto11:SetText(Loc ["STRING_WELCOME_36"]) local texto_plugins = window:CreateFontString (nil, "overlay", "GameFontNormal") - texto_plugins:SetPoint ("topleft", window, "topleft", 25, -101) - texto_plugins:SetText (Loc ["STRING_WELCOME_68"]) - texto_plugins:SetWidth (220) - texto_plugins:SetHeight (110) - texto_plugins:SetJustifyH ("left") + texto_plugins:SetPoint("topleft", window, "topleft", 25, -101) + texto_plugins:SetText(Loc ["STRING_WELCOME_68"]) + texto_plugins:SetWidth(220) + texto_plugins:SetHeight(110) + texto_plugins:SetJustifyH("left") texto_plugins:SetJustifyV ("top") texto_plugins:SetTextColor (1, 1, 1, 1) --local fonte, _, flags = texto_plugins:GetFont() --texto_plugins:SetFont (fonte, 11, flags) - local plugins_image1 = window:CreateTexture (nil, "overlay") - plugins_image1:SetTexture ([[Interface\Addons\Details\images\icons2]]) - plugins_image1:SetPoint ("topright", window, "topright", -12, -90) - plugins_image1:SetWidth (281) - plugins_image1:SetHeight (81) + local plugins_image1 = window:CreateTexture(nil, "overlay") + plugins_image1:SetTexture([[Interface\Addons\Details\images\icons2]]) + plugins_image1:SetPoint("topright", window, "topright", -12, -90) + plugins_image1:SetWidth(281) + plugins_image1:SetHeight(81) plugins_image1:SetTexCoord (216/512, 497/512, 6/512, 95/512) pages [#pages+1] = {bg11, texto11, plugins_image1, texto_plugins} - for _, widget in ipairs (pages[#pages]) do + for _, widget in ipairs(pages[#pages]) do widget:Hide() end -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> page 12 +--page 12 - local bg8 = window:CreateTexture (nil, "overlay") - bg8:SetTexture ([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]]) - bg8:SetPoint ("bottomright", window, "bottomright", -10, 10) - bg8:SetHeight (125*3)--125 - bg8:SetWidth (89*3)--82 + local bg8 = window:CreateTexture(nil, "overlay") + bg8:SetTexture([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]]) + bg8:SetPoint("bottomright", window, "bottomright", -10, 10) + bg8:SetHeight(125*3)--125 + bg8:SetWidth(89*3)--82 bg8:SetAlpha (.1) bg8:SetTexCoord (1, 0, 0, 1) local texto8 = window:CreateFontString (nil, "overlay", "GameFontNormal") - texto8:SetPoint ("topleft", window, "topleft", 20, -80) - texto8:SetText (Loc ["STRING_WELCOME_38"]) + texto8:SetPoint("topleft", window, "topleft", 20, -80) + texto8:SetText(Loc ["STRING_WELCOME_38"]) local texto = window:CreateFontString (nil, "overlay", "GameFontNormal") - texto:SetPoint ("topleft", window, "topleft", 25, -110) - texto:SetText (Loc ["STRING_WELCOME_39"]) - texto:SetWidth (410) - texto:SetHeight (90) - texto:SetJustifyH ("left") + texto:SetPoint("topleft", window, "topleft", 25, -110) + texto:SetText(Loc ["STRING_WELCOME_39"]) + texto:SetWidth(410) + texto:SetHeight(90) + texto:SetJustifyH("left") texto:SetJustifyV ("top") texto:SetTextColor (1, 1, 1, 1) - local final_frame = CreateFrame ("frame", nil, window) - final_frame:SetSize (1, 1) - final_frame:SetPoint ("center") + local final_frame = CreateFrame("frame", nil, window) + final_frame:SetSize(1, 1) + final_frame:SetPoint("center") final_frame:Hide() - final_frame:SetScript ("OnShow", function() + final_frame:SetScript("OnShow", function() cancel:Enable() cancel:GetNormalTexture():SetDesaturated (false) end) @@ -1542,7 +1542,7 @@ local window_openned_at = time() - for _, widget in ipairs (pages[#pages]) do + for _, widget in ipairs(pages[#pages]) do widget:Hide() end diff --git a/functions/api2.lua b/functions/api2.lua index e19d64d6..bc0ddd4c 100644 --- a/functions/api2.lua +++ b/functions/api2.lua @@ -89,7 +89,7 @@ Details.API_Description = { } ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> ~segments +--~segments --[=[ Details.SegmentInfo (segment) @@ -211,7 +211,7 @@ tinsert (Details.API_Description.namespaces[1].api, { function Details.SegmentDamagingUnits (includePlayerUnits, includeEnemyUnits, includeFriendlyPetUnits, segment) segment = segment or 0 - if (type (includePlayerUnits) ~= "boolean") then + if (type(includePlayerUnits) ~= "boolean") then includePlayerUnits = true end @@ -290,7 +290,7 @@ tinsert (Details.API_Description.namespaces[1].api, { function Details.SegmentHealingUnits (includePlayerUnits, includeEnemyUnits, includeFriendlyPetUnits, segment) segment = segment or 0 - if (type (includePlayerUnits) ~= "boolean") then + if (type(includePlayerUnits) ~= "boolean") then includePlayerUnits = true end @@ -434,7 +434,7 @@ function Details.SegmentPhases (segment) local phaseData = combatObject.PhaseData - for phaseChangeId, phaseTable in ipairs (phaseData) do + for phaseChangeId, phaseTable in ipairs(phaseData) do local phaseNumber = phaseTable [1] DetailsFramework.table.addunique (phases, phaseNumber) end @@ -443,7 +443,7 @@ function Details.SegmentPhases (segment) end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> unit ~information +--unit ~information --[=[ Details.UnitInfo (unitId, segment) --=]=] @@ -607,7 +607,7 @@ function Details.UnitTexture (unitId, segment) end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> ~damage +--~damage --[=[ Details.UnitDamage (unitId, segment) @@ -827,7 +827,7 @@ tinsert (Details.API_Description.namespaces[1].api, { }) function Details.UnitDamageBySpell (unitId, spellId, isLiteral, segment) - if (type (isLiteral) ~= "boolean") then + if (type(isLiteral) ~= "boolean") then isLiteral = true end segment = segment or 0 @@ -897,7 +897,7 @@ tinsert (Details.API_Description.namespaces[1].api, { }) function Details.UnitDamageSpellInfo (unitId, spellId, isLiteral, segment) - if (type (isLiteral) ~= "boolean") then + if (type(isLiteral) ~= "boolean") then isLiteral = true end segment = segment or 0 @@ -1021,7 +1021,7 @@ tinsert (Details.API_Description.namespaces[1].api, { }) function Details.UnitDamageSpellOnUnit (unitId, spellId, targetUnitId, isLiteral, segment) - if (type (isLiteral) ~= "boolean") then + if (type(isLiteral) ~= "boolean") then isLiteral = true end segment = segment or 0 @@ -1188,7 +1188,7 @@ tinsert (Details.API_Description.namespaces[1].api, { function Details.UnitDamageTakenFromSpell (unitId, spellId, isLiteral, segment) segment = segment or 0 - if (type (isLiteral) ~= "boolean") then + if (type(isLiteral) ~= "boolean") then isLiteral = true end @@ -1389,7 +1389,7 @@ end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> ~healing +--~healing --[=[ @@ -1556,7 +1556,7 @@ tinsert (Details.API_Description.namespaces[1].api, { }) function Details.UnitHealingBySpell (unitId, spellId, isLiteral, segment) - if (type (isLiteral) ~= "boolean") then + if (type(isLiteral) ~= "boolean") then isLiteral = true end segment = segment or 0 @@ -1628,7 +1628,7 @@ tinsert (Details.API_Description.namespaces[1].api, { }) function Details.UnitHealingSpellInfo (unitId, spellId, isLiteral, segment) - if (type (isLiteral) ~= "boolean") then + if (type(isLiteral) ~= "boolean") then isLiteral = true end segment = segment or 0 @@ -1753,7 +1753,7 @@ tinsert (Details.API_Description.namespaces[1].api, { }) function Details.UnitHealingSpellOnUnit (unitId, spellId, targetUnitId, isLiteral, segment) - if (type (isLiteral) ~= "boolean") then + if (type(isLiteral) ~= "boolean") then isLiteral = true end segment = segment or 0 @@ -1927,7 +1927,7 @@ tinsert (Details.API_Description.namespaces[1].api, { function Details.UnitHealingTakenFromSpell (unitId, spellId, isLiteral, segment) segment = segment or 0 - if (type (isLiteral) ~= "boolean") then + if (type(isLiteral) ~= "boolean") then isLiteral = true end diff --git a/functions/attributes.lua b/functions/attributes.lua index e941e6e6..c7efff13 100644 --- a/functions/attributes.lua +++ b/functions/attributes.lua @@ -4,7 +4,7 @@ do local _detalhes = _G._detalhes local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) - --> Globals + --Globals --[[global]] DETAILS_ATTRIBUTE_DAMAGE = 1 --[[global]] DETAILS_SUBATTRIBUTE_DAMAGEDONE = 1 @@ -81,27 +81,27 @@ do "aura", --debuff uptime } - --> Main Attributes + --Main Attributes _detalhes.atributos = { - --> Attributes amount = 4: damage / heal / energy / misc + --Attributes amount = 4: damage / heal / energy / misc [0] = 4, --[[ DAMAGE ]] - dano = 1, --> identifier - [1] = 8, --> sub attributes + dano = 1, --identifier + [1] = 8, -- sub attributes --[[ HEALING ]] - cura = 2, --> identifier - [2] = 7, --> sub attributes + cura = 2, --identifier + [2] = 7, -- sub attributes --[[ ENERGY ]] - e_energy = 3,--> identifier - [3] = 6, --> sub attributes + e_energy = 3,--identifier + [3] = 6, -- sub attributes --[[ MISC ]] - misc = 4, --> identifier - [4] = 8, --> sub attributes + misc = 4, --identifier + [4] = 8, -- sub attributes --[[ CUSTOM ]] custom = 5, @@ -109,19 +109,19 @@ do --[[ String Names ]] lista = { - Loc ["STRING_ATTRIBUTE_DAMAGE"],--> Damage - Loc ["STRING_ATTRIBUTE_HEAL"], --> Healing - Loc ["STRING_ATTRIBUTE_ENERGY"], --> Energy - Loc ["STRING_ATTRIBUTE_MISC"], --> Misc - Loc ["STRING_SCRIPTS_TITLE"] --> Custom + Loc ["STRING_ATTRIBUTE_DAMAGE"],--Damage + Loc ["STRING_ATTRIBUTE_HEAL"], --Healing + Loc ["STRING_ATTRIBUTE_ENERGY"], --Energy + Loc ["STRING_ATTRIBUTE_MISC"], --Misc + Loc ["STRING_SCRIPTS_TITLE"] --Custom } } - --> Sub Attributes + --Sub Attributes _detalhes.sub_atributos = { { - --> Damage sub classes information + --Damage sub classes information damage_done = 1, dps = 2, damage_taken = 3, @@ -154,7 +154,7 @@ do }, { - --> Healing sub classes information + --Healing sub classes information healing_done = 1, hps = 2, overheal = 3, @@ -185,7 +185,7 @@ do }, { - --> Energy sub classes information + --Energy sub classes information mana_ganha = 1, -- id 0 rage_ganha = 2, -- id 1 energy_ganha = 3, --id 3 @@ -212,7 +212,7 @@ do }, { - --> Misc sub classes information + --Misc sub classes information cc_break = 1, ress = 2, kick = 3, @@ -257,7 +257,7 @@ do return CustomObject.name elseif (CustomObject and customName and CustomObject.name ~= customName) then - for _, custom in ipairs (_detalhes.custom) do + for _, custom in ipairs(_detalhes.custom) do if (custom.name == customName) then return custom.name end diff --git a/functions/autorun.lua b/functions/autorun.lua index b67c2acc..bd9c5411 100644 --- a/functions/autorun.lua +++ b/functions/autorun.lua @@ -45,23 +45,23 @@ if (not _G.DetailsFramework.IsTimewalkWoW()) then end autoRunCodeEventFrame.OnEventFunc = function(self, event) - --> ignore events triggered more than once in a small time window + --ignore events triggered more than once in a small time window if (autoRunCodeEventFrame [event] and not autoRunCodeEventFrame [event]:IsCancelled()) then return end if (event == "PLAYER_SPECIALIZATION_CHANGED") then - --> create a trigger for the event, many times it is triggered more than once - --> so if the event is triggered a second time, it will be ignored + --create a trigger for the event, many times it is triggered more than once + --so if the event is triggered a second time, it will be ignored local newTimer = C_Timer.NewTimer(1, function() Details:DispatchAutoRunCode("on_specchanged") - --> clear and invalidate the timer + --clear and invalidate the timer autoRunCodeEventFrame[event]:Cancel() autoRunCodeEventFrame[event] = nil end) - --> store the trigger + --store the trigger autoRunCodeEventFrame[event] = newTimer end end diff --git a/functions/boss.lua b/functions/boss.lua index eeb58eb4..6b0031a0 100644 --- a/functions/boss.lua +++ b/functions/boss.lua @@ -3,12 +3,12 @@ do local _detalhes = _G._detalhes _detalhes.EncounterInformation = {} - local _ipairs = ipairs --> lua local + local _ipairs = ipairs --lua local ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> details api functions +--details api functions - --> return if the player is inside a raid supported by details + --return if the player is inside a raid supported by details function _detalhes:IsInInstance() local _, _, _, _, _, _, _, zoneMapID = GetInstanceInfo() if (_detalhes.EncounterInformation [zoneMapID]) then @@ -18,7 +18,7 @@ do end end - --> return the full table with all data for the instance + --return the full table with all data for the instance function _detalhes:GetRaidInfoFromEncounterID (encounterID, encounterEJID) for id, raidTable in pairs (_detalhes.EncounterInformation) do if (encounterID) then @@ -40,7 +40,7 @@ do end end - --> return the ids of trash mobs in the instance + --return the ids of trash mobs in the instance function _detalhes:GetInstanceTrashInfo (mapid) return _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].trash_ids end @@ -64,7 +64,7 @@ do end end - --> return the boss table using a encounter id + --return the boss table using a encounter id function _detalhes:GetBossEncounterDetailsFromEncounterId (mapid, encounterid) if (not mapid) then local bossIndex, instance @@ -100,12 +100,12 @@ do end end - --> return the EJ boss id + --return the EJ boss id function _detalhes:GetEncounterIdFromBossIndex (mapid, index) return _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].encounter_ids and _detalhes.EncounterInformation [mapid].encounter_ids [index] end - --> return the table which contain information about the start of a encounter + --return the table which contain information about the start of a encounter function _detalhes:GetEncounterStartInfo (mapid, encounterid) local bossindex = _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].encounter_ids and _detalhes.EncounterInformation [mapid].encounter_ids [encounterid] if (bossindex) then @@ -113,7 +113,7 @@ do end end - --> return the table which contain information about the end of a encounter + --return the table which contain information about the end of a encounter function _detalhes:GetEncounterEndInfo (mapid, encounterid) local bossindex = _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].encounter_ids and _detalhes.EncounterInformation [mapid].encounter_ids [encounterid] if (bossindex) then @@ -121,7 +121,7 @@ do end end - --> return the function for the boss + --return the function for the boss function _detalhes:GetEncounterEnd (mapid, bossindex) local t = _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].encounters [bossindex] if (t) then @@ -133,17 +133,17 @@ do return end - --> generic boss find function + --generic boss find function function _detalhes:GetRaidBossFindFunction (mapid) return _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].find_boss_encounter end - --> return if the boss need sync + --return if the boss need sync function _detalhes:GetEncounterEqualize (mapid, bossindex) return _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].encounters [bossindex] and _detalhes.EncounterInformation [mapid].encounters [bossindex].equalize end - --> return the function for the boss + --return the function for the boss function _detalhes:GetBossFunction (mapid, bossindex) local func = _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].encounters [bossindex] and _detalhes.EncounterInformation [mapid].encounters [bossindex].func if (func) then @@ -152,30 +152,30 @@ do return end - --> return the boss table with information about name, adds, spells, etc + --return the boss table with information about name, adds, spells, etc function _detalhes:GetBossDetails (mapid, bossindex) return _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].encounters [bossindex] end - --> return a table with all names of boss enemies + --return a table with all names of boss enemies function _detalhes:GetEncounterActors (mapid, bossindex) end - --> return a table with spells id of specified encounter + --return a table with spells id of specified encounter function _detalhes:GetEncounterSpells (mapid, bossindex) local encounter = _detalhes:GetBossDetails (mapid, bossindex) local habilidades_poll = {} if (encounter.continuo) then - for index, spellid in _ipairs (encounter.continuo) do + for index, spellid in _ipairs(encounter.continuo) do habilidades_poll [spellid] = true end end local fases = encounter.phases if (fases) then - for fase_id, fase in _ipairs (fases) do + for fase_id, fase in _ipairs(fases) do if (fase.spells) then - for index, spellid in _ipairs (fase.spells) do + for index, spellid in _ipairs(fase.spells) do habilidades_poll [spellid] = true end end @@ -184,7 +184,7 @@ do return habilidades_poll end - --> return a table with all boss ids from a raid instance + --return a table with all boss ids from a raid instance function _detalhes:GetBossIds (mapid) return _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].boss_ids end @@ -196,17 +196,17 @@ do return _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].is_raid end - --> return a table with all encounter names present in raid instance + --return a table with all encounter names present in raid instance function _detalhes:GetBossNames (mapid) return _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].boss_names end - --> return the encounter name + --return the encounter name function _detalhes:GetBossName (mapid, bossindex) return _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].boss_names [bossindex] end - --> same thing as GetBossDetails, just a alias + --same thing as GetBossDetails, just a alias function _detalhes:GetBossEncounterDetails (mapid, bossindex) return _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].encounters [bossindex] end @@ -224,7 +224,7 @@ do end end - --> return the wallpaper for the raid instance + --return the wallpaper for the raid instance function _detalhes:GetRaidBackground (mapid) local bosstables = _detalhes.EncounterInformation [mapid] if (bosstables) then @@ -234,7 +234,7 @@ do end end end - --> return the icon for the raid instance + --return the icon for the raid instance function _detalhes:GetRaidIcon (mapid, ejID, instanceType) local raidIcon = _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].icon if (raidIcon) then @@ -271,7 +271,7 @@ do end end - --> return the boss icon + --return the boss icon function _detalhes:GetBossIcon (mapid, bossindex) if (_detalhes.EncounterInformation [mapid]) then local line = math.ceil (bossindex / 4) @@ -280,7 +280,7 @@ do end end - --> return the boss portrit + --return the boss portrit function _detalhes:GetBossPortrait (mapid, bossindex, encounterName, ejID) if (mapid and bossindex) then local haveIcon = _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].encounters [bossindex] and _detalhes.EncounterInformation [mapid].encounters [bossindex].portrait @@ -302,7 +302,7 @@ do return nil end - --> return a list with names of adds and bosses + --return a list with names of adds and bosses function _detalhes:GetEncounterActorsName (EJ_EncounterID) --code snippet from wowpedia local actors = {} @@ -387,7 +387,7 @@ do end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> core +--core function _detalhes:InstallEncounter (InstanceTable) _detalhes.EncounterInformation [InstanceTable.id] = InstanceTable diff --git a/functions/bossmods.lua b/functions/bossmods.lua index 6710b146..c7a8d61d 100644 --- a/functions/bossmods.lua +++ b/functions/bossmods.lua @@ -2,7 +2,7 @@ local Details = _G.Details ---> get the total of damage and healing of a phase of an encounter +--get the total of damage and healing of a phase of an encounter function Details:OnCombatPhaseChanged() local current_combat = Details:GetCurrentCombat() @@ -23,13 +23,13 @@ function Details:OnCombatPhaseChanged() current_combat.PhaseData.heal [current_phase] = phase_healing_container end - for index, damage_actor in ipairs (Details.cache_damage_group) do + for index, damage_actor in ipairs(Details.cache_damage_group) do local phase_damage = damage_actor.total - (phase_damage_section [damage_actor.nome] or 0) phase_damage_section [damage_actor.nome] = damage_actor.total phase_damage_container [damage_actor.nome] = (phase_damage_container [damage_actor.nome] or 0) + phase_damage end - for index, healing_actor in ipairs (Details.cache_healing_group) do + for index, healing_actor in ipairs(Details.cache_healing_group) do local phase_heal = healing_actor.total - (phase_healing_section [healing_actor.nome] or 0) phase_healing_section [healing_actor.nome] = healing_actor.total phase_healing_container [healing_actor.nome] = (phase_healing_container [healing_actor.nome] or 0) + phase_heal @@ -82,8 +82,8 @@ function Details:BossModsLink() tinsert (cur_combat.PhaseData, {phase, time}) end - Details:SendEvent ("COMBAT_ENCOUNTER_PHASE_CHANGED", nil, phase) - --Details:Msg ("Current phase is now:", phase) + Details:SendEvent("COMBAT_ENCOUNTER_PHASE_CHANGED", nil, phase) + --Details:Msg("Current phase is now:", phase) end end @@ -104,8 +104,8 @@ function Details:CreateCallbackListeners() local current_table_dbm = {} local current_table_bigwigs = {} - local event_frame = CreateFrame ("frame", nil, UIParent, "BackdropTemplate") - event_frame:SetScript ("OnEvent", function(self, event, ...) + local event_frame = CreateFrame("frame", nil, UIParent, "BackdropTemplate") + event_frame:SetScript("OnEvent", function(self, event, ...) if (event == "ENCOUNTER_START") then local encounterID, encounterName, difficultyID, raidSize = select (1, ...) current_encounter = encounterID @@ -158,7 +158,7 @@ function Details:CreateCallbackListeners() function Details:BigWigs_StartBar (event, module, spellid, bar_text, time, icon, ...) spellid = tostring (spellid) if (not current_table_bigwigs [spellid]) then - current_table_bigwigs [spellid] = {(type (module) == "string" and module) or (module and module.moduleName) or "", spellid or "", bar_text or "", time or 0, icon or ""} + current_table_bigwigs [spellid] = {(type(module) == "string" and module) or (module and module.moduleName) or "", spellid or "", bar_text or "", time or 0, icon or ""} end end if (BigWigsLoader.RegisterMessage) then diff --git a/functions/buff.lua b/functions/buff.lua index 35f3f1f7..3f762aca 100644 --- a/functions/buff.lua +++ b/functions/buff.lua @@ -8,34 +8,34 @@ local _detalhes = _G._detalhes local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) local _ - --> initialize buffs name container + --initialize buffs name container _detalhes.Buffs.BuffsTable = {} -- armazenara o [nome do buff] = { tabela do buff } _detalhes.Buffs.__index = _detalhes.Buffs - --> switch off recording buffs by default + --switch off recording buffs by default _detalhes.RecordPlayerSelfBuffs = false _detalhes.RecordPlayerAbilityWithBuffs = false _detalhes.RecordPlayerSelfDebuffs = false ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> local pointers +--local pointers - local _pairs = pairs --> lua local - local _ipairs = ipairs --> lua local + local _pairs = pairs --lua local + local _ipairs = ipairs --lua local ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> details api functions +--details api functions - --> return if the buff is already registred or not + --return if the buff is already registred or not function _detalhes.Buffs:IsRegistred (buff) - if (type (buff) == "number") then + if (type(buff) == "number") then for _, buffObject in _pairs (_detalhes.Buffs.BuffsTable) do if (buffObject.id == buff) then return true end end return false - elseif (type (buff) == "string") then + elseif (type(buff) == "string") then for name, _ in _pairs (_detalhes.Buffs.BuffsTable) do if (name == buff) then return true @@ -45,7 +45,7 @@ end end - --> register a new buff name + --register a new buff name function _detalhes.Buffs:NewBuff (BuffName, BuffId) if (not BuffName) then BuffName = GetSpellInfo(BuffId) @@ -57,7 +57,7 @@ end end - --> remove a registred buff + --remove a registred buff function _detalhes.Buffs:RemoveBuff (BuffName) if (not _detalhes.Buffs.BuffsTable [BuffName]) then return false @@ -67,7 +67,7 @@ end end - --> return a list of registred buffs + --return a list of registred buffs function _detalhes.Buffs:GetBuffList() local list = {} for name, _ in _pairs (_detalhes.Buffs.BuffsTable) do @@ -76,7 +76,7 @@ return list end - --> return a list of registred buffs ids + --return a list of registred buffs ids function _detalhes.Buffs:GetBuffListIds() local list = {} for name, buffObject in _pairs (_detalhes.Buffs.BuffsTable) do @@ -87,7 +87,7 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> internal functions +--internal functions function _detalhes.Buffs:UpdateBuff (method) -- self = buff table @@ -97,7 +97,7 @@ self.castedAmt = self.castedAmt + 1 self.active = true self.appliedAt [#self.appliedAt+1] = _detalhes.tabela_vigente:GetCombatTime() - _detalhes:SendEvent ("BUFF_UPDATE") + _detalhes:SendEvent("BUFF_UPDATE") elseif (method == "refresh") then @@ -105,7 +105,7 @@ self.duration = self.duration + (_detalhes._tempo - self.start) self.start = _detalhes._tempo self.appliedAt [#self.appliedAt+1] = _detalhes.tabela_vigente:GetCombatTime() - _detalhes:SendEvent ("BUFF_UPDATE") + _detalhes:SendEvent("BUFF_UPDATE") elseif (method == "remove") then @@ -117,27 +117,27 @@ self.droppedAmt = self.droppedAmt + 1 self.start = nil self.active = false - _detalhes:SendEvent ("BUFF_UPDATE") + _detalhes:SendEvent("BUFF_UPDATE") end end - --> build buffs + --build buffs function _detalhes.Buffs:BuildTables() _detalhes.Buffs.built = true if (_detalhes.savedbuffs) then - for _, BuffId in _ipairs (_detalhes.savedbuffs) do + for _, BuffId in _ipairs(_detalhes.savedbuffs) do _detalhes.Buffs:NewBuff (nil, BuffId) end end end - --> save buff list when addon exit + --save buff list when addon exit function _detalhes.Buffs:SaveBuffs() _detalhes_database.savedbuffs = _detalhes.Buffs:GetBuffListIds() end - --> construct a buff table of the new buff registred + --construct a buff table of the new buff registred function _detalhes.Buffs:BuildBuffTable (BuffName, BuffId) local bufftable = {name = BuffName, id = BuffId, duration = 0, start = nil, castedAmt = 0, refreshAmt = 0, droppedAmt = 0, active = false, appliedAt = {}} bufftable.IsBuff = true @@ -146,7 +146,7 @@ end - --> update player buffs + --update player buffs function _detalhes.Buffs:CatchBuffs() if (not _detalhes.Buffs.built) then @@ -168,7 +168,7 @@ BuffTable.droppedAmt = 0 end - --> catch buffs untracked yet + --catch buffs untracked yet for buffIndex = 1, 41 do local name = UnitAura ("player", buffIndex) if (name) then diff --git a/functions/classes.lua b/functions/classes.lua index b0a86fed..16c20881 100644 --- a/functions/classes.lua +++ b/functions/classes.lua @@ -170,7 +170,7 @@ do return self.pets end - --> inherits to all actors without placing it on _detalhes namespace. + --inherits to all actors without placing it on _detalhes namespace. _detalhes.container_combatentes.guid = _detalhes.GetGUID _detalhes.container_combatentes.name = _detalhes.GetName _detalhes.container_combatentes.class = _detalhes.GetActorClass diff --git a/functions/coach.lua b/functions/coach.lua index 2c15887c..790703ea 100644 --- a/functions/coach.lua +++ b/functions/coach.lua @@ -444,10 +444,10 @@ function Details.Coach.WelcomePanel() local welcomePanel = _G.DETAILSCOACHPANEL if (not welcomePanel) then welcomePanel = DetailsFramework:CreateSimplePanel(UIParent) - welcomePanel:SetSize (400, 280) + welcomePanel:SetSize(400, 280) welcomePanel:SetTitle ("Details! Coach") welcomePanel:ClearAllPoints() - welcomePanel:SetPoint ("left", UIParent, "left", 10, 0) + welcomePanel:SetPoint("left", UIParent, "left", 10, 0) welcomePanel:Hide() DetailsFramework:ApplyStandardBackdrop(welcomePanel) diff --git a/functions/deathmenu.lua b/functions/deathmenu.lua index 21547eeb..4312b2fd 100644 --- a/functions/deathmenu.lua +++ b/functions/deathmenu.lua @@ -4,10 +4,10 @@ local Details = _G.Details ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> extra buttons at the death options (release, death recap) +--extra buttons at the death options (release, death recap) -local detailsOnDeathMenu = CreateFrame ("frame", "DetailsOnDeathMenu", UIParent, "BackdropTemplate") -detailsOnDeathMenu:SetHeight (30) +local detailsOnDeathMenu = CreateFrame("frame", "DetailsOnDeathMenu", UIParent, "BackdropTemplate") +detailsOnDeathMenu:SetHeight(30) detailsOnDeathMenu.Debug = false detailsOnDeathMenu:RegisterEvent ("PLAYER_REGEN_ENABLED") @@ -16,14 +16,14 @@ DetailsFramework:ApplyStandardBackdrop (detailsOnDeathMenu) detailsOnDeathMenu:SetAlpha (0.75) --disable text -detailsOnDeathMenu.disableLabel = Details.gump:CreateLabel (detailsOnDeathMenu, "you can disable this at /details > Raid Tools", 9) +detailsOnDeathMenu.disableLabel = Details.gump:CreateLabel(detailsOnDeathMenu, "you can disable this at /details > Raid Tools", 9) -detailsOnDeathMenu.warningLabel = Details.gump:CreateLabel (detailsOnDeathMenu, "", 11) +detailsOnDeathMenu.warningLabel = Details.gump:CreateLabel(detailsOnDeathMenu, "", 11) detailsOnDeathMenu.warningLabel.textcolor = "red" -detailsOnDeathMenu.warningLabel:SetPoint ("bottomleft", detailsOnDeathMenu, "bottomleft", 5, 2) +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 @@ -108,7 +108,7 @@ end --encounter breakdown button detailsOnDeathMenu.breakdownButton = Details.gump:CreateButton (detailsOnDeathMenu, detailsOnDeathMenu.OpenEncounterBreakdown, 120, 20, "Encounter Breakdown", "breakdownButton") detailsOnDeathMenu.breakdownButton:SetTemplate (Details.gump:GetTemplate ("button", "DETAILS_PLUGINPANEL_BUTTON_TEMPLATE")) -detailsOnDeathMenu.breakdownButton:SetPoint ("topleft", detailsOnDeathMenu, "topleft", 5, -5) +detailsOnDeathMenu.breakdownButton:SetPoint("topleft", detailsOnDeathMenu, "topleft", 5, -5) detailsOnDeathMenu.breakdownButton:Hide() detailsOnDeathMenu.breakdownButton.CoolTip = { @@ -129,7 +129,7 @@ detailsOnDeathMenu.breakdownButton.CoolTip = { GameCooltip2:AddLine ("Encounter Breakdown plugin is disabled in the Addon Control Panel.", "", 1, "red") end - end, --> called when user mouse over the frame + end, --called when user mouse over the frame OnEnterFunc = function(self) detailsOnDeathMenu.button_mouse_over = true end, @@ -139,12 +139,12 @@ detailsOnDeathMenu.breakdownButton.CoolTip = { FixedValue = "none", ShowSpeed = .5, Options = function() - GameCooltip:SetOption ("MyAnchor", "top") - GameCooltip:SetOption ("RelativeAnchor", "bottom") - GameCooltip:SetOption ("WidthAnchorMod", 0) - GameCooltip:SetOption ("HeightAnchorMod", -13) - GameCooltip:SetOption ("TextSize", 10) - GameCooltip:SetOption ("FixedWidth", 220) + GameCooltip:SetOption("MyAnchor", "top") + GameCooltip:SetOption("RelativeAnchor", "bottom") + GameCooltip:SetOption("WidthAnchorMod", 0) + GameCooltip:SetOption("HeightAnchorMod", -13) + GameCooltip:SetOption("TextSize", 10) + GameCooltip:SetOption("FixedWidth", 220) end } GameCooltip2:CoolTipInject (detailsOnDeathMenu.breakdownButton) @@ -152,7 +152,7 @@ GameCooltip2:CoolTipInject (detailsOnDeathMenu.breakdownButton) --player endurance button detailsOnDeathMenu.enduranceButton = Details.gump:CreateButton (detailsOnDeathMenu, detailsOnDeathMenu.OpenPlayerEndurance, 120, 20, "Player Endurance", "enduranceButton") detailsOnDeathMenu.enduranceButton:SetTemplate (Details.gump:GetTemplate ("button", "DETAILS_PLUGINPANEL_BUTTON_TEMPLATE")) -detailsOnDeathMenu.enduranceButton:SetPoint ("topleft", detailsOnDeathMenu.breakdownButton, "topright", 2, 0) +detailsOnDeathMenu.enduranceButton:SetPoint("topleft", detailsOnDeathMenu.breakdownButton, "topright", 2, 0) detailsOnDeathMenu.enduranceButton:Hide() detailsOnDeathMenu.enduranceButton.CoolTip = { @@ -170,7 +170,7 @@ detailsOnDeathMenu.enduranceButton.CoolTip = { GameCooltip2:AddLine ("Advanced Death Logs plugin is disabled or not installed, check the Addon Control Panel or download it from the Curseforge APP.", "", 1, "red") end - end, --> called when user mouse over the frame + end, --called when user mouse over the frame OnEnterFunc = function(self) detailsOnDeathMenu.button_mouse_over = true end, @@ -180,12 +180,12 @@ detailsOnDeathMenu.enduranceButton.CoolTip = { FixedValue = "none", ShowSpeed = .5, Options = function() - GameCooltip:SetOption ("MyAnchor", "top") - GameCooltip:SetOption ("RelativeAnchor", "bottom") - GameCooltip:SetOption ("WidthAnchorMod", 0) - GameCooltip:SetOption ("HeightAnchorMod", -13) - GameCooltip:SetOption ("TextSize", 10) - GameCooltip:SetOption ("FixedWidth", 220) + GameCooltip:SetOption("MyAnchor", "top") + GameCooltip:SetOption("RelativeAnchor", "bottom") + GameCooltip:SetOption("WidthAnchorMod", 0) + GameCooltip:SetOption("HeightAnchorMod", -13) + GameCooltip:SetOption("TextSize", 10) + GameCooltip:SetOption("FixedWidth", 220) end } GameCooltip2:CoolTipInject (detailsOnDeathMenu.enduranceButton) @@ -193,7 +193,7 @@ GameCooltip2:CoolTipInject (detailsOnDeathMenu.enduranceButton) --spells detailsOnDeathMenu.spellsButton = Details.gump:CreateButton (detailsOnDeathMenu, detailsOnDeathMenu.OpenPlayerSpells, 48, 20, "Spells", "SpellsButton") detailsOnDeathMenu.spellsButton:SetTemplate (Details.gump:GetTemplate ("button", "DETAILS_PLUGINPANEL_BUTTON_TEMPLATE")) -detailsOnDeathMenu.spellsButton:SetPoint ("topleft", detailsOnDeathMenu.enduranceButton, "topright", 2, 0) +detailsOnDeathMenu.spellsButton:SetPoint("topleft", detailsOnDeathMenu.enduranceButton, "topright", 2, 0) detailsOnDeathMenu.spellsButton:Hide() detailsOnDeathMenu.spellsButton.CoolTip = { @@ -202,7 +202,7 @@ detailsOnDeathMenu.spellsButton.CoolTip = { GameCooltip2:Preset (2) GameCooltip2:AddLine ("Open your player Details! breakdown.") - end, --> called when user mouse over the frame + end, --called when user mouse over the frame OnEnterFunc = function(self) detailsOnDeathMenu.button_mouse_over = true end, @@ -212,12 +212,12 @@ detailsOnDeathMenu.spellsButton.CoolTip = { FixedValue = "none", ShowSpeed = .5, Options = function() - GameCooltip:SetOption ("MyAnchor", "top") - GameCooltip:SetOption ("RelativeAnchor", "bottom") - GameCooltip:SetOption ("WidthAnchorMod", 0) - GameCooltip:SetOption ("HeightAnchorMod", -13) - GameCooltip:SetOption ("TextSize", 10) - GameCooltip:SetOption ("FixedWidth", 220) + GameCooltip:SetOption("MyAnchor", "top") + GameCooltip:SetOption("RelativeAnchor", "bottom") + GameCooltip:SetOption("WidthAnchorMod", 0) + GameCooltip:SetOption("HeightAnchorMod", -13) + GameCooltip:SetOption("TextSize", 10) + GameCooltip:SetOption("FixedWidth", 220) end } GameCooltip2:CoolTipInject (detailsOnDeathMenu.spellsButton) @@ -232,11 +232,11 @@ function detailsOnDeathMenu.CanShowPanel() return true end - --> check if the player just wiped in an encounter + --check if the player just wiped in an encounter if (IsInRaid()) then local isInInstance = IsInInstance() if (isInInstance) then - --> check if all players in the raid are out of combat + --check if all players in the raid are out of combat for i = 1, GetNumGroupMembers() do if (UnitAffectingCombat ("raid" .. i)) then C_Timer.After (0.5, detailsOnDeathMenu.ShowPanel) @@ -261,11 +261,11 @@ function detailsOnDeathMenu.ShowPanel() end if (ElvUI) then - detailsOnDeathMenu:SetPoint ("topleft", StaticPopup1, "bottomleft", 0, -1) - detailsOnDeathMenu:SetPoint ("topright", StaticPopup1, "bottomright", 0, -1) + detailsOnDeathMenu:SetPoint("topleft", StaticPopup1, "bottomleft", 0, -1) + detailsOnDeathMenu:SetPoint("topright", StaticPopup1, "bottomright", 0, -1) else - detailsOnDeathMenu:SetPoint ("topleft", StaticPopup1, "bottomleft", 4, 2) - detailsOnDeathMenu:SetPoint ("topright", StaticPopup1, "bottomright", -4, 2) + detailsOnDeathMenu:SetPoint("topleft", StaticPopup1, "bottomleft", 4, 2) + detailsOnDeathMenu:SetPoint("topright", StaticPopup1, "bottomright", -4, 2) end detailsOnDeathMenu.breakdownButton:Show() @@ -274,14 +274,14 @@ function detailsOnDeathMenu.ShowPanel() detailsOnDeathMenu:Show() - detailsOnDeathMenu:SetHeight (30) + detailsOnDeathMenu:SetHeight(30) if (not Details:GetTutorialCVar ("DISABLE_ONDEATH_PANEL")) then detailsOnDeathMenu.disableLabel:Show() - detailsOnDeathMenu.disableLabel:SetPoint ("bottomleft", detailsOnDeathMenu, "bottomleft", 5, 1) + detailsOnDeathMenu.disableLabel:SetPoint("bottomleft", detailsOnDeathMenu, "bottomleft", 5, 1) detailsOnDeathMenu.disableLabel.color = "gray" detailsOnDeathMenu.disableLabel.alpha = 0.5 - detailsOnDeathMenu:SetHeight (detailsOnDeathMenu:GetHeight() + 10) + detailsOnDeathMenu:SetHeight(detailsOnDeathMenu:GetHeight() + 10) if (math.random (1, 3) == 3) then Details:SetTutorialCVar ("DISABLE_ONDEATH_PANEL", true) diff --git a/functions/deathrecap.lua b/functions/deathrecap.lua index 974e2372..0eb12862 100644 --- a/functions/deathrecap.lua +++ b/functions/deathrecap.lua @@ -9,7 +9,7 @@ local on_deathrecap_line_enter = function(self) if (self.spellid) then GameTooltip:SetOwner (self, "ANCHOR_RIGHT") Details:GameTooltipSetSpellByID (self.spellid) - self:SetBackdropColor (.3, .3, .3, .2) + self:SetBackdropColor(.3, .3, .3, .2) GameTooltip:Show() self.backgroundTextureOverlay:Show() self.timeAt:SetAlpha (1) @@ -21,7 +21,7 @@ end local on_deathrecap_line_leave = function(self) GameTooltip:Hide() - self:SetBackdropColor (.3, .3, .3, 0) + self:SetBackdropColor(.3, .3, .3, 0) self.backgroundTextureOverlay:Hide() self.timeAt:SetAlpha (textAlpha) self.sourceName:SetAlpha (textAlpha) @@ -30,19 +30,19 @@ local on_deathrecap_line_leave = function(self) end 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) - line:SetScript ("OnEnter", on_deathrecap_line_enter) - line:SetScript ("OnLeave", on_deathrecap_line_leave) + 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) + line:SetScript("OnEnter", on_deathrecap_line_enter) + line:SetScript("OnLeave", on_deathrecap_line_leave) - line:SetSize (300, 21) + line:SetSize(300, 21) local timeAt = line:CreateFontString (nil, "overlay", "GameFontNormal") - local backgroundTexture = line:CreateTexture (nil, "border") - local backgroundTextureOverlay = line:CreateTexture (nil, "artwork") - local spellIcon = line:CreateTexture (nil, "overlay") - local spellIconBorder = line:CreateTexture (nil, "overlay") + local backgroundTexture = line:CreateTexture(nil, "border") + local backgroundTextureOverlay = line:CreateTexture(nil, "artwork") + local spellIcon = line:CreateTexture(nil, "overlay") + local spellIconBorder = line:CreateTexture(nil, "overlay") spellIcon:SetDrawLayer ("overlay", 1) spellIconBorder:SetDrawLayer ("overlay", 2) local sourceName = line:CreateFontString (nil, "overlay", "GameFontNormal") @@ -51,30 +51,30 @@ local create_deathrecap_line = function(parent, n) local lifeStatusBar = line:CreateTexture(nil, "border", nil, -3) --grave icon - local graveIcon = line:CreateTexture (nil, "overlay") - graveIcon:SetTexture ([[Interface\MINIMAP\POIIcons]]) + local graveIcon = line:CreateTexture(nil, "overlay") + graveIcon:SetTexture([[Interface\MINIMAP\POIIcons]]) graveIcon:SetTexCoord (146/256, 160/256, 0/512, 18/512) - graveIcon:SetPoint ("left", line, "left", 11, 0) - graveIcon:SetSize (14, 18) + graveIcon:SetPoint("left", line, "left", 11, 0) + graveIcon:SetSize(14, 18) --spell icon - spellIcon:SetSize (19, 19) - spellIconBorder:SetTexture ([[Interface\ENCOUNTERJOURNAL\LootTab]]) + spellIcon:SetSize(19, 19) + spellIconBorder:SetTexture([[Interface\ENCOUNTERJOURNAL\LootTab]]) spellIconBorder:SetTexCoord (6/256, 38/256, 49/128, 81/128) - spellIconBorder:SetSize (20, 20) - spellIconBorder:SetPoint ("topleft", spellIcon, "topleft", 0, 0) + spellIconBorder:SetSize(20, 20) + spellIconBorder:SetPoint("topleft", spellIcon, "topleft", 0, 0) --locations - timeAt:SetPoint ("left", line, "left", 2, 0) - spellIcon:SetPoint ("left", line, "left", 50, 0) - sourceName:SetPoint ("left", line, "left", 82, 0) - amount:SetPoint ("left", line, "left", 240, 0) - lifePercent:SetPoint ("left", line, "left", 320, 0) + timeAt:SetPoint("left", line, "left", 2, 0) + spellIcon:SetPoint("left", line, "left", 50, 0) + sourceName:SetPoint("left", line, "left", 82, 0) + amount:SetPoint("left", line, "left", 240, 0) + lifePercent:SetPoint("left", line, "left", 320, 0) --text colors - Details.gump:SetFontColor (amount, "red") - Details.gump:SetFontColor (timeAt, "gray") - Details.gump:SetFontColor (sourceName, "yellow") + Details.gump:SetFontColor(amount, "red") + Details.gump:SetFontColor(timeAt, "gray") + Details.gump:SetFontColor(sourceName, "yellow") Details.gump:SetFontSize (sourceName, 10) @@ -85,50 +85,50 @@ local create_deathrecap_line = function(parent, n) lifePercent:SetAlpha (textAlpha) --text setup - amount:SetWidth (85) - amount:SetJustifyH ("right") - lifePercent:SetWidth (42) - lifePercent:SetJustifyH ("right") + amount:SetWidth(85) + amount:SetJustifyH("right") + lifePercent:SetWidth(42) + lifePercent:SetJustifyH("right") --life statusbar lifeStatusBar:SetPoint("topleft", line, "topleft") lifeStatusBar:SetPoint("bottomleft", line, "bottomleft") lifeStatusBar:SetColorTexture(0.5, 0.5, 0.5, 0.4) - backgroundTexture:SetTexture ([[Interface\AddOns\Details\images\deathrecap_background]]) + backgroundTexture:SetTexture([[Interface\AddOns\Details\images\deathrecap_background]]) backgroundTexture:SetTexCoord (0, 1, 0, 1) backgroundTexture:SetVertexColor (.1, .1, .1, .3) --top border - local TopFader = line:CreateTexture (nil, "border") - TopFader:SetTexture ([[Interface\AddOns\Details\images\deathrecap_background_top]]) + local TopFader = line:CreateTexture(nil, "border") + TopFader:SetTexture([[Interface\AddOns\Details\images\deathrecap_background_top]]) TopFader:SetTexCoord (0, 1, 0, 1) TopFader:SetVertexColor (.1, .1, .1, .3) - TopFader:SetPoint ("bottomleft", backgroundTexture, "topleft", 0, -0) - TopFader:SetPoint ("bottomright", backgroundTexture, "topright", 0, -0) - TopFader:SetHeight (32) + TopFader:SetPoint("bottomleft", backgroundTexture, "topleft", 0, -0) + TopFader:SetPoint("bottomright", backgroundTexture, "topright", 0, -0) + TopFader:SetHeight(32) TopFader:Hide() line.TopFader = TopFader if (n == 10) then --bottom fader - local backgroundTexture2 = line:CreateTexture (nil, "border") - backgroundTexture2:SetTexture ([[Interface\AddOns\Details\images\deathrecap_background_bottom]]) + local backgroundTexture2 = line:CreateTexture(nil, "border") + backgroundTexture2:SetTexture([[Interface\AddOns\Details\images\deathrecap_background_bottom]]) backgroundTexture2:SetTexCoord (0, 1, 0, 1) backgroundTexture2:SetVertexColor (.1, .1, .1, .3) - backgroundTexture2:SetPoint ("topleft", backgroundTexture, "bottomleft", 0, 0) - backgroundTexture2:SetPoint ("topright", backgroundTexture, "bottomright", 0, 0) - backgroundTexture2:SetHeight (32) + backgroundTexture2:SetPoint("topleft", backgroundTexture, "bottomleft", 0, 0) + backgroundTexture2:SetPoint("topright", backgroundTexture, "bottomright", 0, 0) + backgroundTexture2:SetHeight(32) Details.gump:SetFontSize (amount, 14) Details.gump:SetFontSize (lifePercent, 14) backgroundTexture:SetVertexColor (.2, .1, .1, .3) end - backgroundTexture:SetPoint ("topleft", 0, 1) - backgroundTexture:SetPoint ("bottomright", 0, -1) + backgroundTexture:SetPoint("topleft", 0, 1) + backgroundTexture:SetPoint("bottomright", 0, -1) backgroundTexture:SetDesaturated (true) - backgroundTextureOverlay:SetTexture ([[Interface\AdventureMap\AdventureMap]]) + backgroundTextureOverlay:SetTexture([[Interface\AdventureMap\AdventureMap]]) backgroundTextureOverlay:SetTexCoord (460/1024, 659/1024, 330/1024, 350/1024) backgroundTextureOverlay:SetAllPoints() backgroundTextureOverlay:SetDesaturated (true) @@ -238,7 +238,7 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat) for i = 1, 10 do Details.DeathRecap.Lines [i]:Hide() end - for i, button in ipairs (Details.DeathRecap.Segments) do + for i, button in ipairs(Details.DeathRecap.Segments) do button:Hide() end end @@ -255,10 +255,10 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat) --create details death recap if not existant if (not Details.DeathRecap) then - Details.DeathRecap = CreateFrame ("frame", "DetailsDeathRecap", DeathRecapFrame, "BackdropTemplate") + Details.DeathRecap = CreateFrame("frame", "DetailsDeathRecap", DeathRecapFrame, "BackdropTemplate") Details.DeathRecap:SetAllPoints() - DeathRecapFrame.Title:SetText (DeathRecapFrame.Title:GetText() .. " (by Details!)") + DeathRecapFrame.Title:SetText(DeathRecapFrame.Title:GetText() .. " (by Details!)") --lines Details.DeathRecap.Lines = {} @@ -269,18 +269,18 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat) --segments Details.DeathRecap.Segments = {} for i = 5, 1, -1 do - local segmentButton = CreateFrame ("button", "DetailsDeathRecapSegmentButton" .. i, Details.DeathRecap, "BackdropTemplate") + local segmentButton = CreateFrame("button", "DetailsDeathRecapSegmentButton" .. i, Details.DeathRecap, "BackdropTemplate") - segmentButton:SetSize (16, 20) - segmentButton:SetPoint ("topright", DeathRecapFrame, "topright", (-abs (i-6) * 22) - 10, -5) + segmentButton:SetSize(16, 20) + segmentButton:SetPoint("topright", DeathRecapFrame, "topright", (-abs (i-6) * 22) - 10, -5) local text = segmentButton:CreateFontString (nil, "overlay", "GameFontNormal") segmentButton.text = text - text:SetText ("#" .. i) - text:SetPoint ("center") - Details.gump:SetFontColor (text, "silver") + text:SetText("#" .. i) + text:SetPoint("center") + Details.gump:SetFontColor(text, "silver") - segmentButton:SetScript ("OnClick", function() + segmentButton:SetScript("OnClick", function() OpenDetailsDeathRecapAtSegment (i) end) tinsert (Details.DeathRecap.Segments, i, segmentButton) @@ -320,11 +320,11 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat) if (Details.death_recap.show_segments) then local last_index = 0 local buttonsInUse = {} - for i, button in ipairs (Details.DeathRecap.Segments) do + for i, button in ipairs(Details.DeathRecap.Segments) do if (Details.tabela_historico.tabelas [i]) then button:Show() tinsert (buttonsInUse, button) - Details.gump:SetFontColor (button.text, "silver") + Details.gump:SetFontColor(button.text, "silver") last_index = i else button:Hide() @@ -338,18 +338,18 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat) for i = 1, #buttonsInUse2 do local button = buttonsInUse2 [i] button:ClearAllPoints() - button:SetPoint ("topright", DeathRecapFrame, "topright", (-i * 22) - 10, -5) + button:SetPoint("topright", DeathRecapFrame, "topright", (-i * 22) - 10, -5) end if (not segment) then - Details.gump:SetFontColor (Details.DeathRecap.Segments [1].text, "orange") + Details.gump:SetFontColor(Details.DeathRecap.Segments [1].text, "orange") else - Details.gump:SetFontColor (Details.DeathRecap.Segments [segment].text, "orange") + Details.gump:SetFontColor(Details.DeathRecap.Segments [segment].text, "orange") death = Details.tabela_historico.tabelas [segment] and Details.tabela_historico.tabelas [segment].last_events_tables end else - for i, button in ipairs (Details.DeathRecap.Segments) do + for i, button in ipairs(Details.DeathRecap.Segments) do button:Hide() end end @@ -407,14 +407,14 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat) for i = #events, 1, -1 do local event = events [i] local evType = event [1] - if (type (evType) == "boolean" and evType) then + if (type(evType) == "boolean" and evType) then hitKill = event break end end if (hitKill) then local haveHitKill = false - for index, t in ipairs (BiggestDamageHits) do + for index, t in ipairs(BiggestDamageHits) do if (t == hitKill) then haveHitKill = true break @@ -430,9 +430,9 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat) for i = #events, 1, -1 do local event = events [i] local evType = event [1] - if (type (evType) == "boolean" and evType) then + if (type(evType) == "boolean" and evType) then local alreadyHave = false - for index, t in ipairs (BiggestDamageHits) do + for index, t in ipairs(BiggestDamageHits) do if (t == event) then alreadyHave = true break @@ -470,7 +470,7 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat) local lineIndex = 10 --for i = #events, 1, -1 do - for i, event in ipairs (events) do + for i, event in ipairs(events) do local event = events [i] local evType = event [1] @@ -483,15 +483,15 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat) local customSpellInfo = event [11] - if (type (evType) == "boolean" and evType) then + if (type(evType) == "boolean" and evType) then local line = Details.DeathRecap.Lines [lineIndex] if (line) then - line.timeAt:SetText (format ("%.1f", eventTime - timeOfDeath) .. "s") - line.spellIcon:SetTexture (spellIcon or customSpellInfo and customSpellInfo [3] or "") + line.timeAt:SetText(format ("%.1f", eventTime - timeOfDeath) .. "s") + line.spellIcon:SetTexture(spellIcon or customSpellInfo and customSpellInfo [3] or "") line.TopFader:Hide() --line.spellIcon:SetTexCoord (.1, .9, .1, .9) - --line.sourceName:SetText ("|cFFC6B0D9" .. source .. "|r") + --line.sourceName:SetText("|cFFC6B0D9" .. source .. "|r") --parse source and cut the length of the string after setting the spellname and source local sourceClass = Details:GetClass (source) @@ -517,12 +517,12 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat) end end - --> remove real name or owner name + --remove real name or owner name source = Details:GetOnlyName (source) - --> remove owner name + --remove owner name source = source:gsub ((" <.*"), "") - --> if a player? + --if a player? if (Details.player_class [sourceClass]) then source = Details:AddClassOrSpecIcon (source, sourceClass, sourceSpec, 16, true) @@ -531,7 +531,7 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat) end - --> remove the dot signal from the spell name + --remove the dot signal from the spell name if (not spellName) then spellName = customSpellInfo and customSpellInfo [2] or "*?*" if (spellName:find (STRING_ENVIRONMENTAL_DAMAGE_FALLING)) then @@ -541,7 +541,7 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat) else source = "Gravity" end - --/run for a,b in pairs (_G) do if (type (b)=="string" and b:find ("Falling")) then print (a,b) end end + --/run for a,b in pairs (_G) do if (type(b)=="string" and b:find ("Falling")) then print (a,b) end end end end @@ -549,18 +549,18 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat) spellName = spellName:gsub ("[*] ", "") source = source or "" - line.sourceName:SetText (spellName .. " (" .. "|cFFC6B0D9" .. source .. "|r" .. ")") + line.sourceName:SetText(spellName .. " (" .. "|cFFC6B0D9" .. source .. "|r" .. ")") DetailsFramework:TruncateText (line.sourceName, 185) if (amount > 1000) then - --line.amount:SetText ("-" .. Details:ToK (amount)) - line.amount:SetText ("-" .. Details:comma_value(floor(amount))) + --line.amount:SetText("-" .. Details:ToK (amount)) + line.amount:SetText("-" .. Details:comma_value(floor(amount))) else - --line.amount:SetText ("-" .. floor (amount)) - line.amount:SetText ("-" .. floor (amount)) + --line.amount:SetText("-" .. floor (amount)) + line.amount:SetText("-" .. floor (amount)) end - line.lifePercent:SetText (hp .. "%") + line.lifePercent:SetText(hp .. "%") line.lifeStatusBar:SetWidth(line:GetWidth() * (hp/100)) line.spellid = event [2] @@ -569,12 +569,12 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat) if (Details.death_recap.show_life_percent) then line.lifePercent:Show() - line.amount:SetPoint ("left", line, "left", 240, 0) - line.lifePercent:SetPoint ("left", line, "left", 320, 0) + line.amount:SetPoint("left", line, "left", 240, 0) + line.lifePercent:SetPoint("left", line, "left", 320, 0) else line.lifePercent:Hide() - line.amount:SetPoint ("left", line, "left", 280, 0) - --line.lifePercent:SetPoint ("left", line, "left", 320, 0) + line.amount:SetPoint("left", line, "left", 280, 0) + --line.lifePercent:SetPoint("left", line, "left", 320, 0) end end diff --git a/functions/dungeon.lua b/functions/dungeon.lua index b1c65f7d..da7a0c22 100644 --- a/functions/dungeon.lua +++ b/functions/dungeon.lua @@ -11,7 +11,7 @@ local Loc = _G.LibStub("AceLocale-3.0"):GetLocale( "Details" ) --constants local CONST_USE_PLAYER_EDPS = false ---> Generate damage chart for mythic dungeon runs +--Generate damage chart for mythic dungeon runs --[=[ The chart table needs to be stored saparated from the combat @@ -234,7 +234,7 @@ end function mythicDungeonCharts:OnEndMythicDungeon() if (mythicDungeonCharts.ChartTable and mythicDungeonCharts.ChartTable.Running) then - --> stop capturinfg + --stop capturinfg mythicDungeonCharts.ChartTable.Running = false mythicDungeonCharts.ChartTable.ElapsedTime = time() - mythicDungeonCharts.ChartTable.StartTime mythicDungeonCharts.ChartTable.EndTime = time() @@ -243,8 +243,8 @@ function mythicDungeonCharts:OnEndMythicDungeon() local name, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceMapID, instanceGroupSize = GetInstanceInfo() mythicDungeonCharts.ChartTable.DungeonName = name - --> check if is inside the dungeon - --> many players just leave the dungeon in order the re-enter and start the run again, the chart window is showing in these cases data to an imcomplete run. + --check if is inside the dungeon + --many players just leave the dungeon in order the re-enter and start the run again, the chart window is showing in these cases data to an imcomplete run. local isInsideDungeon = IsInInstance() if (not isInsideDungeon) then mythicDungeonCharts:Debug ("OnEndMythicDungeon() player wasn't inside the dungeon.") @@ -253,7 +253,7 @@ function mythicDungeonCharts:OnEndMythicDungeon() mythicDungeonCharts:Debug ("Dungeon ended successfully, chart data capture stopped, scheduling to open the window.") - --> the run is valid, schedule to open the chart window + --the run is valid, schedule to open the chart window _detalhes.mythic_plus.delay_to_show_graphic = 5 C_Timer.After (_detalhes.mythic_plus.delay_to_show_graphic or 5, mythicDungeonCharts.ShowReadyPanel) @@ -285,17 +285,17 @@ function mythicDungeonCharts.ShowReadyPanel() --create the panel if (not mythicDungeonCharts.ReadyFrame) then - mythicDungeonCharts.ReadyFrame = CreateFrame ("frame", "DetailsMythicDungeonReadyFrame", UIParent, "BackdropTemplate") + mythicDungeonCharts.ReadyFrame = CreateFrame("frame", "DetailsMythicDungeonReadyFrame", UIParent, "BackdropTemplate") local f = mythicDungeonCharts.ReadyFrame - f:SetSize (255, 80) - f:SetPoint ("center", UIParent, "center", 300, 0) + f:SetSize(255, 80) + f:SetPoint("center", UIParent, "center", 300, 0) f:SetFrameStrata ("LOW") f:EnableMouse (true) f:SetMovable (true) - f:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - f:SetBackdropColor (0, 0, 0, 0.9) - f:SetBackdropBorderColor (0, 0, 0, 1) + f:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + f:SetBackdropColor(0, 0, 0, 0.9) + f:SetBackdropBorderColor(0, 0, 0, 1) DetailsFramework:ApplyStandardBackdrop (f) DetailsFramework:CreateTitleBar (f, "Details! Damage Graphic for M+") @@ -311,12 +311,12 @@ function mythicDungeonCharts.ShowReadyPanel() --show button f.ShowButton = DetailsFramework:CreateButton (f, function() mythicDungeonCharts.ShowChart(); f:Hide() end, 80, 20, Loc ["STRING_SLASH_SHOW"]) f.ShowButton:SetTemplate (DetailsFramework:GetTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) - f.ShowButton:SetPoint ("topright", f, "topright", -5, -30) + f.ShowButton:SetPoint("topright", f, "topright", -5, -30) --discart button f.DiscartButton = DetailsFramework:CreateButton (f, function() f:Hide() end, 80, 20, Loc ["STRING_DISCARD"]) f.DiscartButton:SetTemplate (DetailsFramework:GetTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) - f.DiscartButton:SetPoint ("right", f.ShowButton, "left", -5, 0) + f.DiscartButton:SetPoint("right", f.ShowButton, "left", -5, 0) --disable feature check box (dont show this again) local on_switch_enable = function(self, _, value) @@ -324,8 +324,8 @@ function mythicDungeonCharts.ShowReadyPanel() 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") notAgainSwitch:ClearAllPoints() - notAgainLabel:SetPoint ("left", notAgainSwitch, "right", 2, 0) - notAgainSwitch:SetPoint ("bottomleft", f, "bottomleft", 5, 5) + notAgainLabel:SetPoint("left", notAgainSwitch, "right", 2, 0) + notAgainSwitch:SetPoint("bottomleft", f, "bottomleft", 5, 5) notAgainSwitch:SetAsCheckBox() end @@ -336,62 +336,62 @@ function mythicDungeonCharts.ShowChart() if (not mythicDungeonCharts.Frame) then - mythicDungeonCharts.Frame = CreateFrame ("frame", "DetailsMythicDungeonChartFrame", UIParent, "BackdropTemplate") + mythicDungeonCharts.Frame = CreateFrame("frame", "DetailsMythicDungeonChartFrame", UIParent, "BackdropTemplate") local f = mythicDungeonCharts.Frame - f:SetSize (1200, 620) - f:SetPoint ("center", UIParent, "center", 0, 0) + f:SetSize(1200, 620) + f:SetPoint("center", UIParent, "center", 0, 0) f:SetFrameStrata ("LOW") f:EnableMouse (true) f:SetMovable (true) - f:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - f:SetBackdropColor (0, 0, 0, 0.9) - f:SetBackdropBorderColor (0, 0, 0, 1) + f:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + f:SetBackdropColor(0, 0, 0, 0.9) + f:SetBackdropBorderColor(0, 0, 0, 1) --minimized frame - mythicDungeonCharts.FrameMinimized = CreateFrame ("frame", "DetailsMythicDungeonChartFrameminimized", UIParent, "BackdropTemplate") + mythicDungeonCharts.FrameMinimized = CreateFrame("frame", "DetailsMythicDungeonChartFrameminimized", UIParent, "BackdropTemplate") local fMinimized = mythicDungeonCharts.FrameMinimized - fMinimized:SetSize (160, 24) - fMinimized:SetPoint ("center", UIParent, "center", 0, 0) + fMinimized:SetSize(160, 24) + fMinimized:SetPoint("center", UIParent, "center", 0, 0) fMinimized:SetFrameStrata ("LOW") fMinimized:EnableMouse (true) fMinimized:SetMovable (true) - fMinimized:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - fMinimized:SetBackdropColor (0, 0, 0, 0.9) - fMinimized:SetBackdropBorderColor (0, 0, 0, 1) + fMinimized:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + fMinimized:SetBackdropColor(0, 0, 0, 0.9) + fMinimized:SetBackdropBorderColor(0, 0, 0, 1) fMinimized:Hide() f.IsMinimized = false --titlebar - local titlebar = CreateFrame ("frame", nil, f, "BackdropTemplate") - titlebar:SetPoint ("topleft", f, "topleft", 2, -3) - titlebar:SetPoint ("topright", f, "topright", -2, -3) - titlebar:SetHeight (20) - titlebar:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) - titlebar:SetBackdropColor (.5, .5, .5, 1) - titlebar:SetBackdropBorderColor (0, 0, 0, 1) + local titlebar = CreateFrame("frame", nil, f, "BackdropTemplate") + titlebar:SetPoint("topleft", f, "topleft", 2, -3) + titlebar:SetPoint("topright", f, "topright", -2, -3) + titlebar:SetHeight(20) + titlebar:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) + titlebar:SetBackdropColor(.5, .5, .5, 1) + titlebar:SetBackdropBorderColor(0, 0, 0, 1) - --> title - local titleLabel = _detalhes.gump:NewLabel (titlebar, titlebar, nil, "titulo", "Plugins", "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255}) - titleLabel:SetPoint ("center", titlebar , "center") - titleLabel:SetPoint ("top", titlebar , "top", 0, -5) + --title + local titleLabel = _detalhes.gump:NewLabel(titlebar, titlebar, nil, "titulo", "Plugins", "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255}) + titleLabel:SetPoint("center", titlebar , "center") + titleLabel:SetPoint("top", titlebar , "top", 0, -5) f.TitleText = titleLabel --titlebar when minimized - local titlebarMinimized = CreateFrame ("frame", nil, fMinimized, "BackdropTemplate") - titlebarMinimized:SetPoint ("topleft", fMinimized, "topleft", 2, -3) - titlebarMinimized:SetPoint ("topright", fMinimized, "topright", -2, -3) - titlebarMinimized:SetHeight (20) - titlebarMinimized:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) - titlebarMinimized:SetBackdropColor (.5, .5, .5, 1) - titlebarMinimized:SetBackdropBorderColor (0, 0, 0, 1) + local titlebarMinimized = CreateFrame("frame", nil, fMinimized, "BackdropTemplate") + titlebarMinimized:SetPoint("topleft", fMinimized, "topleft", 2, -3) + titlebarMinimized:SetPoint("topright", fMinimized, "topright", -2, -3) + titlebarMinimized:SetHeight(20) + titlebarMinimized:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) + titlebarMinimized:SetBackdropColor(.5, .5, .5, 1) + titlebarMinimized:SetBackdropBorderColor(0, 0, 0, 1) - --> title - local titleLabelMinimized = _detalhes.gump:NewLabel (titlebarMinimized, titlebarMinimized, nil, "titulo", "Dungeon Run Chart", "GameFontHighlightLeft", 10, {227/255, 186/255, 4/255}) - titleLabelMinimized:SetPoint ("left", titlebarMinimized , "left", 4, 0) - --titleLabelMinimized:SetPoint ("top", titlebarMinimized , "top", 0, -5) + --title + local titleLabelMinimized = _detalhes.gump:NewLabel(titlebarMinimized, titlebarMinimized, nil, "titulo", "Dungeon Run Chart", "GameFontHighlightLeft", 10, {227/255, 186/255, 4/255}) + titleLabelMinimized:SetPoint("left", titlebarMinimized , "left", 4, 0) + --titleLabelMinimized:SetPoint("top", titlebarMinimized , "top", 0, -5) f.TitleTextMinimized = titleLabelMinimized _detalhes:FormatBackground (f) @@ -412,7 +412,7 @@ function mythicDungeonCharts.ShowChart() LibWindow.SavePosition (fMinimized) f.ChartFrame = Details:GetFramework():CreateChartPanel (f, 1200, 600, "DetailsMythicDungeonChartGraphicFrame") - f.ChartFrame:SetPoint ("topleft", f, "topleft", 5, -20) + f.ChartFrame:SetPoint("topleft", f, "topleft", 5, -20) f.ChartFrame.FrameInUse = {} f.ChartFrame.FrameFree = {} @@ -424,29 +424,29 @@ function mythicDungeonCharts.ShowChart() f.ChartFrame.Graphic.DrawLine = mythicDungeonCharts.CustomDrawLine - f.ChartFrame:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - f.ChartFrame:SetBackdropColor (0, 0, 0, 0.0) - f.ChartFrame:SetBackdropBorderColor (0, 0, 0, 0) + f.ChartFrame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + f.ChartFrame:SetBackdropColor(0, 0, 0, 0.0) + f.ChartFrame:SetBackdropBorderColor(0, 0, 0, 0) f.ChartFrame:EnableMouse (false) f.ChartFrame.CloseButton:Hide() - f.BossWidgetsFrame = CreateFrame ("frame", "$parentBossFrames", f, "BackdropTemplate") + f.BossWidgetsFrame = CreateFrame("frame", "$parentBossFrames", f, "BackdropTemplate") f.BossWidgetsFrame:SetFrameLevel (f:GetFrameLevel()+10) f.BossWidgetsFrame.Widgets = {} - f.BossWidgetsFrame.GraphPin = f.BossWidgetsFrame:CreateTexture (nil, "overlay") - f.BossWidgetsFrame.GraphPin:SetTexture ([[Interface\BUTTONS\UI-RadioButton]]) + f.BossWidgetsFrame.GraphPin = f.BossWidgetsFrame:CreateTexture(nil, "overlay") + f.BossWidgetsFrame.GraphPin:SetTexture([[Interface\BUTTONS\UI-RadioButton]]) f.BossWidgetsFrame.GraphPin:SetTexCoord (17/64, 32/64, 0, 1) - f.BossWidgetsFrame.GraphPin:SetSize (16, 16) + f.BossWidgetsFrame.GraphPin:SetSize(16, 16) - f.BossWidgetsFrame.GraphPinGlow = f.BossWidgetsFrame:CreateTexture (nil, "artwork") - f.BossWidgetsFrame.GraphPinGlow:SetTexture ([[Interface\Calendar\EventNotificationGlow]]) + f.BossWidgetsFrame.GraphPinGlow = f.BossWidgetsFrame:CreateTexture(nil, "artwork") + f.BossWidgetsFrame.GraphPinGlow:SetTexture([[Interface\Calendar\EventNotificationGlow]]) f.BossWidgetsFrame.GraphPinGlow:SetTexCoord (0, 1, 0, 1) - f.BossWidgetsFrame.GraphPinGlow:SetSize (14, 14) - f.BossWidgetsFrame.GraphPinGlow:SetBlendMode ("ADD") - f.BossWidgetsFrame.GraphPinGlow:SetPoint ("center", f.BossWidgetsFrame.GraphPin, "center", 0, 0) + f.BossWidgetsFrame.GraphPinGlow:SetSize(14, 14) + f.BossWidgetsFrame.GraphPinGlow:SetBlendMode("ADD") + f.BossWidgetsFrame.GraphPinGlow:SetPoint("center", f.BossWidgetsFrame.GraphPin, "center", 0, 0) f:Hide() @@ -460,66 +460,66 @@ function mythicDungeonCharts.ShowChart() end end - local closeButton = CreateFrame ("button", "$parentCloseButton", f, "UIPanelCloseButton") + local closeButton = CreateFrame("button", "$parentCloseButton", f, "UIPanelCloseButton") closeButton:GetNormalTexture():SetDesaturated (true) - closeButton:SetWidth (24) - closeButton:SetHeight (24) - closeButton:SetPoint ("topright", f, "topright", 0, -1) + closeButton:SetWidth(24) + closeButton:SetHeight(24) + closeButton:SetPoint("topright", f, "topright", 0, -1) closeButton:SetFrameLevel (f:GetFrameLevel()+16) - local minimizeButton = CreateFrame ("button", "$parentCloseButton", f, "UIPanelCloseButton") + local minimizeButton = CreateFrame("button", "$parentCloseButton", f, "UIPanelCloseButton") minimizeButton:GetNormalTexture():SetDesaturated (true) - minimizeButton:SetWidth (24) - minimizeButton:SetHeight (24) - minimizeButton:SetPoint ("right", closeButton, "left", 2, 0) + minimizeButton:SetWidth(24) + minimizeButton:SetHeight(24) + minimizeButton:SetPoint("right", closeButton, "left", 2, 0) minimizeButton:SetFrameLevel (f:GetFrameLevel()+16) - minimizeButton:SetNormalTexture ([[Interface\BUTTONS\UI-Panel-HideButton-Up]]) - minimizeButton:SetPushedTexture ([[Interface\BUTTONS\UI-Panel-HideButton-Down]]) - minimizeButton:SetHighlightTexture ([[Interface\BUTTONS\UI-Panel-MinimizeButton-Highlight]]) + minimizeButton:SetNormalTexture([[Interface\BUTTONS\UI-Panel-HideButton-Up]]) + minimizeButton:SetPushedTexture([[Interface\BUTTONS\UI-Panel-HideButton-Down]]) + minimizeButton:SetHighlightTexture([[Interface\BUTTONS\UI-Panel-MinimizeButton-Highlight]]) - local closeButtonWhenMinimized = CreateFrame ("button", "$parentCloseButton", fMinimized, "UIPanelCloseButton") + local closeButtonWhenMinimized = CreateFrame("button", "$parentCloseButton", fMinimized, "UIPanelCloseButton") closeButtonWhenMinimized:GetNormalTexture():SetDesaturated (true) - closeButtonWhenMinimized:SetWidth (24) - closeButtonWhenMinimized:SetHeight (24) - closeButtonWhenMinimized:SetPoint ("topright", fMinimized, "topright", 0, -1) + closeButtonWhenMinimized:SetWidth(24) + closeButtonWhenMinimized:SetHeight(24) + closeButtonWhenMinimized:SetPoint("topright", fMinimized, "topright", 0, -1) closeButtonWhenMinimized:SetFrameLevel (fMinimized:GetFrameLevel()+16) - local minimizeButtonWhenMinimized = CreateFrame ("button", "$parentCloseButton", fMinimized, "UIPanelCloseButton") + local minimizeButtonWhenMinimized = CreateFrame("button", "$parentCloseButton", fMinimized, "UIPanelCloseButton") minimizeButtonWhenMinimized:GetNormalTexture():SetDesaturated (true) - minimizeButtonWhenMinimized:SetWidth (24) - minimizeButtonWhenMinimized:SetHeight (24) - minimizeButtonWhenMinimized:SetPoint ("right", closeButtonWhenMinimized, "left", 2, 0) + minimizeButtonWhenMinimized:SetWidth(24) + minimizeButtonWhenMinimized:SetHeight(24) + minimizeButtonWhenMinimized:SetPoint("right", closeButtonWhenMinimized, "left", 2, 0) minimizeButtonWhenMinimized:SetFrameLevel (fMinimized:GetFrameLevel()+16) - minimizeButtonWhenMinimized:SetNormalTexture ([[Interface\BUTTONS\UI-Panel-HideButton-Up]]) - minimizeButtonWhenMinimized:SetPushedTexture ([[Interface\BUTTONS\UI-Panel-HideButton-Down]]) - minimizeButtonWhenMinimized:SetHighlightTexture ([[Interface\BUTTONS\UI-Panel-MinimizeButton-Highlight]]) + minimizeButtonWhenMinimized:SetNormalTexture([[Interface\BUTTONS\UI-Panel-HideButton-Up]]) + minimizeButtonWhenMinimized:SetPushedTexture([[Interface\BUTTONS\UI-Panel-HideButton-Down]]) + minimizeButtonWhenMinimized:SetHighlightTexture([[Interface\BUTTONS\UI-Panel-MinimizeButton-Highlight]]) - closeButtonWhenMinimized:SetScript ("OnClick", function() + closeButtonWhenMinimized:SetScript("OnClick", function() f.IsMinimized = false fMinimized:Hide() - minimizeButtonWhenMinimized:SetNormalTexture ([[Interface\BUTTONS\UI-Panel-HideButton-Up]]) - minimizeButtonWhenMinimized:SetPushedTexture ([[Interface\BUTTONS\UI-Panel-HideButton-Down]]) + minimizeButtonWhenMinimized:SetNormalTexture([[Interface\BUTTONS\UI-Panel-HideButton-Up]]) + minimizeButtonWhenMinimized:SetPushedTexture([[Interface\BUTTONS\UI-Panel-HideButton-Down]]) end) - --> replace the default click function + --replace the default click function local minimize_func = function(self) if (f.IsMinimized) then f.IsMinimized = false fMinimized:Hide() f:Show() - minimizeButtonWhenMinimized:SetNormalTexture ([[Interface\BUTTONS\UI-Panel-HideButton-Up]]) - minimizeButtonWhenMinimized:SetPushedTexture ([[Interface\BUTTONS\UI-Panel-HideButton-Down]]) + minimizeButtonWhenMinimized:SetNormalTexture([[Interface\BUTTONS\UI-Panel-HideButton-Up]]) + minimizeButtonWhenMinimized:SetPushedTexture([[Interface\BUTTONS\UI-Panel-HideButton-Down]]) else f.IsMinimized = true f:Hide() fMinimized:Show() - minimizeButtonWhenMinimized:SetNormalTexture ([[Interface\BUTTONS\UI-Panel-CollapseButton-Up]]) - minimizeButtonWhenMinimized:SetPushedTexture ([[Interface\BUTTONS\UI-Panel-CollapseButton-Up]]) + minimizeButtonWhenMinimized:SetNormalTexture([[Interface\BUTTONS\UI-Panel-CollapseButton-Up]]) + minimizeButtonWhenMinimized:SetPushedTexture([[Interface\BUTTONS\UI-Panel-CollapseButton-Up]]) end end - minimizeButton:SetScript ("OnClick", minimize_func) - minimizeButtonWhenMinimized:SetScript ("OnClick", minimize_func) + minimizeButton:SetScript("OnClick", minimize_func) + minimizeButtonWhenMinimized:SetScript("OnClick", minimize_func) --enabled box -- /run _G.DetailsMythicDungeonChartHandler.ShowChart(); DetailsMythicDungeonChartFrame.ShowChartFrame() @@ -529,53 +529,53 @@ function mythicDungeonCharts.ShowChart() 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") enabledSwitch:SetAsCheckBox() enabledSwitch.tooltip = "Show this chart at the end of a mythic dungeon run.\n\nIf disabled, you can reactivate it again at the options panel > streamer settings." - enabledLabel:SetPoint ("right", minimizeButton, "left", -22, 0) - enabledSwitch:SetSize (16, 16) - Details.gump:SetFontColor (enabledLabel, "gray") + enabledLabel:SetPoint("right", minimizeButton, "left", -22, 0) + enabledSwitch:SetSize(16, 16) + Details.gump:SetFontColor(enabledLabel, "gray") enabledSwitch.checked_texture:SetVertexColor (.75, .75, .75) - local leftDivisorLine = f.BossWidgetsFrame:CreateTexture (nil, "overlay") - leftDivisorLine:SetSize (2, f.ChartFrame.Graphic:GetHeight()) + local leftDivisorLine = f.BossWidgetsFrame:CreateTexture(nil, "overlay") + leftDivisorLine:SetSize(2, f.ChartFrame.Graphic:GetHeight()) leftDivisorLine:SetColorTexture (1, 1, 1, 1) - leftDivisorLine:SetPoint ("bottomleft", f.ChartFrame.Graphic.TextFrame, "bottomleft", -2, 0) + leftDivisorLine:SetPoint("bottomleft", f.ChartFrame.Graphic.TextFrame, "bottomleft", -2, 0) - local bottomDivisorLine = f.BossWidgetsFrame:CreateTexture (nil, "overlay") - bottomDivisorLine:SetSize (f.ChartFrame.Graphic:GetWidth(), 2) + local bottomDivisorLine = f.BossWidgetsFrame:CreateTexture(nil, "overlay") + bottomDivisorLine:SetSize(f.ChartFrame.Graphic:GetWidth(), 2) bottomDivisorLine:SetColorTexture (1, 1, 1, 1) - bottomDivisorLine:SetPoint ("bottomleft", f.ChartFrame.Graphic.TextFrame, "bottomleft", 0, 0) + bottomDivisorLine:SetPoint("bottomleft", f.ChartFrame.Graphic.TextFrame, "bottomleft", 0, 0) - f.ChartFrame.Graphic:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - f.ChartFrame.Graphic:SetBackdropColor (.5, .50, .50, 0.8) - f.ChartFrame.Graphic:SetBackdropBorderColor (0, 0, 0, 0.5) + f.ChartFrame.Graphic:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + f.ChartFrame.Graphic:SetBackdropColor(.5, .50, .50, 0.8) + f.ChartFrame.Graphic:SetBackdropBorderColor(0, 0, 0, 0.5) function f.ChartFrame.RefreshBossTimeline (self, bossTable, elapsedTime) - for i, bossTable in ipairs (mythicDungeonCharts.ChartTable.BossDefeated) do + for i, bossTable in ipairs(mythicDungeonCharts.ChartTable.BossDefeated) do local bossWidget = f.BossWidgetsFrame.Widgets [i] if (not bossWidget) then - local newBossWidget = CreateFrame ("frame", "$parentBossWidget" .. i, f.BossWidgetsFrame, "BackdropTemplate") - newBossWidget:SetSize (64, 32) - newBossWidget:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - newBossWidget:SetBackdropColor (0, 0, 0, 0.1) - newBossWidget:SetBackdropBorderColor (0, 0, 0, 0) + local newBossWidget = CreateFrame("frame", "$parentBossWidget" .. i, f.BossWidgetsFrame, "BackdropTemplate") + newBossWidget:SetSize(64, 32) + newBossWidget:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + newBossWidget:SetBackdropColor(0, 0, 0, 0.1) + newBossWidget:SetBackdropBorderColor(0, 0, 0, 0) local bossAvatar = Details:GetFramework():CreateImage (newBossWidget, "", 64, 32, "border") - bossAvatar:SetPoint ("bottomleft", newBossWidget, "bottomleft", 0, 0) + bossAvatar:SetPoint("bottomleft", newBossWidget, "bottomleft", 0, 0) newBossWidget.AvatarTexture = bossAvatar local verticalLine = Details:GetFramework():CreateImage (newBossWidget, "", 1, f.ChartFrame.Graphic:GetHeight(), "overlay") verticalLine:SetColorTexture (1, 1, 1, 0.3) - verticalLine:SetPoint ("bottomleft", newBossWidget, "bottomright", 0, 0) + verticalLine:SetPoint("bottomleft", newBossWidget, "bottomright", 0, 0) - local timeText = Details:GetFramework():CreateLabel (newBossWidget) - timeText:SetPoint ("bottomright", newBossWidget, "bottomright", 0, 0) + local timeText = Details:GetFramework():CreateLabel(newBossWidget) + timeText:SetPoint("bottomright", newBossWidget, "bottomright", 0, 0) newBossWidget.TimeText = timeText local timeBackground = Details:GetFramework():CreateImage (newBossWidget, "", 30, 12, "artwork") timeBackground:SetColorTexture (0, 0, 0, 0.5) - timeBackground:SetPoint ("topleft", timeText, "topleft", -2, 2) - timeBackground:SetPoint ("bottomright", timeText, "bottomright", 2, 0) + timeBackground:SetPoint("topleft", timeText, "topleft", -2, 2) + timeBackground:SetPoint("bottomright", timeText, "bottomright", 2, 0) f.BossWidgetsFrame.Widgets [i] = newBossWidget bossWidget = newBossWidget @@ -585,15 +585,15 @@ function mythicDungeonCharts.ShowChart() local secondsPerPixel = chartLength / elapsedTime local xPosition = bossTable[1] * secondsPerPixel - bossWidget:SetPoint ("bottomright", f.ChartFrame.Graphic, "bottomleft", xPosition, 0) + bossWidget:SetPoint("bottomright", f.ChartFrame.Graphic, "bottomleft", xPosition, 0) - bossWidget.TimeText:SetText (Details:GetFramework():IntegerToTimer (bossTable[1])) + bossWidget.TimeText:SetText(Details:GetFramework():IntegerToTimer (bossTable[1])) if (bossTable[2].bossimage) then - bossWidget.AvatarTexture:SetTexture (bossTable[2].bossimage) + bossWidget.AvatarTexture:SetTexture(bossTable[2].bossimage) else local bossAvatar = Details:GetBossPortrait (nil, nil, bossTable[2].name, bossTable[2].ej_instance_id) - bossWidget.AvatarTexture:SetTexture (bossAvatar) + bossWidget.AvatarTexture:SetTexture(bossAvatar) end end end @@ -673,7 +673,7 @@ function mythicDungeonCharts.ShowChart() --generate boss time table local bossTimeTable = {} - for i, bossTable in ipairs (mythicDungeonCharts.ChartTable.BossDefeated) do + for i, bossTable in ipairs(mythicDungeonCharts.ChartTable.BossDefeated) do local combatTime = bossTable [3] or math.random (10, 30) tinsert (bossTimeTable, bossTable[1]) @@ -688,7 +688,7 @@ function mythicDungeonCharts.ShowChart() mythicDungeonCharts.Frame.ChartFrame:SetTitle ("") Details:GetFramework():SetFontSize (mythicDungeonCharts.Frame.ChartFrame.chart_title, 14) - mythicDungeonCharts.Frame.TitleText:SetText (mythicDungeonCharts.ChartTable.DungeonName and phrase .. mythicDungeonCharts.ChartTable.DungeonName or phrase) + mythicDungeonCharts.Frame.TitleText:SetText(mythicDungeonCharts.ChartTable.DungeonName and phrase .. mythicDungeonCharts.ChartTable.DungeonName or phrase) mythicDungeonCharts.Frame.ShowChartFrame() @@ -712,13 +712,13 @@ local PixelFrameOnEnter = function(self) --multiply the max dps with the percent dps = mythicDungeonCharts.Frame.ChartFrame.Graphic.max_value * dps - mythicDungeonCharts.Frame.BossWidgetsFrame.GraphPin:SetPoint ("center", self, "center", 0, 0) + mythicDungeonCharts.Frame.BossWidgetsFrame.GraphPin:SetPoint("center", self, "center", 0, 0) mythicDungeonCharts.Frame.BossWidgetsFrame.GraphPin:Show() mythicDungeonCharts.Frame.BossWidgetsFrame.GraphPinGlow:Show() GameCooltip2:Preset (2) - GameCooltip2:SetOption ("FixedWidth", 100) - GameCooltip2:SetOption ("TextSize", 10) + GameCooltip2:SetOption("FixedWidth", 100) + GameCooltip2:SetOption("TextSize", 10) local onlyName = _detalhes:GetOnlyName (playerName) GameCooltip2:AddLine (onlyName) @@ -758,11 +758,11 @@ function mythicDungeonCharts:CustomDrawLine (C, sx, sy, ex, ey, w, color, layer, local T = tremove(C.GraphLib_Lines) or C:CreateTexture(nil, "ARTWORK") - if linetexture then --> this data series texture + if linetexture then --this data series texture T:SetTexture(linetexture) - elseif C.CustomLine then --> overall chart texture + elseif C.CustomLine then --overall chart texture T:SetTexture(C.CustomLine) - else --> no texture assigned, use default + else --no texture assigned, use default T:SetTexture(TextureDirectory.."line") end @@ -829,13 +829,13 @@ function mythicDungeonCharts:CustomDrawLine (C, sx, sy, ex, ey, w, color, layer, local pixelFrame = tremove (mythicDungeonCharts.Frame.ChartFrame.FrameFree) if (not pixelFrame) then - local newFrame = CreateFrame ("frame", nil, mythicDungeonCharts.Frame.ChartFrame, "BackdropTemplate") - newFrame:SetSize (1, 1) + local newFrame = CreateFrame("frame", nil, mythicDungeonCharts.Frame.ChartFrame, "BackdropTemplate") + newFrame:SetSize(1, 1) - --newFrame:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 2, tile = true}) - --newFrame:SetBackdropColor (0, 0, 0, 1) - newFrame:SetScript ("OnEnter", PixelFrameOnEnter) - newFrame:SetScript ("OnLeave", PixelFrameOnLeave) + --newFrame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 2, tile = true}) + --newFrame:SetBackdropColor(0, 0, 0, 1) + newFrame:SetScript("OnEnter", PixelFrameOnEnter) + newFrame:SetScript("OnLeave", PixelFrameOnLeave) pixelFrame = newFrame end diff --git a/functions/events.lua b/functions/events.lua index fd58ca9c..3b42f9bd 100644 --- a/functions/events.lua +++ b/functions/events.lua @@ -5,9 +5,9 @@ local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) local _ - --> Event types: + --Event types: _detalhes.RegistredEvents = { - --> instances + --instances ["DETAILS_INSTANCE_OPEN"] = {}, ["DETAILS_INSTANCE_CLOSE"] = {}, ["DETAILS_INSTANCE_SIZECHANGED"] = {}, @@ -20,16 +20,16 @@ ["DETAILS_INSTANCE_CHANGEMODE"] = {}, ["DETAILS_INSTANCE_NEWROW"] = {}, - --> misc + --misc ["DETAILS_OPTIONS_MODIFIED"] = {}, ["UNIT_SPEC"] = {}, ["UNIT_TALENTS"] = {}, - --> data + --data ["DETAILS_DATA_RESET"] = {}, ["DETAILS_DATA_SEGMENTREMOVED"] = {}, - --> combat + --combat ["COMBAT_ENCOUNTER_START"] = {}, ["COMBAT_ENCOUNTER_END"] = {}, ["COMBAT_PLAYER_ENTER"] = {}, @@ -48,18 +48,18 @@ ["COMBAT_MYTHICDUNGEON_START"] = {}, ["COMBAT_MYTHICDUNGEON_END"] = {}, - --> area + --area ["ZONE_TYPE_CHANGED"] = {}, - --> roster + --roster ["GROUP_ONENTER"] = {}, ["GROUP_ONLEAVE"] = {}, - --> buffs + --buffs ["BUFF_UPDATE"] = {}, ["BUFF_UPDATE_DEBUFFPOWER"] = {}, - --> network + --network ["REALM_CHANNEL_ENTER"] = {}, --deprecated (realm channels are disabled) ["REALM_CHANNEL_LEAVE"] = {}, --deprecated ["COMM_EVENT_RECEIVED"] = {}, --added on core 129 @@ -67,7 +67,7 @@ } local function AlreadyRegistred (_tables, _object) - for index, _this_object in ipairs (_tables) do + for index, _this_object in ipairs(_tables) do if (_this_object.__eventtable) then if (_this_object [1] == _object) then return index @@ -124,7 +124,7 @@ local common_events = { } ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> register a event +--register a event function _detalhes:RegisterEvent (object, event, func) @@ -183,7 +183,7 @@ local common_events = { end ------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> Unregister a Event +--Unregister a Event function _detalhes:UnregisterEvent (object, event) @@ -236,24 +236,24 @@ local common_events = { end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> internal functions +--internal functions local dispatch_error = function(name, errortext) _detalhes:Msg ((name or ""), " |cFFFF9900error|r: ", errortext) end - --> safe call an external func with payload and without telling who is calling + --safe call an external func with payload and without telling who is calling function _detalhes:QuickDispatchEvent (func, event, ...) - if (type (func) ~= "function") then + if (type(func) ~= "function") then return - elseif (type (event) ~= "string") then + elseif (type(event) ~= "string") then return end local okay, errortext = pcall (func, event, ...) if (not okay) then - --> trigger an error msg + --trigger an error msg dispatch_error (_, errortext) return @@ -262,22 +262,22 @@ local common_events = { return true end - --> quick dispatch with context, send the caller object within the payload + --quick dispatch with context, send the caller object within the payload function _detalhes:QuickDispatchEventWithContext (context, func, event, ...) - if (type (context) ~= "table") then + if (type(context) ~= "table") then return - elseif (type (func) ~= "function") then + elseif (type(func) ~= "function") then return - elseif (type (event) ~= "string") then + elseif (type(event) ~= "string") then return end local okay, errortext = pcall (func, context, event, ...) if (not okay) then - --> attempt to get the context name + --attempt to get the context name local objectName = context.__name or context._name or context.name or context.Name - --> trigger an error msg + --trigger an error msg dispatch_error (objectName, errortext) return @@ -286,34 +286,34 @@ local common_events = { return true end - --> Send Event - function _detalhes:SendEvent (event, object, ...) + --Send Event + function _detalhes:SendEvent(event, object, ...) - --> send event to all registred plugins + --send event to all registred plugins if (event == "PLUGIN_DISABLED" or event == "PLUGIN_ENABLED") then return object:OnDetailsEvent (event, ...) elseif (not object) then - --> iterate among all plugins which registered a function for this event - for _, PluginObject in ipairs (_detalhes.RegistredEvents[event]) do + --iterate among all plugins which registered a function for this event + for _, PluginObject in ipairs(_detalhes.RegistredEvents[event]) do - --> when __eventtable is true, the plugin registered a function or method name to callback - --> if is false, we call OnDetailsEvent method on the plugin + --when __eventtable is true, the plugin registered a function or method name to callback + --if is false, we call OnDetailsEvent method on the plugin if (PluginObject.__eventtable) then local pluginTable = PluginObject [1] - --> check if the plugin is enabled + --check if the plugin is enabled if (pluginTable.Enabled and pluginTable.__enabled) then - --> check if fegistered a function - if (type (PluginObject [2]) == "function") then + --check if fegistered a function + if (type(PluginObject [2]) == "function") then local func = PluginObject [2] _detalhes:QuickDispatchEvent (func, event, ...) --PluginObject [2] (event, ...) - --> if not it must be a method name + --if not it must be a method name else local methodName = PluginObject [2] local func = pluginTable [methodName] @@ -332,31 +332,31 @@ local common_events = { end end - --> plugin notifications (does not send to listeners) - elseif (type (object) == "string" and object == "SEND_TO_ALL") then + --plugin notifications (does not send to listeners) + elseif (type(object) == "string" and object == "SEND_TO_ALL") then - for _, PluginObject in ipairs (_detalhes.RaidTables.Plugins) do + for _, PluginObject in ipairs(_detalhes.RaidTables.Plugins) do if (PluginObject.__enabled) then _detalhes:QuickDispatchEventWithContext (PluginObject, PluginObject.OnDetailsEvent, event) --PluginObject:OnDetailsEvent (event) end end - for _, PluginObject in ipairs (_detalhes.SoloTables.Plugins) do + for _, PluginObject in ipairs(_detalhes.SoloTables.Plugins) do if (PluginObject.__enabled) then _detalhes:QuickDispatchEventWithContext (PluginObject, PluginObject.OnDetailsEvent, event) --PluginObject:OnDetailsEvent (event) end end - for _, PluginObject in ipairs (_detalhes.ToolBar.Plugins) do + for _, PluginObject in ipairs(_detalhes.ToolBar.Plugins) do if (PluginObject.__enabled) then _detalhes:QuickDispatchEventWithContext (PluginObject, PluginObject.OnDetailsEvent, event) --PluginObject:OnDetailsEvent (event) end end else - --> send the event only for requested plugin + --send the event only for requested plugin if (object.Enabled and object.__enabled) then return _detalhes:QuickDispatchEventWithContext (object, object.OnDetailsEvent, event, ...) --return object:OnDetailsEvent (event, ...) @@ -365,13 +365,13 @@ local common_events = { end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> special cases +--special cases function _detalhes:SendOptionsModifiedEvent (instance) _detalhes.last_options_modified = _detalhes.last_options_modified or (GetTime() - 5) if (_detalhes.last_options_modified + 0.3 < GetTime()) then - _detalhes:SendEvent ("DETAILS_OPTIONS_MODIFIED", nil, instance) + _detalhes:SendEvent("DETAILS_OPTIONS_MODIFIED", nil, instance) _detalhes.last_options_modified = GetTime() if (_detalhes.last_options_modified_schedule) then _detalhes:CancelTimer (_detalhes.last_options_modified_schedule) @@ -386,7 +386,7 @@ local common_events = { end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> listeners +--listeners local listener_meta = setmetatable ({}, _detalhes) listener_meta.__index = listener_meta diff --git a/functions/hooks.lua b/functions/hooks.lua index dc46aa52..be36bceb 100644 --- a/functions/hooks.lua +++ b/functions/hooks.lua @@ -29,9 +29,9 @@ return false, "Invalid hook type." end - for _, this_func in ipairs (_detalhes.hooks [hook_type]) do + for _, this_func in ipairs(_detalhes.hooks [hook_type]) do if (this_func == func) then - --> already installed + --already installed return end end @@ -50,7 +50,7 @@ return false, "Invalid hook type." end - for index, this_func in ipairs (_detalhes.hooks [hook_type]) do + for index, this_func in ipairs(_detalhes.hooks [hook_type]) do if (this_func == func) then diff --git a/functions/loaddata.lua b/functions/loaddata.lua index aa1d753c..f054a472 100644 --- a/functions/loaddata.lua +++ b/functions/loaddata.lua @@ -6,40 +6,40 @@ local _ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> On Details! Load: - --> load default keys into the main object +--On Details! Load: + --load default keys into the main object function _detalhes:ApplyBasicKeys() - --> we are not in debug mode + --we are not in debug mode self.debug = false - --> connected to realm channel + --connected to realm channel self.is_connected = false - --> who is + --who is self.playername = UnitName ("player") self.playerserial = UnitGUID ("player") - --> player faction and enemy faction + --player faction and enemy faction self.faction = UnitFactionGroup ("player") - if (self.faction == PLAYER_FACTION_GROUP[0]) then --> player is horde - self.faction_against = PLAYER_FACTION_GROUP[1] --> ally + if (self.faction == PLAYER_FACTION_GROUP[0]) then --player is horde + self.faction_against = PLAYER_FACTION_GROUP[1] --ally self.faction_id = 0 - elseif (self.faction == PLAYER_FACTION_GROUP[1]) then --> player is alliance - self.faction_against = PLAYER_FACTION_GROUP[0] --> horde + elseif (self.faction == PLAYER_FACTION_GROUP[1]) then --player is alliance + self.faction_against = PLAYER_FACTION_GROUP[0] --horde self.faction_id = 1 end self.zone_type = nil _detalhes.temp_table1 = {} - --> combat + --combat self.encounter = {} self.in_combat = false self.combat_id = 0 - --> instances (windows) + --instances (windows) self.solo = self.solo or nil self.raid = self.raid or nil self.opened_windows = 0 @@ -61,9 +61,9 @@ function _detalhes:ApplyBasicKeys() ["unknown"] = {0.5, 0.75, 0.75, 1} } - --> load default profile keys + --load default profile keys for key, value in pairs (_detalhes.default_profile) do - if (type (value) == "table") then + if (type(value) == "table") then local ctable = Details.CopyTable (value) self [key] = ctable else @@ -71,42 +71,42 @@ function _detalhes:ApplyBasicKeys() end end - --> end + --end return true end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> On Details! Load: - --> check if this is a first run, reset, or just load the saved data. +--On Details! Load: + --check if this is a first run, reset, or just load the saved data. function _detalhes:LoadGlobalAndCharacterData() - --> check and build the default container for character database + --check and build the default container for character database - --> it exists? + --it exists? if (not _detalhes_database) then _detalhes_database = Details.CopyTable (_detalhes.default_player_data) end - --> load saved values + --load saved values for key, value in pairs (_detalhes.default_player_data) do - --> check if key exists, e.g. a new key was added + --check if key exists, e.g. a new key was added if (_detalhes_database [key] == nil) then - if (type (value) == "table") then + if (type(value) == "table") then _detalhes_database [key] = Details.CopyTable (_detalhes.default_player_data [key]) else _detalhes_database [key] = value end - elseif (type (_detalhes_database [key]) == "table") then + elseif (type(_detalhes_database [key]) == "table") then if (type(_detalhes.default_player_data [key]) == "string") then print("|cFFFFAA00Details!|r error 0x8538, report on discord", key, _detalhes_database [key], _detalhes.default_player_data [key]) end for key2, value2 in pairs (_detalhes.default_player_data [key]) do if (_detalhes_database [key] [key2] == nil) then - if (type (value2) == "table") then + if (type(value2) == "table") then _detalhes_database [key] [key2] = Details.CopyTable (_detalhes.default_player_data [key] [key2]) else _detalhes_database [key] [key2] = value2 @@ -115,8 +115,8 @@ function _detalhes:LoadGlobalAndCharacterData() end end - --> copy the key from saved table to details object - if (type (value) == "table") then + --copy the key from saved table to details object + if (type(value) == "table") then _detalhes [key] = Details.CopyTable (_detalhes_database [key]) else _detalhes [key] = _detalhes_database [key] @@ -124,22 +124,22 @@ function _detalhes:LoadGlobalAndCharacterData() end - --> check and build the default container for account database + --check and build the default container for account database if (not _detalhes_global) then _detalhes_global = Details.CopyTable (_detalhes.default_global_data) end for key, value in pairs (_detalhes.default_global_data) do - --> check if key exists + --check if key exists if (_detalhes_global [key] == nil) then - if (type (value) == "table") then + if (type(value) == "table") then _detalhes_global [key] = Details.CopyTable (_detalhes.default_global_data [key]) else _detalhes_global [key] = value end - elseif (type (_detalhes_global [key]) == "table") then + elseif (type(_detalhes_global [key]) == "table") then if (type(_detalhes.default_global_data [key]) == "string") then C_Timer.After(5, function() @@ -151,10 +151,10 @@ function _detalhes:LoadGlobalAndCharacterData() _detalhes_global ["always_use_profile_name"] = "" end - if (type (_detalhes_global [key]) == "table") then + if (type(_detalhes_global [key]) == "table") then for key2, value2 in pairs (_detalhes.default_global_data [key]) do if (_detalhes_global [key] [key2] == nil) then - if (type (value2) == "table") then + if (type(value2) == "table") then _detalhes_global [key] [key2] = Details.CopyTable (_detalhes.default_global_data [key] [key2]) else _detalhes_global [key] [key2] = value2 @@ -164,8 +164,8 @@ function _detalhes:LoadGlobalAndCharacterData() end end - --> copy the key from saved table to details object - if (type (value) == "table") then + --copy the key from saved table to details object + if (type(value) == "table") then _detalhes [key] = Details.CopyTable (_detalhes_global [key]) else _detalhes [key] = _detalhes_global [key] @@ -173,17 +173,17 @@ function _detalhes:LoadGlobalAndCharacterData() end - --> end + --end return true end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> On Details! Load: - --> load previous saved combat data +--On Details! Load: + --load previous saved combat data function _detalhes:LoadCombatTables() - --> if isn't nothing saved, build a new one + --if isn't nothing saved, build a new one if (not _detalhes_database.tabela_historico) then _detalhes.tabela_historico = _detalhes.historico:NovoHistorico() _detalhes.tabela_overall = _detalhes.combate:NovaTabela() @@ -192,7 +192,7 @@ function _detalhes:LoadCombatTables() _detalhes:UpdateContainerCombatentes() else - --> build basic containers + --build basic containers -- segments _detalhes.tabela_historico = _detalhes_database.tabela_historico or _detalhes.historico:NovoHistorico() -- overall @@ -205,9 +205,9 @@ function _detalhes:LoadCombatTables() end _detalhes:UpdateContainerCombatentes() - --> if the core revision was incremented, reset all combat data + --if the core revision was incremented, reset all combat data if (_detalhes_database.last_realversion and _detalhes_database.last_realversion < _detalhes.realversion) then - --> details was been hard upgraded + --details was been hard upgraded _detalhes.tabela_historico = _detalhes.historico:NovoHistorico() _detalhes.tabela_overall = _detalhes.combate:NovaTabela() _detalhes.tabela_vigente = _detalhes.combate:NovaTabela (_, _detalhes.tabela_overall) @@ -217,11 +217,11 @@ function _detalhes:LoadCombatTables() _detalhes_database.tabela_historico = nil _detalhes_database.tabela_overall = nil else - --> check integrity + --check integrity local combat = _detalhes.tabela_historico.tabelas [1] if (combat) then if (not combat[1] or not combat[2] or not combat[3] or not combat[4]) then - --> something went wrong in last logon, let's just reset and we are good to go + --something went wrong in last logon, let's just reset and we are good to go _detalhes.tabela_historico = _detalhes.historico:NovoHistorico() _detalhes.tabela_vigente = _detalhes.combate:NovaTabela (_, _detalhes.tabela_overall) _detalhes.tabela_pets = _detalhes.container_pets:NovoContainer() @@ -239,27 +239,27 @@ function _detalhes:LoadCombatTables() _detalhes.tabela_overall = _detalhes.combate:NovaTabela() end - --> re-build all indexes and metatables + --re-build all indexes and metatables _detalhes:RestauraMetaTables() - --> get last combat table + --get last combat table local historico_UM = _detalhes.tabela_historico.tabelas[1] if (historico_UM) then - _detalhes.tabela_vigente = historico_UM --> significa que elas eram a mesma tabela, ent�o aqui elas se tornam a mesma tabela + _detalhes.tabela_vigente = historico_UM --significa que elas eram a mesma tabela, ent�o aqui elas se tornam a mesma tabela else _detalhes.tabela_vigente = _detalhes.combate:NovaTabela (_, _detalhes.tabela_overall) end - --> need refresh for all containers - for _, container in ipairs (_detalhes.tabela_overall) do + --need refresh for all containers + for _, container in ipairs(_detalhes.tabela_overall) do container.need_refresh = true end - for _, container in ipairs (_detalhes.tabela_vigente) do + for _, container in ipairs(_detalhes.tabela_vigente) do container.need_refresh = true end - --> erase combat data from the database + --erase combat data from the database _detalhes_database.tabela_vigente = nil _detalhes_database.tabela_historico = nil _detalhes_database.tabela_pets = nil @@ -274,23 +274,23 @@ function _detalhes:LoadCombatTables() end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> On Details! Load: - --> load the saved config on the addon +--On Details! Load: + --load the saved config on the addon function _detalhes:LoadConfig() - --> plugins data + --plugins data _detalhes.plugin_database = _detalhes_database.plugin_database or {} - --> startup + --startup - --> set the nicktag cache host + --set the nicktag cache host _detalhes:NickTagSetCache (_detalhes_database.nick_tag_cache) - --> count data + --count data _detalhes:CountDataOnLoad() - --> solo e raid plugin + --solo e raid plugin if (_detalhes_database.SoloTablesSaved) then if (_detalhes_database.SoloTablesSaved.Mode) then _detalhes.SoloTables.Mode = _detalhes_database.SoloTablesSaved.Mode @@ -300,7 +300,7 @@ function _detalhes:LoadConfig() end end - --> switch tables + --switch tables _detalhes.switch.slots = _detalhes_global.switchSaved.slots _detalhes.switch.table = _detalhes_global.switchSaved.table @@ -312,46 +312,46 @@ function _detalhes:LoadConfig() end end - --> last boss + --last boss _detalhes.last_encounter = _detalhes_database.last_encounter - --> buffs + --buffs _detalhes.savedbuffs = _detalhes_database.savedbuffs _detalhes.Buffs:BuildTables() - --> initialize parser + --initialize parser _detalhes.capture_current = {} for captureType, captureValue in pairs (_detalhes.capture_real) do _detalhes.capture_current [captureType] = captureValue end - --> row animations + --row animations _detalhes:SetUseAnimations() - --> initialize spell cache + --initialize spell cache _detalhes:ClearSpellCache() - --> version first run + --version first run if (not _detalhes_database.last_version or _detalhes_database.last_version ~= _detalhes.userversion) then _detalhes.is_version_first_run = true end - --> profile + --profile local unitname = UnitName ("player") - --> fix for old versions - if (type (_detalhes.always_use_profile) == "string") then + --fix for old versions + if (type(_detalhes.always_use_profile) == "string") then _detalhes.always_use_profile = false _detalhes.always_use_profile_name = "" end - if (type (_detalhes.always_use_profile_name) ~= "string") then + if (type(_detalhes.always_use_profile_name) ~= "string") then _detalhes.always_use_profile = false _detalhes.always_use_profile_name = "" end - --> check for "always use this profile" + --check for "always use this profile" if (_detalhes.always_use_profile and not _detalhes.always_use_profile_exception [unitname]) then local profile_name = _detalhes.always_use_profile_name if (profile_name and profile_name ~= "" and _detalhes:GetProfile (profile_name)) then @@ -359,26 +359,26 @@ function _detalhes:LoadConfig() end end - --> character first run + --character first run if (_detalhes_database.active_profile == "") then _detalhes.character_first_run = true - --> � a primeira vez que este character usa profiles, precisa copiar as keys existentes + --� a primeira vez que este character usa profiles, precisa copiar as keys existentes local current_profile_name = _detalhes:GetCurrentProfileName() _detalhes:GetProfile (current_profile_name, true) _detalhes:SaveProfileSpecial() end - --> load profile and active instances + --load profile and active instances local current_profile_name = _detalhes:GetCurrentProfileName() - --> check if exists, if not, create one + --check if exists, if not, create one local profile = _detalhes:GetProfile (current_profile_name, true) - --> instances + --instances _detalhes.tabela_instancias = _detalhes_database.tabela_instancias or {} - --> fix for version 1.21.0 - if (#_detalhes.tabela_instancias > 0) then --> only happens once after the character logon - for index, saved_skin in ipairs (profile.instances) do + --fix for version 1.21.0 + if (#_detalhes.tabela_instancias > 0) then --only happens once after the character logon + for index, saved_skin in ipairs(profile.instances) do local instance = _detalhes.tabela_instancias [index] if (instance) then saved_skin.__was_opened = instance.ativa @@ -390,7 +390,7 @@ function _detalhes:LoadConfig() for key, value in pairs (instance) do if (_detalhes.instance_defaults [key] ~= nil) then - if (type (value) == "table") then + if (type(value) == "table") then saved_skin [key] = Details.CopyTable (value) else saved_skin [key] = value @@ -424,26 +424,26 @@ function _detalhes:LoadConfig() _detalhes.tabela_instancias = {} end - --> apply the profile + --apply the profile _detalhes:ApplyProfile (current_profile_name, true) - --> custom + --custom _detalhes.custom = _detalhes_global.custom _detalhes.refresh:r_atributo_custom() end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> On Details! Load: - --> count logons, tutorials, etc +--On Details! Load: + --count logons, tutorials, etc function _detalhes:CountDataOnLoad() - --> basic + --basic if (not _detalhes_global.got_first_run) then _detalhes.is_first_run = true end - --> tutorial + --tutorial self.tutorial = self.tutorial or {} self.tutorial.logons = self.tutorial.logons or 0 diff --git a/functions/mythicdungeon.lua b/functions/mythicdungeon.lua index c3031118..8f760a16 100644 --- a/functions/mythicdungeon.lua +++ b/functions/mythicdungeon.lua @@ -14,7 +14,7 @@ Details.MythicPlus = { } -- ~mythic ~dungeon -local DetailsMythicPlusFrame = _G.CreateFrame ("frame", "DetailsMythicPlusFrame", UIParent) +local DetailsMythicPlusFrame = _G.CreateFrame("frame", "DetailsMythicPlusFrame", UIParent) DetailsMythicPlusFrame.DevelopmentDebug = false --disabling the mythic+ feature if the user is playing in wow classic @@ -49,10 +49,10 @@ function DetailsMythicPlusFrame.MergeSegmentsOnEnd() print ("Details!", "MergeSegmentsOnEnd() > starting to merge mythic segments.", "InCombatLockdown():", InCombatLockdown()) end - --> create a new combat to be the overall for the mythic run + --create a new combat to be the overall for the mythic run Details:EntrarEmCombate() - --> get the current combat just created and the table with all past segments + --get the current combat just created and the table with all past segments local newCombat = Details:GetCurrentCombat() local segmentHistory = Details:GetCombatSegments() @@ -61,8 +61,8 @@ function DetailsMythicPlusFrame.MergeSegmentsOnEnd() local lastSegment local totalSegments = 0 - --> add all boss segments from this run to this new segment - for i = 1, 25 do --> from the newer combat to the oldest + --add all boss segments from this run to this new segment + for i = 1, 25 do --from the newer combat to the oldest local pastCombat = segmentHistory [i] if (pastCombat and pastCombat.is_mythic_dungeon_run_id == Details.mythic_dungeon_id) then local canAddThisSegment = true @@ -90,7 +90,7 @@ function DetailsMythicPlusFrame.MergeSegmentsOnEnd() end end - --> get the date where the first segment started + --get the date where the first segment started if (lastSegment) then startDate = lastSegment:GetDate() end @@ -101,7 +101,7 @@ function DetailsMythicPlusFrame.MergeSegmentsOnEnd() local zoneName, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceMapID, instanceGroupSize = GetInstanceInfo() - --> tag the segment as mythic overall segment + --tag the segment as mythic overall segment newCombat.is_mythic_dungeon = { StartedAt = Details.MythicPlus.StartedAt, --the start of the run EndedAt = Details.MythicPlus.EndedAt, --the end of the run @@ -119,20 +119,20 @@ function DetailsMythicPlusFrame.MergeSegmentsOnEnd() newCombat.is_mythic_dungeon_segment = true newCombat.is_mythic_dungeon_run_id = Details.mythic_dungeon_id - --> set the segment time and date + --set the segment time and date newCombat:SetStartTime (GetTime() - totalTime) newCombat:SetEndTime (GetTime()) newCombat:SetDate (startDate, endDate) - --> immediatly finishes the segment just started + --immediatly finishes the segment just started Details:SairDoCombate() - --> update all windows + --update all windows Details:InstanciaCallFunction(Details.FadeHandler.Fader, "IN", nil, "barras") Details:InstanciaCallFunction(Details.AtualizaSegmentos) Details:InstanciaCallFunction(Details.AtualizaSoloMode_AfertReset) Details:InstanciaCallFunction(Details.ResetaGump) - Details:RefreshMainWindow (-1, true) + Details:RefreshMainWindow(-1, true) if (DetailsMythicPlusFrame.DevelopmentDebug) then print ("Details!", "MergeSegmentsOnEnd() > finished merging segments.") @@ -149,7 +149,7 @@ function DetailsMythicPlusFrame.MergeSegmentsOnEnd() end end ---> after each boss fight, if enalbed on settings, create an extra segment with all trash segments from the boss just killed +--after each boss fight, if enalbed on settings, create an extra segment with all trash segments from the boss just killed function DetailsMythicPlusFrame.MergeTrashCleanup (isFromSchedule) if (DetailsMythicPlusFrame.DevelopmentDebug) then print ("Details!", "MergeTrashCleanup() > running", DetailsMythicPlusFrame.TrashMergeScheduled and #DetailsMythicPlusFrame.TrashMergeScheduled) @@ -157,26 +157,26 @@ function DetailsMythicPlusFrame.MergeTrashCleanup (isFromSchedule) local segmentsToMerge = DetailsMythicPlusFrame.TrashMergeScheduled - --> table exists and there's at least one segment + --table exists and there's at least one segment if (segmentsToMerge and segmentsToMerge[1]) then --the first segment is the segment where all other trash segments will be added local masterSegment = segmentsToMerge[1] masterSegment.is_mythic_dungeon_trash = nil - --> get the current combat just created and the table with all past segments + --get the current combat just created and the table with all past segments local newCombat = masterSegment local totalTime = newCombat:GetCombatTime() local startDate, endDate = "", "" local lastSegment - --> add segments + --add segments for i = 2, #segmentsToMerge do --segment #1 is the host local pastCombat = segmentsToMerge[i] newCombat = newCombat + pastCombat totalTime = totalTime + pastCombat:GetCombatTime() - --> tag this combat as already added to a boss trash overall + --tag this combat as already added to a boss trash overall pastCombat._trashoverallalreadyadded = true if (endDate == "") then @@ -186,14 +186,14 @@ function DetailsMythicPlusFrame.MergeTrashCleanup (isFromSchedule) lastSegment = pastCombat end - --> get the date where the first segment started + --get the date where the first segment started if (lastSegment) then startDate = lastSegment:GetDate() end local zoneName, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceMapID, instanceGroupSize = GetInstanceInfo() - --> tag the segment as mythic overall segment + --tag the segment as mythic overall segment newCombat.is_mythic_dungeon = { StartedAt = segmentsToMerge.PreviousBossKilledAt, --start of the mythic run or when the previous boss got killed EndedAt = segmentsToMerge.LastBossKilledAt, --the time() when encounter_end got triggered @@ -211,17 +211,17 @@ function DetailsMythicPlusFrame.MergeTrashCleanup (isFromSchedule) newCombat.is_mythic_dungeon_segment = true newCombat.is_mythic_dungeon_run_id = Details.mythic_dungeon_id - --> set the segment time / using a sum of combat times, this combat time is reliable + --set the segment time / using a sum of combat times, this combat time is reliable newCombat:SetStartTime (GetTime() - totalTime) newCombat:SetEndTime (GetTime()) - --> set the segment date + --set the segment date newCombat:SetDate (startDate, endDate) if (DetailsMythicPlusFrame.DevelopmentDebug) then print ("Details!", "MergeTrashCleanup() > finished merging trash segments.", _detalhes.tabela_vigente, _detalhes.tabela_vigente.is_boss) end - --> should delete the trash segments after the merge? + --should delete the trash segments after the merge? if (_detalhes.mythic_plus.delete_trash_after_merge) then local segmentHistory = Details:GetCombatSegments() for i = #segmentHistory, 1, -1 do @@ -235,31 +235,31 @@ function DetailsMythicPlusFrame.MergeTrashCleanup (isFromSchedule) tremove (segmentsToMerge, i) end - Details:SendEvent ("DETAILS_DATA_SEGMENTREMOVED") + Details:SendEvent("DETAILS_DATA_SEGMENTREMOVED") else - --> clear the segments to merge table + --clear the segments to merge table for i = #segmentsToMerge, 1, -1 do tremove (segmentsToMerge, i) - --> notify plugins about a segment deleted - Details:SendEvent ("DETAILS_DATA_SEGMENTREMOVED") + --notify plugins about a segment deleted + Details:SendEvent("DETAILS_DATA_SEGMENTREMOVED") end - --> clear encounter name and id + --clear encounter name and id segmentsToMerge.EncounterID = nil segmentsToMerge.EncounterName = nil end - --> update all windows + --update all windows Details:InstanciaCallFunction (Details.FadeHandler.Fader, "IN", nil, "barras") Details:InstanciaCallFunction (Details.AtualizaSegmentos) Details:InstanciaCallFunction (Details.AtualizaSoloMode_AfertReset) Details:InstanciaCallFunction (Details.ResetaGump) - Details:RefreshMainWindow (-1, true) + Details:RefreshMainWindow(-1, true) end end ---> this function merges trash segments after all bosses of the mythic dungeon are defeated ---> happens when the group finishes all bosses but don't complete the trash requirement +--this function merges trash segments after all bosses of the mythic dungeon are defeated +--happens when the group finishes all bosses but don't complete the trash requirement function DetailsMythicPlusFrame.MergeRemainingTrashAfterAllBossesDone() if (DetailsMythicPlusFrame.DevelopmentDebug) then print ("Details!", "MergeRemainingTrashAfterAllBossesDone() > running, #segments: ", #DetailsMythicPlusFrame.TrashMergeScheduled2, "trash overall table:", DetailsMythicPlusFrame.TrashMergeScheduled2_OverallCombat) @@ -268,20 +268,20 @@ function DetailsMythicPlusFrame.MergeRemainingTrashAfterAllBossesDone() local segmentsToMerge = DetailsMythicPlusFrame.TrashMergeScheduled2 local overallCombat = DetailsMythicPlusFrame.TrashMergeScheduled2_OverallCombat - --> needs to merge, add the total combat time, set the date end to the date of the first segment + --needs to merge, add the total combat time, set the date end to the date of the first segment local totalTime = 0 local startDate, endDate = "", "" local lastSegment - --> add segments - for i, pastCombat in ipairs (segmentsToMerge) do + --add segments + for i, pastCombat in ipairs(segmentsToMerge) do overallCombat = overallCombat + pastCombat if (DetailsMythicPlusFrame.DevelopmentDebug) then print ("MergeRemainingTrashAfterAllBossesDone() > segment added") end totalTime = totalTime + pastCombat:GetCombatTime() - --> tag this combat as already added to a boss trash overall + --tag this combat as already added to a boss trash overall pastCombat._trashoverallalreadyadded = true if (endDate == "") then --get the end date of the first index only @@ -291,13 +291,13 @@ function DetailsMythicPlusFrame.MergeRemainingTrashAfterAllBossesDone() lastSegment = pastCombat end - --> set the segment time / using a sum of combat times, this combat time is reliable + --set the segment time / using a sum of combat times, this combat time is reliable local startTime = overallCombat:GetStartTime() overallCombat:SetStartTime (startTime - totalTime) if (DetailsMythicPlusFrame.DevelopmentDebug) then print ("MergeRemainingTrashAfterAllBossesDone() > total combat time:", totalTime) end - --> set the segment date + --set the segment date local startDate = overallCombat:GetDate() overallCombat:SetDate (startDate, endDate) if (DetailsMythicPlusFrame.DevelopmentDebug) then @@ -314,15 +314,15 @@ function DetailsMythicPlusFrame.MergeRemainingTrashAfterAllBossesDone() print ("MergeRemainingTrashAfterAllBossesDone() > elapsed time after:", mythicDungeonInfo.EndedAt - mythicDungeonInfo.StartedAt) end - --> should delete the trash segments after the merge? + --should delete the trash segments after the merge? if (_detalhes.mythic_plus.delete_trash_after_merge) then local removedCurrentSegment = false local segmentHistory = Details:GetCombatSegments() - for _, pastCombat in ipairs (segmentsToMerge) do + for _, pastCombat in ipairs(segmentsToMerge) do for i = #segmentHistory, 1, -1 do local segment = segmentHistory [i] if (segment == pastCombat) then - --> remove the segment + --remove the segment if (_detalhes.tabela_vigente == segment) then removedCurrentSegment = true end @@ -337,17 +337,17 @@ function DetailsMythicPlusFrame.MergeRemainingTrashAfterAllBossesDone() end if (removedCurrentSegment) then - --> find another current segment + --find another current segment local segmentHistory = Details:GetCombatSegments() _detalhes.tabela_vigente = segmentHistory [1] if (not _detalhes.tabela_vigente) then - --> assuming there's no segment from the dungeon run + --assuming there's no segment from the dungeon run Details:EntrarEmCombate() Details:SairDoCombate() end - --> update all windows + --update all windows Details:InstanciaCallFunction(Details.FadeHandler.Fader, "IN", nil, "barras") Details:InstanciaCallFunction(Details.AtualizaSegmentos) Details:InstanciaCallFunction(Details.AtualizaSoloMode_AfertReset) @@ -355,13 +355,13 @@ function DetailsMythicPlusFrame.MergeRemainingTrashAfterAllBossesDone() Details:RefreshMainWindow(-1, true) end - Details:SendEvent ("DETAILS_DATA_SEGMENTREMOVED") + Details:SendEvent("DETAILS_DATA_SEGMENTREMOVED") else - --> clear the segments to merge table + --clear the segments to merge table for i = #segmentsToMerge, 1, -1 do tremove (segmentsToMerge, i) - --> notify plugins about a segment deleted - Details:SendEvent ("DETAILS_DATA_SEGMENTREMOVED") + --notify plugins about a segment deleted + Details:SendEvent("DETAILS_DATA_SEGMENTREMOVED") end end @@ -382,7 +382,7 @@ function DetailsMythicPlusFrame.BossDefeated (this_is_end_end, encounterID, enco local zoneName, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceMapID, instanceGroupSize = GetInstanceInfo() - --> add the mythic dungeon info to the combat + --add the mythic dungeon info to the combat _detalhes.tabela_vigente.is_mythic_dungeon = { StartedAt = Details.MythicPlus.StartedAt, --the start of the run EndedAt = time(), --when the boss got killed @@ -397,38 +397,38 @@ function DetailsMythicPlusFrame.BossDefeated (this_is_end_end, encounterID, enco EJID = Details.MythicPlus.ejID, } - --> check if need to merge the trash for this boss + --check if need to merge the trash for this boss if (_detalhes.mythic_plus.merge_boss_trash and not Details.MythicPlus.IsRestoredState) then - --> store on an table all segments which should be merged + --store on an table all segments which should be merged local segmentsToMerge = DetailsMythicPlusFrame.TrashMergeScheduled or {} - --> table with all past semgnets + --table with all past semgnets local segmentHistory = Details:GetCombatSegments() - --> iterate among segments - for i = 1, 25 do --> from the newer combat to the oldest + --iterate among segments + for i = 1, 25 do --from the newer combat to the oldest local pastCombat = segmentHistory [i] - --> does the combat exists + --does the combat exists if (pastCombat and not pastCombat._trashoverallalreadyadded and pastCombat.is_mythic_dungeon_trash) then - --> is the combat a mythic segment from this run? + --is the combat a mythic segment from this run? local isMythicSegment, SegmentID = pastCombat:IsMythicDungeon() if (isMythicSegment and SegmentID == Details.mythic_dungeon_id and not pastCombat.is_boss) then local mythicDungeonInfo = pastCombat:GetMythicDungeonInfo() -- .is_mythic_dungeon only boss, trash overall and run overall have it if (not mythicDungeonInfo or not mythicDungeonInfo.TrashOverallSegment) then - --> trash segment found, schedule to merge + --trash segment found, schedule to merge tinsert (segmentsToMerge, pastCombat) end end end end - --> add encounter information + --add encounter information segmentsToMerge.EncounterID = encounterID segmentsToMerge.EncounterName = encounterName segmentsToMerge.PreviousBossKilledAt = Details.MythicPlus.PreviousBossKilledAt - --> reduce this boss encounter time from the trash lenght time, since the boss doesn't count towards the time spent cleaning trash + --reduce this boss encounter time from the trash lenght time, since the boss doesn't count towards the time spent cleaning trash segmentsToMerge.LastBossKilledAt = time() - _detalhes.tabela_vigente:GetCombatTime() DetailsMythicPlusFrame.TrashMergeScheduled = segmentsToMerge @@ -448,25 +448,25 @@ function DetailsMythicPlusFrame.BossDefeated (this_is_end_end, encounterID, enco --end end - --> close the combat + --close the combat if (this_is_end_end) then - --> player left the dungeon + --player left the dungeon if (in_combat and _detalhes.mythic_plus.always_in_combat) then Details:SairDoCombate() end else - --> re-enter in combat if details! is set to always be in combat during mythic plus + --re-enter in combat if details! is set to always be in combat during mythic plus if (Details.mythic_plus.always_in_combat) then Details:EntrarEmCombate() end - --> increase the segment number for the mythic run + --increase the segment number for the mythic run Details.MythicPlus.SegmentID = Details.MythicPlus.SegmentID + 1 - --> register the time when the last boss has been killed (started a clean up for the next trash) + --register the time when the last boss has been killed (started a clean up for the next trash) Details.MythicPlus.PreviousBossKilledAt = time() - --> update the saved table inside the profile + --update the saved table inside the profile _detalhes:UpdateState_CurrentMythicDungeonRun (true, Details.MythicPlus.SegmentID, Details.MythicPlus.PreviousBossKilledAt) end end @@ -483,7 +483,7 @@ function DetailsMythicPlusFrame.MythicDungeonFinished (fromZoneLeft) Details:UpdateState_CurrentMythicDungeonRun() - --> at this point, details! should not be in combat, but if something triggered a combat start, just close the combat right away + --at this point, details! should not be in combat, but if something triggered a combat start, just close the combat right away if (Details.in_combat) then if (DetailsMythicPlusFrame.DevelopmentDebug) then print ("Details!", "MythicDungeonFinished() > was in combat, calling SairDoCombate():", InCombatLockdown()) @@ -493,40 +493,40 @@ function DetailsMythicPlusFrame.MythicDungeonFinished (fromZoneLeft) local segmentsToMerge = {} - --> check if there is trash segments after the last boss. need to merge these segments with the trash segment of the last boss + --check if there is trash segments after the last boss. need to merge these segments with the trash segment of the last boss if (_detalhes.mythic_plus.merge_boss_trash and not Details.MythicPlus.IsRestoredState and not fromZoneLeft) then - --> is the current combat not a boss fight? - --> this mean a combat was opened after the last boss of the dungeon was killed + --is the current combat not a boss fight? + --this mean a combat was opened after the last boss of the dungeon was killed if (not Details.tabela_vigente.is_boss and Details.tabela_vigente:GetCombatTime() > 5) then if (DetailsMythicPlusFrame.DevelopmentDebug) then print ("Details!", "MythicDungeonFinished() > the last combat isn't a boss fight, might have trash after bosses done.") end - --> table with all past semgnets + --table with all past semgnets local segmentHistory = Details:GetCombatSegments() for i = 1, #segmentHistory do local pastCombat = segmentHistory [i] - --> does the combat exists + --does the combat exists if (pastCombat and not pastCombat._trashoverallalreadyadded and pastCombat:GetCombatTime() > 5) then - --> is the last boss? + --is the last boss? if (pastCombat.is_boss) then break end - --> is the combat a mythic segment from this run? + --is the combat a mythic segment from this run? local isMythicSegment, SegmentID = pastCombat:IsMythicDungeon() if (isMythicSegment and SegmentID == Details.mythic_dungeon_id and pastCombat.is_mythic_dungeon_trash) then - --> if have mythic dungeon info, cancel the loop + --if have mythic dungeon info, cancel the loop local mythicDungeonInfo = pastCombat:GetMythicDungeonInfo() if (mythicDungeonInfo) then break end - --> merge this segment + --merge this segment tinsert (segmentsToMerge, pastCombat) if (DetailsMythicPlusFrame.DevelopmentDebug) then @@ -543,7 +543,7 @@ function DetailsMythicPlusFrame.MythicDungeonFinished (fromZoneLeft) print ("Details!", "MythicDungeonFinished() > found ", #segmentsToMerge, "segments after the last boss") end - --> find the latest trash overall + --find the latest trash overall local segmentHistory = Details:GetCombatSegments() local latestTrashOverall for i = 1, #segmentHistory do @@ -555,7 +555,7 @@ function DetailsMythicPlusFrame.MythicDungeonFinished (fromZoneLeft) end if (latestTrashOverall) then - --> stores the segment table and the trash overall segment to use on the merge + --stores the segment table and the trash overall segment to use on the merge DetailsMythicPlusFrame.TrashMergeScheduled2 = segmentsToMerge DetailsMythicPlusFrame.TrashMergeScheduled2_OverallCombat = latestTrashOverall @@ -575,7 +575,7 @@ function DetailsMythicPlusFrame.MythicDungeonFinished (fromZoneLeft) end end - --> merge segments + --merge segments if (_detalhes.mythic_plus.make_overall_when_done and not Details.MythicPlus.IsRestoredState and not fromZoneLeft) then --if (not InCombatLockdown() and not UnitAffectingCombat ("player")) then if (DetailsMythicPlusFrame.DevelopmentDebug) then @@ -592,7 +592,7 @@ function DetailsMythicPlusFrame.MythicDungeonFinished (fromZoneLeft) Details.MythicPlus.IsRestoredState = nil - --> shutdown parser for a few seconds to avoid opening new segments after the run ends + --shutdown parser for a few seconds to avoid opening new segments after the run ends if (not fromZoneLeft) then Details:CaptureSet (false, "damage", false, 15) Details:CaptureSet (false, "energy", false, 15) @@ -601,7 +601,7 @@ function DetailsMythicPlusFrame.MythicDungeonFinished (fromZoneLeft) Details:CaptureSet (false, "spellcast", false, 15) end - --> store data + --store data --[=[ local expansion = tostring (select (4, GetBuildInfo())):match ("%d%d") if (expansion and type (expansion) == "string" and string.len (expansion) == 2) then @@ -623,10 +623,10 @@ function DetailsMythicPlusFrame.MythicDungeonFinished (fromZoneLeft) end function DetailsMythicPlusFrame.MythicDungeonStarted() - --> flag as a mythic dungeon + --flag as a mythic dungeon DetailsMythicPlusFrame.IsDoingMythicDungeon = true - --> this counter is individual for each character + --this counter is individual for each character Details.mythic_dungeon_id = Details.mythic_dungeon_id + 1 local mythicLevel = C_ChallengeMode.GetActiveKeystoneInfo() @@ -640,11 +640,11 @@ function DetailsMythicPlusFrame.MythicDungeonStarted() local ejID = DF.EncounterJournal.EJ_GetInstanceForMap (mapID) - --> setup the mythic run info + --setup the mythic run info Details.MythicPlus.Started = true Details.MythicPlus.DungeonName = zoneName Details.MythicPlus.DungeonID = currentZoneID - Details.MythicPlus.StartedAt = time()+9.7 --> there's the countdown timer of 10 seconds + Details.MythicPlus.StartedAt = time()+9.7 --there's the countdown timer of 10 seconds Details.MythicPlus.EndedAt = nil --reset Details.MythicPlus.SegmentID = 1 Details.MythicPlus.Level = mythicLevel @@ -653,7 +653,7 @@ function DetailsMythicPlusFrame.MythicDungeonStarted() Details:SaveState_CurrentMythicDungeonRun (Details.mythic_dungeon_id, zoneName, currentZoneID, time()+9.7, 1, mythicLevel, ejID, time()) - --> start a new combat segment after 10 seconds + --start a new combat segment after 10 seconds if (_detalhes.mythic_plus.always_in_combat) then C_Timer.After (9.7, function() if (DetailsMythicPlusFrame.DevelopmentDebug) then @@ -666,10 +666,10 @@ function DetailsMythicPlusFrame.MythicDungeonStarted() local name, groupType, difficultyID, difficult = GetInstanceInfo() if (groupType == "party" and Details.overall_clear_newchallenge) then Details.historico:resetar_overall() - Details:Msg ("overall data are now reset.") + Details:Msg("overall data are now reset.") if (Details.debug) then - Details:Msg ("(debug) timer is for a mythic+ dungeon, overall has been reseted.") + Details:Msg("(debug) timer is for a mythic+ dungeon, overall has been reseted.") end end @@ -680,17 +680,17 @@ function DetailsMythicPlusFrame.MythicDungeonStarted() end function DetailsMythicPlusFrame.OnChallengeModeStart() - --> is this a mythic dungeon? + --is this a mythic dungeon? local _, _, difficulty, _, _, _, _, currentZoneID = GetInstanceInfo() if (difficulty == 8 and DetailsMythicPlusFrame.LastTimer and DetailsMythicPlusFrame.LastTimer+2 > GetTime()) then - --> start the dungeon on Details! + --start the dungeon on Details! DetailsMythicPlusFrame.MythicDungeonStarted() --print("D! mythic dungeon started!") else --print("D! mythic dungeon was already started!") - --> from zone changed + --from zone changed local mythicLevel = C_ChallengeMode.GetActiveKeystoneInfo() local zoneName, _, _, _, _, _, _, currentZoneID = GetInstanceInfo() @@ -726,7 +726,7 @@ function DetailsMythicPlusFrame.EventListener.OnDetailsEvent (contextObject, eve elseif (event == "COMBAT_PLAYER_LEAVE") then - --> ignore the event if ignoring mythic dungeon special treatment + --ignore the event if ignoring mythic dungeon special treatment if (_detalhes.streamer_config.disable_mythic_dungeon) then return end @@ -737,10 +737,10 @@ function DetailsMythicPlusFrame.EventListener.OnDetailsEvent (contextObject, eve if (combatObject.is_boss) then if (not combatObject.is_boss.killed) then - --> just in case the combat get tagged as boss fight + --just in case the combat get tagged as boss fight Details.tabela_vigente.is_boss = nil - --> tag the combat as mythic dungeon trash + --tag the combat as mythic dungeon trash local zoneName, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceMapID, instanceGroupSize = GetInstanceInfo() Details.tabela_vigente.is_mythic_dungeon_trash = { ZoneName = zoneName, @@ -756,7 +756,7 @@ function DetailsMythicPlusFrame.EventListener.OnDetailsEvent (contextObject, eve end elseif (event == "COMBAT_ENCOUNTER_START") then - --> ignore the event if ignoring mythic dungeon special treatment + --ignore the event if ignoring mythic dungeon special treatment if (_detalhes.streamer_config.disable_mythic_dungeon) then return end @@ -765,7 +765,7 @@ function DetailsMythicPlusFrame.EventListener.OnDetailsEvent (contextObject, eve --nothing elseif (event == "COMBAT_ENCOUNTER_END") then - --> ignore the event if ignoring mythic dungeon special treatment + --ignore the event if ignoring mythic dungeon special treatment if (_detalhes.streamer_config.disable_mythic_dungeon) then return end @@ -788,12 +788,12 @@ function DetailsMythicPlusFrame.EventListener.OnDetailsEvent (contextObject, eve end end - --> ignore the event if ignoring mythic dungeon special treatment + --ignore the event if ignoring mythic dungeon special treatment if (_detalhes.streamer_config.disable_mythic_dungeon) then return end - --> reset spec cache if broadcaster requested + --reset spec cache if broadcaster requested if (_detalhes.streamer_config.reset_spec_cache) then wipe (_detalhes.cached_specs) end @@ -802,19 +802,19 @@ function DetailsMythicPlusFrame.EventListener.OnDetailsEvent (contextObject, eve elseif (event == "COMBAT_MYTHICDUNGEON_END") then - --> ignore the event if ignoring mythic dungeon special treatment + --ignore the event if ignoring mythic dungeon special treatment if (_detalhes.streamer_config.disable_mythic_dungeon) then return end - --> delay to wait the encounter_end trigger first - --> assuming here the party cleaned the mobs kill objective before going to kill the last boss + --delay to wait the encounter_end trigger first + --assuming here the party cleaned the mobs kill objective before going to kill the last boss C_Timer.After (2, DetailsMythicPlusFrame.MythicDungeonFinished) end end -DetailsMythicPlusFrame:SetScript ("OnEvent", function(_, event, ...) +DetailsMythicPlusFrame:SetScript("OnEvent", function(_, event, ...) if (event == "START_TIMER") then DetailsMythicPlusFrame.LastTimer = GetTime() @@ -826,7 +826,7 @@ DetailsMythicPlusFrame:SetScript ("OnEvent", function(_, event, ...) print ("Zone changed and is Doing Mythic Dungeon") end - --> ignore the event if ignoring mythic dungeon special treatment + --ignore the event if ignoring mythic dungeon special treatment if (_detalhes.streamer_config.disable_mythic_dungeon) then return end @@ -837,13 +837,13 @@ DetailsMythicPlusFrame:SetScript ("OnEvent", function(_, event, ...) print ("Zone changed and the zone is different than the dungeon") end - --> send mythic dungeon end event - _detalhes:SendEvent ("COMBAT_MYTHICDUNGEON_END") + --send mythic dungeon end event + _detalhes:SendEvent("COMBAT_MYTHICDUNGEON_END") - --> finish the segment + --finish the segment DetailsMythicPlusFrame.BossDefeated (true) - --> finish the mythic run + --finish the mythic run DetailsMythicPlusFrame.MythicDungeonFinished (true) end end diff --git a/functions/pack.lua b/functions/pack.lua index e6d05eca..f1b403ae 100644 --- a/functions/pack.lua +++ b/functions/pack.lua @@ -121,7 +121,7 @@ function Details.packFunctions.PackCombatData(combatObject, flags) Details.packFunctions.PackUtility(combatObject) end - --> prepare data to send over network + --prepare data to send over network local exportedString = flags .. "," --add the combat info @@ -572,7 +572,7 @@ function Details.packFunctions.PackDamage(combatObject) end -------------------------------------------------------------------------------------------------------------------------------- ---> unpack +--unpack --@currentCombat: details! combat object --@combatData: array with strings with combat information @@ -616,7 +616,7 @@ function Details.packFunctions.UnPackDamage(currentCombat, combatData, tablePosi actorObject.grupo = isActorInGroup(class, actorFlag) actorObject.flag_original = actorFlag - --> copy back the base damage + --copy back the base damage actorObject.total = tonumber(combatData[tablePosition+1]) --[2] actorObject.totalabsorbed = tonumber(combatData[tablePosition+2]) --[3] actorObject.damage_taken = tonumber(combatData[tablePosition+3]) --[4] @@ -625,7 +625,7 @@ function Details.packFunctions.UnPackDamage(currentCombat, combatData, tablePosi tablePosition = tablePosition + 6 --increase table position - --> copy back the actor spells + --copy back the actor spells --amount of indexes used to store spells for this actor local spellsSize = tonumber(combatData [tablePosition]) --[7] if (isDebugging) then @@ -822,7 +822,7 @@ function Details.packFunctions.PackHeal(combatObject) end -------------------------------------------------------------------------------------------------------------------------------- ---> unpack +--unpack function Details.packFunctions.UnPackHeal(currentCombat, combatData, tablePosition) @@ -864,7 +864,7 @@ function Details.packFunctions.UnPackHeal(currentCombat, combatData, tablePositi actorObject.grupo = isActorInGroup(class, actorFlag) actorObject.flag_original = actorFlag - --> copy the base healing + --copy the base healing actorObject.total = tonumber(combatData[tablePosition+1]) --[2] actorObject.totalabsorb = tonumber(combatData[tablePosition+2]) --[3] actorObject.totalover = tonumber(combatData[tablePosition+3]) --[4] @@ -873,7 +873,7 @@ function Details.packFunctions.UnPackHeal(currentCombat, combatData, tablePositi tablePosition = tablePosition + 6 - --> copy back the actor spells + --copy back the actor spells --amount of indexes used to store spells for this actor local spellsSize = tonumber(combatData [tablePosition]) --[7] if (isDebugging) then @@ -916,7 +916,7 @@ function Details.packFunctions.UnPackHeal(currentCombat, combatData, tablePositi end -------------------------------------------------------------------------------------------------- ---> pack utility data +--pack utility data --pack utility passes the player utility info + pets the player own --each player will also send an enemy, the enemy will be in order of raidIndex of the player @@ -1135,7 +1135,7 @@ function Details.packFunctions.PackUtility(combatObject) --]=] - --> cooldowns, pack player cooldowns used + --cooldowns, pack player cooldowns used actorUtilityInfo [#actorUtilityInfo + 1] = "C" local cooldownContainer = actor.cooldowns_defensive_spells and actor.cooldowns_defensive_spells._ActorTable local totalSpellIndexes = 0 @@ -1171,7 +1171,7 @@ function Details.packFunctions.PackUtility(combatObject) actorUtilityInfo [#actorUtilityInfo + 1] = 0 end - --> interrupts, pack player interrupts + --interrupts, pack player interrupts actorUtilityInfo [#actorUtilityInfo + 1] = "I" local interruptsContainer = actor.interrupt_spells and actor.interrupt_spells._ActorTable local totalSpellIndexes = 0 @@ -1219,7 +1219,7 @@ function Details.packFunctions.PackUtility(combatObject) actorUtilityInfo [#actorUtilityInfo + 1] = 0 end - --> cc break, pack player crowd control breaks + --cc break, pack player crowd control breaks actorUtilityInfo [#actorUtilityInfo + 1] = "B" local ccBreakContainer = actor.cc_break_spells and actor.cc_break_spells._ActorTable local totalSpellIndexes = 0 @@ -1267,7 +1267,7 @@ function Details.packFunctions.PackUtility(combatObject) actorUtilityInfo [#actorUtilityInfo + 1] = 0 end - --> dispel, pack player dispels done + --dispel, pack player dispels done actorUtilityInfo [#actorUtilityInfo + 1] = "D" local dispelsContainer = actor.dispell_spells and actor.dispell_spells._ActorTable local totalSpellIndexes = 0 @@ -1315,7 +1315,7 @@ function Details.packFunctions.PackUtility(combatObject) actorUtilityInfo [#actorUtilityInfo + 1] = 0 end - --> ress, pack player ress performed + --ress, pack player ress performed actorUtilityInfo [#actorUtilityInfo + 1] = "R" local ressContainer = actor.ress_spells and actor.ress_spells._ActorTable local totalSpellIndexes = 0 @@ -1402,7 +1402,7 @@ function Details.packFunctions.UnPackUtility(currentCombat, combatData, tablePos --D - dispels --R - ress - --> copy back the actor cooldowns spells + --copy back the actor cooldowns spells tablePosition = tablePosition + 1 tablePosition = tablePosition + 1 @@ -1449,7 +1449,7 @@ function Details.packFunctions.UnPackUtility(currentCombat, combatData, tablePos tablePosition = tablePosition + spellsSize --increase table position end - --> copy back the actor interrupts spells + --copy back the actor interrupts spells --tablePosition = tablePosition + 1 local startInterrupt = combatData[tablePosition] tablePosition = tablePosition + 1 @@ -1506,7 +1506,7 @@ function Details.packFunctions.UnPackUtility(currentCombat, combatData, tablePos tablePosition = tablePosition + spellsSize --increase table position end - --> copy back the actor cc break spells + --copy back the actor cc break spells --tablePosition = tablePosition + 1 local startCCBreak = combatData[tablePosition] tablePosition = tablePosition + 1 @@ -1564,7 +1564,7 @@ function Details.packFunctions.UnPackUtility(currentCombat, combatData, tablePos tablePosition = tablePosition + spellsSize --increase table position end - --> copy back the actor dispel spells + --copy back the actor dispel spells --tablePosition = tablePosition + 1 tablePosition = tablePosition + 1 @@ -1623,7 +1623,7 @@ function Details.packFunctions.UnPackUtility(currentCombat, combatData, tablePos --ress --ress_targets --ress_spells - --> copy back the actor ress spells + --copy back the actor ress spells --tablePosition = tablePosition + 1 tablePosition = tablePosition + 1 diff --git a/functions/plater.lua b/functions/plater.lua index ab02010d..decab52c 100644 --- a/functions/plater.lua +++ b/functions/plater.lua @@ -4,45 +4,45 @@ local Details = _G.Details -local plater_integration_frame = CreateFrame ("frame", "DetailsPlaterFrame", UIParent, "BackdropTemplate") +local plater_integration_frame = CreateFrame("frame", "DetailsPlaterFrame", UIParent, "BackdropTemplate") plater_integration_frame.DamageTaken = {} ---> aprox. 6 updates per second +--aprox. 6 updates per second local CONST_REALTIME_UPDATE_TIME = 0.166 ---> how many samples to store, 30 x .166 aprox 5 seconds buffer +--how many samples to store, 30 x .166 aprox 5 seconds buffer local CONST_BUFFER_SIZE = 30 ---> Dps division factor +--Dps division factor PLATER_DPS_SAMPLE_SIZE = CONST_BUFFER_SIZE * CONST_REALTIME_UPDATE_TIME ---> separate CLEU events from the Tick event for performance -plater_integration_frame.OnTickFrame = CreateFrame ("frame", "DetailsPlaterFrameOnTicker", UIParent, "BackdropTemplate") +--separate CLEU events from the Tick event for performance +plater_integration_frame.OnTickFrame = CreateFrame("frame", "DetailsPlaterFrameOnTicker", UIParent, "BackdropTemplate") ---> on tick function +--on tick function plater_integration_frame.OnTickFrameFunc = function(self, deltaTime) if (self.NextUpdate < 0) then for targetGUID, damageTable in pairs (plater_integration_frame.DamageTaken) do - --> total damage + --total damage local totalDamage = damageTable.TotalDamageTaken local totalDamageFromPlayer = damageTable.TotalDamageTakenFromPlayer - --> damage on this update + --damage on this update local damageOnThisUpdate = totalDamage - damageTable.LastTotalDamageTaken local damageOnThisUpdateFromPlayer = totalDamageFromPlayer - damageTable.LastTotalDamageTakenFromPlayer - --> update the last damage taken + --update the last damage taken damageTable.LastTotalDamageTaken = totalDamage damageTable.LastTotalDamageTakenFromPlayer = totalDamageFromPlayer - --> sum the current damage + --sum the current damage damageTable.CurrentDamage = damageTable.CurrentDamage + damageOnThisUpdate damageTable.CurrentDamageFromPlayer = damageTable.CurrentDamageFromPlayer + damageOnThisUpdateFromPlayer - --> add to the buffer the damage added + --add to the buffer the damage added tinsert (damageTable.RealTimeBuffer, 1, damageOnThisUpdate) tinsert (damageTable.RealTimeBufferFromPlayer, 1, damageOnThisUpdateFromPlayer) - --> remove the damage from the buffer + --remove the damage from the buffer local damageRemoved = tremove (damageTable.RealTimeBuffer, CONST_BUFFER_SIZE + 1) if (damageRemoved) then damageTable.CurrentDamage = max (damageTable.CurrentDamage - damageRemoved, 0) @@ -62,7 +62,7 @@ plater_integration_frame.OnTickFrameFunc = function(self, deltaTime) end ---> parse the damage taken by unit +--parse the damage taken by unit function plater_integration_frame.AddDamageToGUID (sourceGUID, targetGUID, time, amount) local damageTable = plater_integration_frame.DamageTaken [targetGUID] @@ -82,7 +82,7 @@ function plater_integration_frame.AddDamageToGUID (sourceGUID, targetGUID, time, CurrentDamageFromPlayer = 0, } - --> is the damage from the player it self? + --is the damage from the player it self? if (sourceGUID == plater_integration_frame.PlayerGUID) then plater_integration_frame.DamageTaken [targetGUID].TotalDamageTakenFromPlayer = amount end @@ -96,10 +96,10 @@ 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 + --tamage taken by the GUID unit if (token == "SPELL_DAMAGE" or token == "SPELL_PERIODIC_DAMAGE" or token == "RANGE_DAMAGE" or token == "DAMAGE_SHIELD") then plater_integration_frame.AddDamageToGUID (sourceGUID, targetGUID, time, amount) @@ -113,25 +113,25 @@ function Details:RefreshPlaterIntegration() if (Plater and Details.plater.realtime_dps_enabled or Details.plater.realtime_dps_player_enabled or Details.plater.damage_taken_enabled) then - --> wipe the cache + --wipe the cache wipe (plater_integration_frame.DamageTaken) - --> read cleu events + --read cleu events plater_integration_frame:RegisterEvent ("COMBAT_LOG_EVENT_UNFILTERED") - --> start the real time dps updater + --start the real time dps updater plater_integration_frame.OnTickFrame.NextUpdate = CONST_REALTIME_UPDATE_TIME - plater_integration_frame.OnTickFrame:SetScript ("OnUpdate", plater_integration_frame.OnTickFrameFunc) + plater_integration_frame.OnTickFrame:SetScript("OnUpdate", plater_integration_frame.OnTickFrameFunc) - --> cache the player serial + --cache the player serial plater_integration_frame.PlayerGUID = UnitGUID ("player") - --> cancel the timer if already have one + --cancel the timer if already have one if (plater_integration_frame.CleanUpTimer and not plater_integration_frame.CleanUpTimer:IsCancelled()) then plater_integration_frame.CleanUpTimer:Cancel() end - --> cleanup the old tables + --cleanup the old tables plater_integration_frame.CleanUpTimer = C_Timer.NewTicker (10, function() local now = time() for GUID, damageTable in pairs (plater_integration_frame.DamageTaken) do @@ -142,13 +142,13 @@ function Details:RefreshPlaterIntegration() end) else - --> unregister the cleu + --unregister the cleu plater_integration_frame:UnregisterEvent ("COMBAT_LOG_EVENT_UNFILTERED") - --> stop the real time updater - plater_integration_frame.OnTickFrame:SetScript ("OnUpdate", nil) + --stop the real time updater + plater_integration_frame.OnTickFrame:SetScript("OnUpdate", nil) - --> stop the cleanup process + --stop the cleanup process if (plater_integration_frame.CleanUpTimer and not plater_integration_frame.CleanUpTimer:IsCancelled()) then plater_integration_frame.CleanUpTimer:Cancel() end diff --git a/functions/playerclass.lua b/functions/playerclass.lua index fbfcb16c..a764daf6 100644 --- a/functions/playerclass.lua +++ b/functions/playerclass.lua @@ -42,7 +42,7 @@ do local _, class = _UnitClass (name) if (not class) then - for index, container in _ipairs (_detalhes.tabela_overall) do + for index, container in _ipairs(_detalhes.tabela_overall) do local index = container._NameIndexTable [name] if (index) then local actor = container._ActorTable [index] @@ -80,9 +80,9 @@ do if (self.classe) then c = self.classe - elseif (type (class) == "table" and class.classe) then + elseif (type(class) == "table" and class.classe) then c = class.classe - elseif (type (class) == "string") then + elseif (type(class) == "string") then c = class else c = "UNKNOW" @@ -122,10 +122,10 @@ do if (self.classe) then return unpack (_detalhes.class_colors [self.classe] or default_color) - elseif (type (class) == "table" and class.classe) then + elseif (type(class) == "table" and class.classe) then return unpack (_detalhes.class_colors [class.classe] or default_color) - elseif (type (class) == "string") then + elseif (type(class) == "string") then return unpack (_detalhes.class_colors [class] or default_color) elseif (self.color) then @@ -171,7 +171,7 @@ do return false end - if (Actor.spells) then --> correcao pros containers misc, precisa pegar os diferentes tipos de containers de l� + if (Actor.spells) then --correcao pros containers misc, precisa pegar os diferentes tipos de containers de l� for spellid, _ in _pairs (Actor.spells._ActorTable) do local class = _detalhes.ClassSpellList [spellid] if (class) then @@ -248,7 +248,7 @@ do end end - for index, container in _ipairs (_detalhes.tabela_overall) do + for index, container in _ipairs(_detalhes.tabela_overall) do local index = container._NameIndexTable [name] if (index) then local actor = container._ActorTable [index] @@ -292,7 +292,7 @@ do local Actor, container = t[1], t[2] local SpecSpellList = _detalhes.SpecSpellList - --> get from the spell cast list + --get from the spell cast list if (_detalhes.tabela_vigente) then local misc_actor = _detalhes.tabela_vigente (4, Actor.nome) if (misc_actor and misc_actor.spell_cast) then @@ -402,7 +402,7 @@ do --local misc_actor = info.instancia.showing (4, self:name()) --spell_cast - --> get from the spec cache + --get from the spec cache local spec = _detalhes.cached_specs [Actor.serial] if (spec) then Actor.spec = spec @@ -422,7 +422,7 @@ do return spec end - --> get from the spell cast list + --get from the spell cast list if (_detalhes.tabela_vigente) then local misc_actor = _detalhes.tabela_vigente (4, Actor.nome) @@ -452,7 +452,7 @@ do end end else - if (Actor.spells) then --> correcao pros containers misc, precisa pegar os diferentes tipos de containers de l� + if (Actor.spells) then --correcao pros containers misc, precisa pegar os diferentes tipos de containers de l� for spellid, _ in _pairs (Actor.spells._ActorTable) do local spec = SpecSpellList [spellid] if (spec) then @@ -480,7 +480,7 @@ do end else - if (Actor.spells) then --> correcao pros containers misc, precisa pegar os diferentes tipos de containers de l� + if (Actor.spells) then --correcao pros containers misc, precisa pegar os diferentes tipos de containers de l� for spellid, _ in _pairs (Actor.spells._ActorTable) do local spec = SpecSpellList [spellid] if (spec) then @@ -583,26 +583,26 @@ end function _detalhes:AddColorString (player_name, class) - --> check if the class colors exists + --check if the class colors exists local classColors = _G.RAID_CLASS_COLORS if (classColors) then local color = classColors [class] - --> check if the player name is valid - if (type (player_name) == "string" and color) then + --check if the player name is valid + if (type(player_name) == "string" and color) then player_name = "|c" .. color.colorStr .. player_name .. "|r" return player_name end end - --> if failed, return the player name without modifications + --if failed, return the player name without modifications return player_name end function _detalhes:AddRoleIcon (player_name, role, size) - --> check if is a valid role + --check if is a valid role local roleIcon = _detalhes.role_texcoord [role] - if (type (player_name) == "string" and roleIcon and role ~= "NONE") then - --> add the role icon + if (type(player_name) == "string" and roleIcon and role ~= "NONE") then + --add the role icon size = size or 14 player_name = "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. size .. ":" .. size .. ":0:0:256:256:" .. roleIcon .. "|t " .. player_name return player_name diff --git a/functions/profiles.lua b/functions/profiles.lua index d1b98708..7e744d7d 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -6,24 +6,24 @@ local _ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> Profiles: - --> return the current profile name +--Profiles: + --return the current profile name function _detalhes:GetCurrentProfileName() - --> check is have a profile name + --check is have a profile name if (_detalhes_database.active_profile == "") then -- or not _detalhes_database.active_profile local character_key = UnitName ("player") .. "-" .. GetRealmName() _detalhes_database.active_profile = character_key end - --> end + --end return _detalhes_database.active_profile end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> Profiles: - --> create a new profile +--Profiles: + --create a new profile function _detalhes:CreateProfile (name) @@ -31,46 +31,46 @@ function _detalhes:CreateProfile (name) return false end - --> check if already exists + --check if already exists if (_detalhes_global.__profiles [name]) then return false end - --> copy the default table + --copy the default table local new_profile = Details.CopyTable (_detalhes.default_profile) new_profile.instances = {} - --> add to global container + --add to global container _detalhes_global.__profiles [name] = new_profile - --> end + --end return new_profile end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> Profiles: - --> return the list os all profiles +--Profiles: + --return the list os all profiles function _detalhes:GetProfileList() - --> build the table + --build the table local t = {} for name, profile in pairs (_detalhes_global.__profiles) do t [#t + 1] = name end - --> end + --end return t end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> Profiles: - --> delete a profile +--Profiles: + --delete a profile function _detalhes:EraseProfile (profile_name) - --> erase profile table + --erase profile table _detalhes_global.__profiles [profile_name] = nil if (_detalhes_database.active_profile == profile_name) then @@ -88,17 +88,17 @@ function _detalhes:EraseProfile (profile_name) end - --> end + --end return true end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> Profiles: - --> return the profile table requested +--Profiles: + --return the profile table requested function _detalhes:GetProfile (name, create) - --> get the profile, create and return + --get the profile, create and return if (not name) then name = _detalhes:GetCurrentProfileName() end @@ -113,7 +113,7 @@ function _detalhes:GetProfile (name, create) end - --> end + --end return profile end @@ -125,7 +125,7 @@ function _detalhes:SetProfileCProp (name, cprop, value) local profile = _detalhes:GetProfile (name, false) if (profile) then - if (type (value) == "table") then + if (type(value) == "table") then rawset (profile, cprop, Details.CopyTable (value)) else rawset (profile, cprop, value) @@ -136,18 +136,18 @@ function _detalhes:SetProfileCProp (name, cprop, value) end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> Profiles: - --> reset the profile +--Profiles: + --reset the profile function _detalhes:ResetProfile (profile_name) - --> get the profile + --get the profile local profile = _detalhes:GetProfile (profile_name, true) if (not profile) then return false end - --> reset all already created instances + --reset all already created instances for index, instance in _detalhes:ListInstances() do if (not instance.baseframe) then instance:AtivarInstancia() @@ -164,10 +164,10 @@ function _detalhes:ResetProfile (profile_name) instance:ChangeSkin(_detalhes.default_skin_to_use) end - --> reset the profile + --reset the profile table.wipe (profile.instances) - --> export first instance + --export first instance local instance = _detalhes:GetInstance (1) local exported = instance:ExportSkin() exported.__was_opened = instance:IsEnabled() @@ -183,24 +183,24 @@ function _detalhes:ResetProfile (profile_name) _detalhes:ApplyProfile (profile_name, true) - --> end + --end return true end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> Profiles: - --> return the profile table requested +--Profiles: + --return the profile table requested function _detalhes:CreatePanicWarning() - _detalhes.instance_load_failed = CreateFrame ("frame", "DetailsPanicWarningFrame", UIParent,"BackdropTemplate") - _detalhes.instance_load_failed:SetHeight (80) + _detalhes.instance_load_failed = CreateFrame("frame", "DetailsPanicWarningFrame", UIParent,"BackdropTemplate") + _detalhes.instance_load_failed:SetHeight(80) --tinsert (UISpecialFrames, "DetailsPanicWarningFrame") _detalhes.instance_load_failed.text = _detalhes.instance_load_failed:CreateFontString (nil, "overlay", "GameFontNormal") - _detalhes.instance_load_failed.text:SetPoint ("center", _detalhes.instance_load_failed, "center") + _detalhes.instance_load_failed.text:SetPoint("center", _detalhes.instance_load_failed, "center") _detalhes.instance_load_failed.text:SetTextColor (1, 0.6, 0) - _detalhes.instance_load_failed:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - _detalhes.instance_load_failed:SetBackdropColor (1, 0, 0, 0.2) - _detalhes.instance_load_failed:SetPoint ("topleft", UIParent, "topleft", 0, -250) - _detalhes.instance_load_failed:SetPoint ("topright", UIParent, "topright", 0, -250) + _detalhes.instance_load_failed:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + _detalhes.instance_load_failed:SetBackdropColor(1, 0, 0, 0.2) + _detalhes.instance_load_failed:SetPoint("topleft", UIParent, "topleft", 0, -250) + _detalhes.instance_load_failed:SetPoint("topright", UIParent, "topright", 0, -250) end local safe_load = function(func, param1, ...) @@ -210,17 +210,17 @@ local safe_load = function(func, param1, ...) _detalhes:CreatePanicWarning() end _detalhes.do_not_save_skins = true - _detalhes.instance_load_failed.text:SetText ("Failed to load a Details! window.\n/reload or reboot the game client may fix the problem.\nIf the problem persist, try /details reinstall.\nError: " .. errortext .. "") + _detalhes.instance_load_failed.text:SetText("Failed to load a Details! window.\n/reload or reboot the game client may fix the problem.\nIf the problem persist, try /details reinstall.\nError: " .. errortext .. "") end return okey end function _detalhes:ApplyProfile (profile_name, nosave, is_copy) - --> get the profile + --get the profile local profile = _detalhes:GetProfile (profile_name, true) - --> if the profile doesn't exist, just quit + --if the profile doesn't exist, just quit if (not profile) then _detalhes:Msg ("Profile Not Found.") return false @@ -228,34 +228,34 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy) profile.ocd_tracker = nil --moved to local character saved - --> always save the previous profile, except if nosave flag is up + --always save the previous profile, except if nosave flag is up if (not nosave) then - --> salva o profile ativo no momento + --salva o profile ativo no momento _detalhes:SaveProfile() end - --> update profile keys before go + --update profile keys before go for key, value in pairs (_detalhes.default_profile) do - --> the entire key doesn't exist + --the entire key doesn't exist if (profile [key] == nil) then - if (type (value) == "table") then + if (type(value) == "table") then profile [key] = Details.CopyTable (_detalhes.default_profile [key]) else profile [key] = value end - --> the key exist and is a table, check for missing values on sub tables - elseif (type (value) == "table") then - --> deploy only copy non existing data + --the key exist and is a table, check for missing values on sub tables + elseif (type(value) == "table") then + --deploy only copy non existing data _detalhes.table.deploy (profile [key], value) end end - --> apply the profile values + --apply the profile values for key, _ in pairs (_detalhes.default_profile) do local value = profile [key] - if (type (value) == "table") then + if (type(value) == "table") then if (key == "class_specs_coords") then value = Details.CopyTable (_detalhes.default_profile.class_specs_coords) end @@ -267,21 +267,21 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy) end end - --> set the current profile + --set the current profile if (not is_copy) then _detalhes.active_profile = profile_name _detalhes_database.active_profile = profile_name end - --> apply the skin + --apply the skin - --> first save the local instance configs + --first save the local instance configs _detalhes:SaveLocalInstanceConfig() local saved_skins = profile.instances local instance_limit = _detalhes.instances_amount - --> then close all opened instances + --then close all opened instances for index, instance in _detalhes:ListInstances() do if (not getmetatable (instance)) then instance.iniciada = false @@ -294,20 +294,20 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy) end end - --> check if there is a skin saved or this is a empty profile + --check if there is a skin saved or this is a empty profile if (#saved_skins == 0) then local instance1 = _detalhes:GetInstance (1) if (not instance1) then instance1 = _detalhes:CreateInstance (1) end - --> apply default config on this instance (flat skin texture was 'ResetInstanceConfig' running). + --apply default config on this instance (flat skin texture was 'ResetInstanceConfig' running). instance1.modo = 2 instance1:ResetInstanceConfig() instance1.skin = "no skin" instance1:ChangeSkin (_detalhes.default_skin_to_use) - --> release the snap and lock + --release the snap and lock instance1:LoadLocalInstanceConfig() instance1.snap = {} instance1.horizontalSnap = nil @@ -323,40 +323,40 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy) end else - --> load skins + --load skins local instances_loaded = 0 - for index, skin in ipairs (saved_skins) do + for index, skin in ipairs(saved_skins) do if (instance_limit < index) then break end - --> get the instance + --get the instance local instance = _detalhes:GetInstance (index) if (not instance) then - --> create a instance without creating its frames (not initializing) + --create a instance without creating its frames (not initializing) instance = _detalhes:CreateDisabledInstance (index, skin) end - --> copy skin + --copy skin for key, value in pairs (skin) do - if (type (value) == "table") then + if (type(value) == "table") then instance [key] = Details.CopyTable (value) else instance [key] = value end end - --> apply default values if some key is missing + --apply default values if some key is missing instance:LoadInstanceConfig() - --> reset basic config + --reset basic config instance.snap = {} instance.horizontalSnap = nil instance.verticalSnap = nil instance:LockInstance (false) - --> load data saved for this character only + --load data saved for this character only instance:LoadLocalInstanceConfig() if (skin.__was_opened) then if (not safe_load (_detalhes.AtivarInstancia, instance, nil, true)) then @@ -368,9 +368,9 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy) instance.modo = instance.modo or 2 - --> load data saved again + --load data saved again instance:LoadLocalInstanceConfig() - --> check window positioning + --check window positioning if (_detalhes.profile_save_pos) then --print ("is profile save pos", skin.__pos.normal.x, skin.__pos.normal.y) if (skin.__pos) then @@ -397,7 +397,7 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy) end end - --> open the instance + --open the instance if (instance:IsEnabled()) then if (not instance.baseframe) then instance:AtivarInstancia() @@ -418,7 +418,7 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy) instances_loaded = instances_loaded + 1 end - --> move unused instances for unused container + --move unused instances for unused container if (#_detalhes.tabela_instancias > instances_loaded) then for i = #_detalhes.tabela_instancias, instances_loaded+1, -1 do _detalhes.unused_instances [i] = _detalhes.tabela_instancias [i] @@ -426,22 +426,22 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy) end end - --> check all snaps for invalid entries + --check all snaps for invalid entries for i = 1, instances_loaded do local instance = _detalhes:GetInstance (i) local previous_instance_id = _detalhes:GetInstance (i-1) and _detalhes:GetInstance (i-1):GetId() or 0 local next_instance_id = _detalhes:GetInstance (i+1) and _detalhes:GetInstance (i+1):GetId() or 0 for snap_side, instance_id in pairs (instance.snap) do - if (instance_id < 1) then --> invalid instance + if (instance_id < 1) then --invalid instance instance.snap [snap_side] = nil - elseif (instance_id ~= previous_instance_id and instance_id ~= next_instance_id) then --> no match + elseif (instance_id ~= previous_instance_id and instance_id ~= next_instance_id) then --no match instance.snap [snap_side] = nil end end end - --> auto realign windows + --auto realign windows if (not _detalhes.initializing) then for _, instance in _detalhes:ListInstances() do if (instance:IsEnabled()) then @@ -450,7 +450,7 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy) end end else - --> is in startup + --is in startup for _, instance in _detalhes:ListInstances() do for side, id in pairs (instance.snap) do local window = _detalhes.tabela_instancias [id] @@ -475,7 +475,7 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy) end - --> check instance amount + --check instance amount _detalhes.opened_windows = 0 for index = 1, _detalhes.instances_amount do local instance = _detalhes.tabela_instancias [index] @@ -484,22 +484,22 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy) end end - --> update tooltip settings + --update tooltip settings _detalhes:SetTooltipBackdrop() - --> update player detail window + --update player detail window _detalhes:ApplyPDWSkin() - --> update the numerical system + --update the numerical system _detalhes:SelectNumericalSystem() - --> refresh the update interval + --refresh the update interval _detalhes:RefreshUpdater() - --> refresh animation functions + --refresh animation functions _detalhes:RefreshAnimationFunctions() - --> refresh broadcaster tools + --refresh broadcaster tools _detalhes:LoadFramesForBroadcastTools() if (_detalhes.initializing) then @@ -510,12 +510,12 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy) end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> Profiles: - --> return the profile table requested +--Profiles: + --return the profile table requested function _detalhes:SaveProfile (saveas) - --> get the current profile + --get the current profile local profile_name @@ -527,12 +527,12 @@ function _detalhes:SaveProfile (saveas) local profile = _detalhes:GetProfile (profile_name, true) - --> save default keys + --save default keys for key, _ in pairs (_detalhes.default_profile) do local current_value = _detalhes [key] - if (type (current_value) == "table") then + if (type(current_value) == "table") then local ctable = Details.CopyTable (current_value) profile [key] = ctable else @@ -863,19 +863,19 @@ local default_profile = { fade_speed = 0.15, use_self_color = false, - --> minimap + --minimap minimap = {hide = false, radius = 160, minimapPos = 220, onclick_what_todo = 1, text_type = 1, text_format = 3}, data_broker_text = "", - --> hotcorner + --hotcorner hotcorner_topleft = {hide = false}, - --> PvP + --PvP only_pvp_frags = false, color_by_arena_team = true, show_arena_role_icon = false, --deprecated: this has been moved to instance settings 05.06.22 (tercio) - --> window settings + --window settings max_window_size = {width = 480, height = 450}, new_window_size = {width = 310, height = 158}, window_clamp = {-8, 0, 21, -14}, @@ -887,7 +887,7 @@ local default_profile = { disable_alldisplays_window = false, damage_taken_everything = false, - --> info window + --info window player_details_window = { skin = "ElvUI", bar_texture = "Skyline", @@ -898,13 +898,13 @@ local default_profile = { scale = 1, }, - --> segments + --segments segments_amount = 40, segments_amount_to_save = 40, segments_panic_mode = false, segments_auto_erase = 1, - --> instances + --instances instances_amount = 5, instances_segments_locked = true, instances_disable_bar_highlight = false, @@ -912,16 +912,16 @@ local default_profile = { instances_no_libwindow = false, instances_suppress_trash = 0, - --> if clear ungroup characters when logout + --if clear ungroup characters when logout clear_ungrouped = true, - --> if clear graphic data when logout + --if clear graphic data when logout clear_graphic = true, - --> item level tracker + --item level tracker track_item_level = false, - --> text settings + --text settings font_sizes = {menus = 10}, font_faces = {menus = "Friz Quadrata TT"}, ps_abbreviation = 3, @@ -929,7 +929,7 @@ local default_profile = { numerical_system = 1, numerical_system_symbols = "auto", - --> performance + --performance use_row_animations = true, --default animation speed - % per second animation_speed = 33, @@ -953,28 +953,28 @@ local default_profile = { trash_auto_remove = false, world_combat_is_trash = false, - --> death log + --death log deadlog_limit = 16, deadlog_events = 32, - --> report + --report report_lines = 5, report_to_who = "", report_heal_links = false, report_schema = 1, deny_score_messages = false, - --> colors + --colors default_bg_color = 0.0941, default_bg_alpha = 0.5, - --> fades + --fades row_fade_in = {"in", 0.2}, windows_fade_in = {"in", 0.2}, row_fade_out = {"out", 0.2}, windows_fade_out = {"out", 0.2}, - --> captures + --captures capture_real = { ["damage"] = true, ["heal"] = true, @@ -984,13 +984,13 @@ local default_profile = { ["spellcast"] = true, }, - --> bookmark + --bookmark bookmark_text_size = 11, - --> cloud capture + --cloud capture cloud_capture = true, - --> combat + --combat minimum_combat_time = 5, --combats with less then this in elapsed time is discarted minimum_overall_combat_time = 10, --minimum time the combat must have to be added into the overall data overall_flag = 0x10, @@ -1008,7 +1008,7 @@ local default_profile = { override_spellids = true, all_players_are_group = false, - --> skins + --skins standard_skin = false, skin = "Minimalistic", profile_save_pos = true, @@ -1022,10 +1022,10 @@ local default_profile = { y_offset = 0, }, - --> broadcaster options + --broadcaster options broadcaster_enabled = false, - --> event tracker + --event tracker event_tracker = { frame = { locked = false, @@ -1046,7 +1046,7 @@ local default_profile = { line_color = {.1, .1, .1, 0.3}, }, - --> current damage + --current damage realtime_dps_meter = { frame_settings = { locked = true, @@ -1075,7 +1075,7 @@ local default_profile = { sample_size = 3, --in seconds }, - --> streamer + --streamer -- _detalhes.streamer_config. streamer_config = { reset_spec_cache = false, @@ -1086,7 +1086,7 @@ local default_profile = { use_animation_accel = true, }, - --> tooltip + --tooltip tooltip = { fontface = "Friz Quadrata TT", fontsize = 10, @@ -1141,7 +1141,7 @@ local default_player_data = { last_coach_name = false, }, - --> ocd tracker test + --ocd tracker test ocd_tracker = { enabled = false, cooldowns = {}, @@ -1165,10 +1165,10 @@ local default_player_data = { lines_per_column = 12, }, - --> force all fonts to have this outline + --force all fonts to have this outline force_font_outline = "", - --> current combat number + --current combat number cached_specs = {}, cached_talents = {}, cached_roles = {}, @@ -1191,26 +1191,26 @@ local default_player_data = { ej_id = 0, previous_boss_killed_at = 0, }, - --> nicktag cache + --nicktag cache nick_tag_cache = {}, ignore_nicktag = false, - --> plugin data + --plugin data plugin_database = {}, - --> information about this character + --information about this character character_data = {logons = 0}, - --> version + --version last_realversion = _detalhes.realversion, last_version = "v1.0.0", - --> profile + --profile active_profile = "", - --> plugins tables + --plugins tables SoloTablesSaved = {}, RaidTablesSaved = {}, - --> saved skins + --saved skins savedStyles = {}, - --> instance config + --instance config local_instances_config = {}, - --> announcements + --announcements announce_deaths = { enabled = false, only_first = 5, @@ -1243,18 +1243,18 @@ local default_player_data = { enabled = true, channel = "SELF", }, - --> benchmark + --benchmark benchmark_db = { frame = {}, }, - --> rank + --rank rank_window = { last_difficulty = 15, last_raid = "", }, - --> death panel buttons + --death panel buttons on_death_menu = false, } @@ -1262,7 +1262,7 @@ _detalhes.default_player_data = default_player_data local default_global_data = { - --> profile pool + --profile pool __profiles = {}, latest_news_saw = "", always_use_profile = false, @@ -1296,31 +1296,31 @@ local default_global_data = { current_exp_raid_encounters = {}, installed_skins_cache = {}, - --> spell category feedback + --spell category feedback spell_category_savedtable = {}, spell_category_latest_query = 0, spell_category_latest_save = 0, spell_category_latest_sent = 0, - --> class time played + --class time played class_time_played = {}, - --> keystone cache + --keystone cache keystone_cache = {}, - --> all switch settings (panel shown when right click the title bar) + --all switch settings (panel shown when right click the title bar) all_switch_config = { scale = 1, font_size = 10, }, - --> keystone window + --keystone window keystone_frame = { scale = 1, position = {}, }, - --> aura tracker panel + --aura tracker panel aura_tracker_frame = { position = {}, --for libwindow scaletable = { @@ -1328,16 +1328,16 @@ local default_global_data = { }, }, - --> profile by spec + --profile by spec profile_by_spec = {}, - --> displays by spec + --displays by spec displays_by_spec = {}, - --> death log + --death log show_totalhitdamage_on_overkill = false, - --> switch tables + --switch tables switchSaved = {slots = 4, table = { {["atributo"] = 1, ["sub_atributo"] = 1}, --damage done {["atributo"] = 2, ["sub_atributo"] = 1}, --healing done @@ -1346,7 +1346,7 @@ local default_global_data = { }}, report_pos = {1, 1}, - --> tutorial + --tutorial tutorial = { logons = 0, unlock_button = 0, @@ -1368,16 +1368,16 @@ local default_global_data = { ["Dungeon"] = {enabled = false, update_speed = 1, use_row_animations = false, damage = true, heal = true, aura = true, energy = false, miscdata = true}, }, - --> auras (wa auras created from the aura panel) + --auras (wa auras created from the aura panel) details_auras = {}, - --> ilvl + --ilvl item_level_pool = {}, - --> latest report + --latest report latest_report_table = {}, - --> death recap + --death recap death_recap = { enabled = true, relevance_time = 7, @@ -1392,14 +1392,14 @@ local default_global_data = { encounter_spell_pool = {}, npcid_pool = {}, - --> aura creation frame libwindow + --aura creation frame libwindow createauraframe = {}, - --> min health done on the death report + --min health done on the death report deathlog_healingdone_min = 1, deathlog_healingdone_min_arena = 400, - --> mythic plus config + --mythic plus config mythic_plus = { always_in_combat = false, -- merge_boss_trash = true, -- @@ -1416,10 +1416,10 @@ local default_global_data = { mythicrun_chart_frame_ready = {}, }, - --> plugin window positions + --plugin window positions plugin_window_pos = {}, - --> run code + --run code run_code = { ["on_specchanged"] = "\n-- run when the player changes its spec", ["on_zonechanged"] = "\n-- when the player changes zone, this code will run", @@ -1429,7 +1429,7 @@ local default_global_data = { ["on_groupchange"] = "\n-- this code runs when the player enter or leave a group", }, - --> plater integration + --plater integration plater = { realtime_dps_enabled = false, realtime_dps_size = 12, @@ -1451,18 +1451,18 @@ local default_global_data = { }, - --> dungeon information - can be accessed by plugins and third party mods + --dungeon information - can be accessed by plugins and third party mods dungeon_data = {}, - --> raid information - can be accessed by plugins and third party mods + --raid information - can be accessed by plugins and third party mods raid_data = {}, - --> store all npcids blacklisted by the user + --store all npcids blacklisted by the user npcid_ignored = {}, - --> store all spellids blacklisted by the user + --store all spellids blacklisted by the user spellid_ignored = {}, - --> 9.0 exp (store data only used for the 9.0 expansion) + --9.0 exp (store data only used for the 9.0 expansion) exp90temp = { delete_damage_TCOB = true, --delete damage on the concil of blood encounter }, @@ -1471,7 +1471,7 @@ local default_global_data = { _detalhes.default_global_data = default_global_data function _detalhes:GetTutorialCVar (key, default) - --> is disabling all popups from the streamer options + --is disabling all popups from the streamer options if (_detalhes.streamer_config.no_alerts) then return true end @@ -1489,16 +1489,16 @@ end function _detalhes:SaveProfileSpecial() - --> get the current profile + --get the current profile local profile_name = _detalhes:GetCurrentProfileName() local profile = _detalhes:GetProfile (profile_name, true) - --> save default keys + --save default keys for key, _ in pairs (_detalhes.default_profile) do local current_value = _detalhes_database [key] or _detalhes_global [key] or _detalhes.default_player_data [key] or _detalhes.default_global_data [key] - if (type (current_value) == "table") then + if (type(current_value) == "table") then local ctable = Details.CopyTable (current_value) profile [key] = ctable else @@ -1507,21 +1507,21 @@ function _detalhes:SaveProfileSpecial() end - --> save skins + --save skins table.wipe (profile.instances) if (_detalhes.tabela_instancias) then - for index, instance in ipairs (_detalhes.tabela_instancias) do + for index, instance in ipairs(_detalhes.tabela_instancias) do local exported = instance:ExportSkin() profile.instances [index] = exported end end - --> end + --end return profile end ---> save things for the mythic dungeon run +--save things for the mythic dungeon run function _detalhes:SaveState_CurrentMythicDungeonRun (runID, zoneName, zoneID, startAt, segmentID, level, ejID, latestBossAt) local savedTable = _detalhes.mythic_dungeon_currentsaved savedTable.started = true @@ -1574,13 +1574,13 @@ function _detalhes:RestoreState_CurrentMythicDungeonRun() ejID = DetailsFramework.EncounterJournal.EJ_GetInstanceForMap (mapID) or 0 end - --> is there a saved state for the dungeon? + --is there a saved state for the dungeon? if (savedTable.started) then - --> player are within the same zone? + --player are within the same zone? if (zoneName == savedTable.dungeon_name and currentZoneID == savedTable.dungeon_zone_id) then - --> is there a mythic run ongoing and the level is the same as the saved state? + --is there a mythic run ongoing and the level is the same as the saved state? if (mythicLevel and mythicLevel == savedTable.level) then - --> restore the state + --restore the state _detalhes.MythicPlus.Started = true _detalhes.MythicPlus.DungeonName = zoneName _detalhes.MythicPlus.DungeonID = currentZoneID @@ -1595,7 +1595,7 @@ function _detalhes:RestoreState_CurrentMythicDungeonRun() print("D! (debug) mythic dungeon state restored.") C_Timer.After (2, function() - _detalhes:SendEvent ("COMBAT_MYTHICDUNGEON_START") + _detalhes:SendEvent("COMBAT_MYTHICDUNGEON_START") end) return else @@ -1605,7 +1605,7 @@ function _detalhes:RestoreState_CurrentMythicDungeonRun() print("D! (debug) zone name or zone Id isn't the same:", zoneName, savedTable.dungeon_name, currentZoneID, savedTable.dungeon_zone_id) end - --> mythic run is over + --mythic run is over savedTable.started = false else --print("D! savedTable.stated isn't true.") @@ -1668,7 +1668,7 @@ function Details:ExportCurrentProfile() --data saved inside the profile local profileObject = Details:GetProfile (Details:GetCurrentProfileName()) if (not profileObject) then - Details:Msg ("fail to get the current profile.") + Details:Msg("fail to get the current profile.") return false end @@ -1682,7 +1682,7 @@ function Details:ExportCurrentProfile() --fill player and global data tables for key, _ in pairs (defaultPlayerData) do if (not exportProfileBlacklist[key]) then - if (type (Details[key]) == "table") then + if (type(Details[key]) == "table") then playerData [key] = DetailsFramework.table.copy ({}, Details[key]) else playerData [key] = Details[key] @@ -1691,7 +1691,7 @@ function Details:ExportCurrentProfile() end for key, _ in pairs (defaultGlobalData) do if (not exportProfileBlacklist[key]) then - if (type (Details[key]) == "table") then + if (type(Details[key]) == "table") then globaData [key] = DetailsFramework.table.copy ({}, Details[key]) else globaData [key] = Details[key] @@ -1713,7 +1713,7 @@ end function Details:ImportProfile (profileString, newProfileName) if (not newProfileName or type (newProfileName) ~= "string" or string.len (newProfileName) < 2) then - Details:Msg ("invalid profile name or profile name is too short.") --localize-me + Details:Msg("invalid profile name or profile name is too short.") --localize-me return end @@ -1728,7 +1728,7 @@ function Details:ImportProfile (profileString, newProfileName) --profile doesn't exists, create new profileObject = Details:CreateProfile (newProfileName) if (not profileObject) then - Details:Msg ("failed to create a new profile.")--localize-me + Details:Msg("failed to create a new profile.")--localize-me return end end @@ -1750,7 +1750,7 @@ function Details:ImportProfile (profileString, newProfileName) for key, _ in pairs (defaultPlayerData) do local importedValue = playerData[key] if (importedValue ~= nil) then - if (type (importedValue) == "table") then + if (type(importedValue) == "table") then Details [key] = DetailsFramework.table.copy ({}, importedValue) else Details [key] = importedValue @@ -1761,7 +1761,7 @@ function Details:ImportProfile (profileString, newProfileName) for key, _ in pairs (defaultGlobalData) do local importedValue = globalData[key] if (importedValue ~= nil) then - if (type (importedValue) == "table") then + if (type(importedValue) == "table") then Details [key] = DetailsFramework.table.copy ({}, importedValue) else Details [key] = importedValue @@ -1773,7 +1773,7 @@ function Details:ImportProfile (profileString, newProfileName) for key, _ in pairs (defaultProfileData) do local importedValue = profileData[key] if (importedValue ~= nil) then - if (type (importedValue) == "table") then + if (type(importedValue) == "table") then profileObject [key] = DetailsFramework.table.copy ({}, importedValue) else profileObject [key] = importedValue @@ -1811,10 +1811,10 @@ function Details:ImportProfile (profileString, newProfileName) end - Details:Msg ("profile successfully imported.")--localize-me + Details:Msg("profile successfully imported.")--localize-me return true else - Details:Msg ("failed to decompress profile data.")--localize-me + Details:Msg("failed to decompress profile data.")--localize-me end end diff --git a/functions/raidinfo.lua b/functions/raidinfo.lua index f5eee559..b64742b1 100644 --- a/functions/raidinfo.lua +++ b/functions/raidinfo.lua @@ -1,6 +1,6 @@ ---> install data for raiding tiers +--install data for raiding tiers local C_Timer = _G.C_Timer local DetailsFramework = _G.DetailsFramework @@ -9,7 +9,7 @@ local tinsert = _G.tinsert function Details.InstallRaidInfo() do - --> data for Sanctum of Domination (Shadowlands tier 1) + --data for Sanctum of Domination (Shadowlands tier 1) local INSTANCE_EJID = 1193 local INSTANCE_MAPID = 2450 local HDIMAGESPATH = [[Details\images\raid]] @@ -93,7 +93,7 @@ function Details.InstallRaidInfo() end do - --> data for Castle Nathria (Shadowlands tier 1) + --data for Castle Nathria (Shadowlands tier 1) --F:\World of Warcraft\_retail_\BlizzardInterfaceArt\Interface\GLUES\LOADINGSCREENS\Expansion07\Main\LOADINGSCREEN_NzothRAID local INSTANCE_EJID = 1190 local INSTANCE_MAPID = 2296 diff --git a/functions/rowanimation.lua b/functions/rowanimation.lua index 3f6785e2..3b0ace1e 100644 --- a/functions/rowanimation.lua +++ b/functions/rowanimation.lua @@ -12,7 +12,7 @@ local _ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> basic functions +--basic functions _detalhes.current_row_animation = "" _detalhes.row_animation_pool = {} @@ -35,7 +35,7 @@ end function _detalhes:SelectRowAnimation (name) - for key, value in ipairs (_detalhes.row_animation_pool) do + for key, value in ipairs(_detalhes.row_animation_pool) do if (value.name == name) then _detalhes.current_row_animation = name return true @@ -46,21 +46,21 @@ function _detalhes:GetRowAnimationList() local t = {} - for key, value in ipairs (_detalhes.row_animation_pool) do + for key, value in ipairs(_detalhes.row_animation_pool) do tinsert (t, value.name) end return t end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> install default animations +--install default animations do local fade_func = function(row, state) if (state) then - Details.FadeHandler.Fader (row, "out") + Details.FadeHandler.Fader(row, "out") else - Details.FadeHandler.Fader (row, "in") + Details.FadeHandler.Fader(row, "in") end end local fade_desc = "Default animation, makes the bar fade in or fade out when showing or hiding in the window" diff --git a/functions/savedata.lua b/functions/savedata.lua index 1df820da..f2d80d89 100644 --- a/functions/savedata.lua +++ b/functions/savedata.lua @@ -5,15 +5,15 @@ local _detalhes = _G._detalhes function _detalhes:WipeConfig() local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) - local b = CreateFrame ("button", "DetailsResetConfigButton", UIParent) + local b = CreateFrame("button", "DetailsResetConfigButton", UIParent) tinsert (UISpecialFrames, "DetailsResetConfigButton") DetailsFramework:ApplyStandardBackdrop(b) - b:SetSize (250, 40) - b:SetText (Loc ["STRING_SLASH_WIPECONFIG_CONFIRM"]) - b:SetScript ("OnClick", function() _detalhes.wipe_full_config = true; ReloadUI(); end) - b:SetPoint ("center", UIParent, "center", 0, 0) + b:SetSize(250, 40) + b:SetText(Loc ["STRING_SLASH_WIPECONFIG_CONFIRM"]) + b:SetScript("OnClick", function() _detalhes.wipe_full_config = true; ReloadUI(); end) + b:SetPoint("center", UIParent, "center", 0, 0) end local is_exception = { @@ -23,13 +23,13 @@ local is_exception = { function _detalhes:SaveLocalInstanceConfig() for index, instance in _detalhes:ListInstances() do - --> check for the max size toggle, don't save it + --check for the max size toggle, don't save it if (instance.is_in_max_size) then instance.is_in_max_size = false - instance:SetSize (instance.original_width, instance.original_height) + instance:SetSize(instance.original_width, instance.original_height) end - --> save local instance data + --save local instance data local a1, a2 = instance:GetDisplay() local t = { @@ -71,10 +71,10 @@ end function _detalhes:SaveConfig() - --> save instance configs localy + --save instance configs localy _detalhes:SaveLocalInstanceConfig() - --> cleanup + --cleanup _detalhes:PrepareTablesForSave() @@ -87,33 +87,33 @@ function _detalhes:SaveConfig() local name, ttype, difficulty, difficultyName, maxPlayers, playerDifficulty, isDynamicInstance, mapID, instanceGroupSize = GetInstanceInfo() if (ttype == "party" or ttype == "raid") then - --> salvar container de pet + --salvar container de pet _detalhes_database.tabela_pets = _detalhes.tabela_pets.pets end xpcall (_detalhes.TimeDataCleanUpTemporary, _detalhes.saver_error_func) - --> buffs + --buffs xpcall (_detalhes.Buffs.SaveBuffs, _detalhes.saver_error_func) - --> date + --date _detalhes.last_day = date ("%d") - --> salva o container do personagem + --salva o container do personagem for key, value in pairs (_detalhes.default_player_data) do if (not is_exception [key]) then _detalhes_database [key] = _detalhes [key] end end - --> salva o container das globais + --salva o container das globais for key, value in pairs (_detalhes.default_global_data) do if (key ~= "__profiles") then _detalhes_global [key] = _detalhes [key] end end - --> solo e raid mode + --solo e raid mode if (_detalhes.SoloTables.Mode) then _detalhes_database.SoloTablesSaved = {} _detalhes_database.SoloTablesSaved.Mode = _detalhes.SoloTables.Mode @@ -124,16 +124,16 @@ function _detalhes:SaveConfig() _detalhes_database.RaidTablesSaved = nil - --> salva switch tables + --salva switch tables _detalhes_global.switchSaved.slots = _detalhes.switch.slots _detalhes_global.switchSaved.table = _detalhes.switch.table - --> last boss + --last boss _detalhes_database.last_encounter = _detalhes.last_encounter - --> last versions - _detalhes_database.last_realversion = _detalhes.realversion --> core number - _detalhes_database.last_version = _detalhes.userversion --> version + --last versions + _detalhes_database.last_realversion = _detalhes.realversion --core number + _detalhes_database.last_version = _detalhes.userversion --version _detalhes_global.got_first_run = true end diff --git a/functions/skins.lua b/functions/skins.lua index dd38e099..c7aac770 100644 --- a/functions/skins.lua +++ b/functions/skins.lua @@ -3,7 +3,7 @@ local _detalhes = _G._detalhes local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) local _ - --> install skin function: + --install skin function: function _detalhes:InstallSkin (skin_name, skin_table) if (not skin_name) then return false @@ -71,7 +71,7 @@ local _ _detalhes:DelayOptionsRefresh() end - --> install wow interface skin: + --install wow interface skin: _detalhes:InstallSkin ("WoW Interface", { file = [[Interface\AddOns\Details\images\skins\default_skin.blp]], author = "Details!", @@ -294,7 +294,7 @@ local _ instance:AttributeMenu (nil, nil, 4) if (_detalhes.options_group_edit) then - for _, this_instance in ipairs (instance:GetInstanceGroup()) do + for _, this_instance in ipairs(instance:GetInstanceGroup()) do if (this_instance ~= instance) then this_instance:ToolbarMenuSetButtonsOptions (nil, true) this_instance:AttributeMenu (nil, nil, nil, nil, nil, nil, nil, true) @@ -382,7 +382,7 @@ local _ ["text_face"] = "Accidental Presidency", ["anchor"] = { 1.4, -- [1] - 1, -- [2] + 2, -- [2] }, ["text_color"] = { 1, -- [1] @@ -473,7 +473,7 @@ local _ ["textL_custom_text"] = "{data1}. {data3}{data2}", ["font_size"] = 16, ["height"] = 21, - ["texture_file"] = "Interface\\AddOns\\Details\\images\\BantoBar", + ["texture_file"] = "Interface\\AddOns\\Details\\images\\bar_skyline", ["icon_file"] = "Interface\\AddOns\\Details\\images\\classes_small", ["textR_bracket"] = "(", ["textR_enable_custom_text"] = false, @@ -484,7 +484,7 @@ local _ }, ["textL_show_number"] = true, ["textR_custom_text"] = "{data1} ({data2}, {data3}%)", - ["texture"] = "BantoBar", + ["texture"] = "Skyline", ["use_spec_icons"] = true, ["textR_class_colors"] = false, ["textL_class_colors"] = false, @@ -1038,20 +1038,20 @@ local _ local ElvUIRightChatDataPanel = RightChatDataPanel and RightChatDataPanel:IsShown() if (instance1.skin == "Forced Square") then - instance1.baseframe:SetSize (wight/2 - 4, height-20 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled1 and 14 or 0)) - instance2.baseframe:SetSize (wight/2 - 4 + 2, height-20 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled2 and 14 or 0)) + instance1.baseframe:SetSize(wight/2 - 4, height-20 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled1 and 14 or 0)) + instance2.baseframe:SetSize(wight/2 - 4 + 2, height-20 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled2 and 14 or 0)) elseif (instance1.skin == "ElvUI Frame Style") then - instance1.baseframe:SetSize (wight/2 - 4, height-20 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled1 and 14 or 0)) - instance2.baseframe:SetSize (wight/2 - 4, height-20 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled2 and 14 or 0)) + instance1.baseframe:SetSize(wight/2 - 4, height-20 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled1 and 14 or 0)) + instance2.baseframe:SetSize(wight/2 - 4, height-20 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled2 and 14 or 0)) elseif (instance1.skin == "ElvUI Style II") then - instance1.baseframe:SetSize (wight/2 - 4 - 2, height - 20 - 2 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled1 and 14 or 0)) - instance2.baseframe:SetSize (wight/2 - 4 - 2, height - 20 - 2 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled2 and 14 or 0)) + instance1.baseframe:SetSize(wight/2 - 4 - 2, height - 20 - 2 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled1 and 14 or 0)) + instance2.baseframe:SetSize(wight/2 - 4 - 2, height - 20 - 2 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled2 and 14 or 0)) else - instance1.baseframe:SetSize (wight/2 - 4, height-20 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled1 and 14 or 0)) - instance2.baseframe:SetSize (wight/2 - 4, height-20 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled2 and 14 or 0)) + instance1.baseframe:SetSize(wight/2 - 4, height-20 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled1 and 14 or 0)) + instance2.baseframe:SetSize(wight/2 - 4, height-20 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled2 and 14 or 0)) end @@ -1059,8 +1059,8 @@ local _ instance1.snap [3] = 2; instance2.snap [1] = 1; instance1.horizontalSnap = true; instance2.horizontalSnap = true - instance1.baseframe:SetPoint ("bottomleft", RightChatDataPanel, "topleft", 1 - (instance1.skin == "Forced Square" and 1 or 0), 1 + (statusbar_enabled1 and 14 or 0) - (ElvUIRightChatDataPanel and 0 or 22)) - instance2.baseframe:SetPoint ("bottomright", RightChatToggleButton, "topright", -1, 1 + (statusbar_enabled2 and 14 or 0) - (ElvUIRightChatDataPanel and 0 or 22)) + instance1.baseframe:SetPoint("bottomleft", RightChatDataPanel, "topleft", 1 - (instance1.skin == "Forced Square" and 1 or 0), 1 + (statusbar_enabled1 and 14 or 0) - (ElvUIRightChatDataPanel and 0 or 22)) + instance2.baseframe:SetPoint("bottomright", RightChatToggleButton, "topright", -1, 1 + (statusbar_enabled2 and 14 or 0) - (ElvUIRightChatDataPanel and 0 or 22)) instance1:LockInstance (true) instance2:LockInstance (true) diff --git a/functions/slash.lua b/functions/slash.lua index f8c3d354..a2168427 100644 --- a/functions/slash.lua +++ b/functions/slash.lua @@ -246,7 +246,7 @@ function SlashCmdList.DETAILS (msg, editbox) Details:Dump (state) else - Details:Msg ("Window 1 not found.") + Details:Msg("Window 1 not found.") end elseif (command == "bosstimers" or command == "bosstimer" or command == "timer" or command == "timers") then @@ -294,12 +294,12 @@ function SlashCmdList.DETAILS (msg, editbox) local exiterrors = _detalhes_global.exit_errors print ("EXIT LOG:") - for index, text in ipairs (exitlog) do + for index, text in ipairs(exitlog) do print (text) end print ("ERRORS:") if (exiterrors) then - for index, text in ipairs (exiterrors) do + for index, text in ipairs(exiterrors) do print (text) end else @@ -308,18 +308,18 @@ function SlashCmdList.DETAILS (msg, editbox) elseif (msg == "tr") then - local f = CreateFrame ("frame", nil, UIParent) - f:SetSize (300, 300) - f:SetPoint ("center") + local f = CreateFrame("frame", nil, UIParent) + f:SetSize(300, 300) + f:SetPoint("center") --- /run TTT:SetTexture ("Interface\\1024.tga") - local texture = f:CreateTexture ("TTT", "background") +-- /run TTT:SetTexture("Interface\\1024.tga") + local texture = f:CreateTexture("TTT", "background") texture:SetAllPoints() - texture:SetTexture ("Interface\\1023.tga") + texture:SetTexture("Interface\\1023.tga") local A = DetailsFramework:CreateAnimationHub (texture) - local b = DetailsFramework:CreateAnimation (A, "ROTATION", 1, 40, 360) + local b = DetailsFramework:CreateAnimation(A, "ROTATION", 1, 40, 360) b:SetTarget (texture) A:Play() @@ -377,11 +377,11 @@ function SlashCmdList.DETAILS (msg, editbox) instance1.baseframe:ClearAllPoints() instance2.baseframe:ClearAllPoints() - instance1.baseframe:SetSize (w/2 - 4, h-20-21-8) - instance2.baseframe:SetSize (w/2 - 4, h-20-21-8) + instance1.baseframe:SetSize(w/2 - 4, h-20-21-8) + instance2.baseframe:SetSize(w/2 - 4, h-20-21-8) - instance1.baseframe:SetPoint ("bottomleft", RightChatDataPanel, "topleft", 1, 1) - instance2.baseframe:SetPoint ("bottomright", RightChatToggleButton, "topright", -1, 1) + instance1.baseframe:SetPoint("bottomleft", RightChatDataPanel, "topleft", 1, 1) + instance2.baseframe:SetPoint("bottomright", RightChatToggleButton, "topright", -1, 1) elseif (msg == "addcombat") then @@ -439,7 +439,7 @@ function SlashCmdList.DETAILS (msg, editbox) _detalhes:InstanciaCallFunction (_detalhes.AtualizaSegmentos) -- atualiza o instancia.showing para as novas tabelas criadas _detalhes:InstanciaCallFunction (_detalhes.AtualizaSoloMode_AfertReset) -- verifica se precisa zerar as tabela da janela solo mode _detalhes:InstanciaCallFunction (_detalhes.ResetaGump) --_detalhes:ResetaGump ("de todas as instancias") - _detalhes:RefreshMainWindow (-1, true) --atualiza todas as instancias + _detalhes:RefreshMainWindow(-1, true) --atualiza todas as instancias @@ -472,11 +472,11 @@ function SlashCmdList.DETAILS (msg, editbox) local instance = _detalhes.tabela_instancias [1] instance.baseframe:ClearAllPoints() - --instance.baseframe:SetPoint ("CENTER", UIParent, "CENTER", 300, 100) - instance.baseframe:SetPoint ("left", DetailsWelcomeWindow, "right", 10, 0) + --instance.baseframe:SetPoint("CENTER", UIParent, "CENTER", 300, 100) + instance.baseframe:SetPoint("left", DetailsWelcomeWindow, "right", 10, 0) elseif (msg == "model") then - local frame = CreateFrame ("PlayerModel"); + local frame = CreateFrame("PlayerModel"); frame:SetPoint("center",UIParent,"center"); frame:SetHeight(600); frame:SetWidth(300); @@ -563,23 +563,23 @@ function SlashCmdList.DETAILS (msg, editbox) elseif (msg == "slider") then - local f = CreateFrame ("frame", "TESTEDESCROLL", UIParent) - f:SetPoint ("center", UIParent, "center", 200, -2) - f:SetWidth (300) - f:SetHeight (150) - f:SetBackdrop ({bgFile = "Interface\\AddOns\\Details\\images\\background", tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}) - f:SetBackdropColor (0, 0, 0, 1) + local f = CreateFrame("frame", "TESTEDESCROLL", UIParent) + f:SetPoint("center", UIParent, "center", 200, -2) + f:SetWidth(300) + f:SetHeight(150) + f:SetBackdrop({bgFile = "Interface\\AddOns\\Details\\images\\background", tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}) + f:SetBackdropColor(0, 0, 0, 1) f:EnableMouseWheel (true) local rows = {} for i = 1, 7 do - local row = CreateFrame ("frame", nil, UIParent) - row:SetPoint ("topleft", f, "topleft", 10, -(i-1)*21) - row:SetWidth (200) - row:SetHeight (20) - row:SetBackdrop ({bgFile = "Interface\\AddOns\\Details\\images\\background", tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}) + local row = CreateFrame("frame", nil, UIParent) + row:SetPoint("topleft", f, "topleft", 10, -(i-1)*21) + row:SetWidth(200) + row:SetHeight(20) + row:SetBackdrop({bgFile = "Interface\\AddOns\\Details\\images\\background", tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}) local t = row:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - t:SetPoint ("left", row, "left") + t:SetPoint("left", row, "left") row.text = t rows [#rows+1] = row end @@ -598,12 +598,12 @@ function SlashCmdList.DETAILS (msg, editbox) local t = _detalhes.ResetButton:GetHighlightTexture() t:SetVertexColor (0, 1, 0, 1) --print (t:GetObjectType()) - --_detalhes.ResetButton:SetHighlightTexture (t) - _detalhes.ResetButton:SetNormalTexture (t) + --_detalhes.ResetButton:SetHighlightTexture(t) + _detalhes.ResetButton:SetNormalTexture(t) print ("backdrop", _detalhes.ResetButton:GetBackdrop()) - _detalhes.ResetButton:SetBackdropColor (0, 0, 1, 1) + _detalhes.ResetButton:SetBackdropColor(0, 0, 1, 1) --Details.VarDump (_detalhes.ResetButton) @@ -620,7 +620,7 @@ function SlashCmdList.DETAILS (msg, editbox) local petGUID = UnitGUID ("target") if (not _G.DetailsScanTooltip) then - local scanTool = CreateFrame ("GameTooltip", "DetailsScanTooltip", nil, "GameTooltipTemplate") + local scanTool = CreateFrame("GameTooltip", "DetailsScanTooltip", nil, "GameTooltipTemplate") scanTool:SetOwner (WorldFrame, "ANCHOR_NONE") end @@ -711,7 +711,7 @@ function SlashCmdList.DETAILS (msg, editbox) elseif (msg == "error") then a = nil + 1 - --> debug + --debug elseif (command == "resetcapture") then _detalhes.capture_real = { ["damage"] = true, @@ -724,7 +724,7 @@ function SlashCmdList.DETAILS (msg, editbox) _detalhes:CaptureRefresh() print (Loc ["STRING_DETAILS1"] .. "capture has been reseted.") - --> debug + --debug elseif (command == "barra") then local whichRowLine = rest and tonumber (rest) or 1 @@ -740,8 +740,8 @@ function SlashCmdList.DETAILS (msg, editbox) elseif (msg == "opened") then print ("Instances opened: " .. _detalhes.opened_windows) - --> debug, get a guid of something - elseif (command == "backdrop") then --> localize-me + --debug, get a guid of something + elseif (command == "backdrop") then --localize-me local f = MacroFrameTextBackground local backdrop = MacroFrameTextBackground:GetBackdrop() @@ -751,10 +751,10 @@ function SlashCmdList.DETAILS (msg, editbox) print ("bgcolor:",f:GetBackdropColor()) print ("bordercolor",f:GetBackdropBorderColor()) - elseif (command == "myguid") then --> localize-me + elseif (command == "myguid") then --localize-me local g = UnitGUID ("player") - print (type (g)) + print (type(g)) print (g) print (string.len (g)) local serial = g:sub (12, 18) @@ -777,16 +777,16 @@ function SlashCmdList.DETAILS (msg, editbox) tile = true, edgeSize = 1, tileSize = 5, } - Details.id_frame = CreateFrame ("Frame", "DetailsID", UIParent, "BackdropTemplate") + Details.id_frame = CreateFrame("Frame", "DetailsID", UIParent, "BackdropTemplate") Details.id_frame:SetHeight(14) Details.id_frame:SetWidth(120) - Details.id_frame:SetPoint ("center", UIParent, "center") + Details.id_frame:SetPoint("center", UIParent, "center") Details.id_frame:SetBackdrop(backdrop) tinsert(UISpecialFrames, "DetailsID") - Details.id_frame.texto = CreateFrame ("editbox", nil, Details.id_frame, "BackdropTemplate") - Details.id_frame.texto:SetPoint ("topleft", Details.id_frame, "topleft") + Details.id_frame.texto = CreateFrame("editbox", nil, Details.id_frame, "BackdropTemplate") + Details.id_frame.texto:SetPoint("topleft", Details.id_frame, "topleft") Details.id_frame.texto:SetAutoFocus(false) Details.id_frame.texto:SetFontObject (GameFontHighlightSmall) Details.id_frame.texto:SetHeight(14) @@ -795,15 +795,15 @@ function SlashCmdList.DETAILS (msg, editbox) Details.id_frame.texto:EnableMouse(true) Details.id_frame.texto:SetBackdropColor(0, 0, 0, 0.5) Details.id_frame.texto:SetBackdropBorderColor(0.3, 0.3, 0.30, 0.80) - Details.id_frame.texto:SetText ("") + 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) - Details.id_frame.texto:SetScript ("OnEscapePressed", function() + Details.id_frame.texto:SetScript("OnEscapePressed", function() Details.id_frame.texto:ClearFocus() Details.id_frame:Hide() end) @@ -813,7 +813,7 @@ function SlashCmdList.DETAILS (msg, editbox) C_Timer.After(0.1, function() Details.id_frame:Show() Details.id_frame.texto:SetFocus() - Details.id_frame.texto:SetText ("" .. npcId) + Details.id_frame.texto:SetText("" .. npcId) Details.id_frame.texto:HighlightText() end) end @@ -833,16 +833,16 @@ function SlashCmdList.DETAILS (msg, editbox) tile = true, edgeSize = 1, tileSize = 5, } - _detalhes.id_frame = CreateFrame ("Frame", "DetailsID", UIParent) + _detalhes.id_frame = CreateFrame("Frame", "DetailsID", UIParent) _detalhes.id_frame:SetHeight(14) _detalhes.id_frame:SetWidth(120) - _detalhes.id_frame:SetPoint ("center", UIParent, "center") + _detalhes.id_frame:SetPoint("center", UIParent, "center") _detalhes.id_frame:SetBackdrop(backdrop) tinsert (UISpecialFrames, "DetailsID") - _detalhes.id_frame.texto = CreateFrame ("editbox", nil, _detalhes.id_frame) - _detalhes.id_frame.texto:SetPoint ("topleft", _detalhes.id_frame, "topleft") + _detalhes.id_frame.texto = CreateFrame("editbox", nil, _detalhes.id_frame) + _detalhes.id_frame.texto:SetPoint("topleft", _detalhes.id_frame, "topleft") _detalhes.id_frame.texto:SetAutoFocus(false) _detalhes.id_frame.texto:SetFontObject (GameFontHighlightSmall) _detalhes.id_frame.texto:SetHeight(14) @@ -852,15 +852,15 @@ function SlashCmdList.DETAILS (msg, editbox) _detalhes.id_frame.texto:SetBackdrop(ManualBackdrop) _detalhes.id_frame.texto:SetBackdropColor(0, 0, 0, 0.5) _detalhes.id_frame.texto:SetBackdropBorderColor(0.3, 0.3, 0.30, 0.80) - _detalhes.id_frame.texto:SetText ("") --localize-me + _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) - _detalhes.id_frame.texto:SetScript ("OnEscapePressed", function() + _detalhes.id_frame.texto:SetScript("OnEscapePressed", function() _detalhes.id_frame.texto:ClearFocus() _detalhes.id_frame:Hide() end) @@ -874,13 +874,13 @@ function SlashCmdList.DETAILS (msg, editbox) local guid = UnitGUID ("target") if (guid) then local g = _detalhes:GetNpcIdFromGuid (guid) - _detalhes.id_frame.texto:SetText ("" .. g) + _detalhes.id_frame.texto:SetText("" .. g) _detalhes.id_frame.texto:HighlightText() end else print (pass_guid.. " -> " .. tonumber (pass_guid:sub(6, 10), 16)) - _detalhes.id_frame.texto:SetText (""..tonumber (pass_guid:sub(6, 10), 16)) + _detalhes.id_frame.texto:SetText(""..tonumber (pass_guid:sub(6, 10), 16)) _detalhes.id_frame.texto:HighlightText() end @@ -969,13 +969,13 @@ function SlashCmdList.DETAILS (msg, editbox) local container = _detalhes.tabela_vigente [t]._ActorTable print (#container, "actors found.") - for index, actor in ipairs (container) do + for index, actor in ipairs(container) do f:add (actor.nome, index, filter) end f:Show() - --> debug + --debug elseif (msg == "save") then print ("running... this is a debug command, details wont work until next /reload.") _detalhes:PrepareTablesForSave() @@ -998,7 +998,7 @@ function SlashCmdList.DETAILS (msg, editbox) print("NPC ID:", tonumber((UnitGUID("target")):sub(-12, -9), 16) ) end - --> debug + --debug elseif (command == "debugnet") then if (_detalhes.debugnet) then _detalhes.debugnet = false @@ -1031,7 +1031,7 @@ function SlashCmdList.DETAILS (msg, editbox) end end - --> debug combat log + --debug combat log elseif (msg == "combatlog") then if (_detalhes.isLoggingCombat) then LoggingCombat (false) @@ -1074,7 +1074,7 @@ function SlashCmdList.DETAILS (msg, editbox) if (not DetailsPosBox) then _detalhes.gump:CreateTextEntry (UIParent, function()end, 200, 20, nil, "DetailsPosBox") - DetailsPosBox:SetPoint ("center", UIParent, "center") + DetailsPosBox:SetPoint("center", UIParent, "center") end local one, two = rest:match("^(%S*)%s*(.-)$") @@ -1089,7 +1089,7 @@ function SlashCmdList.DETAILS (msg, editbox) elseif (msg == "outline") then local instancia = _detalhes.tabela_instancias [1] - for _, barra in ipairs (instancia.barras) do + for _, barra in ipairs(instancia.barras) do local _, _, flags = barra.lineText1:GetFont() print ("outline:",flags) end @@ -1203,8 +1203,8 @@ function SlashCmdList.DETAILS (msg, editbox) if (iLevel) then item_level = item_level + iLevel print (iLevel, item) - --> 16 = main hand 17 = off hand - --> if using a two-hand, ignore the off hand slot + --16 = main hand 17 = off hand + -- if using a two-hand, ignore the off hand slot if (equip_id == 16 and two_hand [equipSlot]) then item_amount = 15 break @@ -1233,7 +1233,7 @@ function SlashCmdList.DETAILS (msg, editbox) if (not bar) then bar = Details.gump:CreateBar (UIParent, nil, 600, 200, 100, nil, "DetailsTestBar") _G.DetailsTestBar = bar - bar:SetPoint ("center", 0, 0) + bar:SetPoint("center", 0, 0) bar.RightTextIsTimer = true bar.BarIsInverse = true end @@ -1252,12 +1252,12 @@ function SlashCmdList.DETAILS (msg, editbox) local myframe = TestFrame if (not myframe) then - myframe = TestFrame or CreateFrame ("frame", "TestFrame", UIParent) - myframe:SetPoint ("center", UIParent, "center") - myframe:SetSize (300, 300) - myframe.texture = myframe:CreateTexture (nil, "overlay") + myframe = TestFrame or CreateFrame("frame", "TestFrame", UIParent) + myframe:SetPoint("center", UIParent, "center") + myframe:SetSize(300, 300) + myframe.texture = myframe:CreateTexture(nil, "overlay") myframe.texture:SetAllPoints() - myframe.texture:SetTexture ([[Interface\AddOns\WorldQuestTracker\media\icon_flag_common]]) + myframe.texture:SetTexture([[Interface\AddOns\WorldQuestTracker\media\icon_flag_common]]) else if (myframe.texture:IsShown()) then myframe.texture:Hide() @@ -1283,14 +1283,14 @@ function SlashCmdList.DETAILS (msg, editbox) for i = 1, 10 do - local a = CreateFrame ("statusbar", nil, UIParent) - a:SetPoint ("topleft", UIParent, "topleft", i*32, y) - a:SetSize (32, 32) + local a = CreateFrame("statusbar", nil, UIParent) + a:SetPoint("topleft", UIParent, "topleft", i*32, y) + a:SetSize(32, 32) a:SetMinMaxValues (0, 1) - local texture = a:CreateTexture (nil, "overlay") - texture:SetSize (32, 32) - texture:SetPoint ("topleft") + local texture = a:CreateTexture(nil, "overlay") + texture:SetSize(32, 32) + texture:SetPoint("topleft") if (i%10 == 0) then y = y - 32 @@ -1300,19 +1300,19 @@ 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)) + --texture:SetSize(math.random (50, 300), math.random (50, 300)) --local spec = allspecs [math.random (#allspecs)] - texture:SetTexture ([[Interface\AddOns\Details\images\options_window]]) - --texture:SetTexture ([[Interface\Store\Store-Splash]]) - --texture:SetTexture ([[Interface\AddOns\Details\images\options_window]]) - --texture:SetTexture ([[Interface\CHARACTERFRAME\Button_BloodPresence_DeathKnight]]) + texture:SetTexture([[Interface\AddOns\Details\images\options_window]]) + --texture:SetTexture([[Interface\Store\Store-Splash]]) + --texture:SetTexture([[Interface\AddOns\Details\images\options_window]]) + --texture:SetTexture([[Interface\CHARACTERFRAME\Button_BloodPresence_DeathKnight]]) --texture:SetTexCoord (unpack (_detalhes.class_specs_coords [spec])) --a:SetAlpha (abs (math.sin (time))) - --a:SetValue (abs (math.sin (time))) + --a:SetValue(abs (math.sin (time))) end) end @@ -1391,16 +1391,16 @@ function SlashCmdList.DETAILS (msg, editbox) elseif (msg == "merge") then - --> at this point, details! should not be in combat + --at this point, details! should not be in combat if (_detalhes.in_combat) then _detalhes:Msg ("already in combat, closing current segment.") _detalhes:SairDoCombate() end - --> create a new combat to be the overall for the mythic run + --create a new combat to be the overall for the mythic run _detalhes:EntrarEmCombate() - --> get the current combat just created and the table with all past segments + --get the current combat just created and the table with all past segments local newCombat = _detalhes:GetCurrentCombat() local segmentHistory = _detalhes:GetCombatSegments() local totalTime = 0 @@ -1408,7 +1408,7 @@ function SlashCmdList.DETAILS (msg, editbox) local lastSegment local segmentsAdded = 0 - --> add all boss segments from this run to this new segment + --add all boss segments from this run to this new segment for i = 1, 25 do local pastCombat = segmentHistory [i] if (pastCombat and pastCombat ~= newCombat) then @@ -1431,7 +1431,7 @@ function SlashCmdList.DETAILS (msg, editbox) _detalhes:Msg ("done merging, segments: " .. segmentsAdded .. ", total time: " .. DetailsFramework:IntegerToTimer (totalTime)) --[[ --mythic+ debug - --> tag the segment as mythic overall segment + --tag the segment as mythic overall segment newCombat.is_mythic_dungeon = { MapID = _detalhes.MythicPlus.Dungeon, StartedAt = _detalhes.MythicPlus.StartedAt, --the start of the run @@ -1444,17 +1444,17 @@ function SlashCmdList.DETAILS (msg, editbox) } --]] - --> set some data + --set some data newCombat:SetStartTime (GetTime() - totalTime) newCombat:SetEndTime (GetTime()) newCombat.data_inicio = startDate newCombat.data_fim = endDate - --> immediatly finishes the segment just started + --immediatly finishes the segment just started _detalhes:SairDoCombate() - --> cleanup the past segments table + --cleanup the past segments table for i = 25, 1, -1 do local pastCombat = segmentHistory [i] if (pastCombat and pastCombat ~= newCombat) then @@ -1463,14 +1463,14 @@ function SlashCmdList.DETAILS (msg, editbox) end end - --> clear memory + --clear memory collectgarbage() _detalhes:InstanciaCallFunction (Details.FadeHandler.Fader, "in", nil, "barras") _detalhes:InstanciaCallFunction (_detalhes.AtualizaSegmentos) _detalhes:InstanciaCallFunction (_detalhes.AtualizaSoloMode_AfertReset) _detalhes:InstanciaCallFunction (_detalhes.ResetaGump) - _detalhes:RefreshMainWindow (-1, true) + _detalhes:RefreshMainWindow(-1, true) elseif (msg == "ej") then @@ -1488,7 +1488,7 @@ function SlashCmdList.DETAILS (msg, editbox) local nextID = {sectionInfo.siblingSectionID} while (nextID [1]) do - --> get the deepest section in the hierarchy + --get the deepest section in the hierarchy local ID = tremove (nextID) local sectionInfo = C_EncounterJournal.GetSectionInfo (ID) @@ -1559,7 +1559,7 @@ function SlashCmdList.DETAILS (msg, editbox) local f = DetailsRecordFrameAnimation if (not f) then - f = CreateFrame ("frame", "DetailsRecordFrameAnimation", UIParent) + f = CreateFrame("frame", "DetailsRecordFrameAnimation", UIParent) --estrela no inicio dando um giro --Interface\Cooldown\star4 @@ -1567,8 +1567,8 @@ function SlashCmdList.DETAILS (msg, editbox) --Interface\Artifacts\ArtifactAnim2 local animationHub = DetailsFramework:CreateAnimationHub (f, function() f:Show() end) - DetailsFramework:CreateAnimation (animationHub, "Scale", 1, .10, .9, .9, 1.1, 1.1) - DetailsFramework:CreateAnimation (animationHub, "Scale", 2, .10, 1.2, 1.2, 1, 1) + DetailsFramework:CreateAnimation(animationHub, "Scale", 1, .10, .9, .9, 1.1, 1.1) + DetailsFramework:CreateAnimation(animationHub, "Scale", 2, .10, 1.2, 1.2, 1, 1) end --BFA BETA @@ -1611,7 +1611,7 @@ function SlashCmdList.DETAILS (msg, editbox) local keys = {} - --> copy from table2 to table1 overwriting values + --copy from table2 to table1 overwriting values function f.copy (t1, t2) if (t1.Timer) then t1, t2 = t1.t1, t1.t2 @@ -1621,7 +1621,7 @@ function SlashCmdList.DETAILS (msg, editbox) if (key == "targets") then t1 [key] = {} - elseif (type (value) == "table") then + elseif (type(value) == "table") then t1 [key] = t1 [key] or {} --print (key, value) @@ -1657,12 +1657,12 @@ function SlashCmdList.DETAILS (msg, editbox) --end if (command) then - --> check if the line passed is a parameters in the default profile + --check if the line passed is a parameters in the default profile if (_detalhes.default_profile [command]) then if (rest and (rest ~= "" and rest ~= " ")) then local whichType = type (_detalhes.default_profile [command]) - --> attempt to cast the passed value to the same value as the type in the profile + --attempt to cast the passed value to the same value as the type in the profile if (whichType == "number") then rest = tonumber (rest) if (rest) then @@ -1697,7 +1697,7 @@ function SlashCmdList.DETAILS (msg, editbox) else local value = _detalhes [command] - if (type (value) == "boolean") then + if (type(value) == "boolean") then value = value and "true" or "false" end print (Loc ["STRING_DETAILS1"] .. "config '" .. command .. "' current value is: " .. value) @@ -1759,11 +1759,11 @@ function Details:UpdateUserPanel (usersTable) if (not Details.UserPanel) then DetailsUserPanel = DetailsFramework:CreateSimplePanel (UIParent) - DetailsUserPanel:SetSize (707, 505) + DetailsUserPanel:SetSize(707, 505) DetailsUserPanel:SetTitle ("Details! Version Check") DetailsUserPanel.Data = {} DetailsUserPanel:ClearAllPoints() - DetailsUserPanel:SetPoint ("left", UIParent, "left", 10, 0) + DetailsUserPanel:SetPoint("left", UIParent, "left", 10, 0) DetailsUserPanel:Hide() Details.UserPanel = DetailsUserPanel @@ -1794,7 +1794,7 @@ function Details:UpdateUserPanel (usersTable) } DetailsUserPanel.Header = DetailsFramework:CreateHeader (DetailsUserPanel, headerTable, headerOptions) - DetailsUserPanel.Header:SetPoint ("topleft", DetailsUserPanel, "topleft", 5, headerY) + DetailsUserPanel.Header:SetPoint("topleft", DetailsUserPanel, "topleft", 5, headerY) local scroll_refresh = function(self, data, offset, total_lines) @@ -1821,43 +1821,43 @@ function Details:UpdateUserPanel (usersTable) local lineOnEnter = function(self) if (self.IsCritical) then - self:SetBackdropColor (unpack (backdrop_color_is_critical_on_enter)) + self:SetBackdropColor(unpack (backdrop_color_is_critical_on_enter)) else - self:SetBackdropColor (unpack (backdrop_color_on_enter)) + self:SetBackdropColor(unpack (backdrop_color_on_enter)) end end local lineOnLeave = function(self) if (self.IsCritical) then - self:SetBackdropColor (unpack (backdrop_color_is_critical)) + self:SetBackdropColor(unpack (backdrop_color_is_critical)) else - self:SetBackdropColor (unpack (backdrop_color)) + self:SetBackdropColor(unpack (backdrop_color)) end GameTooltip:Hide() end 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) + 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) - line:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - line:SetBackdropColor (unpack (backdrop_color)) + line:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + line:SetBackdropColor(unpack (backdrop_color)) DetailsFramework:Mixin (line, DetailsFramework.HeaderFunctions) - line:SetScript ("OnEnter", lineOnEnter) - line:SetScript ("OnLeave", lineOnLeave) + line:SetScript("OnEnter", lineOnEnter) + line:SetScript("OnLeave", lineOnLeave) --username - local userNameText = DetailsFramework:CreateLabel (line) + local userNameText = DetailsFramework:CreateLabel(line) --realm - local realmText = DetailsFramework:CreateLabel (line) + local realmText = DetailsFramework:CreateLabel(line) --version - local versionText = DetailsFramework:CreateLabel (line) + local versionText = DetailsFramework:CreateLabel(line) line:AddFrameToHeaderAlignment (userNameText) line:AddFrameToHeaderAlignment (realmText) @@ -1874,7 +1874,7 @@ function Details:UpdateUserPanel (usersTable) local usersScroll = DetailsFramework:CreateScrollBox (DetailsUserPanel, "$parentUsersScroll", scroll_refresh, DetailsUserPanel.Data, scroll_width, scroll_height, scroll_lines, scroll_line_height) DetailsFramework:ReskinSlider(usersScroll) - usersScroll:SetPoint ("topleft", DetailsUserPanel, "topleft", 5, scrollY) + usersScroll:SetPoint("topleft", DetailsUserPanel, "topleft", 5, scrollY) Details.UserPanel.ScrollBox = usersScroll --create lines @@ -1882,10 +1882,10 @@ function Details:UpdateUserPanel (usersTable) usersScroll:CreateLine (scroll_createline) end - DetailsUserPanel:SetScript ("OnShow", function() + DetailsUserPanel:SetScript("OnShow", function() end) - DetailsUserPanel:SetScript ("OnHide", function() + DetailsUserPanel:SetScript("OnHide", function() end) end @@ -1896,14 +1896,14 @@ end function _detalhes:CreateListPanel() _detalhes.ListPanel = _detalhes.gump:NewPanel (UIParent, nil, "DetailsActorsFrame", nil, 300, 600) - _detalhes.ListPanel:SetPoint ("center", UIParent, "center", 300, 0) + _detalhes.ListPanel:SetPoint("center", UIParent, "center", 300, 0) _detalhes.ListPanel.barras = {} tinsert (UISpecialFrames, "DetailsActorsFrame") _detalhes.ListPanel.close_with_right = true - local container_barras_window = CreateFrame ("ScrollFrame", "Details_ActorsBarrasScroll", _detalhes.ListPanel.widget) - local container_barras = CreateFrame ("Frame", "Details_ActorsBarras", container_barras_window) + local container_barras_window = CreateFrame("ScrollFrame", "Details_ActorsBarrasScroll", _detalhes.ListPanel.widget) + local container_barras = CreateFrame("Frame", "Details_ActorsBarras", container_barras_window) _detalhes.ListPanel.container = container_barras _detalhes.ListPanel.width = 500 @@ -1912,24 +1912,24 @@ function _detalhes:CreateListPanel() container_barras_window:SetBackdrop({ edgeFile = "Interface\\DialogFrame\\UI-DialogBox-gold-Border", tile = true, tileSize = 16, edgeSize = 5, insets = {left = 1, right = 1, top = 0, bottom = 1},}) - container_barras_window:SetBackdropBorderColor (0, 0, 0, 0) + container_barras_window:SetBackdropBorderColor(0, 0, 0, 0) container_barras:SetBackdrop({ bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, insets = {left = 1, right = 1, top = 0, bottom = 1},}) - container_barras:SetBackdropColor (0, 0, 0, 0) + container_barras:SetBackdropColor(0, 0, 0, 0) - container_barras:SetAllPoints (container_barras_window) - container_barras:SetWidth (500) - container_barras:SetHeight (150) + container_barras:SetAllPoints(container_barras_window) + container_barras:SetWidth(500) + container_barras:SetHeight(150) container_barras:EnableMouse (true) - container_barras:SetResizable (false) + container_barras:SetResizable(false) container_barras:SetMovable (true) - container_barras_window:SetWidth (460) - container_barras_window:SetHeight (550) + container_barras_window:SetWidth(460) + container_barras_window:SetHeight(550) container_barras_window:SetScrollChild (container_barras) - container_barras_window:SetPoint ("TOPLEFT", _detalhes.ListPanel.widget, "TOPLEFT", 21, -10) + container_barras_window:SetPoint("TOPLEFT", _detalhes.ListPanel.widget, "TOPLEFT", 21, -10) _detalhes.gump:NewScrollBar (container_barras_window, container_barras, -10, -17) container_barras_window.slider:Altura (560) @@ -1946,7 +1946,7 @@ function _detalhes:CreateListPanel() if (not row) then row = {text = _detalhes.ListPanel.container:CreateFontString (nil, "overlay", "GameFontNormal")} _detalhes.ListPanel.barras [index] = row - row.text:SetPoint ("topleft", _detalhes.ListPanel.container, "topleft", 0, -index * 15) + row.text:SetPoint("topleft", _detalhes.ListPanel.container, "topleft", 0, -index * 15) end if (filter and text:find (filter)) then @@ -1955,7 +1955,7 @@ function _detalhes:CreateListPanel() row.text:SetTextColor (1, 1, 1) end - row.text:SetText (text) + row.text:SetText(text) end return _detalhes.ListPanel diff --git a/functions/spellcache.lua b/functions/spellcache.lua index 8783271b..5f68cba0 100644 --- a/functions/spellcache.lua +++ b/functions/spellcache.lua @@ -3,7 +3,7 @@ do -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> On The Fly SpellCache +--On The Fly SpellCache local _detalhes = _G._detalhes local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) @@ -14,12 +14,12 @@ do local _GetSpellInfo = GetSpellInfo local _unpack = unpack - --> is this a timewalking exp? + --is this a timewalking exp? local is_classic_exp = DetailsFramework.IsClassicWow() - --> default container + --default container _detalhes.spellcache = {} - local unknowSpell = {Loc ["STRING_UNKNOWSPELL"], _, "Interface\\Icons\\Ability_Druid_Eclipse"} --> localize-me + local unknowSpell = {Loc ["STRING_UNKNOWSPELL"], _, "Interface\\Icons\\Ability_Druid_Eclipse"} --localize-me local AllSpellNames if (is_classic_exp) then @@ -59,7 +59,7 @@ do return spellName, _, AllSpellNames [spell] or spellIcon end - --> reset spell cache + --reset spell cache function _detalhes:ClearSpellCache() _detalhes.spellcache = _setmetatable ({}, {__index = function(tabela, valor) @@ -68,8 +68,8 @@ do return esta_magia end - --> should save only icon and name, other values are not used - if (valor) then --> check if spell is valid before + --should save only icon and name, other values are not used + if (valor) then --check if spell is valid before local cache if (is_classic_exp) then cache = {GetSpellInfoClassic(valor)} @@ -84,19 +84,19 @@ do end}) - --> default overwrites + --default overwrites --_rawset (_detalhes.spellcache, 1, {Loc ["STRING_MELEE"], 1, "Interface\\AddOns\\Details\\images\\melee.tga"}) --_rawset (_detalhes.spellcache, 2, {Loc ["STRING_AUTOSHOT"], 1, "Interface\\AddOns\\Details\\images\\autoshot.tga"}) - --> built-in overwrites + --built-in overwrites for spellId, spellTable in pairs (_detalhes.SpellOverwrite) do local name, _, icon = _GetSpellInfo(spellId) _rawset (_detalhes.spellcache, spellId, {spellTable.name or name, 1, spellTable.icon or icon}) end - --> user overwrites + --user overwrites -- [1] spellid [2] spellname [3] spellicon - for index, spellTable in ipairs (_detalhes.savedCustomSpells) do + for index, spellTable in ipairs(_detalhes.savedCustomSpells) do _rawset (_detalhes.spellcache, spellTable [1], {spellTable [2], 1, spellTable [3]}) end end @@ -157,7 +157,7 @@ do [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) + --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] @@ -229,7 +229,7 @@ do for spellid, t in pairs (defaultSpellCustomization) do local already_have - for index, spelltable in ipairs (_detalhes.savedCustomSpells) do + for index, spelltable in ipairs(_detalhes.savedCustomSpells) do if (spelltable [1] == spellid) then already_have = spelltable end @@ -256,7 +256,7 @@ do function _detalhes:UserCustomSpellAdd (spellid, name, icon) local is_overwrite = false - for index, t in ipairs (_detalhes.savedCustomSpells) do + for index, t in ipairs(_detalhes.savedCustomSpells) do if (t [1] == spellid) then t[2] = name t[3] = icon @@ -284,12 +284,12 @@ do return false end - --> overwrite for API GetSpellInfo function + --overwrite for API GetSpellInfo function _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 + --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) @@ -301,7 +301,7 @@ do end -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> Cache All Spells +--Cache All Spells function _detalhes:BuildSpellListSlow() @@ -314,13 +314,13 @@ do local max = 160000 if (not load_frame) then - load_frame = CreateFrame ("frame", "DetailsLoadSpellCache", UIParent) + load_frame = CreateFrame("frame", "DetailsLoadSpellCache", UIParent) load_frame:SetFrameStrata ("DIALOG") local progress_label = load_frame:CreateFontString ("DetailsLoadSpellCacheProgress", "overlay", "GameFontHighlightSmall") - progress_label:SetText ("Loading Spells: 0%") + progress_label:SetText("Loading Spells: 0%") function _detalhes:BuildSpellListSlowTick() - progress_label:SetText ("Loading Spells: " .. load_frame:GetProgress() .. "%") + progress_label:SetText("Loading Spells: " .. load_frame:GetProgress() .. "%") end load_frame.tick = _detalhes:ScheduleRepeatingTimer ("BuildSpellListSlowTick", 1) @@ -338,11 +338,11 @@ do _detalhes.spellcachefull = SpellCache - load_frame:SetScript ("OnUpdate", function() + load_frame:SetScript("OnUpdate", function() for spellid = step, step+500 do local name, _, icon = blizzGetSpellInfo (spellid) if (name) then - local LetterIndex = _string_lower (_string_sub (name, 1, 1)) --> get the first letter + local LetterIndex = _string_lower (_string_sub (name, 1, 1)) --get the first letter local CachedIndex = SpellCache [LetterIndex] if (CachedIndex) then CachedIndex [spellid] = {name, icon} @@ -358,7 +358,7 @@ do _G.DetailsLoadSpellCache.inprogress = false _detalhes:CancelTimer (_G.DetailsLoadSpellCache.tick) DetailsLoadSpellCacheProgress:Hide() - load_frame:SetScript ("OnUpdate", nil) + load_frame:SetScript("OnUpdate", nil) end end) diff --git a/functions/spells.lua b/functions/spells.lua index 390f1737..a73b25f9 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 = { @@ -3960,7 +3960,7 @@ end --save spells of a segment -local SplitLoadFrame = CreateFrame ("frame") +local SplitLoadFrame = CreateFrame("frame") local MiscContainerNames = { "dispell_spells", "cooldowns_defensive_spells", @@ -3977,9 +3977,9 @@ local SplitLoadFunc = function(self, deltaTime) if (not container) then if (Details.debug) then - Details:Msg ("(debug) finished index spells.") + Details:Msg("(debug) finished index spells.") end - SplitLoadFrame:SetScript ("OnUpdate", nil) + SplitLoadFrame:SetScript("OnUpdate", nil) return end @@ -3997,9 +3997,9 @@ local SplitLoadFunc = function(self, deltaTime) --finished all the 4 container? kill the process if (SplitLoadFrame.NextActorContainer == 5) then - SplitLoadFrame:SetScript ("OnUpdate", nil) + SplitLoadFrame:SetScript("OnUpdate", nil) if (Details.debug) then - Details:Msg ("(debug) finished index spells.") + Details:Msg("(debug) finished index spells.") end return end @@ -4040,7 +4040,7 @@ local SplitLoadFunc = function(self, deltaTime) --if is a misc container elseif (SplitLoadFrame.NextActorContainer == 4) then - for _, containerName in ipairs (MiscContainerNames) do + for _, containerName in ipairs(MiscContainerNames) do --check if the actor have this container if (actorToIndex [containerName]) then local spellList = actorToIndex [containerName]._ActorTable @@ -4086,9 +4086,9 @@ end function Details.StoreSpells() if (Details.debug) then - Details:Msg ("(debug) started to index spells.") + Details:Msg("(debug) started to index spells.") end - SplitLoadFrame:SetScript ("OnUpdate", SplitLoadFunc) + SplitLoadFrame:SetScript("OnUpdate", SplitLoadFunc) SplitLoadFrame.NextActorContainer = 1 SplitLoadFrame.NextActorIndex = 1 end diff --git a/functions/testbars.lua b/functions/testbars.lua index 96693401..e4af5b08 100644 --- a/functions/testbars.lua +++ b/functions/testbars.lua @@ -318,7 +318,7 @@ function Details:CreateTestBars (alphabet, isArena) current_combat.totals [1] = total_damage current_combat.totals [2] = total_heal - for _, instance in ipairs (Details.tabela_instancias) do + for _, instance in ipairs(Details.tabela_instancias) do if (instance:IsEnabled()) then instance:InstanceReset() end diff --git a/functions/timedata.lua b/functions/timedata.lua index 6dadf149..b208bab2 100644 --- a/functions/timedata.lua +++ b/functions/timedata.lua @@ -3,25 +3,25 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> basic stuff +--basic stuff local _ local _detalhes = _G._detalhes local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) - --> mantain the enabled time captures + --mantain the enabled time captures _detalhes.timeContainer = {} _detalhes.timeContainer.Exec = {} ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> local pointers +--local pointers local ipairs = ipairs local _math_floor = math.floor local _pcall = pcall local time = time ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> constants +--constants local INDEX_NAME = 1 local INDEX_FUNCTION = 2 @@ -34,16 +34,16 @@ local DEFAULT_USER_MATRIX = {max_value = 0, last_value = 0} ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> register and unregister captures +--register and unregister captures function _detalhes:TimeDataUpdate (index_or_name, name, func, matrix, author, version, icon, is_enabled) local this_capture - if (type (index_or_name) == "number") then + if (type(index_or_name) == "number") then this_capture = _detalhes.savedTimeCaptures [index_or_name] else - for index, t in ipairs (_detalhes.savedTimeCaptures) do + for index, t in ipairs(_detalhes.savedTimeCaptures) do if (t [INDEX_NAME] == index_or_name) then this_capture = t end @@ -82,31 +82,31 @@ --matrix = table containing {max_value = 0, last_value = 0} function _detalhes:TimeDataRegister (name, func, matrix, author, version, icon, is_enabled, force_no_save) - --> check name + --check name if (not name) then return "Couldn't register the time capture, name was nil." end - --> check if the name already exists - for index, t in ipairs (_detalhes.savedTimeCaptures) do + --check if the name already exists + for index, t in ipairs(_detalhes.savedTimeCaptures) do if (t [INDEX_NAME] == name) then return "Couldn't register the time capture, name already registred." end end - --> check function + --check function if (not func) then return "Couldn't register the time capture, invalid function." end local no_save = nil - --> passed a function means that this isn't came from a user - --> so the plugin register the capture every time it loads. - if (type (func) == "function") then + --passed a function means that this isn't came from a user + --so the plugin register the capture every time it loads. + if (type(func) == "function") then no_save = true - --> this a custom capture from a user, so we register a default user table for matrix - elseif (type (func) == "string") then + --this a custom capture from a user, so we register a default user table for matrix + elseif (type(func) == "string") then matrix = DEFAULT_USER_MATRIX end @@ -115,7 +115,7 @@ no_save = true end - --> check matrix + --check matrix if (not matrix or type (matrix) ~= "table") then return "Couldn't register the time capture, matrix was invalid." end @@ -134,15 +134,15 @@ end - --> unregister + --unregister function _detalhes:TimeDataUnregister (name) - if (type (name) == "number") then + if (type(name) == "number") then tremove (_detalhes.savedTimeCaptures, name) if (_G.DetailsOptionsWindow and _G.DetailsOptionsWindow:IsShown()) then DetailsOptionsWindowTab17UserTimeCapturesFillPanel.MyObject:Refresh() end else - for index, t in ipairs (_detalhes.savedTimeCaptures) do + for index, t in ipairs(_detalhes.savedTimeCaptures) do if (t [INDEX_NAME] == name) then tremove (_detalhes.savedTimeCaptures, index) if (_G.DetailsOptionsWindow and _G.DetailsOptionsWindow:IsShown()) then @@ -155,10 +155,10 @@ end end - --> cleanup when logout + --cleanup when logout function _detalhes:TimeDataCleanUpTemporary() local new_table = {} - for index, t in ipairs (_detalhes.savedTimeCaptures) do + for index, t in ipairs(_detalhes.savedTimeCaptures) do if (not t.do_not_save) then tinsert (new_table, t) end @@ -168,27 +168,27 @@ local tick_time = 0 - --> starting a combat + --starting a combat function _detalhes:TimeDataCreateCombatTables() - --> create capture table + --create capture table local data_captured = {} - --> drop the last capture exec table without wiping + --drop the last capture exec table without wiping local exec = {} _detalhes.timeContainer.Exec = exec - _detalhes:SendEvent ("COMBAT_CHARTTABLES_CREATING") + _detalhes:SendEvent("COMBAT_CHARTTABLES_CREATING") - --> build the exec table - for index, t in ipairs (_detalhes.savedTimeCaptures) do + --build the exec table + for index, t in ipairs(_detalhes.savedTimeCaptures) do if (t [INDEX_ENABLED]) then local data = {} data_captured [t [INDEX_NAME]] = data - if (type (t [INDEX_FUNCTION]) == "string") then - --> user + if (type(t [INDEX_FUNCTION]) == "string") then + --user local func, errortext = loadstring (t [INDEX_FUNCTION]) if (func) then DetailsFramework:SetEnvironment(func) @@ -197,7 +197,7 @@ _detalhes:Msg ("|cFFFF9900error compiling script for time data (charts)|r: ", errortext) end else - --> plugin + --plugin local func = t [INDEX_FUNCTION] DetailsFramework:SetEnvironment(func) tinsert (exec, { func = func, data = data, attributes = Details.CopyTable (t [INDEX_MATRIX]) }) @@ -206,11 +206,11 @@ end end - _detalhes:SendEvent ("COMBAT_CHARTTABLES_CREATED") + _detalhes:SendEvent("COMBAT_CHARTTABLES_CREATED") tick_time = 0 - --> return the capture table the to combat object + --return the capture table the to combat object return data_captured end @@ -238,14 +238,14 @@ tick_time = tick_time + 1 - for index, t in ipairs (_detalhes.timeContainer.Exec) do + for index, t in ipairs(_detalhes.timeContainer.Exec) do if (t.is_user) then - --> by a user + --by a user exec_user_func (t.func, t.attributes, t.data, tick_time) else - --> by a plugin + --by a plugin t.func (t.attributes, t.data, tick_time) end @@ -255,7 +255,7 @@ end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> broker dps stuff +--broker dps stuff local ToKFunctions = _detalhes.ToKFunctions @@ -285,7 +285,7 @@ local get_combat_time = function() local combat_time = _detalhes.tabela_vigente:GetCombatTime() - local minutos, segundos = _math_floor (combat_time / 60), _math_floor (combat_time % 60) + local minutos, segundos = _math_floor(combat_time / 60), _math_floor(combat_time % 60) if (segundos < 10) then segundos = "0" .. segundos end @@ -297,7 +297,7 @@ damage_container:SortByKey ("total") local pos = 1 - for index, actor in ipairs (damage_container._ActorTable) do + for index, actor in ipairs(damage_container._ActorTable) do if (actor.grupo) then if (actor.nome == _detalhes.playername) then return pos @@ -314,7 +314,7 @@ heal_container:SortByKey ("total") local pos = 1 - for index, actor in ipairs (heal_container._ActorTable) do + for index, actor in ipairs(heal_container._ActorTable) do if (actor.grupo) then if (actor.nome == _detalhes.playername) then return pos @@ -332,7 +332,7 @@ local first local first_index - for index, actor in ipairs (damage_container._ActorTable) do + for index, actor in ipairs(damage_container._ActorTable) do if (actor.grupo) then first = actor first_index = index @@ -378,7 +378,7 @@ local first local first_index - for index, actor in ipairs (heal_container._ActorTable) do + for index, actor in ipairs(heal_container._ActorTable) do if (actor.grupo) then first = actor first_index = index @@ -528,10 +528,10 @@ end function _detalhes:SetDataBrokerText (text) - if (type (text) == "string") then + if (type(text) == "string") then _detalhes.data_broker_text = text _detalhes:BrokerTick() - elseif (text == nil or (type (text) == "boolean" and not text)) then + elseif (text == nil or (type(text) == "boolean" and not text)) then _detalhes.data_broker_text = "" _detalhes:BrokerTick() end diff --git a/images/spec_icons_highlight.tga b/images/spec_icons_highlight.tga new file mode 100644 index 00000000..3f24e992 Binary files /dev/null and b/images/spec_icons_highlight.tga differ diff --git a/plugins/Details_DataStorage/Details_DataStorage.lua b/plugins/Details_DataStorage/Details_DataStorage.lua index f089b74e..3b946649 100644 --- a/plugins/Details_DataStorage/Details_DataStorage.lua +++ b/plugins/Details_DataStorage/Details_DataStorage.lua @@ -13,18 +13,18 @@ function _detalhes:CreateStorageDB() return DetailsDataStorage end -local f = CreateFrame ("frame", nil, UIParent) +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 DetailsDataStorage = DetailsDataStorage or _detalhes:CreateStorageDB() if (DetailsDataStorage.VERSION < DETAILS_STORAGE_VERSION) then - --> do revisions + --do revisions if (DetailsDataStorage.VERSION < 5) then table.wipe (DetailsDataStorage) DetailsDataStorage = _detalhes:CreateStorageDB() diff --git a/plugins/Details_EncounterDetails/Details_EncounterDetails.lua b/plugins/Details_EncounterDetails/Details_EncounterDetails.lua index 04dfbde0..3e41b828 100644 --- a/plugins/Details_EncounterDetails/Details_EncounterDetails.lua +++ b/plugins/Details_EncounterDetails/Details_EncounterDetails.lua @@ -10,35 +10,35 @@ local function DebugMessage (...) end end ---> Needed locals -local _GetTime = GetTime --> wow api local -local _UFC = UnitAffectingCombat --> wow api local -local _IsInRaid = IsInRaid --> wow api local -local _IsInGroup = IsInGroup --> wow api local -local _UnitAura = UnitAura --> wow api local -local _GetSpellInfo = _detalhes.getspellinfo --> wow api local -local _CreateFrame = CreateFrame --> wow api local -local _GetTime = GetTime --> wow api local -local _GetCursorPosition = GetCursorPosition --> wow api local -local _GameTooltip = GameTooltip --> wow api local +--Needed locals +local _GetTime = GetTime --wow api local +local _UFC = UnitAffectingCombat --wow api local +local _IsInRaid = IsInRaid --wow api local +local _IsInGroup = IsInGroup --wow api local +local _UnitAura = UnitAura --wow api local +local _GetSpellInfo = _detalhes.getspellinfo --wow api local +local _CreateFrame = CreateFrame --wow api local +local _GetTime = GetTime --wow api local +local _GetCursorPosition = GetCursorPosition --wow api local +local _GameTooltip = GameTooltip --wow api local local GameCooltip = GameCooltip2 -local _math_floor = math.floor --> lua library local -local _cstr = string.format --> lua library local -local _ipairs = ipairs --> lua library local -local _pairs = pairs --> lua library local -local _table_sort = table.sort --> lua library local -local _table_insert = table.insert --> lua library local -local _unpack = unpack --> lua library local +local _math_floor = math.floor --lua library local +local _cstr = string.format --lua library local +local _ipairs = ipairs --lua library local +local _pairs = pairs --lua library local +local _table_sort = table.sort --lua library local +local _table_insert = table.insert --lua library local +local _unpack = unpack --lua library local local _bit_band = bit.band local CONST_FONT_SIZE = 10 ---> Create the plugin Object +--Create the plugin Object local EncounterDetails = _detalhes:NewPluginObject ("Details_EncounterDetails", DETAILSPLUGIN_ALWAYSENABLED) tinsert (UISpecialFrames, "Details_EncounterDetails") ---> Main Frame +--Main Frame local EncounterDetailsFrame = EncounterDetails.Frame EncounterDetailsFrame.DefaultBarHeight = 20 EncounterDetailsFrame.CooltipStatusbarAlpha = .65 @@ -46,10 +46,10 @@ EncounterDetailsFrame.DefaultBarTexture = "Interface\\AddOns\\Details\\images\\b EncounterDetails:SetPluginDescription ("Raid encounters summary, show basic stuff like dispels, interrupts and also graphic charts, boss emotes and the Weakaura Creation Tool.") ---> container types -local class_type_damage = _detalhes.atributos.dano --> damage -local class_type_misc = _detalhes.atributos.misc --> misc ---> main combat object +--container types +local class_type_damage = _detalhes.atributos.dano --damage +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 @@ -61,14 +61,14 @@ EncounterDetails.debugmode = false function EncounterDetails:FormatCooltipSettings() GameCooltip:SetType ("tooltip") - GameCooltip:SetOption ("StatusBarTexture", [[Interface\AddOns\Details\images\bar_serenity]]) - GameCooltip:SetOption ("StatusBarHeightMod", 0) - GameCooltip:SetOption ("FixedWidth", 280) - GameCooltip:SetOption ("TextSize", 11) - GameCooltip:SetOption ("LeftBorderSize", -4) - GameCooltip:SetOption ("RightBorderSize", 5) - GameCooltip:SetOption ("ButtonsYMod", 0) - GameCooltip:SetOption ("YSpacingMod", -1) + GameCooltip:SetOption("StatusBarTexture", [[Interface\AddOns\Details\images\bar_serenity]]) + GameCooltip:SetOption("StatusBarHeightMod", 0) + GameCooltip:SetOption("FixedWidth", 280) + GameCooltip:SetOption("TextSize", 11) + GameCooltip:SetOption("LeftBorderSize", -4) + GameCooltip:SetOption("RightBorderSize", 5) + GameCooltip:SetOption("ButtonsYMod", 0) + GameCooltip:SetOption("YSpacingMod", -1) end EncounterDetails.CooltipLineHeight = 18 @@ -94,41 +94,41 @@ local ability_type_table = { } ---> main object frame functions +--main object frame functions local function CreatePluginFrames (data) - --> catch Details! main object + --catch Details! main object local _detalhes = Details local DetailsFrameWork = _detalhes.gump - --> saved data if any + --saved data if any EncounterDetails.data = data or {} - --> record if button is shown + --record if button is shown EncounterDetails.showing = false - --> record if boss window is open or not + --record if boss window is open or not EncounterDetails.window_open = false EncounterDetails.combat_boss_found = false - --> OnEvent Table + --OnEvent Table function EncounterDetails:OnDetailsEvent (event, ...) - --> when main frame became hide - if (event == "HIDE") then --> plugin hidded, disabled + --when main frame became hide + if (event == "HIDE") then --plugin hidded, disabled self.open = false - --> when main frame is shown on screen - elseif (event == "SHOW") then --> plugin hidded, disabled + --when main frame is shown on screen + elseif (event == "SHOW") then --plugin hidded, disabled self.open = true EncounterDetails:RefreshScale() - --> when details finish his startup and are ready to work + --when details finish his startup and are ready to work elseif (event == "DETAILS_STARTED") then - --> check if details are in combat, if not check if the last fight was a boss fight + --check if details are in combat, if not check if the last fight was a boss fight if (not EncounterDetails:IsInCombat()) then - --> get the current combat table + --get the current combat table _combat_object = EncounterDetails:GetCombat() - --> check if was a boss fight + --check if was a boss fight EncounterDetails:WasEncounter() end @@ -148,7 +148,7 @@ local function CreatePluginFrames (data) -- this script takes the current combat and request the total of damage done by the group. -- first lets take the current combat and name it "current_combat". - local current_combat = _detalhes:GetCombat ("current") --> getting the current combat + local current_combat = _detalhes:GetCombat ("current") --getting the current combat -- now lets ask the combat for the total damage done by the raide group. local total_damage = current_combat:GetTotal ( DETAILS_ATTRIBUTE_DAMAGE, nil, DETAILS_TOTALS_ONLYGROUP ) @@ -173,7 +173,7 @@ local function CreatePluginFrames (data) --EncounterDetails:CreateCallbackListeners() - elseif (event == "COMBAT_PLAYER_ENTER") then --> combat started + elseif (event == "COMBAT_PLAYER_ENTER") then --combat started if (EncounterDetails.showing and EncounterDetails.db.hide_on_combat) then --EncounterDetails:HideIcon() EncounterDetails:CloseWindow() @@ -182,9 +182,9 @@ local function CreatePluginFrames (data) EncounterDetails.current_whisper_table = {} elseif (event == "COMBAT_PLAYER_LEAVE") then - --> combat leave and enter always send current combat table + --combat leave and enter always send current combat table _combat_object = select (1, ...) - --> check if was a boss fight + --check if was a boss fight EncounterDetails:WasEncounter() if (EncounterDetails.combat_boss_found) then EncounterDetails.combat_boss_found = false @@ -272,8 +272,8 @@ local function CreatePluginFrames (data) local current_table_dbm = {} local current_table_bigwigs = {} - local event_frame = CreateFrame ("frame", nil, UIParent, "BackdropTemplate") - event_frame:SetScript ("OnEvent", function(self, event, ...) + local event_frame = CreateFrame("frame", nil, UIParent, "BackdropTemplate") + event_frame:SetScript("OnEvent", function(self, event, ...) if (event == "ENCOUNTER_START") then local encounterID, encounterName, difficultyID, raidSize = select (1, ...) current_encounter = encounterID @@ -331,7 +331,7 @@ local function CreatePluginFrames (data) --print (event, module, spellid, bar_text, time, icon, ...) spellid = tostring (spellid) if (not current_table_bigwigs [spellid]) then - current_table_bigwigs [spellid] = {(type (module) == "string" and module) or (module and module.moduleName) or "", spellid or "", bar_text or "", time or 0, icon or ""} + current_table_bigwigs [spellid] = {(type(module) == "string" and module) or (module and module.moduleName) or "", spellid or "", bar_text or "", time or 0, icon or ""} end end if (BigWigsLoader.RegisterMessage) then @@ -351,7 +351,7 @@ local function CreatePluginFrames (data) function EncounterDetails:WasEncounter() - --> check if last combat was a boss encounter fight + --check if last combat was a boss encounter fight if (not EncounterDetails.debugmode) then if (not _combat_object.is_boss) then @@ -366,11 +366,11 @@ local function CreatePluginFrames (data) end - --> boss found, we need to show the icon + --boss found, we need to show the icon EncounterDetails:ShowIcon() end - --> show icon on toolbar + --show icon on toolbar local re_ShowIconBallonTutorial = function() EncounterDetails:ShowIconBallonTutorial() @@ -396,13 +396,13 @@ local function CreatePluginFrames (data) end --[=[ - local alert = CreateFrame ("frame", "EncounterDetailsTutorialAlertButton1", EncounterDetails.ToolbarButton, "MicroButtonAlertTemplate") + local alert = CreateFrame("frame", "EncounterDetailsTutorialAlertButton1", EncounterDetails.ToolbarButton, "MicroButtonAlertTemplate") alert:SetFrameLevel (302) alert.label = "Click here (on the skull icon) to bring the Encounter Breakdown panel" alert.Text:SetSpacing (4) alert:SetClampedToScreen (true) MicroButtonAlert_SetText (alert, alert.label) - alert:SetPoint ("bottom", EncounterDetails.ToolbarButton, "top", 0, 22) + alert:SetPoint("bottom", EncounterDetails.ToolbarButton, "top", 0, 22) alert.CloseButton:HookScript ("OnClick", hook_AlertButtonCloseButton) alert:Show() --]=] @@ -411,7 +411,7 @@ local function CreatePluginFrames (data) function EncounterDetails:ShowIcon() EncounterDetails.showing = true - --> [1] button to show [2] button animation: "star", "blink" or true (blink) + --[1] button to show [2] button animation: "star", "blink" or true (blink) EncounterDetails:ShowToolbarIcon (EncounterDetails.ToolbarButton, "star") --EncounterDetails:SetTutorialCVar ("ENCOUNTER_DETAILS_BALLON_TUTORIAL1", false) --debug @@ -422,7 +422,7 @@ local function CreatePluginFrames (data) end - --> hide icon on toolbar + -- hide icon on toolbar function EncounterDetails:HideIcon() EncounterDetails.showing = false EncounterDetails:HideToolbarIcon (EncounterDetails.ToolbarButton) @@ -449,17 +449,17 @@ local function CreatePluginFrames (data) end) end) - --> user clicked on button, need open or close window + --user clicked on button, need open or close window function EncounterDetails:OpenWindow() if (EncounterDetails.Frame:IsShown()) then return EncounterDetails:CloseWindow() end - --> build all window data + --build all window data EncounterDetails.db.opened = EncounterDetails.db.opened + 1 EncounterDetails:OpenAndRefresh() - --> show + --show EncounterDetailsFrame:Show() EncounterDetails.open = true @@ -501,20 +501,20 @@ local function CreatePluginFrames (data) CoolTip:Reset() CoolTip:SetType ("menu") - CoolTip:SetOption ("TextSize", Details.font_sizes.menus) - CoolTip:SetOption ("TextFont", Details.font_faces.menus) + CoolTip:SetOption("TextSize", Details.font_sizes.menus) + CoolTip:SetOption("TextFont", Details.font_faces.menus) - CoolTip:SetOption ("ButtonHeightModSub", -2) - CoolTip:SetOption ("ButtonHeightMod", -5) + CoolTip:SetOption("ButtonHeightModSub", -2) + CoolTip:SetOption("ButtonHeightMod", -5) - CoolTip:SetOption ("ButtonsYModSub", -3) - CoolTip:SetOption ("ButtonsYMod", -6) + CoolTip:SetOption("ButtonsYModSub", -3) + CoolTip:SetOption("ButtonsYMod", -6) - CoolTip:SetOption ("YSpacingModSub", -3) - CoolTip:SetOption ("YSpacingMod", 1) + CoolTip:SetOption("YSpacingModSub", -3) + CoolTip:SetOption("YSpacingMod", 1) - CoolTip:SetOption ("HeighMod", 3) - CoolTip:SetOption ("SubFollowButton", true) + CoolTip:SetOption("HeighMod", 3) + CoolTip:SetOption("SubFollowButton", true) Details:SetTooltipMinWidth() @@ -564,8 +564,8 @@ local function CreatePluginFrames (data) local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0") - --CoolTip:SetBannerImage (1, [[]], 200, 22, avatarPoint, avatarTexCoord, nil) --> overlay [2] avatar path - --CoolTip:SetBannerText (1, Loc ["STRING_PLUGIN_NAME"], textPoint, {1, 1, 1}, 14, SharedMedia:Fetch ("font", _detalhes.tooltip.fontface)) --> text [1] nickname + --CoolTip:SetBannerImage (1, [[]], 200, 22, avatarPoint, avatarTexCoord, nil) --overlay [2] avatar path + --CoolTip:SetBannerText (1, Loc ["STRING_PLUGIN_NAME"], textPoint, {1, 1, 1}, 14, SharedMedia:Fetch ("font", _detalhes.tooltip.fontface)) --text [1] nickname --apply the backdrop settings to the menu Details:FormatCooltipBackdrop() @@ -575,17 +575,17 @@ local function CreatePluginFrames (data) end EncounterDetails.ToolbarButton = _detalhes.ToolBar:NewPluginToolbarButton (EncounterDetails.OpenWindow, "Interface\\AddOns\\Details_EncounterDetails\\images\\icon", Loc ["STRING_PLUGIN_NAME"], Loc ["STRING_TOOLTIP"], 16, 16, "ENCOUNTERDETAILS_BUTTON", cooltip_menu) --"Interface\\COMMON\\help-i" - EncounterDetails.ToolbarButton.shadow = true --> loads icon_shadow.tga when the instance is showing icons with shadows + EncounterDetails.ToolbarButton.shadow = true --loads icon_shadow.tga when the instance is showing icons with shadows - --> setpoint anchors mod if needed + --setpoint anchors mod if needed EncounterDetails.ToolbarButton.y = 0.5 EncounterDetails.ToolbarButton.x = 0 - --> build all frames ans widgets + --build all frames ans widgets _detalhes.EncounterDetailsTempWindow (EncounterDetails) _detalhes.EncounterDetailsTempWindow = nil - --> ~remover ~autoabrir �brir ~abrir ~auto + --~remover ~autoabrir �brir ~abrir ~auto --C_Timer.After (.5, EncounterDetails.OpenWindow) @@ -603,7 +603,7 @@ local sort_damage_from = function(a, b) end end ---> custom tooltip for dead details --------------------------------------------------------------------------------------------------------- +--custom tooltip for dead details --------------------------------------------------------------------------------------------------------- --tooltip backdrop, color and border local bgColor, borderColor = {0.17, 0.17, 0.17, .9}, {.30, .30, .30, .3} @@ -630,9 +630,9 @@ end local statusBarBackground = {value = 100, color = {.21, .21, .21, 0.8}, texture = [[Interface\AddOns\Details\images\bar_serenity]]} --death parser - for index, event in _ipairs (eventos) do + for index, event in _ipairs(eventos) do - local hp = _math_floor (event[5]/hp_max*100) + local hp = _math_floor(event[5]/hp_max*100) if (hp > 100) then hp = 100 end @@ -643,10 +643,10 @@ end local time = event [4] local source = event [6] - if (type (evtype) == "boolean") then - --> is damage or heal + if (type(evtype) == "boolean") then + --is damage or heal if (evtype) then - --> damage + --damage local overkill = event [10] or 0 if (overkill > 0) then @@ -664,14 +664,14 @@ end GameCooltip:AddIcon (spellicon, 1, 1, 16, 16, .1, .9, .1, .9) if (event [9]) then - --> friendly fire + --friendly fire GameCooltip:AddStatusBar (hp, 1, "darkorange", true, statusBarBackground) else - --> from a enemy + --from a enemy GameCooltip:AddStatusBar (hp, 1, "red", true, statusBarBackground) end else - --> heal + --heal local class = Details:GetClass (source) local spec = Details:GetSpec (source) @@ -680,23 +680,23 @@ end GameCooltip:AddStatusBar (hp, 1, "green", true, statusBarBackground) end - elseif (type (evtype) == "number") then + elseif (type(evtype) == "number") then if (evtype == 1) then - --> cooldown + --cooldown GameCooltip:AddLine ("" .. _cstr ("%.1f", time - hora_da_morte) .. "s " .. spellname .. " (" .. source .. ")", "cooldown (" .. hp .. "%)", 1, "white", "white") GameCooltip:AddIcon (spellicon, 1, 1, 16, 16, .1, .9, .1, .9) GameCooltip:AddStatusBar (100, 1, "yellow", true, statusBarBackground) elseif (evtype == 2 and not battleress) then - --> battle ress + --battle ress battleress = event elseif (evtype == 3) then - --> last cooldown used + --last cooldown used lastcooldown = event elseif (evtype == 4) then - --> debuff + --debuff if (source:find ("%[")) then source = source:gsub ("%[%*%] ", "") end @@ -733,32 +733,32 @@ end end --death log cooltip settings - GameCooltip:SetOption ("StatusBarHeightMod", -6) - GameCooltip:SetOption ("FixedWidth", 400) - GameCooltip:SetOption ("TextSize", 10) - GameCooltip:SetOption ("LeftBorderSize", -4) - GameCooltip:SetOption ("RightBorderSize", 5) - GameCooltip:SetOption ("StatusBarTexture", [[Interface\AddOns\Details\images\bar_serenity]]) - GameCooltip:SetBackdrop (1, _detalhes.cooltip_preset2_backdrop, bgColor, borderColor) + GameCooltip:SetOption("StatusBarHeightMod", -6) + GameCooltip:SetOption("FixedWidth", 400) + GameCooltip:SetOption("TextSize", 10) + GameCooltip:SetOption("LeftBorderSize", -4) + GameCooltip:SetOption("RightBorderSize", 5) + GameCooltip:SetOption("StatusBarTexture", [[Interface\AddOns\Details\images\bar_serenity]]) + GameCooltip:SetBackdrop(1, _detalhes.cooltip_preset2_backdrop, bgColor, borderColor) GameCooltip:SetOwner (row, "bottomright", "bottomleft", -2, -50) row.OverlayTexture:Show() GameCooltip:ShowCooltip() end ---> custom tooltip for dispells details --------------------------------------------------------------------------------------------------------- +--custom tooltip for dispells details --------------------------------------------------------------------------------------------------------- local function DispellInfo (dispell, barra) - local jogadores = dispell [1] --> [nome od jogador] = total + local jogadores = dispell [1] --[nome od jogador] = total local tabela_jogadores = {} - for nome, tabela in _pairs (jogadores) do --> tabela = [1] total tomado [2] classe + for nome, tabela in _pairs (jogadores) do --tabela = [1] total tomado [2] classe tabela_jogadores [#tabela_jogadores + 1] = {nome, tabela [1], tabela [2]} end _table_sort (tabela_jogadores, _detalhes.Sort2) - for index, tabela in _ipairs (tabela_jogadores) do + for index, tabela in _ipairs(tabela_jogadores) do local coords = EncounterDetails.class_coords [tabela[3]] if (not coords) then GameCooltip:AddLine (EncounterDetails:GetOnlyName (tabela[1]), tabela[2], 1, "white", "orange") @@ -780,19 +780,19 @@ local function DispellInfo (dispell, barra) if (spellname) then GameTooltip:SetOwner (GameCooltipFrame1, "ANCHOR_NONE") GameTooltip:SetSpellByID(barra.spellid) - GameTooltip:SetPoint ("topright", GameCooltipFrame1, "topleft", -2, 0) + GameTooltip:SetPoint("topright", GameCooltipFrame1, "topleft", -2, 0) GameTooltip:Show() end end ---> custom tooltip for kick details --------------------------------------------------------------------------------------------------------- +--custom tooltip for kick details --------------------------------------------------------------------------------------------------------- local function KickBy (magia, barra) - local jogadores = magia [1] --> [nome od jogador] = total + local jogadores = magia [1] --[nome od jogador] = total local tabela_jogadores = {} - for nome, tabela in _pairs (jogadores) do --> tabela = [1] total tomado [2] classe + for nome, tabela in _pairs (jogadores) do --tabela = [1] total tomado [2] classe tabela_jogadores [#tabela_jogadores + 1] = {nome, tabela [1], tabela [2]} end @@ -804,7 +804,7 @@ local function KickBy (magia, barra) GameCooltip:AddIcon (spellIcon, nil, 1, EncounterDetails.CooltipLineHeight, EncounterDetails.CooltipLineHeight, 5/64, 59/64, 5/64, 59/64) end - for index, tabela in _ipairs (tabela_jogadores) do + for index, tabela in _ipairs(tabela_jogadores) do local coords = EncounterDetails.class_coords [tabela[3]] GameCooltip:AddLine (EncounterDetails:GetOnlyName (tabela[1]), tabela[2], 1, "white") @@ -823,24 +823,24 @@ local function KickBy (magia, barra) if (spellname) then GameTooltip:SetOwner (GameCooltipFrame1, "ANCHOR_NONE") GameTooltip:SetSpellByID(barra.spellid) - GameTooltip:SetPoint ("topright", GameCooltipFrame1, "topleft", -2, 0) + GameTooltip:SetPoint("topright", GameCooltipFrame1, "topleft", -2, 0) GameTooltip:Show() end end ---> custom tooltip for enemy abilities details --------------------------------------------------------------------------------------------------------- +--custom tooltip for enemy abilities details --------------------------------------------------------------------------------------------------------- local function EnemySkills (habilidade, barra) - --> barra.jogador agora tem a tabela com --> [1] total dano causado [2] jogadores que foram alvos [3] jogadores que castaram essa magia [4] ID da magia + --barra.jogador agora tem a tabela com --[1] total dano causado [2] jogadores que foram alvos [3] jogadores que castaram essa magia [4] ID da magia local total = habilidade [1] - local jogadores = habilidade [2] --> [nome od jogador] = total + local jogadores = habilidade [2] --[nome od jogador] = total local tabela_jogadores = {} local total = 0 - for nome, tabela in _pairs (jogadores) do --> tabela = [1] total tomado [2] classe + for nome, tabela in _pairs (jogadores) do --tabela = [1] total tomado [2] classe tabela_jogadores [#tabela_jogadores + 1] = {nome, tabela[1], tabela[2]} total = total + tabela[1] end @@ -853,7 +853,7 @@ local function EnemySkills (habilidade, barra) local topValue = tabela_jogadores [1] and tabela_jogadores [1][2] - for index, tabela in _ipairs (tabela_jogadores) do + for index, tabela in _ipairs(tabela_jogadores) do local coords = EncounterDetails.class_coords [tabela[3]] GameCooltip:AddLine (EncounterDetails:GetOnlyName (tabela[1]), ToK (_, tabela[2]) .. " (" .. format ("%.1f", tabela[2] / total * 100) .. "%)", 1, "white") @@ -882,27 +882,27 @@ local function EnemySkills (habilidade, barra) if (spellname) then GameTooltip:SetOwner (GameCooltipFrame1, "ANCHOR_NONE") GameTooltip:SetSpellByID(barra.spellid) - GameTooltip:SetPoint ("right", barra, "left", -2, 0) + GameTooltip:SetPoint("right", barra, "left", -2, 0) GameTooltip:Show() end GameCooltip:SetOwner (barra, "left", "right", 2, 0) end ---> custom tooltip for damage taken details --------------------------------------------------------------------------------------------------------- +--custom tooltip for damage taken details --------------------------------------------------------------------------------------------------------- local function DamageTakenDetails (jogador, barra) local agressores = jogador.damage_from local damage_taken = jogador.damage_taken - local showing = _combat_object [class_type_damage] --> o que esta sendo mostrado -> [1] - dano [2] - cura --> pega o container com ._NameIndexTable ._ActorTable + local showing = _combat_object [class_type_damage] --o que esta sendo mostrado -> [1] - dano [2] - cura --pega o container com ._NameIndexTable ._ActorTable local meus_agressores = {} - for nome, _ in _pairs (agressores) do --> agressores seria a lista de nomes + for nome, _ in _pairs (agressores) do --agressores seria a lista de nomes 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 + if (este_agressor) then --checagem por causa do total e do garbage collector que n�o limpa os nomes que deram dano local habilidades = este_agressor.spells._ActorTable for id, habilidade in _pairs (habilidades) do local alvos = habilidade.targets @@ -950,14 +950,14 @@ local function DamageTakenDetails (jogador, barra) GameCooltip:SetOwner (barra, "left", "right", 2, 0) end ---> custom tooltip clicks on any bar --------------------------------------------------------------------------------------------------------- +--custom tooltip clicks on any bar --------------------------------------------------------------------------------------------------------- function _detalhes:BossInfoRowClick (barra, param1) - if (type (self) == "table") then + if (type(self) == "table") then barra, param1 = self, barra end - if (type (param1) == "table") then + if (type(param1) == "table") then barra = param1 end @@ -967,7 +967,7 @@ function _detalhes:BossInfoRowClick (barra, param1) local reportar - if (barra.TTT == "morte" or true) then --> deaths -- todos os boxes est�o usando cooltip, por isso o 'true'. + if (barra.TTT == "morte" or true) then --deaths -- todos os boxes est�o usando cooltip, por isso o 'true'. reportar = {barra.report_text .. " " .. (barra.lineText1 and barra.lineText1:GetText() or barra:GetParent() and barra:GetParent().lineText1 and barra:GetParent().lineText1:GetText() or "")} local beginAt = 1 @@ -1009,29 +1009,29 @@ function _detalhes:BossInfoRowClick (barra, param1) end ---> custom tooltip that handle mouse enter and leave on customized rows --------------------------------------------------------------------------------------------------------- +--custom tooltip that handle mouse enter and leave on customized rows --------------------------------------------------------------------------------------------------------- local backdrop_bar_onenter = {bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16, edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border", edgeSize = 8, insets = {left = 1, right = 1, top = 0, bottom = 1}} local backdrop_bar_onleave = {bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16, insets = {left = 1, right = 1, top = 0, bottom = 1}} function EncounterDetails:SetRowScripts (barra, index, container) - barra:SetScript ("OnMouseDown", function(self) + barra:SetScript("OnMouseDown", function(self) if (self.fading_in) then return end self.mouse_down = _GetTime() local x, y = _GetCursorPosition() - self.x = _math_floor (x) - self.y = _math_floor (y) + self.x = _math_floor(x) + self.y = _math_floor(y) --EncounterDetailsFrame:StartMoving() EncounterDetailsFrame.isMoving = true end) - barra:SetScript ("OnMouseUp", function(self) + barra:SetScript("OnMouseUp", function(self) if (self.fading_in) then return @@ -1040,27 +1040,27 @@ function EncounterDetails:SetRowScripts (barra, index, container) if (EncounterDetailsFrame.isMoving) then --EncounterDetailsFrame:GetParent():StopMovingOrSizing() EncounterDetailsFrame.isMoving = false - --instancia:SaveMainWindowPosition() --> precisa fazer algo pra salvar o trem + --instancia:SaveMainWindowPosition() --precisa fazer algo pra salvar o trem end local x, y = _GetCursorPosition() - x = _math_floor (x) - y = _math_floor (y) + x = _math_floor(x) + 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 _detalhes:BossInfoRowClick (self) end end) - barra:SetScript ("OnEnter", --> MOUSE OVER + barra:SetScript("OnEnter", --MOUSE OVER function(self) - --> aqui 1 + --aqui 1 if (container.fading_in or container.faded) then return end self.mouse_over = true - self:SetHeight (EncounterDetails.Frame.DefaultBarHeight + 1) + self:SetHeight(EncounterDetails.Frame.DefaultBarHeight + 1) self:SetAlpha (1) EncounterDetails.SetBarBackdrop_OnEnter (self) @@ -1069,14 +1069,14 @@ function EncounterDetails:SetRowScripts (barra, index, container) GameCooltip:SetOwner (self) EncounterDetails:FormatCooltipSettings() - if (not self.TTT) then --> tool tip type + if (not self.TTT) then --tool tip type return end - if (self.TTT == "damage_taken") then --> damage taken + if (self.TTT == "damage_taken") then --damage taken DamageTakenDetails (self.jogador, barra) - elseif (self.TTT == "habilidades_inimigas") then --> enemy abilytes + elseif (self.TTT == "habilidades_inimigas") then --enemy abilytes self.spellid = self.jogador [4] EnemySkills (self.jogador, self) @@ -1088,23 +1088,23 @@ function EncounterDetails:SetRowScripts (barra, index, container) self.spellid = self.jogador [3] DispellInfo (self.jogador, self) - elseif (self.TTT == "morte") then --> deaths - KillInfo (self.jogador, self) --> aqui 2 + elseif (self.TTT == "morte") then --deaths + KillInfo (self.jogador, self) --aqui 2 end GameCooltip:Show() end) - barra:SetScript ("OnLeave", --> MOUSE OUT + barra:SetScript("OnLeave", --MOUSE OUT function(self) - self:SetScript ("OnUpdate", nil) + self:SetScript("OnUpdate", nil) if (self.fading_in or self.faded or not self:IsShown() or self.hidden) then return end - self:SetHeight (EncounterDetails.Frame.DefaultBarHeight) + self:SetHeight(EncounterDetails.Frame.DefaultBarHeight) self:SetAlpha (0.9) EncounterDetails.SetBarBackdrop_OnLeave (self) @@ -1118,7 +1118,7 @@ function EncounterDetails:SetRowScripts (barra, index, container) end) end ---> Here start the data mine --------------------------------------------------------------------------------------------------------- +--Here start the data mine --------------------------------------------------------------------------------------------------------- function EncounterDetails:OpenAndRefresh (_, segment) local frame = EncounterDetailsFrame --alias @@ -1144,7 +1144,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) local historico = _detalhes.tabela_historico.tabelas local foundABoss = false - for index, combate in ipairs (historico) do + for index, combate in ipairs(historico) do if (combate.is_boss and combate.is_boss.index) then EncounterDetails._segment = index _combat_object = combate @@ -1190,7 +1190,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) DebugMessage ("_combat_object is not a boss, trying another loop in the segments") local foundSegment - for index, combat in _ipairs (EncounterDetails:GetCombatSegments()) do + for index, combat in _ipairs(EncounterDetails:GetCombatSegments()) do if (combat.is_boss and EncounterDetails:GetBossDetails (combat.is_boss.mapid, combat.is_boss.index)) then _combat_object = combat @@ -1220,7 +1220,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) end end - --> the segment is a boss + --the segment is a boss boss_id = _combat_object.is_boss.index map_id = _combat_object.is_boss.mapid @@ -1244,8 +1244,8 @@ function EncounterDetails:OpenAndRefresh (_, segment) EncounterDetails.LastSegmentShown = _combat_object -------------- set boss name and zone name -------------- - EncounterDetailsFrame.boss_name:SetText (_combat_object.is_boss.encounter) - EncounterDetailsFrame.raid_name:SetText (_combat_object.is_boss.zone) + EncounterDetailsFrame.boss_name:SetText(_combat_object.is_boss.encounter) + EncounterDetailsFrame.raid_name:SetText(_combat_object.is_boss.zone) -------------- set portrait and background image -------------- @@ -1253,31 +1253,31 @@ function EncounterDetails:OpenAndRefresh (_, segment) local L, R, T, B, Texture = EncounterDetails:GetBossIcon (mapID, _combat_object.is_boss.index) if (L) then - EncounterDetailsFrame.boss_icone:SetTexture (Texture) + EncounterDetailsFrame.boss_icone:SetTexture(Texture) EncounterDetailsFrame.boss_icone:SetTexCoord (L, R, T, B) else - EncounterDetailsFrame.boss_icone:SetTexture ([[Interface\CHARACTERFRAME\TempPortrait]]) + EncounterDetailsFrame.boss_icone:SetTexture([[Interface\CHARACTERFRAME\TempPortrait]]) EncounterDetailsFrame.boss_icone:SetTexCoord (0, 1, 0, 1) end --[=[ local file, L, R, T, B = EncounterDetails:GetRaidBackground (_combat_object.is_boss.mapid) if (file) then - EncounterDetailsFrame.raidbackground:SetTexture (file) + EncounterDetailsFrame.raidbackground:SetTexture(file) EncounterDetailsFrame.raidbackground:SetTexCoord (L, R, T, B) else - EncounterDetailsFrame.raidbackground:SetTexture ([[Interface\Glues\LOADINGSCREENS\LoadScreenDungeon]]) + EncounterDetailsFrame.raidbackground:SetTexture([[Interface\Glues\LOADINGSCREENS\LoadScreenDungeon]]) EncounterDetailsFrame.raidbackground:SetTexCoord (0, 1, 120/512, 408/512) end --]=] - EncounterDetailsFrame.raidbackground:SetTexture (.3, .3, .3, .5) + EncounterDetailsFrame.raidbackground:SetTexture(.3, .3, .3, .5) -------------- set totals on down frame -------------- --[[ data mine: _combat_object ["totals_grupo"] hold the total [1] damage // [2] heal // [3] [energy_name] energies // [4] [misc_name] miscs --]] - --> Container Overall Damage Taken ~damagetaken ~damage taken + --Container Overall Damage Taken ~damagetaken ~damage taken --[[ data mine: combat tables have 4 containers [1] damage [2] heal [3] energy [4] misc each container have 2 tables: ._NameIndexTable and ._ActorTable --]] local DamageContainer = _combat_object [class_type_damage] @@ -1289,10 +1289,10 @@ function EncounterDetails:OpenAndRefresh (_, segment) local quantidade = 0 local dano_do_primeiro = 0 - for index, jogador in _ipairs (DamageContainer._ActorTable) do - --> ta em ordem de quem tomou mais dano. + for index, jogador in _ipairs(DamageContainer._ActorTable) do + --ta em ordem de quem tomou mais dano. - if (not jogador.grupo) then --> s� aparecer nego da raid + if (not jogador.grupo) then --s� aparecer nego da raid break end @@ -1302,17 +1302,17 @@ function EncounterDetails:OpenAndRefresh (_, segment) barra = EncounterDetails:CreateRow (index, container, 1, 0, -1) _detalhes:SetFontSize (barra.lineText1, CONST_FONT_SIZE) _detalhes:SetFontSize (barra.lineText4, CONST_FONT_SIZE) - barra.TTT = "damage_taken" -- tool tip type --> damage taken + barra.TTT = "damage_taken" -- tool tip type --damage taken barra.report_text = Loc ["STRING_PLUGIN_NAME"].."! "..Loc ["STRING_DAMAGE_TAKEN_REPORT"] end if (jogador.nome:find ("-")) then - barra.lineText1:SetText (jogador.nome:gsub (("-.*"), "")) + barra.lineText1:SetText(jogador.nome:gsub (("-.*"), "")) else - barra.lineText1:SetText (jogador.nome) + barra.lineText1:SetText(jogador.nome) end - barra.lineText4:SetText (ToK (_, jogador.damage_taken)) + barra.lineText4:SetText(ToK (_, jogador.damage_taken)) _detalhes:name_space (barra) @@ -1321,19 +1321,19 @@ function EncounterDetails:OpenAndRefresh (_, segment) barra.textura:SetStatusBarColor (_unpack (_detalhes.class_colors [jogador.classe])) if (index == 1) then - barra.textura:SetValue (100) + barra.textura:SetValue(100) dano_do_primeiro = jogador.damage_taken else - barra.textura:SetValue (jogador.damage_taken/dano_do_primeiro *100) + barra.textura:SetValue(jogador.damage_taken/dano_do_primeiro *100) end local specID = Details:GetSpec (jogador.nome) if (specID) then local texture, l, r, t, b = Details:GetSpecIcon (specID, false) - barra.icone:SetTexture (texture) + barra.icone:SetTexture(texture) barra.icone:SetTexCoord (l, r, t, b) else - barra.icone:SetTexture ("Interface\\AddOns\\Details\\images\\classes_small") + barra.icone:SetTexture("Interface\\AddOns\\Details\\images\\classes_small") if (EncounterDetails.class_coords [jogador.classe]) then barra.icone:SetTexCoord (_unpack (EncounterDetails.class_coords [jogador.classe])) end @@ -1355,25 +1355,25 @@ function EncounterDetails:OpenAndRefresh (_, segment) end end - --> Fim do container Overall Damage Taken + --Fim do container Overall Damage Taken - --> Container Overall Habilidades Inimigas ~damage taken by spell + --Container Overall Habilidades Inimigas ~damage taken by spell local habilidades_poll = {} - --> pega as magias cont�nuas presentes em todas as fases + --pega as magias cont�nuas presentes em todas as fases --deprecated if (boss_info and boss_info.continuo) then - for index, spellid in _ipairs (boss_info.continuo) do + for index, spellid in _ipairs(boss_info.continuo) do habilidades_poll [spellid] = true end end - --> pega as habilidades que pertence especificamente a cada fase + --pega as habilidades que pertence especificamente a cada fase --deprecated if (boss_info and boss_info.phases) then - for fase_id, fase in _ipairs (boss_info.phases) do + for fase_id, fase in _ipairs(boss_info.phases) do if (fase.spells) then - for index, spellid in _ipairs (fase.spells) do + for index, spellid in _ipairs(fase.spells) do habilidades_poll [spellid] = true end end @@ -1387,9 +1387,9 @@ function EncounterDetails:OpenAndRefresh (_, segment) break end - for index, jogador in _ipairs (DamageContainer._ActorTable) do + for index, jogador in _ipairs(DamageContainer._ActorTable) do - --> get all spells from neutral and hostile npcs + --get all spells from neutral and hostile npcs if ( _bit_band (jogador.flag_original, 0x00000060) ~= 0 and --is neutral or hostile (not jogador.owner or (_bit_band (jogador.owner.flag_original, 0x00000060) ~= 0 and not jogador.owner.grupo and _bit_band (jogador.owner.flag_original, 0x00000400) == 0)) and --isn't a pet or the owner isn't a player @@ -1401,28 +1401,28 @@ function EncounterDetails:OpenAndRefresh (_, segment) for id, habilidade in _pairs (habilidades) do --if (habilidades_poll [id]) then - --> esse jogador usou uma habilidade do boss - local esta_habilidade = habilidades_usadas [id] --> tabela n�o numerica, pq diferentes monstros podem castar a mesma magia + --esse jogador usou uma habilidade do boss + local esta_habilidade = habilidades_usadas [id] --tabela n�o numerica, pq diferentes monstros podem castar a mesma magia if (not esta_habilidade) then - esta_habilidade = {0, {}, {}, id} --> [1] total dano causado [2] jogadores que foram alvos [3] jogadores que castaram essa magia [4] ID da magia + esta_habilidade = {0, {}, {}, id} --[1] total dano causado [2] jogadores que foram alvos [3] jogadores que castaram essa magia [4] ID da magia habilidades_usadas [id] = esta_habilidade end - --> adiciona ao [1] total de dano que esta habilidade causou + --adiciona ao [1] total de dano que esta habilidade causou esta_habilidade[1] = esta_habilidade[1] + habilidade.total - --> adiciona ao [3] total do jogador que castou + --adiciona ao [3] total do jogador que castou if (not esta_habilidade[3][jogador.nome]) then esta_habilidade[3][jogador.nome] = 0 end esta_habilidade[3][jogador.nome] = esta_habilidade[3][jogador.nome] + habilidade.total - --> pega os alvos e adiciona ao [2] + --pega os alvos e adiciona ao [2] local alvos = habilidade.targets for target_name, amount in _pairs (alvos) do - --> ele tem o nome do jogador, vamos ver se este alvo � realmente um jogador verificando na tabela do combate + --ele tem o nome do jogador, vamos ver se este alvo � realmente um jogador verificando na tabela do combate local tabela_dano_do_jogador = DamageContainer._ActorTable [DamageContainer._NameIndexTable [target_name]] if (tabela_dano_do_jogador and tabela_dano_do_jogador.grupo) then if (not esta_habilidade[2] [target_name]) then @@ -1435,33 +1435,33 @@ function EncounterDetails:OpenAndRefresh (_, segment) end elseif (have_pool) then - --> check if the spell id is in the spell poll. + --check if the spell id is in the spell poll. local habilidades = jogador.spells._ActorTable for id, habilidade in _pairs (habilidades) do if (habilidades_poll [id]) then - --> esse jogador usou uma habilidade do boss - local esta_habilidade = habilidades_usadas [id] --> tabela n�o numerica, pq diferentes monstros podem castar a mesma magia + --esse jogador usou uma habilidade do boss + local esta_habilidade = habilidades_usadas [id] --tabela n�o numerica, pq diferentes monstros podem castar a mesma magia if (not esta_habilidade) then - esta_habilidade = {0, {}, {}, id} --> [1] total dano causado [2] jogadores que foram alvos [3] jogadores que castaram essa magia [4] ID da magia + esta_habilidade = {0, {}, {}, id} --[1] total dano causado [2] jogadores que foram alvos [3] jogadores que castaram essa magia [4] ID da magia habilidades_usadas [id] = esta_habilidade end - --> adiciona ao [1] total de dano que esta habilidade causou + --adiciona ao [1] total de dano que esta habilidade causou esta_habilidade[1] = esta_habilidade[1] + habilidade.total - --> adiciona ao [3] total do jogador que castou + --adiciona ao [3] total do jogador que castou if (not esta_habilidade[3][jogador.nome]) then esta_habilidade[3][jogador.nome] = 0 end esta_habilidade[3][jogador.nome] = esta_habilidade[3][jogador.nome] + habilidade.total - --> pega os alvos e adiciona ao [2] + --pega os alvos e adiciona ao [2] local alvos = habilidade.targets for target_name, amount in _pairs (alvos) do - --> ele tem o nome do jogador, vamos ver se este alvo � realmente um jogador verificando na tabela do combate + --ele tem o nome do jogador, vamos ver se este alvo � realmente um jogador verificando na tabela do combate local tabela_dano_do_jogador = DamageContainer._ActorTable [DamageContainer._NameIndexTable [target_name]] if (tabela_dano_do_jogador and tabela_dano_do_jogador.grupo) then if (not esta_habilidade[2] [target_name]) then @@ -1475,7 +1475,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) end end - --> por em ordem + --por em ordem local tabela_em_ordem = {} local jaFoi = {} @@ -1509,9 +1509,9 @@ function EncounterDetails:OpenAndRefresh (_, segment) quantidade = 0 dano_do_primeiro = 0 - --> mostra o resultado nas barras - for index, habilidade in _ipairs (tabela_em_ordem) do - --> ta em ordem das habilidades que deram mais dano + --mostra o resultado nas barras + for index, habilidade in _ipairs(tabela_em_ordem) do + --ta em ordem das habilidades que deram mais dano if (habilidade[1] > 0) then @@ -1527,12 +1527,12 @@ function EncounterDetails:OpenAndRefresh (_, segment) local nome_magia, _, icone_magia = _GetSpellInfo(habilidade[4]) - barra.lineText1:SetText (nome_magia) -- .. " (|cFFa0a0a0" .. habilidade[4] .. "|r) - barra.lineText4:SetText (ToK (_, habilidade[1])) + barra.lineText1:SetText(nome_magia) -- .. " (|cFFa0a0a0" .. habilidade[4] .. "|r) + barra.lineText4:SetText(ToK (_, habilidade[1])) _detalhes:name_space (barra) - barra.jogador = habilidade --> barra.jogador agora tem a tabela com --> [1] total dano causado [2] jogadores que foram alvos [3] jogadores que castaram essa magia [4] ID da magia + barra.jogador = habilidade --barra.jogador agora tem a tabela com --[1] total dano causado [2] jogadores que foram alvos [3] jogadores que castaram essa magia [4] ID da magia local spellSchool = _detalhes.spell_school_cache [nome_magia] or 1 local r, g, b = _detalhes:GetSpellSchoolColor (spellSchool) @@ -1540,13 +1540,13 @@ function EncounterDetails:OpenAndRefresh (_, segment) barra.t:SetVertexColor (r, g, b) if (index == 1) then - barra.textura:SetValue (100) + barra.textura:SetValue(100) dano_do_primeiro = habilidade[1] else - barra.textura:SetValue (habilidade[1]/dano_do_primeiro *100) + barra.textura:SetValue(habilidade[1]/dano_do_primeiro *100) end - barra.icone:SetTexture (icone_magia) + barra.icone:SetTexture(icone_magia) barra.icone:SetTexCoord (.1, .9, .1, .9) barra:Show() @@ -1563,51 +1563,51 @@ function EncounterDetails:OpenAndRefresh (_, segment) end end - --> Fim do container Over Habilidades Inimigas + --Fim do container Over Habilidades Inimigas - --> Identificar os ADDs da luta: + --Identificar os ADDs da luta: - --> declara a pool onde ser�o armazenados os adds existentas na luta + --declara a pool onde ser�o armazenados os adds existentas na luta local adds_pool = {} - --> pega as habilidades que pertence especificamente a cada fase + --pega as habilidades que pertence especificamente a cada fase if (boss_info and boss_info.phases) then - for fase_id, fase in _ipairs (boss_info.phases) do + for fase_id, fase in _ipairs(boss_info.phases) do if (fase.adds) then - for index, addId in _ipairs (fase.adds) do + for index, addId in _ipairs(fase.adds) do adds_pool [addId] = true end end end end - --> agora ja tenho a lista de todos os adds da luta + --agora ja tenho a lista de todos os adds da luta -- vasculhar o container de dano e achar os adds: -- ~add local adds = {} - for index, jogador in _ipairs (DamageContainer._ActorTable) do + for index, jogador in _ipairs(DamageContainer._ActorTable) do - --> s� estou interessado nos adds, conferir pelo nome + --s� estou interessado nos adds, conferir pelo nome if (adds_pool [_detalhes:GetNpcIdFromGuid (jogador.serial)] or ( jogador.flag_original and bit.band (jogador.flag_original, 0x00000060) ~= 0 and (not jogador.owner or (_bit_band (jogador.owner.flag_original, 0x00000060) ~= 0 and not jogador.owner.grupo and _bit_band (jogador.owner.flag_original, 0x00000400) == 0)) and --isn't a pet or the owner isn't a player not jogador.grupo and _bit_band (jogador.flag_original, 0x00000400) == 0 - )) then --> � um inimigo ou neutro + )) then --� um inimigo ou neutro local nome = jogador.nome if (not nome:find ("%*")) then local tabela = {nome = nome, total = 0, dano_em = {}, dano_em_total = 0, damage_from = {}, damage_from_total = 0} - --> total de dano que ele causou + --total de dano que ele causou tabela.total = jogador.total - --> em quem ele deu dano + --em quem ele deu dano for target_name, amount in _pairs (jogador.targets) do local este_jogador = _combat_object (1, target_name) if (este_jogador) then @@ -1619,7 +1619,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) end _table_sort (tabela.dano_em, _detalhes.Sort2) - --> quem deu dano nele + --quem deu dano nele for agressor, _ in _pairs (jogador.damage_from) do --local este_jogador = DamageContainer._ActorTable [DamageContainer._NameIndexTable [agressor]] local este_jogador = _combat_object (1, agressor) @@ -1642,10 +1642,10 @@ function EncounterDetails:OpenAndRefresh (_, segment) end - --> montou a tabela, agora precisa mostrar no painel + --montou a tabela, agora precisa mostrar no painel local function _DanoFeito (self) - self.textura:SetBlendMode ("ADD") + self.textura:SetBlendMode("ADD") local barra = self:GetParent() local tabela = barra.jogador @@ -1682,8 +1682,8 @@ function EncounterDetails:OpenAndRefresh (_, segment) end end - self.textura:SetBlendMode ("ADD") - self.textura:SetSize (18, 18) + self.textura:SetBlendMode("ADD") + self.textura:SetSize(18, 18) self.ArrowOnEnter = true GameCooltip:SetOwner (self, "right", "left", -10, 0) @@ -1736,7 +1736,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) end self.mouse_over = true - self:SetHeight (EncounterDetails.Frame.DefaultBarHeight + 1) + self:SetHeight(EncounterDetails.Frame.DefaultBarHeight + 1) self:SetAlpha (1) EncounterDetails.SetBarBackdrop_OnEnter (self) @@ -1751,11 +1751,11 @@ function EncounterDetails:OpenAndRefresh (_, segment) GameCooltip:Hide() if (self.ArrowOnEnter) then - self.textura:SetBlendMode ("BLEND") - self.textura:SetSize (16, 16) + self.textura:SetBlendMode("BLEND") + self.textura:SetSize(16, 16) else self:SetAlpha (0.9) - self:SetHeight (EncounterDetails.Frame.DefaultBarHeight) + self:SetHeight(EncounterDetails.Frame.DefaultBarHeight) EncounterDetails.SetBarBackdrop_OnLeave (self) end end @@ -1769,7 +1769,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) --table.sort (adds, sort_by_name) table.sort (adds, _detalhes.Sort1) - for index, esta_tabela in _ipairs (adds) do + for index, esta_tabela in _ipairs(adds) do local addName = esta_tabela.nome local barra = container.barras [index] @@ -1777,36 +1777,36 @@ function EncounterDetails:OpenAndRefresh (_, segment) if (not barra) then barra = EncounterDetails:CreateRow (index, container, -0) - barra:SetWidth (155) + barra:SetWidth(155) - barra:SetScript ("OnEnter", _DanoRecebido) - barra:SetScript ("OnLeave", _OnHide) + barra:SetScript("OnEnter", _DanoRecebido) + barra:SetScript("OnLeave", _OnHide) barra:HookScript ("OnMouseDown", EncounterDetails.BossInfoRowClick) local add_damage_done = _CreateFrame ("Button", nil, barra, "BackdropTemplate") barra.report_text = "Details! Tamage Taken of " add_damage_done.report_text = "Details! Damage Done of " add_damage_done.barra = barra - add_damage_done:SetWidth (EncounterDetails.CooltipLineHeight) - add_damage_done:SetHeight (EncounterDetails.CooltipLineHeight) + add_damage_done:SetWidth(EncounterDetails.CooltipLineHeight) + add_damage_done:SetHeight(EncounterDetails.CooltipLineHeight) add_damage_done:EnableMouse (true) - add_damage_done:SetResizable (false) - add_damage_done:SetPoint ("left", barra, "left", 0, 0) + add_damage_done:SetResizable(false) + add_damage_done:SetPoint("left", barra, "left", 0, 0) - add_damage_done:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16}) - add_damage_done:SetBackdropColor (.5, .0, .0, 0.5) + add_damage_done:SetBackdrop({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16}) + add_damage_done:SetBackdropColor(.5, .0, .0, 0.5) - add_damage_done.textura = add_damage_done:CreateTexture (nil, "overlay") - add_damage_done.textura:SetTexture ("Interface\\Buttons\\UI-MicroStream-Red") - add_damage_done.textura:SetWidth (16) - add_damage_done.textura:SetHeight (16) - add_damage_done.textura:SetPoint ("topleft", add_damage_done, "topleft") + add_damage_done.textura = add_damage_done:CreateTexture(nil, "overlay") + add_damage_done.textura:SetTexture("Interface\\Buttons\\UI-MicroStream-Red") + add_damage_done.textura:SetWidth(16) + add_damage_done.textura:SetHeight(16) + add_damage_done.textura:SetPoint("topleft", add_damage_done, "topleft") - add_damage_done:SetScript ("OnEnter", _DanoFeito) - add_damage_done:SetScript ("OnLeave", _OnHide) - add_damage_done:SetScript ("OnClick", EncounterDetails.BossInfoRowClick) + add_damage_done:SetScript("OnEnter", _DanoFeito) + add_damage_done:SetScript("OnLeave", _OnHide) + add_damage_done:SetScript("OnClick", EncounterDetails.BossInfoRowClick) - barra.lineText1:SetPoint ("left", add_damage_done, "right", 2, 0) + barra.lineText1:SetPoint("left", add_damage_done, "right", 2, 0) barra.textura:SetStatusBarTexture (nil) _detalhes:SetFontSize (barra.lineText1, CONST_FONT_SIZE) @@ -1816,15 +1816,15 @@ function EncounterDetails:OpenAndRefresh (_, segment) add_damage_done.TTT = "add" end - barra.lineText1:SetText (addName) - barra.lineText4:SetText (_detalhes:ToK (esta_tabela.damage_from_total)) - barra.lineText1:SetSize (barra:GetWidth() - barra.lineText4:GetStringWidth() - 34, 15) + barra.lineText1:SetText(addName) + barra.lineText4:SetText(_detalhes:ToK (esta_tabela.damage_from_total)) + barra.lineText1:SetSize(barra:GetWidth() - barra.lineText4:GetStringWidth() - 34, 15) - barra.jogador = esta_tabela --> barra.jogador agora tem a tabela com --> [1] total dano causado [2] jogadores que foram alvos [3] jogadores que castaram essa magia [4] ID da magia + barra.jogador = esta_tabela --barra.jogador agora tem a tabela com --[1] total dano causado [2] jogadores que foram alvos [3] jogadores que castaram essa magia [4] ID da magia --barra.textura:SetStatusBarColor (_unpack (_detalhes.class_colors [jogador.classe])) - barra.textura:SetStatusBarColor (1, 1, 1, 1) --> a cor pode ser a spell school da magia - barra.textura:SetValue (100) + barra.textura:SetStatusBarColor (1, 1, 1, 1) --a cor pode ser a spell school da magia + barra.textura:SetValue(100) barra:Show() quantidade = quantidade + 1 @@ -1839,9 +1839,9 @@ function EncounterDetails:OpenAndRefresh (_, segment) end end - --> Fim do container Over ADDS + --Fim do container Over ADDS - --> Inicio do Container de Interrupts: + --Inicio do Container de Interrupts: local misc = _combat_object [class_type_misc] @@ -1855,8 +1855,8 @@ function EncounterDetails:OpenAndRefresh (_, segment) local habilidades_interrompidas = {} - for index, jogador in _ipairs (misc._ActorTable) do - if (not jogador.grupo) then --> s� aparecer nego da raid + for index, jogador in _ipairs(misc._ActorTable) do + if (not jogador.grupo) then --s� aparecer nego da raid break end @@ -1864,14 +1864,14 @@ function EncounterDetails:OpenAndRefresh (_, segment) local interrupts = jogador.interrupt if (interrupts and interrupts > 0) then local oque_interrompi = jogador.interrompeu_oque - --> vai ter [spellid] = quantidade + --vai ter [spellid] = quantidade for spellid, amt in _pairs (oque_interrompi) do - if (not habilidades_interrompidas [spellid]) then --> se a spell n�o tiver na pool, cria a tabela dela - habilidades_interrompidas [spellid] = {{}, 0, spellid} --> tabela com quem interrompeu e o total de vezes que a habilidade foi interrompida + if (not habilidades_interrompidas [spellid]) then --se a spell n�o tiver na pool, cria a tabela dela + habilidades_interrompidas [spellid] = {{}, 0, spellid} --tabela com quem interrompeu e o total de vezes que a habilidade foi interrompida end - if (not habilidades_interrompidas [spellid] [1] [jogador.nome]) then --> se o jogador n�o tiver na pool dessa habilidade interrompida, cria um indice pra ele. + if (not habilidades_interrompidas [spellid] [1] [jogador.nome]) then --se o jogador n�o tiver na pool dessa habilidade interrompida, cria um indice pra ele. habilidades_interrompidas [spellid] [1] [jogador.nome] = {0, jogador.classe} end @@ -1882,7 +1882,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) end end - --> por em ordem + --por em ordem tabela_em_ordem = {} for spellid, tabela in _pairs (habilidades_interrompidas) do tabela_em_ordem [#tabela_em_ordem+1] = tabela @@ -1891,7 +1891,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) index = 1 - for _, tabela in _ipairs (tabela_em_ordem) do + for _, tabela in _ipairs(tabela_em_ordem) do local barra = container.barras [index] if (not barra) then @@ -1900,24 +1900,24 @@ function EncounterDetails:OpenAndRefresh (_, segment) _detalhes:SetFontSize (barra.lineText4, CONST_FONT_SIZE) barra.TTT = "total_interrupt" -- tool tip type barra.report_text = "Details! ".. Loc ["STRING_INTERRUPTS_OF"] - barra:SetWidth (155) + barra:SetWidth(155) end local spellid = 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 + --pegar quantas vezes a magia passou com sucesso. + for _, enemy_actor in _ipairs(DamageContainer._ActorTable) do if (enemy_actor.spells._ActorTable [spellid]) then local spell = enemy_actor.spells._ActorTable [spellid] successful = spell.successful_casted end end - barra.lineText1:SetText (nome_magia) + barra.lineText1:SetText(nome_magia) local total = successful + tabela [2] - barra.lineText4:SetText (tabela [2] .. " / ".. total) + barra.lineText4:SetText(tabela [2] .. " / ".. total) _detalhes:name_space (barra) @@ -1926,13 +1926,13 @@ function EncounterDetails:OpenAndRefresh (_, segment) --barra.textura:SetStatusBarColor (_unpack (_detalhes.class_colors [jogador.classe])) if (index == 1) then - barra.textura:SetValue (100) + barra.textura:SetValue(100) dano_do_primeiro = tabela [2] else - barra.textura:SetValue (tabela [2]/dano_do_primeiro *100) + barra.textura:SetValue(tabela [2]/dano_do_primeiro *100) end - barra.icone:SetTexture (icone_magia) + barra.icone:SetTexture(icone_magia) barra.icone:SetTexCoord (.1, .9, .1, .9) barra:Show() @@ -1949,11 +1949,11 @@ function EncounterDetails:OpenAndRefresh (_, segment) end end - --> Fim do container dos Interrupts + --Fim do container dos Interrupts - --> Inicio do Container dos Dispells: + --Inicio do Container dos Dispells: - --> force refresh window behavior + --force refresh window behavior local total_dispelado = _detalhes.atributo_misc:RefreshWindow ({}, _combat_object, _, { key = "dispell", modo = _detalhes.modos.group }) local frame_dispell = EncounterDetailsFrame.overall_dispell @@ -1964,8 +1964,8 @@ function EncounterDetails:OpenAndRefresh (_, segment) local habilidades_dispeladas = {} - for index, jogador in _ipairs (misc._ActorTable) do - if (not jogador.grupo) then --> s� aparecer nego da raid + for index, jogador in _ipairs(misc._ActorTable) do + if (not jogador.grupo) then --s� aparecer nego da raid break end @@ -1974,16 +1974,16 @@ function EncounterDetails:OpenAndRefresh (_, segment) local dispells = jogador.dispell if (dispells and dispells > 0) then local oque_dispelei = jogador.dispell_oque - --> vai ter [spellid] = quantidade + --vai ter [spellid] = quantidade --print ("dispell: " .. jogador.classe .. " nome: " .. jogador.nome) for spellid, amt in _pairs (oque_dispelei) do - if (not habilidades_dispeladas [spellid]) then --> se a spell n�o tiver na pool, cria a tabela dela - habilidades_dispeladas [spellid] = {{}, 0, spellid} --> tabela com quem dispolou e o total de vezes que a habilidade foi dispelada + if (not habilidades_dispeladas [spellid]) then --se a spell n�o tiver na pool, cria a tabela dela + habilidades_dispeladas [spellid] = {{}, 0, spellid} --tabela com quem dispolou e o total de vezes que a habilidade foi dispelada end - if (not habilidades_dispeladas [spellid] [1] [jogador.nome]) then --> se o jogador n�o tiver na pool dessa habilidade interrompida, cria um indice pra ele. + if (not habilidades_dispeladas [spellid] [1] [jogador.nome]) then --se o jogador n�o tiver na pool dessa habilidade interrompida, cria um indice pra ele. habilidades_dispeladas [spellid] [1] [jogador.nome] = {0, jogador.classe} --print (jogador.nome) --print (jogador.classe) @@ -1996,7 +1996,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) end end - --> por em ordem + --por em ordem tabela_em_ordem = {} for spellid, tabela in _pairs (habilidades_dispeladas) do tabela_em_ordem [#tabela_em_ordem+1] = tabela @@ -2005,7 +2005,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) index = 1 - for _, tabela in _ipairs (tabela_em_ordem) do + for _, tabela in _ipairs(tabela_em_ordem) do local barra = container.barras [index] if (not barra) then @@ -2014,13 +2014,13 @@ function EncounterDetails:OpenAndRefresh (_, segment) _detalhes:SetFontSize (barra.lineText4, CONST_FONT_SIZE) barra.TTT = "dispell" -- tool tip type barra.report_text = "Details! ".. Loc ["STRING_DISPELLS_OF"] - barra:SetWidth (160) + barra:SetWidth(160) end local nome_magia, _, icone_magia = _GetSpellInfo(tabela [3]) - barra.lineText1:SetText (nome_magia) - barra.lineText4:SetText (tabela [2]) + barra.lineText1:SetText(nome_magia) + barra.lineText4:SetText(tabela [2]) _detalhes:name_space (barra) @@ -2029,13 +2029,13 @@ function EncounterDetails:OpenAndRefresh (_, segment) --barra.textura:SetStatusBarColor (_unpack (_detalhes.class_colors [jogador.classe])) if (index == 1) then - barra.textura:SetValue (100) + barra.textura:SetValue(100) dano_do_primeiro = tabela [2] else - barra.textura:SetValue (tabela [2]/dano_do_primeiro *100) + barra.textura:SetValue(tabela [2]/dano_do_primeiro *100) end - barra.icone:SetTexture (icone_magia) + barra.icone:SetTexture(icone_magia) barra.icone:SetTexCoord (.1, .9, .1, .9) barra:Show() @@ -2052,9 +2052,9 @@ function EncounterDetails:OpenAndRefresh (_, segment) end end - --> Fim do container dos Dispells + --Fim do container dos Dispells - --> Inicio do Container das Mortes: + --Inicio do Container das Mortes: local frame_mortes = EncounterDetailsFrame.overall_dead container = frame_mortes.gump @@ -2063,10 +2063,10 @@ function EncounterDetails:OpenAndRefresh (_, segment) -- boss_info.spells_info o erro de lua do boss � a habilidade dele que n�o foi declarada ainda local mortes = _combat_object.last_events_tables - local habilidades_info = boss_info and boss_info.spell_mechanics or {} --barra.extra pega esse cara aqui --> ent�o esse erro � das habilidades que n�o tao + local habilidades_info = boss_info and boss_info.spell_mechanics or {} --barra.extra pega esse cara aqui --ent�o esse erro � das habilidades que n�o tao - for index, tabela in _ipairs (mortes) do - --> {esta_morte, time, este_jogador.nome, este_jogador.classe, _UnitHealthMax (alvo_name), minutos.."m "..segundos.."s", ["dead"] = true} + for index, tabela in _ipairs(mortes) do + --{esta_morte, time, este_jogador.nome, este_jogador.classe, _UnitHealthMax (alvo_name), minutos.."m "..segundos.."s", ["dead"] = true} local barra = container.barras [index] if (not barra) then barra = EncounterDetails:CreateRow (index, container, 3, 0, 1) @@ -2074,9 +2074,9 @@ function EncounterDetails:OpenAndRefresh (_, segment) barra.report_text = "Details! " .. Loc ["STRING_DEAD_LOG"] _detalhes:SetFontSize (barra.lineText1, CONST_FONT_SIZE) _detalhes:SetFontSize (barra.lineText4, CONST_FONT_SIZE) - barra:SetWidth (169) + barra:SetWidth(169) - local overlayTexture = barra:CreateTexture (nil, "overlay") + local overlayTexture = barra:CreateTexture(nil, "overlay") overlayTexture:SetAllPoints() overlayTexture:SetColorTexture (1, 1, 1) overlayTexture:SetAlpha (1) @@ -2085,12 +2085,12 @@ function EncounterDetails:OpenAndRefresh (_, segment) end if (tabela [3]:find ("-")) then - barra.lineText1:SetText (index..". "..tabela [3]:gsub (("-.*"), "")) + barra.lineText1:SetText(index..". "..tabela [3]:gsub (("-.*"), "")) else - barra.lineText1:SetText (index..". "..tabela [3]) + barra.lineText1:SetText(index..". "..tabela [3]) end - barra.lineText4:SetText (tabela [6]) + barra.lineText4:SetText(tabela [6]) _detalhes:name_space (barra) @@ -2098,9 +2098,9 @@ function EncounterDetails:OpenAndRefresh (_, segment) barra.extra = habilidades_info barra.textura:SetStatusBarColor (_unpack (_detalhes.class_colors [tabela [4]])) - barra.textura:SetValue (100) + barra.textura:SetValue(100) - barra.icone:SetTexture ("Interface\\AddOns\\Details\\images\\classes_small") + barra.icone:SetTexture("Interface\\AddOns\\Details\\images\\classes_small") barra.icone:SetTexCoord (_unpack (EncounterDetails.class_coords [tabela [4]])) barra:Show() diff --git a/plugins/Details_EncounterDetails/enUS.lua b/plugins/Details_EncounterDetails/enUS.lua index 7b981fe0..8e0d030e 100644 --- a/plugins/Details_EncounterDetails/enUS.lua +++ b/plugins/Details_EncounterDetails/enUS.lua @@ -48,7 +48,7 @@ Loc ["STRING_INTERRIPT_HELP"] = " |cFFFFFF00Click|r on a bar:\nopen report windo Loc ["STRING_DISPELL_HELP"] = " \n|cFFFFFF00Click|r on a bar:\nopen report window." Loc ["STRING_DEATHS_HELP"] = " \n|cFFFFFF00Click|r on a bar:\nopen report window." ---> mechanic types +--mechanic types Loc ["STRING_HEAL"] = "heal" Loc ["STRING_LOWDPS"] = "lowdps" Loc ["STRING_LOWHEAL"] = "lowheal" diff --git a/plugins/Details_EncounterDetails/frames.lua b/plugins/Details_EncounterDetails/frames.lua index f6b7a4f8..e2fbb1c2 100644 --- a/plugins/Details_EncounterDetails/frames.lua +++ b/plugins/Details_EncounterDetails/frames.lua @@ -37,9 +37,9 @@ do } 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) + frame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tileSize = 64, tile = true}) + frame:SetBackdropColor(0, 0, 0, .2) + frame:SetBackdropBorderColor(0, 0, 0, 1) end local BGColorDefault = {0.5, 0.5, 0.5, 0.3} @@ -48,18 +48,18 @@ do _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) - --> options panel + --options panel EncounterDetails.SetBarBackdrop_OnEnter = function(self) - self:SetBackdropColor (unpack (BGColorDefault_Hover)) + self:SetBackdropColor(unpack (BGColorDefault_Hover)) end EncounterDetails.SetBarBackdrop_OnLeave = function(self) - self:SetBackdropColor (unpack (BGColorDefault)) + self:SetBackdropColor(unpack (BGColorDefault)) end function EncounterDetails:AutoShowIcon() local found_boss = false - for _, combat in ipairs (EncounterDetails:GetCombatSegments()) do + for _, combat in ipairs(EncounterDetails:GetCombatSegments()) do if (combat.is_boss) then EncounterDetails:ShowIcon() found_boss = true @@ -174,15 +174,15 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) function EncounterDetails:RefreshScale() local scale = EncounterDetails.db.window_scale if (EncounterDetails.Frame) then - EncounterDetails.Frame:SetScale (scale) + EncounterDetails.Frame:SetScale(scale) end end function EncounterDetails:CreateRowTexture (row) - row.textura = CreateFrame ("StatusBar", nil, row, "BackdropTemplate") - row.textura:SetAllPoints (row) - local t = row.textura:CreateTexture (nil, "overlay") - t:SetTexture (EncounterDetails.Frame.DefaultBarTexture) + row.textura = CreateFrame("StatusBar", nil, row, "BackdropTemplate") + row.textura:SetAllPoints(row) + local t = row.textura:CreateTexture(nil, "overlay") + t:SetTexture(EncounterDetails.Frame.DefaultBarTexture) row.t = t row.textura:SetStatusBarTexture (t) @@ -190,13 +190,13 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) row.textura:SetMinMaxValues (0,100) row.lineText1 = row.textura:CreateFontString (nil, "OVERLAY", "GameFontHighlightSmall") - row.lineText1:SetPoint ("LEFT", row.textura, "LEFT", 22, -1) - row.lineText1:SetJustifyH ("LEFT") + row.lineText1:SetPoint("LEFT", row.textura, "LEFT", 22, -1) + row.lineText1:SetJustifyH("LEFT") row.lineText1:SetTextColor (1,1,1,1) row.lineText4 = row.textura:CreateFontString (nil, "OVERLAY", "GameFontHighlightSmall") - row.lineText4:SetPoint ("RIGHT", row.textura, "RIGHT", -2, 0) - row.lineText4:SetJustifyH ("RIGHT") + row.lineText4:SetPoint("RIGHT", row.textura, "RIGHT", -2, 0) + row.lineText4:SetJustifyH("RIGHT") row.lineText4:SetTextColor (1,1,1,1) row.textura:Show() @@ -204,24 +204,24 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) function EncounterDetails:CreateRow (index, container, x_mod, y_mod, width_mod) - local barra = CreateFrame ("Button", "Details_"..container:GetName().."_barra_"..index, container,"BackdropTemplate") + local barra = CreateFrame("Button", "Details_"..container:GetName().."_barra_"..index, container,"BackdropTemplate") x_mod = x_mod or 0 width_mod = width_mod or 0 local default_height = EncounterDetails.Frame.DefaultBarHeight - barra:SetWidth (200 + width_mod) --> tamanho da barra de acordo com o tamanho da janela - barra:SetHeight (default_height) --> altura determinada pela inst�ncia + barra:SetWidth(200 + width_mod) --tamanho da barra de acordo com o tamanho da janela + barra:SetHeight(default_height) --altura determinada pela inst�ncia local y = (index-1)*(default_height + 1) y_mod = y_mod or 0 y = y + y_mod - y = y*-1 --> baixo + y = y*-1 --baixo - barra:SetPoint ("LEFT", container, "LEFT", x_mod, 0) - barra:SetPoint ("RIGHT", container, "RIGHT", width_mod, 0) - barra:SetPoint ("TOP", container, "TOP", 0, y) + barra:SetPoint("LEFT", container, "LEFT", x_mod, 0) + barra:SetPoint("RIGHT", container, "RIGHT", width_mod, 0) + barra:SetPoint("TOP", container, "TOP", 0, y) barra:SetFrameLevel (container:GetFrameLevel() + 1) barra:EnableMouse (true) @@ -229,14 +229,14 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) EncounterDetails:CreateRowTexture (barra) - barra:SetBackdrop (BackdropDefault) + barra:SetBackdrop(BackdropDefault) EncounterDetails.SetBarBackdrop_OnLeave (barra) - --> icone - barra.icone = barra.textura:CreateTexture (nil, "OVERLAY") - barra.icone:SetWidth (default_height) - barra.icone:SetHeight (default_height) - barra.icone:SetPoint ("RIGHT", barra.textura, "LEFT", 20, 0) + --icone + barra.icone = barra.textura:CreateTexture(nil, "OVERLAY") + barra.icone:SetWidth(default_height) + barra.icone:SetHeight(default_height) + barra.icone:SetPoint("RIGHT", barra.textura, "LEFT", 20, 0) barra:SetAlpha (0.9) barra.icone:SetAlpha (0.8) @@ -252,12 +252,12 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) barras_total = barras_total or 6 if (amt >= barras_total and container.ultimo ~= amt) then local tamanho = (EncounterDetails.Frame.DefaultBarHeight + 1) * amt - container:SetHeight (tamanho) + container:SetHeight(tamanho) container.window.slider:Update() container.window.ultimo = amt elseif (amt <= barras_total-1 and container.slider.ativo) then container.window.slider:Update (true) - container:SetHeight (140) + container:SetHeight(140) container.window.scroll_ativo = false container.window.ultimo = 0 end @@ -307,7 +307,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) return end - --> battle time + --battle time if (combat.end_time - combat.start_time < 12) then return end @@ -321,7 +321,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) g.max_damage = 0 - for _, line in ipairs (g.VerticalLines) do + for _, line in ipairs(g.VerticalLines) do line:Hide() end @@ -368,18 +368,18 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) local start_at = phase_data[i][2] local texture = g:GetPhaseTexture (i, phase) - texture:SetPoint ("bottomleft", g, "bottomleft", (start_at * scale) + 58, 0) + texture:SetPoint("bottomleft", g, "bottomleft", (start_at * scale) + 58, 0) texture.phase = phase texture.start_at = start_at local next_phase = phase_data[i+1] if (next_phase) then local duration = next_phase [2] - start_at - texture:SetWidth (scale * duration) + texture:SetWidth(scale * duration) texture.elapsed = duration else local duration = combat:GetCombatTime() - start_at - texture:SetWidth (scale * duration) + texture:SetWidth(scale * duration) texture.elapsed = duration end end @@ -413,8 +413,8 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) local graphMaxDps = math.max (g.max_damage, dps_max) while (_i <= #content-2) do - local v = (content[_i-2]+content[_i-1]+content[_i]+content[_i+1]+content[_i+2])/5 --> normalize - _data [#_data+1] = {scaleW*(_i-2), v/graphMaxDps} --> x and y coords + local v = (content[_i-2]+content[_i-1]+content[_i]+content[_i+1]+content[_i+2])/5 --normalize + _data [#_data+1] = {scaleW*(_i-2), v/graphMaxDps} --x and y coords _i = _i + 1 end @@ -423,7 +423,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) tremove (content, #graphicData) tremove (content, #graphicData) - --> update timeline + --update timeline local tempo = combat.end_time - combat.start_time if (g.max_time < tempo) then g.max_time = tempo @@ -432,22 +432,22 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) for i = 1, 8, 1 do local t = tempo_divisao*i - local minutos, segundos = _math_floor (t/60), _math_floor (t%60) + local minutos, segundos = _math_floor(t/60), _math_floor(t%60) if (segundos < 10) then segundos = "0"..segundos end if (minutos < 10) then minutos = "0"..minutos end - EncounterDetails.Frame["timeamt"..i]:SetText (minutos..":"..segundos) + EncounterDetails.Frame["timeamt"..i]:SetText(minutos..":"..segundos) end end - --> normalize previous data + --normalize previous data if (dps_max > g.max_damage) then if (g.max_damage > 0) then local normalizePercent = g.max_damage / dps_max - for dataIndex, Data in ipairs (g.Data) do + for dataIndex, Data in ipairs(g.Data) do local Points = Data.Points for i = 1, #Points do Points[i][2] = Points[i][2]*normalizePercent @@ -459,11 +459,11 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) local dano_divisao = g.max_damage/8 - --> update damage line + --update damage line local o = 1 for i = 8, 1, -1 do local d = _detalhes:ToK (dano_divisao*i) - EncounterDetails.Frame["dpsamt"..o]:SetText (d) + EncounterDetails.Frame["dpsamt"..o]:SetText(d) o = o + 1 end @@ -479,12 +479,12 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) g:ChangeColorOnDataSeries (i, grafico_cores [i]) end - --> add death icons for the first deaths in the segment + --add death icons for the first deaths in the segment if (drawDeathsCombat) then local mortes = drawDeathsCombat.last_events_tables local scaleG = CONST_CHART_LENGTH / drawDeathsCombat:GetCombatTime() - for _, row in _ipairs (g.VerticalLines) do + for _, row in _ipairs(g.VerticalLines) do row:Hide() end @@ -494,12 +494,12 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) if (not vRowFrame) then - vRowFrame = CreateFrame ("frame", "DetailsEncountersVerticalLine"..i, g, "BackdropTemplate") - vRowFrame:SetWidth (20) - vRowFrame:SetHeight (43) + vRowFrame = CreateFrame("frame", "DetailsEncountersVerticalLine"..i, g, "BackdropTemplate") + vRowFrame:SetWidth(20) + vRowFrame:SetHeight(43) vRowFrame:SetFrameLevel (g:GetFrameLevel()+2) - vRowFrame:SetScript ("OnEnter", function(frame) + vRowFrame:SetScript("OnEnter", function(frame) if (vRowFrame.dead[1] and vRowFrame.dead[1][3] and vRowFrame.dead[1][3][2]) then @@ -518,7 +518,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) local amt = 0 for i = #death[1], 1, -1 do local this_hit = death[1][i] - if (type (this_hit[1]) == "boolean" and this_hit[1]) then + if (type(this_hit[1]) == "boolean" and this_hit[1]) then local spellname, _, spellicon = _GetSpellInfo(this_hit[2]) local t = death [2] - this_hit [4] GameCooltip:AddLine ("-" .. _cstr ("%.1f", t) .. " " .. spellname .. " (" .. this_hit[6] .. ")", EncounterDetails:comma_value (this_hit [3])) @@ -530,39 +530,39 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) end end - GameCooltip:SetOption ("TextSize", 9.5) - GameCooltip:SetOption ("HeightAnchorMod", -15) + GameCooltip:SetOption("TextSize", 9.5) + GameCooltip:SetOption("HeightAnchorMod", -15) GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], {.6, 0.1, 0, 0.64453125}, {1, 1, 1, 0.1}, true) GameCooltip:ShowCooltip (frame, "tooltip") end end) - vRowFrame:SetScript ("OnLeave", function(frame) + vRowFrame:SetScript("OnLeave", function(frame) _detalhes.popup:ShowMe (false) end) - vRowFrame.texture = vRowFrame:CreateTexture (nil, "overlay") - vRowFrame.texture:SetTexture ("Interface\\AddOns\\Details\\images\\verticalline") - vRowFrame.texture:SetWidth (3) - vRowFrame.texture:SetHeight (20) - vRowFrame.texture:SetPoint ("center", "DetailsEncountersVerticalLine"..i, "center") - vRowFrame.texture:SetPoint ("bottom", "DetailsEncountersVerticalLine"..i, "bottom", 0, 0) + vRowFrame.texture = vRowFrame:CreateTexture(nil, "overlay") + vRowFrame.texture:SetTexture("Interface\\AddOns\\Details\\images\\verticalline") + vRowFrame.texture:SetWidth(3) + vRowFrame.texture:SetHeight(20) + vRowFrame.texture:SetPoint("center", "DetailsEncountersVerticalLine"..i, "center") + vRowFrame.texture:SetPoint("bottom", "DetailsEncountersVerticalLine"..i, "bottom", 0, 0) vRowFrame.texture:SetVertexColor (1, 1, 1, .5) - vRowFrame.icon = vRowFrame:CreateTexture (nil, "overlay") - vRowFrame.icon:SetTexture ("Interface\\WorldStateFrame\\SkullBones") + vRowFrame.icon = vRowFrame:CreateTexture(nil, "overlay") + vRowFrame.icon:SetTexture("Interface\\WorldStateFrame\\SkullBones") vRowFrame.icon:SetTexCoord (0.046875, 0.453125, 0.046875, 0.46875) - vRowFrame.icon:SetWidth (16) - vRowFrame.icon:SetHeight (16) - vRowFrame.icon:SetPoint ("center", "DetailsEncountersVerticalLine"..i, "center") - vRowFrame.icon:SetPoint ("bottom", "DetailsEncountersVerticalLine"..i, "bottom", 0, 20) + vRowFrame.icon:SetWidth(16) + vRowFrame.icon:SetHeight(16) + vRowFrame.icon:SetPoint("center", "DetailsEncountersVerticalLine"..i, "center") + vRowFrame.icon:SetPoint("bottom", "DetailsEncountersVerticalLine"..i, "bottom", 0, 20) g.VerticalLines [i] = vRowFrame end local deadTime = mortes [i].dead_at - vRowFrame:SetPoint ("topleft", EncounterDetails.Frame, "topleft", (deadTime*scaleG)+70, -CONST_CHART_HEIGHT-22) + vRowFrame:SetPoint("topleft", EncounterDetails.Frame, "topleft", (deadTime*scaleG)+70, -CONST_CHART_HEIGHT-22) vRowFrame.dead = mortes [i] vRowFrame:Show() @@ -573,7 +573,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) --~chart ~graphic ~grafico function EncounterDetails:CreateGraphPanel() - --> main chart frame + --main chart frame local g = Graphics:CreateGraphLine ("DetailsRaidDpsGraph", EncounterDetails.Frame, "topleft", "topleft", 20, -76, CONST_CHART_WIDTH, CONST_CHART_HEIGHT) g:SetXAxis (-1,1) g:SetYAxis (-1,1) @@ -594,7 +594,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) [1.5] = {0.25, 0.95, 0.25, phase_alpha}, [2.5] = {0.95, 0.95, 0.25, phase_alpha}, [3.5] = {0.95, 0.25, 0.25, phase_alpha} } - --> bloodlust indicators + --bloodlust indicators g.bloodlustIndicators = {} for i = 1, 5 do local texture = g:CreateTexture(nil, "overlay") @@ -602,36 +602,36 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) g.bloodlustIndicators[#g.bloodlustIndicators+1] = texture end - --> build the phase panel - local phase_panel = CreateFrame ("frame", "EncounterDetailsPhasePanel", g, "BackdropTemplate") + --build the phase panel + local phase_panel = CreateFrame("frame", "EncounterDetailsPhasePanel", g, "BackdropTemplate") phase_panel:SetFrameStrata ("TOOLTIP") - phase_panel:SetWidth (CONST_PHASE_PANEL_WIDTH) - phase_panel:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, + phase_panel:SetWidth(CONST_PHASE_PANEL_WIDTH) + phase_panel:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, edgeFile = [[Interface\AddOns\Details\images\border_2]], edgeSize = 32, insets = {left = 1, right = 1, top = 1, bottom = 1}}) - phase_panel:SetBackdropColor (0, 0, 0, .4) + phase_panel:SetBackdropColor(0, 0, 0, .4) local damage_icon = DetailsFrameWork:CreateImage (phase_panel, [[Interface\AddOns\Details\images\skins\classic_skin_v1]], 16, 16, "overlay", {11/1024, 24/1024, 376/1024, 390/1024}) - local damage_label = DetailsFrameWork:CreateLabel (phase_panel, "Damage Done:") - damage_icon:SetPoint ("topleft", phase_panel, "topleft", 10, -10) - damage_label:SetPoint ("left", damage_icon, "right", 4, 0) + local damage_label = DetailsFrameWork:CreateLabel(phase_panel, "Damage Done:") + damage_icon:SetPoint("topleft", phase_panel, "topleft", 10, -10) + damage_label:SetPoint("left", damage_icon, "right", 4, 0) local heal_icon = DetailsFrameWork:CreateImage (phase_panel, [[Interface\AddOns\Details\images\skins\classic_skin_v1]], 16, 16, "overlay", {43/1024, 57/1024, 376/1024, 390/1024}) - local heal_label = DetailsFrameWork:CreateLabel (phase_panel, "Healing Done:") - heal_icon:SetPoint ("topleft", phase_panel, "topleft", 250, -10) - heal_label:SetPoint ("left", heal_icon, "right", 4, 0) + local heal_label = DetailsFrameWork:CreateLabel(phase_panel, "Healing Done:") + heal_icon:SetPoint("topleft", phase_panel, "topleft", 250, -10) + heal_label:SetPoint("left", heal_icon, "right", 4, 0) phase_panel.damage_labels = {} phase_panel.heal_labels = {} function phase_panel:ClearLabels() - for i, label in ipairs (phase_panel.damage_labels) do + for i, label in ipairs(phase_panel.damage_labels) do label.lefttext:Hide() label.righttext:Hide() label.icon:Hide() label.bg:Hide() end - for i, label in ipairs (phase_panel.heal_labels) do + for i, label in ipairs(phase_panel.heal_labels) do label.lefttext:Hide() label.righttext:Hide() label.icon:Hide() @@ -642,16 +642,16 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) function phase_panel:GetDamageLabel (index) local label = phase_panel.damage_labels [index] if (not label) then - local player_name = DetailsFrameWork:CreateLabel (phase_panel, "") - local amount = DetailsFrameWork:CreateLabel (phase_panel, "") - amount:SetJustifyH ("right") + local player_name = DetailsFrameWork:CreateLabel(phase_panel, "") + local amount = DetailsFrameWork:CreateLabel(phase_panel, "") + amount:SetJustifyH("right") local icon = DetailsFrameWork:CreateImage (phase_panel, "", 16, 16) local bg = DetailsFrameWork:CreateImage (phase_panel, [[Interface\AddOns\Details\images\BantoBar]], nil, nil, "artwork") - bg:SetPoint ("left", icon, "left"); bg.height = 16; bg:SetPoint ("right", amount, "right"); bg:SetVertexColor (.2, .2, .2, 0.8) + bg:SetPoint("left", icon, "left"); bg.height = 16; bg:SetPoint("right", amount, "right"); bg:SetVertexColor (.2, .2, .2, 0.8) - icon:SetPoint ("topleft", phase_panel, "topleft", 10, ((index * 16) * -1) - 16) - player_name:SetPoint ("left", icon, "right", 2, 0) - amount:SetPoint ("topright", phase_panel, "topleft", 200, ((index * 16) * -1) - 16) + icon:SetPoint("topleft", phase_panel, "topleft", 10, ((index * 16) * -1) - 16) + player_name:SetPoint("left", icon, "right", 2, 0) + amount:SetPoint("topright", phase_panel, "topleft", 200, ((index * 16) * -1) - 16) label = {lefttext = player_name, righttext = amount, icon = icon, bg = bg} phase_panel.damage_labels [index] = label @@ -662,16 +662,16 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) function phase_panel:GetHealLabel (index) local label = phase_panel.heal_labels [index] if (not label) then - local player_name = DetailsFrameWork:CreateLabel (phase_panel, "") - local amount = DetailsFrameWork:CreateLabel (phase_panel, "") - amount:SetJustifyH ("right") + local player_name = DetailsFrameWork:CreateLabel(phase_panel, "") + local amount = DetailsFrameWork:CreateLabel(phase_panel, "") + amount:SetJustifyH("right") local icon = DetailsFrameWork:CreateImage (phase_panel, "", 16, 16) local bg = DetailsFrameWork:CreateImage (phase_panel, [[Interface\AddOns\Details\images\BantoBar]], nil, nil, "artwork") - bg:SetPoint ("left", icon, "left"); bg.height = 16; bg:SetPoint ("right", amount, "right"); bg:SetVertexColor (.2, .2, .2, 0.8) + bg:SetPoint("left", icon, "left"); bg.height = 16; bg:SetPoint("right", amount, "right"); bg:SetVertexColor (.2, .2, .2, 0.8) - icon:SetPoint ("topleft", phase_panel, "topleft", 250, ((index * 16) * -1) - 16) - player_name:SetPoint ("left", icon, "right", 2, 0) - amount:SetPoint ("topright", phase_panel, "topleft", 440, ((index * 16) * -1) - 16) + icon:SetPoint("topleft", phase_panel, "topleft", 250, ((index * 16) * -1) - 16) + player_name:SetPoint("left", icon, "right", 2, 0) + amount:SetPoint("topright", phase_panel, "topleft", 440, ((index * 16) * -1) - 16) label = {lefttext = player_name, righttext = amount, icon = icon, bg = bg} phase_panel.heal_labels [index] = label @@ -679,25 +679,25 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) return label end - phase_panel.phase_label = DetailsFrameWork:CreateLabel (phase_panel, "") - phase_panel.time_label = DetailsFrameWork:CreateLabel (phase_panel, "") - phase_panel.report_label = DetailsFrameWork:CreateLabel (phase_panel, "|cFFffb400Left Click|r: Report Damage |cFFffb400Right Click|r: Report Heal") + phase_panel.phase_label = DetailsFrameWork:CreateLabel(phase_panel, "") + phase_panel.time_label = DetailsFrameWork:CreateLabel(phase_panel, "") + phase_panel.report_label = DetailsFrameWork:CreateLabel(phase_panel, "|cFFffb400Left Click|r: Report Damage |cFFffb400Right Click|r: Report Heal") - phase_panel.phase_label:SetPoint ("bottomleft", phase_panel, "bottomleft", 10, 5) - phase_panel.time_label:SetPoint ("left", phase_panel.phase_label, "right", 5, 0) - phase_panel.report_label:SetPoint ("bottomright", phase_panel, "bottomright", -10, 5) + phase_panel.phase_label:SetPoint("bottomleft", phase_panel, "bottomleft", 10, 5) + phase_panel.time_label:SetPoint("left", phase_panel.phase_label, "right", 5, 0) + phase_panel.report_label:SetPoint("bottomright", phase_panel, "bottomright", -10, 5) local bg = DetailsFrameWork:CreateImage (phase_panel, [[Interface\Tooltips\UI-Tooltip-Background]], nil, nil, "artwork") - bg:SetPoint ("left", phase_panel.phase_label, "left"); + bg:SetPoint("left", phase_panel.phase_label, "left"); bg.height = 16; - bg:SetPoint ("right", phase_panel.report_label, "right"); + bg:SetPoint("right", phase_panel.report_label, "right"); bg:SetVertexColor (0, 0, 0, 1) local spark_container = {} local create_spark = function() - local t = phase_panel:CreateTexture (nil, "overlay") - t:SetTexture ([[Interface\CastingBar\UI-CastingBar-Spark]]) - t:SetBlendMode ("ADD") + local t = phase_panel:CreateTexture(nil, "overlay") + t:SetTexture([[Interface\CastingBar\UI-CastingBar-Spark]]) + t:SetBlendMode("ADD") t:Hide() tinsert (spark_container, t) end @@ -711,7 +711,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) return spark end local hide_sparks = function() - for _, spark in ipairs (spark_container) do + for _, spark in ipairs(spark_container) do spark:Hide() end end @@ -720,9 +720,9 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) local spark1 = get_spark (1) local spark2 = get_spark (2) - self.texture:SetBlendMode ("ADD") - spark1:SetPoint ("left", self.texture, "left", -16, 0) - spark2:SetPoint ("right", self.texture, "right", 16, 0) + self.texture:SetBlendMode("ADD") + spark1:SetPoint("left", self.texture, "left", -16, 0) + spark2:SetPoint("right", self.texture, "right", 16, 0) spark1:Show() spark2:Show() @@ -731,14 +731,14 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) self.texture:SetVertexColor (1, 1, 1) - for _, f in ipairs (g.PhaseTextures) do + for _, f in ipairs(g.PhaseTextures) do if (f ~= self and f.phase == phase) then local spark1 = get_spark (spark_index) local spark2 = get_spark (spark_index+1) - f.texture:SetBlendMode ("ADD") + f.texture:SetBlendMode("ADD") f.texture:SetVertexColor (1, 1, 1) - spark1:SetPoint ("left", f.texture, "left", -16, 0) - spark2:SetPoint ("right", f.texture, "right", 16, 0) + spark1:SetPoint("left", f.texture, "left", -16, 0) + spark2:SetPoint("right", f.texture, "right", 16, 0) spark1:Show() spark2:Show() spark_index = spark_index + 2 @@ -757,10 +757,10 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) end table.sort (players, _detalhes.Sort2) - for i, player in ipairs (players) do + for i, player in ipairs(players) do local dlabel = phase_panel:GetDamageLabel (i) dlabel.lefttext.text = EncounterDetails:GetOnlyName (player [1]) - dlabel.righttext.text = _detalhes:ToK (_math_floor (player [2])) + dlabel.righttext.text = _detalhes:ToK (_math_floor(player [2])) local class = EncounterDetails:GetClass (player [1]) local spec = EncounterDetails:GetSpec (player [1]) @@ -794,17 +794,17 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) end table.sort (players, _detalhes.Sort2) - for i, player in ipairs (players) do + for i, player in ipairs(players) do local hlabel = phase_panel:GetHealLabel (i) hlabel.lefttext.text = EncounterDetails:GetOnlyName (player [1]) - hlabel.righttext.text = _detalhes:ToK (_math_floor (player [2])) + hlabel.righttext.text = _detalhes:ToK (_math_floor(player [2])) local classe = _detalhes:GetClass (player [1]) if (classe) then - hlabel.icon:SetTexture ([[Interface\AddOns\Details\images\classes_small_alpha]]) + hlabel.icon:SetTexture([[Interface\AddOns\Details\images\classes_small_alpha]]) hlabel.icon:SetTexCoord (unpack (_detalhes.class_coords [classe])) else - hlabel.icon:SetTexture ([[Interface\LFGFRAME\LFGROLE_BW]]) + hlabel.icon:SetTexture([[Interface\LFGFRAME\LFGROLE_BW]]) hlabel.icon:SetTexCoord (.25, .5, 0, 1) end @@ -818,13 +818,13 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) self.heal_actors = players --show the panel - phase_panel:SetHeight ((math.max (damage_players, heal_players) * 16) + 60) - phase_panel:SetPoint ("bottom", self, "top", 0, 10) + phase_panel:SetHeight((math.max (damage_players, heal_players) * 16) + 60) + phase_panel:SetPoint("bottom", self, "top", 0, 10) phase_panel:Show() phase_panel.phase_label.text = "|cFFffb400Phase|r: " .. self.phase - local m, s = _math_floor (self.elapsed / 60), _math_floor (self.elapsed % 60) + local m, s = _math_floor(self.elapsed / 60), _math_floor(self.elapsed % 60) phase_panel.time_label.text = "|cFFffb400Elapsed|r: " .. m .. "m " .. s .. "s" end @@ -834,8 +834,8 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) table.wipe (self.damage_actors) table.wipe (self.heal_actors) - for _, f in ipairs (g.PhaseTextures) do - f.texture:SetBlendMode ("BLEND") + for _, f in ipairs(g.PhaseTextures) do + f.texture:SetBlendMode("BLEND") f.texture:SetVertexColor (unpack (f.texture.original_color)) end @@ -860,7 +860,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) --need to build here because the mouse will leave the block to click in the send button tinsert (result, "Details!: Damage for Phase " .. self.phase .. " of " .. (g.combat and g.combat.is_boss and g.combat.is_boss.name or "Unknown") .. ":") for i = 1, #self.damage_actors do - tinsert (result, EncounterDetails:GetOnlyName (self.damage_actors[i][1]) .. ": " .. _detalhes:ToK (_math_floor (self.damage_actors [i][2]))) + tinsert (result, EncounterDetails:GetOnlyName (self.damage_actors[i][1]) .. ": " .. _detalhes:ToK (_math_floor(self.damage_actors [i][2]))) end EncounterDetails:SendReportWindow (reportFunc, nil, nil, true) @@ -879,7 +879,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) tinsert (result, "Details!: Healing for Phase " .. self.phase .. " of " .. (g.combat and g.combat.is_boss and g.combat.is_boss.name or "Unknown") .. ":") for i = 1, #self.heal_actors do - tinsert (result, EncounterDetails:GetOnlyName (self.heal_actors[i][1]) .. ": " .. _detalhes:ToK (_math_floor (self.heal_actors [i][2]))) + tinsert (result, EncounterDetails:GetOnlyName (self.heal_actors[i][1]) .. ": " .. _detalhes:ToK (_math_floor(self.heal_actors [i][2]))) end EncounterDetails:SendReportWindow (reportFunc, nil, nil, true) @@ -891,18 +891,18 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) local texture = g.PhaseTextures [index] if (not texture) then - local f = CreateFrame ("frame", "EncounterDetailsPhaseTexture" .. index, g, "BackdropTemplate") - f:SetHeight (CONST_PHASE_BAR_HEIGHT) + local f = CreateFrame("frame", "EncounterDetailsPhaseTexture" .. index, g, "BackdropTemplate") + f:SetHeight(CONST_PHASE_BAR_HEIGHT) - local t = f:CreateTexture (nil, "artwork") + local t = f:CreateTexture(nil, "artwork") t:SetAllPoints() t:SetColorTexture (1, 1, 1, phase_alpha) t.original_color = {1, 1, 1} f.texture = t - f:SetScript ("OnEnter", phase_on_enter) - f:SetScript ("OnLeave", phase_on_leave) - f:SetScript ("OnMouseUp", phase_on_click) + f:SetScript("OnEnter", phase_on_enter) + f:SetScript("OnLeave", phase_on_leave) + f:SetScript("OnMouseUp", phase_on_click) texture = f tinsert (g.PhaseTextures, f) @@ -931,7 +931,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) end end - --> chart frame implementations + --chart frame implementations function g:ChangeColorOnDataSeries (index, color) self.Data [index].Color = color @@ -961,25 +961,25 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) self.NeedsUpdate=true end - DetailsFrameWork:NewLabel (EncounterDetails.Frame, EncounterDetails.Frame, nil, "phases_string", "phases:", "GameFontHighlightSmall") - EncounterDetails.Frame["phases_string"]:SetPoint ("TOPLEFT", EncounterDetails.Frame, "TOPLEFT", 20, CONST_CHART_TIMELINE_Y_POSITION) + DetailsFrameWork:NewLabel(EncounterDetails.Frame, EncounterDetails.Frame, nil, "phases_string", "phases:", "GameFontHighlightSmall") + EncounterDetails.Frame["phases_string"]:SetPoint("TOPLEFT", EncounterDetails.Frame, "TOPLEFT", 20, CONST_CHART_TIMELINE_Y_POSITION) - DetailsFrameWork:NewLabel (EncounterDetails.Frame, EncounterDetails.Frame, nil, "timeamt0", "00:00", "GameFontHighlightSmall") - EncounterDetails.Frame["timeamt0"]:SetPoint ("TOPLEFT", EncounterDetails.Frame, "TOPLEFT", 85, CONST_CHART_TIMELINE_Y_POSITION) + DetailsFrameWork:NewLabel(EncounterDetails.Frame, EncounterDetails.Frame, nil, "timeamt0", "00:00", "GameFontHighlightSmall") + EncounterDetails.Frame["timeamt0"]:SetPoint("TOPLEFT", EncounterDetails.Frame, "TOPLEFT", 85, CONST_CHART_TIMELINE_Y_POSITION) - --> create lines for damage and time + --create lines for damage and time for i = 1, 8, 1 do - local line = g:CreateTexture (nil, "overlay") + local line = g:CreateTexture(nil, "overlay") line:SetColorTexture (unpack (CONST_DAMAGE_LINES_COLOR)) - line:SetWidth (CONST_CHART_WIDTH) - line:SetHeight (1) + line:SetWidth(CONST_CHART_WIDTH) + line:SetHeight(1) - DetailsFrameWork:NewLabel (EncounterDetails.Frame, EncounterDetails.Frame, nil, "dpsamt"..i, "", "GameFontHighlightSmall") - EncounterDetails.Frame["dpsamt"..i]:SetPoint ("TOPLEFT", EncounterDetails.Frame, "TOPLEFT", CONST_CHART_DAMAGELINE_X_POSITION, -61 + (-( (CONST_CHART_HEIGHT / 9) *i ))) - line:SetPoint ("topleft", EncounterDetails.Frame["dpsamt"..i].widget, "bottom", -27, 0) + DetailsFrameWork:NewLabel(EncounterDetails.Frame, EncounterDetails.Frame, nil, "dpsamt"..i, "", "GameFontHighlightSmall") + EncounterDetails.Frame["dpsamt"..i]:SetPoint("TOPLEFT", EncounterDetails.Frame, "TOPLEFT", CONST_CHART_DAMAGELINE_X_POSITION, -61 + (-( (CONST_CHART_HEIGHT / 9) *i ))) + line:SetPoint("topleft", EncounterDetails.Frame["dpsamt"..i].widget, "bottom", -27, 0) - DetailsFrameWork:NewLabel (EncounterDetails.Frame, EncounterDetails.Frame, nil, "timeamt"..i, "", "GameFontHighlightSmall") - EncounterDetails.Frame["timeamt"..i].widget:SetPoint ("TOPLEFT", EncounterDetails.Frame, "TOPLEFT", CONST_CHART_TIMELINE_X_POSITION + ( (CONST_CHART_WIDTH / 9) * i ), CONST_CHART_TIMELINE_Y_POSITION + 1) + DetailsFrameWork:NewLabel(EncounterDetails.Frame, EncounterDetails.Frame, nil, "timeamt"..i, "", "GameFontHighlightSmall") + EncounterDetails.Frame["timeamt"..i].widget:SetPoint("TOPLEFT", EncounterDetails.Frame, "TOPLEFT", CONST_CHART_TIMELINE_X_POSITION + ( (CONST_CHART_WIDTH / 9) * i ), CONST_CHART_TIMELINE_Y_POSITION + 1) end g.max_time = 0 @@ -987,38 +987,38 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) EncounterDetails.MaxGraphics = EncounterDetails.MaxGraphics or 5 - --> fight segments at the top right corner + --fight segments at the top right corner for i = 1, EncounterDetails.MaxGraphics do - local texture = g:CreateTexture (nil, "overlay") - texture:SetWidth (9) - texture:SetHeight (9) - texture:SetPoint ("TOPLEFT", EncounterDetails.Frame, "TOPLEFT", (i*65) + 499, -81) + local texture = g:CreateTexture(nil, "overlay") + texture:SetWidth(9) + texture:SetHeight(9) + texture:SetPoint("TOPLEFT", EncounterDetails.Frame, "TOPLEFT", (i*65) + 499, -81) texture:SetColorTexture (unpack (grafico_cores[i])) local text = g:CreateFontString (nil, "OVERLAY", "GameFontHighlightSmall") - text:SetPoint ("LEFT", texture, "right", 2, 0) - text:SetJustifyH ("LEFT") + text:SetPoint("LEFT", texture, "right", 2, 0) + text:SetJustifyH("LEFT") if (i == 1) then - text:SetText (Loc ["STRING_CURRENT"]) + text:SetText(Loc ["STRING_CURRENT"]) else - text:SetText (Loc ["STRING_TRY"] .. " #" .. i) + text:SetText(Loc ["STRING_TRY"] .. " #" .. i) end g.TryIndicator [#g.TryIndicator+1] = {texture = texture, text = text} end - --> vertical line at the left side - local v = g:CreateTexture (nil, "overlay") - v:SetWidth (1) - v:SetHeight (CONST_CHART_HEIGHT + 1) - v:SetPoint ("top", g, "top", 0, 1) - v:SetPoint ("left", g, "left", CONST_CHART_DAMAGELINE_X_POSITION + 30, 0) --> leave 30 pixels for the damage text + --vertical line at the left side + local v = g:CreateTexture(nil, "overlay") + v:SetWidth(1) + v:SetHeight(CONST_CHART_HEIGHT + 1) + v:SetPoint("top", g, "top", 0, 1) + v:SetPoint("left", g, "left", CONST_CHART_DAMAGELINE_X_POSITION + 30, 0) --leave 30 pixels for the damage text v:SetColorTexture (1, 1, 1, 1) - --> horizontal line at the bottom side - local h = g:CreateTexture (nil, "overlay") - h:SetWidth (CONST_CHART_WIDTH) - h:SetHeight (1) - h:SetPoint ("top", g, "top", 0, -CONST_CHART_HEIGHT + CONST_PHASE_BAR_HEIGHT*2) - h:SetPoint ("left", g, "left") + --horizontal line at the bottom side + local h = g:CreateTexture(nil, "overlay") + h:SetWidth(CONST_CHART_WIDTH) + h:SetHeight(1) + h:SetPoint("top", g, "top", 0, -CONST_CHART_HEIGHT + CONST_PHASE_BAR_HEIGHT*2) + h:SetPoint("left", g, "left") h:SetColorTexture (1, 1, 1, 1) end @@ -1029,80 +1029,80 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) BossFrame:SetFrameStrata ("HIGH") BossFrame:SetToplevel (true) - BossFrame:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) - BossFrame:SetBackdropColor (.5, .5, .5, .5) - BossFrame:SetBackdropBorderColor (0, 0, 0, 1) + BossFrame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) + BossFrame:SetBackdropColor(.5, .5, .5, .5) + BossFrame:SetBackdropBorderColor(0, 0, 0, 1) -- ~size - BossFrame:SetWidth (898) -- + 200 - BossFrame:SetHeight (504) -- + 150 + BossFrame:SetWidth(898) -- + 200 + BossFrame:SetHeight(504) -- + 150 BossFrame:EnableMouse (true) - BossFrame:SetResizable (false) + BossFrame:SetResizable(false) BossFrame:SetMovable (true) --background - BossFrame.bg1 = BossFrame:CreateTexture (nil, "background") - BossFrame.bg1:SetTexture ([[Interface\AddOns\Details\images\background]], true) + BossFrame.bg1 = BossFrame:CreateTexture(nil, "background") + BossFrame.bg1:SetTexture([[Interface\AddOns\Details\images\background]], true) BossFrame.bg1:SetAlpha (0.7) BossFrame.bg1:SetVertexColor (0.27, 0.27, 0.27) BossFrame.bg1:SetVertTile (true) BossFrame.bg1:SetHorizTile (true) - BossFrame.bg1:SetSize (790, 454) + BossFrame.bg1:SetSize(790, 454) BossFrame.bg1:SetAllPoints() --title bar - local titlebar = CreateFrame ("frame", nil, BossFrame,"BackdropTemplate") - titlebar:SetPoint ("topleft", BossFrame, "topleft", 2, -3) - titlebar:SetPoint ("topright", BossFrame, "topright", -2, -3) - titlebar:SetHeight (20) - titlebar:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) - titlebar:SetBackdropColor (.5, .5, .5, 1) - titlebar:SetBackdropBorderColor (0, 0, 0, 1) + local titlebar = CreateFrame("frame", nil, BossFrame,"BackdropTemplate") + titlebar:SetPoint("topleft", BossFrame, "topleft", 2, -3) + titlebar:SetPoint("topright", BossFrame, "topright", -2, -3) + titlebar:SetHeight(20) + titlebar:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) + titlebar:SetBackdropColor(.5, .5, .5, 1) + titlebar:SetBackdropBorderColor(0, 0, 0, 1) - local name_bg_texture = BossFrame:CreateTexture (nil, "background") - name_bg_texture:SetTexture ([[Interface\PetBattles\_PetBattleHorizTile]], true) + local name_bg_texture = BossFrame:CreateTexture(nil, "background") + name_bg_texture:SetTexture([[Interface\PetBattles\_PetBattleHorizTile]], true) name_bg_texture:SetHorizTile (true) name_bg_texture:SetTexCoord (0, 1, 126/256, 19/256) - name_bg_texture:SetPoint ("topleft", BossFrame, "topleft", 2, -22) - name_bg_texture:SetPoint ("bottomright", BossFrame, "bottomright") - name_bg_texture:SetHeight (54) + name_bg_texture:SetPoint("topleft", BossFrame, "topleft", 2, -22) + name_bg_texture:SetPoint("bottomright", BossFrame, "bottomright") + name_bg_texture:SetHeight(54) name_bg_texture:SetVertexColor (0, 0, 0, 0.2) - --> header background - local headerFrame = CreateFrame ("frame", "EncounterDetailsHeaderFrame", BossFrame,"BackdropTemplate") + --header background + local headerFrame = CreateFrame("frame", "EncounterDetailsHeaderFrame", BossFrame,"BackdropTemplate") headerFrame:EnableMouse (false) - headerFrame:SetPoint ("topleft", titlebar, "bottomleft", 0, -1) - headerFrame:SetPoint ("topright", titlebar, "bottomright", 0, -1) - headerFrame:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) - headerFrame:SetBackdropColor (.7, .7, .7, .4) - headerFrame:SetBackdropBorderColor (0, 0, 0, 0) - headerFrame:SetHeight (48) + headerFrame:SetPoint("topleft", titlebar, "bottomleft", 0, -1) + headerFrame:SetPoint("topright", titlebar, "bottomright", 0, -1) + headerFrame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) + headerFrame:SetBackdropColor(.7, .7, .7, .4) + headerFrame:SetBackdropBorderColor(0, 0, 0, 0) + headerFrame:SetHeight(48) --window title - local titleLabel = DetailsFrameWork:NewLabel (titlebar, titlebar, nil, "titulo", Loc ["STRING_WINDOW_TITLE"], "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255}) - titleLabel:SetPoint ("center", BossFrame, "center") - titleLabel:SetPoint ("top", BossFrame, "top", 0, -7) + local titleLabel = DetailsFrameWork:NewLabel(titlebar, titlebar, nil, "titulo", Loc ["STRING_WINDOW_TITLE"], "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255}) + titleLabel:SetPoint("center", BossFrame, "center") + titleLabel:SetPoint("top", BossFrame, "top", 0, -7) - --> Nome do Encontro - DetailsFrameWork:NewLabel (headerFrame, headerFrame, nil, "boss_name", "Unknown Encounter", "QuestFont_Large") + --Nome do Encontro + DetailsFrameWork:NewLabel(headerFrame, headerFrame, nil, "boss_name", "Unknown Encounter", "QuestFont_Large") BossFrame.boss_name = headerFrame.boss_name - BossFrame.boss_name:SetPoint ("TOPLEFT", BossFrame, "TOPLEFT", 100, -46) + BossFrame.boss_name:SetPoint("TOPLEFT", BossFrame, "TOPLEFT", 100, -46) - --> Nome da Raid - DetailsFrameWork:NewLabel (headerFrame, headerFrame, nil, "raid_name", "Unknown Raid", "GameFontHighlightSmall") + --Nome da Raid + DetailsFrameWork:NewLabel(headerFrame, headerFrame, nil, "raid_name", "Unknown Raid", "GameFontHighlightSmall") BossFrame.raid_name = headerFrame.raid_name - BossFrame.raid_name:SetPoint ("CENTER", BossFrame.boss_name, "CENTER", 0, 14) + BossFrame.raid_name:SetPoint("CENTER", BossFrame.boss_name, "CENTER", 0, 14) - --> icone da classe no canto esquerdo superior - BossFrame.boss_icone = headerFrame:CreateTexture (nil, "overlay") - BossFrame.boss_icone:SetPoint ("TOPLEFT", BossFrame, "TOPLEFT", 9, -24) - BossFrame.boss_icone:SetWidth (46) - BossFrame.boss_icone:SetHeight (46) + --icone da classe no canto esquerdo superior + BossFrame.boss_icone = headerFrame:CreateTexture(nil, "overlay") + BossFrame.boss_icone:SetPoint("TOPLEFT", BossFrame, "TOPLEFT", 9, -24) + BossFrame.boss_icone:SetWidth(46) + BossFrame.boss_icone:SetHeight(46) ---- - BossFrame:SetScript ("OnMouseDown", + BossFrame:SetScript("OnMouseDown", function(self, botao) if (botao == "LeftButton") then self:StartMoving() @@ -1112,7 +1112,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) end end) - BossFrame:SetScript ("OnMouseUp", + BossFrame:SetScript("OnMouseUp", function(self) if (self.isMoving) then self:StopMovingOrSizing() @@ -1120,34 +1120,34 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) end end) - BossFrame:SetPoint ("CENTER", UIParent) + BossFrame:SetPoint("CENTER", UIParent) - --> imagem de fundo - BossFrame.raidbackground = BossFrame:CreateTexture (nil, "BORDER") - BossFrame.raidbackground:SetPoint ("TOPLEFT", BossFrame, "TOPLEFT", 0, -74) - BossFrame.raidbackground:SetPoint ("bottomright", BossFrame, "bottomright", 0, 0) + --imagem de fundo + BossFrame.raidbackground = BossFrame:CreateTexture(nil, "BORDER") + BossFrame.raidbackground:SetPoint("TOPLEFT", BossFrame, "TOPLEFT", 0, -74) + BossFrame.raidbackground:SetPoint("bottomright", BossFrame, "bottomright", 0, 0) BossFrame.raidbackground:SetDrawLayer ("BORDER", 2) BossFrame.raidbackground:SetAlpha (0.1) - --> bot�o fechar - titlebar.CloseButton = CreateFrame ("Button", nil, titlebar, "UIPanelCloseButton") - titlebar.CloseButton:SetWidth (20) - titlebar.CloseButton:SetHeight (20) - titlebar.CloseButton:SetPoint ("TOPRIGHT", BossFrame, "TOPRIGHT", -2, -3) - titlebar.CloseButton:SetText ("X") - titlebar.CloseButton:SetScript ("OnClick", function(self) + --bot�o fechar + titlebar.CloseButton = CreateFrame("Button", nil, titlebar, "UIPanelCloseButton") + titlebar.CloseButton:SetWidth(20) + titlebar.CloseButton:SetHeight(20) + titlebar.CloseButton:SetPoint("TOPRIGHT", BossFrame, "TOPRIGHT", -2, -3) + titlebar.CloseButton:SetText("X") + titlebar.CloseButton:SetScript("OnClick", function(self) EncounterDetails:CloseWindow() end) titlebar.CloseButton:SetFrameLevel (titlebar:GetFrameLevel()+2) titlebar.CloseButton:GetNormalTexture():SetDesaturated (true) - --> background completo + --background completo BossFrame.Widgets = {} BossFrame.ShowType = "main" - --> revisar + --revisar BossFrame.Reset = function() BossFrame.switch (nil, nil, "main") if (_G.DetailsRaidDpsGraph) then @@ -1191,7 +1191,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) local hide_Summary = function() --hide boss frames - for _, frame in _ipairs (BossFrame.Widgets) do + for _, frame in _ipairs(BossFrame.Widgets) do frame:Hide() end end @@ -1205,9 +1205,9 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) end BossFrame.switch = function(to, _, to2) - if (type (to) == "string") then + if (type(to) == "string") then to = to - elseif (type (to2) == "string") then + elseif (type(to2) == "string") then to = to2 end @@ -1221,7 +1221,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) if (to == "main") then BossFrame.raidbackground:Show() - for _, frame in _ipairs (BossFrame.Widgets) do + for _, frame in _ipairs(BossFrame.Widgets) do frame:Show() end @@ -1274,7 +1274,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) end --hide boss frames - for _, frame in _ipairs (BossFrame.Widgets) do + for _, frame in _ipairs(BossFrame.Widgets) do frame:Hide() end @@ -1346,7 +1346,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) BossFrame.raidbackground:Hide() - for _, frame in _ipairs (BossFrame.Widgets) do + for _, frame in _ipairs(BossFrame.Widgets) do frame:Hide() end @@ -1391,42 +1391,42 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) BossFrame.buttonSwitchNormal = _detalhes.gump:CreateButton (BossFrame, BossFrame.switch, BUTTON_WIDTH, BUTTON_HEIGHT, "Summary", "main") BossFrame.buttonSwitchNormal:SetIcon ("Interface\\AddOns\\Details_EncounterDetails\\images\\boss_frame_buttons", 18, 18, "overlay", {0, 32/256, 0, 0.505625}) BossFrame.buttonSwitchNormal:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE")) - BossFrame.buttonSwitchNormal:SetWidth (BUTTON_WIDTH) + BossFrame.buttonSwitchNormal:SetWidth(BUTTON_WIDTH) --spells e auras BossFrame.buttonSwitchSpellsAuras = _detalhes.gump:CreateButton (BossFrame, BossFrame.switch, BUTTON_WIDTH, BUTTON_HEIGHT, "Timers & Spells", "spellsauras") BossFrame.buttonSwitchSpellsAuras:SetIcon ("Interface\\AddOns\\Details_EncounterDetails\\images\\boss_frame_buttons", 18, 18, "overlay", {33/256, 64/256, 0, 0.505625}) BossFrame.buttonSwitchSpellsAuras:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) - BossFrame.buttonSwitchSpellsAuras:SetWidth (BUTTON_WIDTH) + BossFrame.buttonSwitchSpellsAuras:SetWidth(BUTTON_WIDTH) BossFrame.AllButtons = {BossFrame.buttonSwitchNormal, BossFrame.buttonSwitchGraphic, BossFrame.buttonSwitchBossEmotes, BossFrame.buttonSwitchSpellsAuras, BossFrame.buttonSwitchPhases} --phases BossFrame.buttonSwitchPhases = _detalhes.gump:CreateButton (BossFrame, BossFrame.switch, BUTTON_WIDTH, BUTTON_HEIGHT, "Phases", "phases") BossFrame.buttonSwitchPhases:SetIcon ("Interface\\AddOns\\Details_EncounterDetails\\images\\boss_frame_buttons", 18, 18, "overlay", {65/256, 96/256, 0, 0.505625}) BossFrame.buttonSwitchPhases:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) - BossFrame.buttonSwitchPhases:SetWidth (BUTTON_WIDTH) + BossFrame.buttonSwitchPhases:SetWidth(BUTTON_WIDTH) --chart BossFrame.buttonSwitchGraphic = _detalhes.gump:CreateButton (BossFrame, BossFrame.switch, BUTTON_WIDTH, BUTTON_HEIGHT, "Damage Graphic", "graph") BossFrame.buttonSwitchGraphic:SetIcon ("Interface\\AddOns\\Details_EncounterDetails\\images\\boss_frame_buttons", 18, 18, "overlay", {97/256, 128/256, 0, 0.505625}) BossFrame.buttonSwitchGraphic:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) - BossFrame.buttonSwitchGraphic:SetWidth (BUTTON_WIDTH) + BossFrame.buttonSwitchGraphic:SetWidth(BUTTON_WIDTH) --emotes BossFrame.buttonSwitchBossEmotes = _detalhes.gump:CreateButton (BossFrame, BossFrame.switch, BUTTON_WIDTH, BUTTON_HEIGHT, "Emotes", "emotes") BossFrame.buttonSwitchBossEmotes:SetIcon ("Interface\\AddOns\\Details_EncounterDetails\\images\\boss_frame_buttons", 18, 18, "overlay", {129/256, 160/256, 0, 0.505625}) BossFrame.buttonSwitchBossEmotes:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) - BossFrame.buttonSwitchBossEmotes:SetWidth (BUTTON_WIDTH) + BossFrame.buttonSwitchBossEmotes:SetWidth(BUTTON_WIDTH) --anchors - BossFrame.buttonSwitchNormal:SetPoint ("TOPLEFT", BossFrame, "TOPLEFT", HEADER_MENUBUTTONS_X, HEADER_MENUBUTTONS_Y) - BossFrame.buttonSwitchSpellsAuras:SetPoint ("left", BossFrame.buttonSwitchNormal, "right", HEADER_MENUBUTTONS_SPACEMENT, 0) - BossFrame.buttonSwitchPhases:SetPoint ("left", BossFrame.buttonSwitchSpellsAuras, "right", HEADER_MENUBUTTONS_SPACEMENT, 0) - BossFrame.buttonSwitchGraphic:SetPoint ("left", BossFrame.buttonSwitchPhases, "right", HEADER_MENUBUTTONS_SPACEMENT, 0) - BossFrame.buttonSwitchBossEmotes:SetPoint ("left", BossFrame.buttonSwitchGraphic, "right", HEADER_MENUBUTTONS_SPACEMENT, 0) + BossFrame.buttonSwitchNormal:SetPoint("TOPLEFT", BossFrame, "TOPLEFT", HEADER_MENUBUTTONS_X, HEADER_MENUBUTTONS_Y) + BossFrame.buttonSwitchSpellsAuras:SetPoint("left", BossFrame.buttonSwitchNormal, "right", HEADER_MENUBUTTONS_SPACEMENT, 0) + BossFrame.buttonSwitchPhases:SetPoint("left", BossFrame.buttonSwitchSpellsAuras, "right", HEADER_MENUBUTTONS_SPACEMENT, 0) + BossFrame.buttonSwitchGraphic:SetPoint("left", BossFrame.buttonSwitchPhases, "right", HEADER_MENUBUTTONS_SPACEMENT, 0) + BossFrame.buttonSwitchBossEmotes:SetPoint("left", BossFrame.buttonSwitchGraphic, "right", HEADER_MENUBUTTONS_SPACEMENT, 0) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> ~emotes +--~emotes local emote_lines = {} local emote_search_table = {} @@ -1444,7 +1444,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) if (searching) then local i = 0 local lower = string.lower - for index, data in ipairs (emote_pool) do + for index, data in ipairs(emote_pool) do if (lower (data [2]):find (lower(searching))) then i = i + 1 emote_search_table [i] = data @@ -1455,7 +1455,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) emote_pool = emote_search_table end BossFrame.SearchResults:Show() - BossFrame.SearchResults:SetText ("Found " .. i .. " matches") + BossFrame.SearchResults:SetText("Found " .. i .. " matches") if (i > 0) then BossFrame.ReportEmoteButton:Enable() @@ -1473,22 +1473,22 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) if (data) then bar:Show() - local min, sec = _math_floor (data[1] / 60), _math_floor (data[1] % 60) - bar.lefttext:SetText (min .. "m" .. sec .. "s:") + local min, sec = _math_floor(data[1] / 60), _math_floor(data[1] % 60) + bar.lefttext:SetText(min .. "m" .. sec .. "s:") if (data [2] == "") then - bar.righttext:SetText ("--x--x--") + bar.righttext:SetText("--x--x--") else - bar.righttext:SetText (_cstr (data [2], data [3])) + bar.righttext:SetText(_cstr (data [2], data [3])) end local color_string = EncounterDetails.BossWhispColors [data [4]] local color_table = ChatTypeInfo [color_string] bar.righttext:SetTextColor (color_table.r, color_table.g, color_table.b) - bar.icon:SetTexture ([[Interface\CHARACTERFRAME\UI-StateIcon]]) + bar.icon:SetTexture([[Interface\CHARACTERFRAME\UI-StateIcon]]) bar.icon:SetTexCoord (0, 0.5, 0.5, 1) - bar.icon:SetBlendMode ("ADD") + bar.icon:SetBlendMode("ADD") else bar:Hide() end @@ -1507,14 +1507,14 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) --~emotes ~whispers local bar_div_emotes = DetailsFrameWork:CreateImage (BossFrame, "Interface\\AddOns\\Details_EncounterDetails\\images\\boss_bg", 4, 480, "artwork", {724/1024, 728/1024, 0, 245/512}) - bar_div_emotes:SetPoint ("TOPLEFT", BossFrame, "TOPLEFT", 244, -74) + bar_div_emotes:SetPoint("TOPLEFT", BossFrame, "TOPLEFT", 244, -74) bar_div_emotes:Hide() tinsert (BossFrame.EmoteWidgets, bar_div_emotes) - scrollframe = CreateFrame ("ScrollFrame", "EncounterDetails_EmoteScroll", BossFrame, "FauxScrollFrameTemplate, BackdropTemplate") - scrollframe:SetScript ("OnVerticalScroll", function(self, offset) FauxScrollFrame_OnVerticalScroll (self, offset, 14, refresh_emotes) end) - scrollframe:SetPoint ("topleft", BossFrame, "topleft", 249, -75) - scrollframe:SetPoint ("bottomright", BossFrame, "bottomright", -33, 42) + scrollframe = CreateFrame("ScrollFrame", "EncounterDetails_EmoteScroll", BossFrame, "FauxScrollFrameTemplate, BackdropTemplate") + scrollframe:SetScript("OnVerticalScroll", function(self, offset) FauxScrollFrame_OnVerticalScroll (self, offset, 14, refresh_emotes) end) + scrollframe:SetPoint("topleft", BossFrame, "topleft", 249, -75) + scrollframe:SetPoint("bottomright", BossFrame, "bottomright", -33, 42) scrollframe.Update = refresh_emotes scrollframe:Hide() _detalhes.gump:ReskinSlider(scrollframe, 3) @@ -1523,8 +1523,8 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) tinsert (BossFrame.EmoteWidgets, scrollframe) local row_on_enter = function(self) - self:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16}) - self:SetBackdropColor (1, 1, 1, .6) + self:SetBackdrop({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16}) + self:SetBackdropColor(1, 1, 1, .6) if (self.righttext:IsTruncated()) then GameCooltip:Reset() GameCooltip:AddLine (self.righttext:GetText()) @@ -1533,8 +1533,8 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) end end local row_on_leave = function(self) - self:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16}) - self:SetBackdropColor (1, 1, 1, .3) + self:SetBackdrop({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16}) + self:SetBackdropColor(1, 1, 1, .3) GameCooltip:Hide() end @@ -1567,43 +1567,43 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) end for i = 1, CONST_EMOTES_MAX_LINES do - local line = CreateFrame ("frame", nil, BossFrame,"BackdropTemplate") + local line = CreateFrame("frame", nil, BossFrame,"BackdropTemplate") local y = (i-1) * 15 * -1 - line:SetPoint ("topleft", scrollframe, "topleft", 0, y) - line:SetPoint ("topright", scrollframe, "topright", 0, y) - line:SetHeight (14) - line:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16}) - line:SetBackdropColor (1, 1, 1, .3) + line:SetPoint("topleft", scrollframe, "topleft", 0, y) + line:SetPoint("topright", scrollframe, "topright", 0, y) + line:SetHeight(14) + line:SetBackdrop({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16}) + line:SetBackdropColor(1, 1, 1, .3) - line.icon = line:CreateTexture (nil, "overlay") - line.icon:SetPoint ("left", line, "left", 2, 0) - line.icon:SetSize (14, 14) + line.icon = line:CreateTexture(nil, "overlay") + line.icon:SetPoint("left", line, "left", 2, 0) + line.icon:SetSize(14, 14) line.lefttext = line:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - line.lefttext:SetPoint ("left", line.icon, "right", 2, 0) - line.lefttext:SetWidth (line:GetWidth() - 26) - line.lefttext:SetHeight (14) - line.lefttext:SetJustifyH ("left") + line.lefttext:SetPoint("left", line.icon, "right", 2, 0) + line.lefttext:SetWidth(line:GetWidth() - 26) + line.lefttext:SetHeight(14) + line.lefttext:SetJustifyH("left") line.righttext = line:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - line.righttext:SetPoint ("left", line.icon, "right", 46, 0) - line.righttext:SetWidth (line:GetWidth() - 60) - line.righttext:SetHeight (14) - line.righttext:SetJustifyH ("left") + line.righttext:SetPoint("left", line.icon, "right", 46, 0) + line.righttext:SetWidth(line:GetWidth() - 60) + line.righttext:SetHeight(14) + line.righttext:SetJustifyH("left") line:SetFrameLevel (scrollframe:GetFrameLevel()+1) - line:SetScript ("OnEnter", row_on_enter) - line:SetScript ("OnLeave", row_on_leave) - line:SetScript ("OnMouseUp", row_on_mouse_up) + line:SetScript("OnEnter", row_on_enter) + line:SetScript("OnLeave", row_on_leave) + line:SetScript("OnMouseUp", row_on_mouse_up) tinsert (emote_lines, line) tinsert (BossFrame.EmoteWidgets, line) line:Hide() end --select emote segment - local emotes_segment_label = DetailsFrameWork:CreateLabel (BossFrame, "Segment:", 11, nil, "GameFontHighlightSmall") - emotes_segment_label:SetPoint ("topleft", BossFrame, "topleft", 10, -85) + local emotes_segment_label = DetailsFrameWork:CreateLabel(BossFrame, "Segment:", 11, nil, "GameFontHighlightSmall") + emotes_segment_label:SetPoint("topleft", BossFrame, "topleft", 10, -85) local on_emote_Segment_select = function(_, _, segment) FauxScrollFrame_SetOffset (scrollframe, 0) @@ -1624,31 +1624,31 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) if (not EncounterDetails.charsaved) then return t end - for index, segment in ipairs (EncounterDetails.charsaved.emotes) do + for index, segment in ipairs(EncounterDetails.charsaved.emotes) do tinsert (t, {label = "#" .. index .. " " .. (segment.boss or "unknown"), value = index, icon = segment_icon, texcoord = segment_icon_coord, onclick = on_emote_Segment_select, iconcolor = segment_icon_color}) end return t end local dropdown = DetailsFrameWork:NewDropDown (BossFrame, _, "$parentEmotesSegmentDropdown", "EmotesSegment", 180, 20, build_emote_segments, 1) - dropdown:SetPoint ("topleft", emotes_segment_label, "bottomleft", -1, -2) + dropdown:SetPoint("topleft", emotes_segment_label, "bottomleft", -1, -2) dropdown:SetTemplate (DetailsFrameWork:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) tinsert (BossFrame.EmoteWidgets, dropdown) tinsert (BossFrame.EmoteWidgets, emotes_segment_label) --search box - local emotes_search_label = DetailsFrameWork:CreateLabel (BossFrame, "Search:", 11, nil, "GameFontHighlightSmall") - emotes_search_label:SetPoint ("topleft", BossFrame, "topleft", 10, -130) + local emotes_search_label = DetailsFrameWork:CreateLabel(BossFrame, "Search:", 11, nil, "GameFontHighlightSmall") + emotes_search_label:SetPoint("topleft", BossFrame, "topleft", 10, -130) - local emotes_search_results_label = DetailsFrameWork:CreateLabel (BossFrame, "", 11, nil, "GameFontNormal", "SearchResults") - emotes_search_results_label:SetPoint ("topleft", BossFrame, "topleft", 10, -190) + local emotes_search_results_label = DetailsFrameWork:CreateLabel(BossFrame, "", 11, nil, "GameFontNormal", "SearchResults") + emotes_search_results_label:SetPoint("topleft", BossFrame, "topleft", 10, -190) -- local search = DetailsFrameWork:NewTextEntry (BossFrame, nil, "$parentEmoteSearchBox", nil, 180, 20) search:SetTemplate (DetailsFrameWork:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) - search:SetPoint ("topleft",emotes_search_label, "bottomleft", -1, -2) - search:SetJustifyH ("left") + search:SetPoint("topleft",emotes_search_label, "bottomleft", -1, -2) + search:SetJustifyH("left") - search:SetHook ("OnTextChanged", function() + search:SetHook("OnTextChanged", function() searching = search:GetText() if (searching == "") then searching = nil @@ -1663,13 +1663,13 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) end) local reset = DetailsFrameWork:NewButton (BossFrame, nil, "$parentResetSearchBoxtButton", "ResetSearchBox", 16, 16, function() - search:SetText ("") + search:SetText("") end) - reset:SetPoint ("left", search, "right", -1, 0) - reset:SetNormalTexture ([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GroupLoot-Pass-Down]]) - reset:SetHighlightTexture ([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GROUPLOOT-PASS-HIGHLIGHT]]) - reset:SetPushedTexture ([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GroupLoot-Pass-Up]]) + reset:SetPoint("left", search, "right", -1, 0) + reset:SetNormalTexture([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GroupLoot-Pass-Down]]) + reset:SetHighlightTexture([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GROUPLOOT-PASS-HIGHLIGHT]]) + reset:SetPushedTexture([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GroupLoot-Pass-Up]]) reset:GetNormalTexture():SetDesaturated (true) reset.tooltip = "Reset Search" @@ -1732,7 +1732,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) report_emote_button:SetIcon ([[Interface\AddOns\Details\images\report_button]], 8, 14, nil, {0, 1, 0, 1}, nil, 4, 2) report_emote_button:SetTemplate (DetailsFrameWork:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) - report_emote_button:SetPoint ("topleft", search, "bottomleft", 0, -4) + report_emote_button:SetPoint("topleft", search, "bottomleft", 0, -4) report_emote_button:Disable() tinsert (BossFrame.EmoteWidgets, report_emote_button) @@ -1743,17 +1743,17 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) widget:Hide() end - local emote_report_label = DetailsFrameWork:NewLabel (search.widget, search.widget, nil, "report_click", "|cFFffb400Left Click|r: Report Line") - emote_report_label:SetPoint ("topleft", search.widget, "bottomleft", 1, -61) + local emote_report_label = DetailsFrameWork:NewLabel(search.widget, search.widget, nil, "report_click", "|cFFffb400Left Click|r: Report Line") + emote_report_label:SetPoint("topleft", search.widget, "bottomleft", 1, -61) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> auras weakauras +--auras weakauras BossFrame.EnemySpellsWidgets = {} - --> spells and auras ~auras ~spell ~weakaura �ura + --spells and auras ~auras ~spell ~weakaura �ura local CONST_MAX_AURA_LINES = 21 @@ -1784,15 +1784,15 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) end GameTooltip:Show() - self:SetBackdropColor (1, 1, 1, .5) - self:SetBackdropBorderColor (0, 0, 0, 1) + self:SetBackdropColor(1, 1, 1, .5) + self:SetBackdropBorderColor(0, 0, 0, 1) return true end end local on_leave_spell = function(self, capsule) GameTooltip:Hide() - self:SetBackdropColor (.3, .3, .3, .5) + self:SetBackdropColor(.3, .3, .3, .5) end local create_aura_func = function(self, button, spellid, encounter_id) @@ -1806,7 +1806,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) local info = EncounterDetails.EnemySpellPool [spellid] if (info) then _detalhes:CooltipPreset (2) - GameCooltip:SetOption ("FixedWidth", false) + GameCooltip:SetOption("FixedWidth", false) for token, _ in pairs (info.token) do GameCooltip:AddLine ("event:", token, 1, nil, "white") @@ -1821,52 +1821,52 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) GameCooltip:ShowCooltip (self, "tooltip") end - self:SetBackdropColor (1, 1, 1, .5) + self:SetBackdropColor(1, 1, 1, .5) end local info_onleave = function(self) GameCooltip:Hide() - self:SetBackdropColor (.3, .3, .3, .5) + self:SetBackdropColor(.3, .3, .3, .5) end - local bossModsTitle = DetailsFrameWork:CreateLabel (BossFrame, "Boss Mods Time Bars:", 12, "orange") + local bossModsTitle = DetailsFrameWork:CreateLabel(BossFrame, "Boss Mods Time Bars:", 12, "orange") bossModsTitle:SetPoint(10, -85) tinsert (BossFrame.EnemySpellsWidgets, bossModsTitle) bossModsTitle:Hide() - local bossSpellsTitle = DetailsFrameWork:CreateLabel (BossFrame, "Boss Spells and Auras:", 12, "orange") + local bossSpellsTitle = DetailsFrameWork:CreateLabel(BossFrame, "Boss Spells and Auras:", 12, "orange") bossSpellsTitle:SetPoint(444, -85) tinsert (BossFrame.EnemySpellsWidgets, bossSpellsTitle) bossSpellsTitle:Hide() --create boss mods list for i = 1, CONST_MAX_AURA_LINES do - local anchor_frame = CreateFrame ("frame", "BossFrameBossModsAnchor" .. i, BossFrame, "BackdropTemplate") + local anchor_frame = CreateFrame("frame", "BossFrameBossModsAnchor" .. i, BossFrame, "BackdropTemplate") local spellicon = DetailsFrameWork:NewImage (anchor_frame, [[Interface\ICONS\TEMP]], 19, 19, "background", nil, "icon", "$parentIcon") --timerId local spellid = DetailsFrameWork:CreateTextEntry (anchor_frame, EncounterDetails.empty_function, 80, 20, nil, "$parentSpellId") spellid:SetTemplate (AurasButtonTemplate) - spellid:SetHook ("OnEditFocusGained", on_focus_gain) - spellid:SetHook ("OnEditFocusLost", on_focus_lost) - spellid:SetHook ("OnEnter", on_enter_spell) - spellid:SetHook ("OnLeave", on_leave_spell) + spellid:SetHook("OnEditFocusGained", on_focus_gain) + spellid:SetHook("OnEditFocusLost", on_focus_lost) + spellid:SetHook("OnEnter", on_enter_spell) + spellid:SetHook("OnLeave", on_leave_spell) --ability name local spellname = DetailsFrameWork:CreateTextEntry (anchor_frame, EncounterDetails.empty_function, 180, 20, nil, "$parentSpellName") spellname:SetTemplate (AurasButtonTemplate) - spellname:SetHook ("OnEditFocusGained", on_focus_gain) - spellname:SetHook ("OnEditFocusLost", on_focus_lost) - spellname:SetHook ("OnEnter", on_enter_spell) - spellname:SetHook ("OnLeave", on_leave_spell) + spellname:SetHook("OnEditFocusGained", on_focus_gain) + spellname:SetHook("OnEditFocusLost", on_focus_lost) + spellname:SetHook("OnEnter", on_enter_spell) + spellname:SetHook("OnLeave", on_leave_spell) local create_aura = DetailsFrameWork:NewButton (anchor_frame, nil, "$parentCreateAuraButton", "AuraButton", 90, 18, create_aura_func, nil, nil, nil, "Make Aura") create_aura:SetTemplate (AurasButtonTemplate) - spellicon:SetPoint ("topleft", BossFrame, "topleft", 10, -85 + (i * 21 * -1)) - spellid:SetPoint ("left", spellicon, "right", 4, 0) - spellname:SetPoint ("left", spellid, "right", 4, 0) - create_aura:SetPoint ("left", spellname, "right", 4, 0) + spellicon:SetPoint("topleft", BossFrame, "topleft", 10, -85 + (i * 21 * -1)) + spellid:SetPoint("left", spellicon, "right", 4, 0) + spellname:SetPoint("left", spellid, "right", 4, 0) + create_aura:SetPoint("left", spellname, "right", 4, 0) spellid:SetBackdropBorderColor(0, 0, 0) spellname:SetBackdropBorderColor(0, 0, 0) @@ -1885,44 +1885,44 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) --create buff list for i = 1, CONST_MAX_AURA_LINES do - local anchor_frame = CreateFrame ("frame", "BossFrameSpellAnchor" .. i, BossFrame, "BackdropTemplate") + local anchor_frame = CreateFrame("frame", "BossFrameSpellAnchor" .. i, BossFrame, "BackdropTemplate") local spellicon = DetailsFrameWork:NewImage (anchor_frame, [[Interface\ICONS\TEMP]], 19, 19, "background", nil, "icon", "$parentIcon") local spellid = DetailsFrameWork:CreateTextEntry (anchor_frame, EncounterDetails.empty_function, 80, 20) spellid:SetTemplate (AurasButtonTemplate) - spellid:SetHook ("OnEditFocusGained", on_focus_gain) - spellid:SetHook ("OnEditFocusLost", on_focus_lost) - spellid:SetHook ("OnEnter", on_enter_spell) - spellid:SetHook ("OnLeave", on_leave_spell) + spellid:SetHook("OnEditFocusGained", on_focus_gain) + spellid:SetHook("OnEditFocusLost", on_focus_lost) + spellid:SetHook("OnEnter", on_enter_spell) + spellid:SetHook("OnLeave", on_leave_spell) local spellname = DetailsFrameWork:CreateTextEntry (anchor_frame, EncounterDetails.empty_function, 160, 20) spellname:SetTemplate (AurasButtonTemplate) - spellname:SetHook ("OnEditFocusGained", on_focus_gain) - spellname:SetHook ("OnEditFocusLost", on_focus_lost) - spellname:SetHook ("OnEnter", on_enter_spell) - spellname:SetHook ("OnLeave", on_leave_spell) + spellname:SetHook("OnEditFocusGained", on_focus_gain) + spellname:SetHook("OnEditFocusLost", on_focus_lost) + spellname:SetHook("OnEnter", on_enter_spell) + spellname:SetHook("OnLeave", on_leave_spell) - --spellicon_button:SetPoint ("topleft", BossFrame, "topleft", 255, -65 + (i * 21 * -1)) - spellicon:SetPoint ("topleft", BossFrame, "topleft", 443, -85 + (i * 21 * -1)) - spellid:SetPoint ("left", spellicon, "right", 4, 0) - spellname:SetPoint ("left", spellid, "right", 4, 0) + --spellicon_button:SetPoint("topleft", BossFrame, "topleft", 255, -65 + (i * 21 * -1)) + spellicon:SetPoint("topleft", BossFrame, "topleft", 443, -85 + (i * 21 * -1)) + spellid:SetPoint("left", spellicon, "right", 4, 0) + spellname:SetPoint("left", spellid, "right", 4, 0) - local spellinfo = CreateFrame ("frame", nil, anchor_frame,"BackdropTemplate") - spellinfo:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - spellinfo:SetBackdropColor (.3, .3, .3, .5) - spellinfo:SetBackdropBorderColor (0, 0, 0, 1) - spellinfo:SetSize (80, 20) - spellinfo:SetScript ("OnEnter", info_onenter) - spellinfo:SetScript ("OnLeave", info_onleave) + local spellinfo = CreateFrame("frame", nil, anchor_frame,"BackdropTemplate") + spellinfo:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + spellinfo:SetBackdropColor(.3, .3, .3, .5) + spellinfo:SetBackdropBorderColor(0, 0, 0, 1) + spellinfo:SetSize(80, 20) + spellinfo:SetScript("OnEnter", info_onenter) + spellinfo:SetScript("OnLeave", info_onleave) local spellinfotext = spellinfo:CreateFontString (nil, "overlay", "GameFontNormal") - spellinfotext:SetPoint ("center", spellinfo, "center") - spellinfotext:SetText ("info") - spellinfo:SetPoint ("left", spellname.widget, "right", 4, 0) + spellinfotext:SetPoint("center", spellinfo, "center") + spellinfotext:SetText("info") + spellinfo:SetPoint("left", spellname.widget, "right", 4, 0) local create_aura = DetailsFrameWork:NewButton (anchor_frame, nil, "$parentCreateAuraButton", "AuraButton", 90, 18, create_aura_func, nil, nil, nil, "Make Aura") - create_aura:SetPoint ("left", spellinfo, "right", 4, 0) + create_aura:SetPoint("left", spellinfo, "right", 4, 0) create_aura:SetTemplate (AurasButtonTemplate) anchor_frame.icon = spellicon @@ -2079,11 +2079,11 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) local is_heal = data [4] if (is_heal) then - bar.spellid:SetBackdropBorderColor (0, 1, 0) - bar.spellname:SetBackdropBorderColor (0, 1, 0) + bar.spellid:SetBackdropBorderColor(0, 1, 0) + bar.spellname:SetBackdropBorderColor(0, 1, 0) else - bar.spellid:SetBackdropBorderColor (0, 0, 0) - bar.spellname:SetBackdropBorderColor (0, 0, 0) + bar.spellid:SetBackdropBorderColor(0, 0, 0) + bar.spellname:SetBackdropBorderColor(0, 0, 0) end bar.aurabutton:SetClickFunction (create_aura_func, data [1], encounter_id) @@ -2097,10 +2097,10 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) end - local spell_scrollframe = CreateFrame ("ScrollFrame", "EncounterDetails_SpellAurasScroll", BossFrame, "FauxScrollFrameTemplate, BackdropTemplate") - spell_scrollframe:SetScript ("OnVerticalScroll", function(self, offset) FauxScrollFrame_OnVerticalScroll (self, offset, 14, refresh_spellauras) end) - spell_scrollframe:SetPoint ("topleft", BossFrame, "topleft", 200, -75) - spell_scrollframe:SetPoint ("bottomright", BossFrame, "bottomright", -33, 42) + local spell_scrollframe = CreateFrame("ScrollFrame", "EncounterDetails_SpellAurasScroll", BossFrame, "FauxScrollFrameTemplate, BackdropTemplate") + spell_scrollframe:SetScript("OnVerticalScroll", function(self, offset) FauxScrollFrame_OnVerticalScroll (self, offset, 14, refresh_spellauras) end) + spell_scrollframe:SetPoint("topleft", BossFrame, "topleft", 200, -75) + spell_scrollframe:SetPoint("bottomright", BossFrame, "bottomright", -33, 42) spell_scrollframe.Update = refresh_spellauras spell_scrollframe:Hide() EncounterDetails.SpellScrollframe = spell_scrollframe @@ -2110,10 +2110,10 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) EncounterDetails.update_enemy_spells = update_enemy_spells - local bossmods_scrollframe = CreateFrame ("ScrollFrame", "EncounterDetails_BossModsScroll", BossFrame, "FauxScrollFrameTemplate, BackdropTemplate") - bossmods_scrollframe:SetScript ("OnVerticalScroll", function(self, offset) FauxScrollFrame_OnVerticalScroll(self, offset, 14, refresh_bossmods_timers) end) - bossmods_scrollframe:SetPoint ("topleft", BossFrame, "topleft", 10, -75) - bossmods_scrollframe:SetPoint ("bottomleft", BossFrame, "bottomleft", 250, 42) + local bossmods_scrollframe = CreateFrame("ScrollFrame", "EncounterDetails_BossModsScroll", BossFrame, "FauxScrollFrameTemplate, BackdropTemplate") + bossmods_scrollframe:SetScript("OnVerticalScroll", function(self, offset) FauxScrollFrame_OnVerticalScroll(self, offset, 14, refresh_bossmods_timers) end) + bossmods_scrollframe:SetPoint("topleft", BossFrame, "topleft", 10, -75) + bossmods_scrollframe:SetPoint("bottomleft", BossFrame, "bottomleft", 250, 42) bossmods_scrollframe.Update = refresh_bossmods_timers bossmods_scrollframe:Hide() EncounterDetails.BossModsScrollframe = bossmods_scrollframe @@ -2156,7 +2156,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -- ~phases -local PhaseFrame = CreateFrame ("frame", "EncounterDetailsPhaseFrame", BossFrame, "BackdropTemplate") +local PhaseFrame = CreateFrame("frame", "EncounterDetailsPhaseFrame", BossFrame, "BackdropTemplate") PhaseFrame:SetAllPoints() PhaseFrame:SetFrameLevel (BossFrame:GetFrameLevel()+1) PhaseFrame.DamageTable = {} @@ -2170,7 +2170,7 @@ local ScrollWidth, ScrollHeight, ScrollLineAmount, ScrollLineHeight = 250, 420, local PhasesY = -88 local AnchorY = -120 -PhaseFrame:SetScript ("OnShow", function() +PhaseFrame:SetScript("OnShow", function() PhaseFrame.OnSelectPhase (1) end) @@ -2217,7 +2217,7 @@ function PhaseFrame.OnSelectPhase (phaseSelected) PhaseFrame.LastPhaseSelected = phaseSelected local phases = PhaseFrame:GetPhaseTimers (PhaseFrame.CurrentSegment, true) - for buttonIndex, phase in ipairs (phases) do + for buttonIndex, phase in ipairs(phases) do local button = PhaseFrame.PhaseButtons [buttonIndex] if (phase == phaseSelected) then button:SetTemplate (PhaseButtonTemplateHighlight) @@ -2229,7 +2229,7 @@ function PhaseFrame.OnSelectPhase (phaseSelected) button:Disable() end end - button:SetText (phase) + button:SetText(phase) button:SetClickFunction (selectSegment, phase) end @@ -2258,10 +2258,10 @@ function PhaseFrame.OnSelectPhase (phaseSelected) PhaseFrame:UpdatePhaseBars() end -local PhaseSelectLabel = _detalhes.gump:CreateLabel (PhaseFrame, "Select Phase:", 12, "orange") -local DamageLabel = _detalhes.gump:CreateLabel (PhaseFrame, "Damage Done") -local HealLabel = _detalhes.gump:CreateLabel (PhaseFrame, "Healing Done") -local PhaseTimersLabel = _detalhes.gump:CreateLabel (PhaseFrame, "Time Spent on Each Phase") +local PhaseSelectLabel = _detalhes.gump:CreateLabel(PhaseFrame, "Select Phase:", 12, "orange") +local DamageLabel = _detalhes.gump:CreateLabel(PhaseFrame, "Damage Done") +local HealLabel = _detalhes.gump:CreateLabel(PhaseFrame, "Healing Done") +local PhaseTimersLabel = _detalhes.gump:CreateLabel(PhaseFrame, "Time Spent on Each Phase") local report_damage = function(IsCurrent, IsReverse, AmtLines) local result = {} @@ -2277,14 +2277,14 @@ local report_damage = function(IsCurrent, IsReverse, AmtLines) tinsert (result, "Details!: Damage for Phase " .. PhaseFrame.LastPhaseSelected .. " of " .. (PhaseFrame.CurrentSegment and PhaseFrame.CurrentSegment.is_boss and PhaseFrame.CurrentSegment.is_boss.name or "Unknown") .. ":") for i = 1, #PhaseFrame.DamageTable do - tinsert (result, EncounterDetails:GetOnlyName (PhaseFrame.DamageTable[i][1]) .. ": " .. _detalhes:ToK (_math_floor (PhaseFrame.DamageTable [i][2]))) + tinsert (result, EncounterDetails:GetOnlyName (PhaseFrame.DamageTable[i][1]) .. ": " .. _detalhes:ToK (_math_floor(PhaseFrame.DamageTable [i][2]))) end EncounterDetails:SendReportWindow (reportFunc, nil, nil, true) end local Report_DamageButton = _detalhes.gump:CreateButton (PhaseFrame, report_damage, 16, 16, "report") -Report_DamageButton:SetPoint ("left", DamageLabel, "left", ScrollWidth-44, 0) +Report_DamageButton:SetPoint("left", DamageLabel, "left", ScrollWidth-44, 0) Report_DamageButton.textcolor = "gray" Report_DamageButton.textsize = 9 @@ -2302,26 +2302,26 @@ local report_healing = function() tinsert (result, "Details!: Healing for Phase " .. PhaseFrame.LastPhaseSelected .. " of " .. (PhaseFrame.CurrentSegment and PhaseFrame.CurrentSegment.is_boss and PhaseFrame.CurrentSegment.is_boss.name or "Unknown") .. ":") for i = 1, #PhaseFrame.HealingTable do - tinsert (result, EncounterDetails:GetOnlyName (PhaseFrame.HealingTable[i][1]) .. ": " .. _detalhes:ToK (_math_floor (PhaseFrame.HealingTable [i][2]))) + tinsert (result, EncounterDetails:GetOnlyName (PhaseFrame.HealingTable[i][1]) .. ": " .. _detalhes:ToK (_math_floor(PhaseFrame.HealingTable [i][2]))) end EncounterDetails:SendReportWindow (reportFunc, nil, nil, true) end local Report_HealingButton = _detalhes.gump:CreateButton (PhaseFrame, report_healing, 16, 16, "report") -Report_HealingButton:SetPoint ("left", HealLabel, "left", ScrollWidth-44, 0) +Report_HealingButton:SetPoint("left", HealLabel, "left", ScrollWidth-44, 0) Report_HealingButton.textcolor = "gray" Report_HealingButton.textsize = 9 -PhaseSelectLabel:SetPoint ("topleft", PhaseFrame, "topleft", 10, PhasesY) +PhaseSelectLabel:SetPoint("topleft", PhaseFrame, "topleft", 10, PhasesY) -DamageLabel:SetPoint ("topleft", PhaseFrame, "topleft", 10, AnchorY) -HealLabel:SetPoint ("topleft", PhaseFrame, "topleft", ScrollWidth + 40, AnchorY) -PhaseTimersLabel:SetPoint ("topleft", PhaseFrame, "topleft", (ScrollWidth * 2) + (40*2), AnchorY) +DamageLabel:SetPoint("topleft", PhaseFrame, "topleft", 10, AnchorY) +HealLabel:SetPoint("topleft", PhaseFrame, "topleft", ScrollWidth + 40, AnchorY) +PhaseTimersLabel:SetPoint("topleft", PhaseFrame, "topleft", (ScrollWidth * 2) + (40*2), AnchorY) for i = 1, 10 do local button = _detalhes.gump:CreateButton (PhaseFrame, PhaseFrame.OnSelectPhase, 60, 20, "", i) - button:SetPoint ("left", PhaseSelectLabel, "right", 8 + ((i-1) * 61), 0) + button:SetPoint("left", PhaseSelectLabel, "right", 8 + ((i-1) * 61), 0) tinsert (PhaseFrame.PhaseButtons, button) end @@ -2338,11 +2338,11 @@ local ScrollRefresh = function(self, data, offset, total_lines) local line = self:GetLine (i) local texture, L, R, T, B = _detalhes:GetPlayerIcon (player[1], PhaseFrame.CurrentSegment) - line.icon:SetTexture (texture) + line.icon:SetTexture(texture) line.icon:SetTexCoord (L, R, T, B) - line.name:SetText (index .. ". " .. removeRealm (_, player[1])) - line.done:SetText (formatToK (_, player[2]) .. " (" .. format ("%.1f", player[2] / topValue * 100) .. "%)") - line.statusbar:SetValue (player[2] / topValue * 100) + line.name:SetText(index .. ". " .. removeRealm (_, player[1])) + line.done:SetText(formatToK (_, player[2]) .. " (" .. format ("%.1f", player[2] / topValue * 100) .. "%)") + line.statusbar:SetValue(player[2] / topValue * 100) local actorClass = Details:GetClass (player[1]) if (actorClass) then line.statusbar:SetColor (actorClass) @@ -2354,57 +2354,57 @@ local ScrollRefresh = function(self, data, offset, total_lines) end local line_onenter = function(self) - self:SetBackdropColor (unpack (BGColorDefault_Hover)) + self:SetBackdropColor(unpack (BGColorDefault_Hover)) end local line_onleave = function(self) - self:SetBackdropColor (unpack (BGColorDefault)) + self:SetBackdropColor(unpack (BGColorDefault)) end local ScrollCreateLine = function(self, index) - local line = CreateFrame ("button", "$parentLine" .. index, self,"BackdropTemplate") - line:SetPoint ("topleft", self, "topleft", 0, -((index-1)*(ScrollLineHeight+1))) - line:SetSize (ScrollWidth, ScrollLineHeight) - line:SetScript ("OnEnter", line_onenter) - line:SetScript ("OnLeave", line_onleave) - line:SetScript ("OnClick", line_onclick) + local line = CreateFrame("button", "$parentLine" .. index, self,"BackdropTemplate") + line:SetPoint("topleft", self, "topleft", 0, -((index-1)*(ScrollLineHeight+1))) + line:SetSize(ScrollWidth, ScrollLineHeight) + line:SetScript("OnEnter", line_onenter) + line:SetScript("OnLeave", line_onleave) + line:SetScript("OnClick", line_onclick) - line:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - line:SetBackdropColor (unpack (BGColorDefault)) + line:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + line:SetBackdropColor(unpack (BGColorDefault)) local statusBar = DetailsFrameWork:CreateBar (line, EncounterDetails.Frame.DefaultBarTexture, 1, 1, 100) - statusBar:SetAllPoints (line) + statusBar:SetAllPoints(line) statusBar.backgroundtexture = EncounterDetails.Frame.DefaultBarTexture statusBar.backgroundcolor = {.3, .3, .3, .3} - local icon = statusBar:CreateTexture ("$parentIcon", "overlay") - icon:SetSize (ScrollLineHeight, ScrollLineHeight) + local icon = statusBar:CreateTexture("$parentIcon", "overlay") + icon:SetSize(ScrollLineHeight, ScrollLineHeight) local name = statusBar:CreateFontString ("$parentName", "overlay", "GameFontNormal") _detalhes.gump:SetFontSize (name, 10) - icon:SetPoint ("left", line, "left", 2, 0) - name:SetPoint ("left", icon, "right", 2, 0) - _detalhes.gump:SetFontColor (name, "white") + icon:SetPoint("left", line, "left", 2, 0) + name:SetPoint("left", icon, "right", 2, 0) + _detalhes.gump:SetFontColor(name, "white") local done = statusBar:CreateFontString ("$parentDone", "overlay", "GameFontNormal") _detalhes.gump:SetFontSize (done, 10) - _detalhes.gump:SetFontColor (done, "white") - done:SetPoint ("right", line, "right", -2, 0) + _detalhes.gump:SetFontColor(done, "white") + done:SetPoint("right", line, "right", -2, 0) line.icon = icon line.name = name line.done = done line.statusbar = statusBar - name:SetHeight (10) - name:SetJustifyH ("left") + name:SetHeight(10) + name:SetJustifyH("left") return line end local Damage_Scroll = _detalhes.gump:CreateScrollBox (PhaseFrame, "$parentDamageScroll", ScrollRefresh, PhaseFrame.DamageTable, ScrollWidth, ScrollHeight, ScrollLineAmount, ScrollLineHeight) local Heal_Scroll = _detalhes.gump:CreateScrollBox (PhaseFrame, "$parentHealScroll", ScrollRefresh, PhaseFrame.HealingTable, ScrollWidth, ScrollHeight, ScrollLineAmount, ScrollLineHeight) -Damage_Scroll:SetPoint ("topleft", DamageLabel.widget, "bottomleft", 0, -4) -Heal_Scroll:SetPoint ("topleft", HealLabel.widget, "bottomleft", 0, -4) +Damage_Scroll:SetPoint("topleft", DamageLabel.widget, "bottomleft", 0, -4) +Heal_Scroll:SetPoint("topleft", HealLabel.widget, "bottomleft", 0, -4) _detalhes.gump:ReskinSlider(Damage_Scroll, 4) _detalhes.gump:ReskinSlider(Heal_Scroll, 4) @@ -2413,15 +2413,15 @@ for i = 1, ScrollLineAmount do Damage_Scroll:CreateLine (ScrollCreateLine) end PhaseFrame.Damage_Scroll = Damage_Scroll -Damage_Scroll:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16}) -Damage_Scroll:SetBackdropColor (0, 0, 0, .4) +Damage_Scroll:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16}) +Damage_Scroll:SetBackdropColor(0, 0, 0, .4) for i = 1, ScrollLineAmount do Heal_Scroll:CreateLine (ScrollCreateLine) end PhaseFrame.Heal_Scroll = Heal_Scroll -Heal_Scroll:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16}) -Heal_Scroll:SetBackdropColor (0, 0, 0, .4) +Heal_Scroll:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16}) +Heal_Scroll:SetBackdropColor(0, 0, 0, .4) ---------------------------------------------------------- @@ -2431,11 +2431,11 @@ PhaseFrame.PhasesSegmentCompare = {} local PhaseBarOnEnter = function(self) PhaseFrame:UpdateSegmentCompareBars (self.phase) - self:SetBackdropColor (unpack (BGColorDefault_Hover)) + self:SetBackdropColor(unpack (BGColorDefault_Hover)) end local PhaseBarOnLeave = function(self) PhaseFrame:ClearSegmentCompareBars() - self:SetBackdropColor (unpack (BGColorDefault)) + self:SetBackdropColor(unpack (BGColorDefault)) end local PhaseBarOnClick = function(self) --report @@ -2443,33 +2443,33 @@ end --cria as linhas mostrando o tempo decorride de cada phase for i = 1, 10 do - local line = CreateFrame ("button", "$parentPhaseBar" .. i, PhaseFrame,"BackdropTemplate") - line:SetPoint ("topleft", PhaseTimersLabel.widget, "bottomleft", 0, -((i-1)*(31)) - 4) - line:SetSize (175, 30) - line:SetScript ("OnEnter", PhaseBarOnEnter) - line:SetScript ("OnLeave", PhaseBarOnLeave) - line:SetScript ("OnClick", PhaseBarOnClick) + local line = CreateFrame("button", "$parentPhaseBar" .. i, PhaseFrame,"BackdropTemplate") + line:SetPoint("topleft", PhaseTimersLabel.widget, "bottomleft", 0, -((i-1)*(31)) - 4) + line:SetSize(175, 30) + line:SetScript("OnEnter", PhaseBarOnEnter) + line:SetScript("OnLeave", PhaseBarOnLeave) + line:SetScript("OnClick", PhaseBarOnClick) - line:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - line:SetBackdropColor (unpack (BGColorDefault)) + line:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + line:SetBackdropColor(unpack (BGColorDefault)) - local icon = line:CreateTexture ("$parentIcon", "overlay") - icon:SetSize (16, 16) - icon:SetTexture ([[Interface\AddOns\Details\images\clock]]) + local icon = line:CreateTexture("$parentIcon", "overlay") + icon:SetSize(16, 16) + icon:SetTexture([[Interface\AddOns\Details\images\clock]]) local name = line:CreateFontString ("$parentName", "overlay", "GameFontNormal") _detalhes.gump:SetFontSize (name, 10) local done = line:CreateFontString ("$parentDone", "overlay", "GameFontNormal") _detalhes.gump:SetFontSize (done, 10) - icon:SetPoint ("left", line, "left", 2, 0) - name:SetPoint ("left", icon, "right", 2, 0) - done:SetPoint ("right", line, "right", -3, 0) + icon:SetPoint("left", line, "left", 2, 0) + name:SetPoint("left", icon, "right", 2, 0) + done:SetPoint("right", line, "right", -3, 0) line.icon = icon line.name = name line.done = done - name:SetHeight (10) - name:SetJustifyH ("left") + name:SetHeight(10) + name:SetJustifyH("left") tinsert (PhaseFrame.PhasesBars, line) end @@ -2477,25 +2477,25 @@ end --cria a linha do segmento para a compara��o, � o que fica na parte direita da tela --ele � acessado para mostrar quando passar o mouse sobre uma das barras de phase for i = 1, 20 do - local line = CreateFrame ("button", "$parentSegmentCompareBar" .. i, PhaseFrame,"BackdropTemplate") - line:SetPoint ("topleft", PhaseTimersLabel.widget, "bottomleft", 175+10, -((i-1)*(ScrollLineHeight+1)) - 4) - line:SetSize (150, ScrollLineHeight) + local line = CreateFrame("button", "$parentSegmentCompareBar" .. i, PhaseFrame,"BackdropTemplate") + line:SetPoint("topleft", PhaseTimersLabel.widget, "bottomleft", 175+10, -((i-1)*(ScrollLineHeight+1)) - 4) + line:SetSize(150, ScrollLineHeight) - line:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - line:SetBackdropColor (unpack (BGColorDefault)) + line:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + line:SetBackdropColor(unpack (BGColorDefault)) line:Hide() local name = line:CreateFontString ("$parentName", "overlay", "GameFontNormal") _detalhes.gump:SetFontSize (name, 9) - name:SetPoint ("left", line, "left", 2, 0) + name:SetPoint("left", line, "left", 2, 0) local done = line:CreateFontString ("$parentDone", "overlay", "GameFontNormal") _detalhes.gump:SetFontSize (done, 9) - done:SetPoint ("right", line, "right", -2, 0) + done:SetPoint("right", line, "right", -2, 0) line.name = name line.done = done - name:SetHeight (10) - name:SetJustifyH ("left") + name:SetHeight(10) + name:SetJustifyH("left") tinsert (PhaseFrame.PhasesSegmentCompare, line) end @@ -2503,8 +2503,8 @@ end function PhaseFrame:ClearPhaseBars() for i = 1, #PhaseFrame.PhasesBars do local bar = PhaseFrame.PhasesBars[i] - bar.name:SetText ("") - bar.done:SetText ("") + bar.name:SetText("") + bar.done:SetText("") bar.phase = nil bar:Hide() end @@ -2543,10 +2543,10 @@ end function PhaseFrame:UpdatePhaseBars() local timers, hash = PhaseFrame:GetPhaseTimers (PhaseFrame.CurrentSegment, true) local i = 1 - for index, phase in ipairs (timers) do + for index, phase in ipairs(timers) do local timer = hash [phase] - PhaseFrame.PhasesBars [i].name:SetText ("|cFFC0C0C0Phase:|r |cFFFFFFFF" .. phase) - PhaseFrame.PhasesBars [i].done:SetText (_detalhes.gump:IntegerToTimer (timer)) + PhaseFrame.PhasesBars [i].name:SetText("|cFFC0C0C0Phase:|r |cFFFFFFFF" .. phase) + PhaseFrame.PhasesBars [i].done:SetText(_detalhes.gump:IntegerToTimer (timer)) PhaseFrame.PhasesBars [i].phase = phase PhaseFrame.PhasesBars [i]:Show() i = i + 1 @@ -2561,7 +2561,7 @@ function PhaseFrame:UpdateSegmentCompareBars (phase) local bossID = segmentTable:GetBossInfo() and segmentTable:GetBossInfo().id local index = 1 - for i, segment in ipairs (_detalhes:GetCombatSegments()) do + for i, segment in ipairs(_detalhes:GetCombatSegments()) do if (segment:GetBossInfo() and segment:GetBossInfo().id == bossID) then local bar = PhaseFrame.PhasesSegmentCompare [index] @@ -2569,20 +2569,20 @@ function PhaseFrame:UpdateSegmentCompareBars (phase) if (timers [phase]) then if (segment ~= segmentTable) then - bar.name:SetText ("Segment " .. i .. ":") - _detalhes.gump:SetFontColor (bar.name, "orange") - bar.done:SetText (_detalhes.gump:IntegerToTimer (timers [phase])) - _detalhes.gump:SetFontColor (bar.done, "orange") + bar.name:SetText("Segment " .. i .. ":") + _detalhes.gump:SetFontColor(bar.name, "orange") + bar.done:SetText(_detalhes.gump:IntegerToTimer (timers [phase])) + _detalhes.gump:SetFontColor(bar.done, "orange") else - bar.name:SetText ("Segment " .. i .. ":") - _detalhes.gump:SetFontColor (bar.name, "white") - bar.done:SetText (_detalhes.gump:IntegerToTimer (timers [phase])) - _detalhes.gump:SetFontColor (bar.done, "white") + bar.name:SetText("Segment " .. i .. ":") + _detalhes.gump:SetFontColor(bar.name, "white") + bar.done:SetText(_detalhes.gump:IntegerToTimer (timers [phase])) + _detalhes.gump:SetFontColor(bar.done, "white") end else - bar.name:SetText ("Segment " .. i .. ":") - _detalhes.gump:SetFontColor (bar.name, "red") - bar.done:SetText ("--x--x--") + bar.name:SetText("Segment " .. i .. ":") + _detalhes.gump:SetFontColor(bar.name, "red") + bar.done:SetText("--x--x--") end bar:Show() @@ -2611,13 +2611,13 @@ end local backdrop = {edgeFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, edgeSize = 1, insets = {left = 1, right = 1, top = 0, bottom = 1}} - --> Selecionar o segmento + --Selecionar o segmento local buildSegmentosMenu = function(self) local historico = _detalhes.tabela_historico.tabelas local return_table = {} - for index, combate in ipairs (historico) do + for index, combate in ipairs(historico) do if (combate.is_boss and combate.is_boss.index) then local l, r, t, b, icon = _detalhes:GetBossIcon (combate.is_boss.mapid, combate.is_boss.index) return_table [#return_table+1] = {value = index, label = "#" .. index .. " " .. combate.is_boss.name, icon = icon, texcoord = {l, r, t, b}, onclick = EncounterDetails.OpenAndRefresh} @@ -2627,37 +2627,37 @@ end return return_table end - local segmentos_string = DetailsFrameWork:NewLabel (frame, nil, nil, "segmentosString", "Segment:", "GameFontNormal", 12) - segmentos_string:SetPoint ("bottomleft", frame, "bottomleft", 20, 16) + local segmentos_string = DetailsFrameWork:NewLabel(frame, nil, nil, "segmentosString", "Segment:", "GameFontNormal", 12) + segmentos_string:SetPoint("bottomleft", frame, "bottomleft", 20, 16) -- ~dropdown local segmentos = DetailsFrameWork:NewDropDown (frame, _, "$parentSegmentsDropdown", "segmentosDropdown", 160, 20, buildSegmentosMenu, nil) - segmentos:SetPoint ("left", segmentos_string, "right", 2, 0) + segmentos:SetPoint("left", segmentos_string, "right", 2, 0) segmentos:SetTemplate (DetailsFrameWork:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) - --> options button + --options button local options = DetailsFrameWork:NewButton (frame, nil, "$parentOptionsButton", "OptionsButton", 120, 20, EncounterDetails.OpenOptionsPanel, nil, nil, nil, "Options") - options:SetPoint ("left", segmentos, "right", 10, 0) + options:SetPoint("left", segmentos, "right", 10, 0) options:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) options:SetIcon ([[Interface\Buttons\UI-OptionsButton]], 14, 14, nil, {0, 1, 0, 1}, nil, 3) - --> macro box + --macro box BossFrame.MacroEditBox = DetailsFrameWork:CreateTextEntry (frame, function()end, 300, 20) - BossFrame.MacroEditBox:SetPoint ("left", options, "right", 10, 0) + BossFrame.MacroEditBox:SetPoint("left", options, "right", 10, 0) BossFrame.MacroEditBox:SetAlpha (0.5) - BossFrame.MacroEditBox:SetText ("/run Details:OpenPlugin ('Encounter Breakdown')") + BossFrame.MacroEditBox:SetText("/run Details:OpenPlugin ('Encounter Breakdown')") BossFrame.MacroEditBox:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) - BossFrame.MacroEditBox:SetSize (360, 20) + BossFrame.MacroEditBox:SetSize(360, 20) BossFrame.MacroEditBox:HookScript ("OnEditFocusGained", function() C_Timer.After (0, function() BossFrame.MacroEditBox:HighlightText() end) end) - BossFrame.MacroEditBox.BackgroundLabel = DetailsFrameWork:CreateLabel (BossFrame.MacroEditBox, "macro") - BossFrame.MacroEditBox.BackgroundLabel:SetPoint ("left", BossFrame.MacroEditBox, "left", 6, 0) + BossFrame.MacroEditBox.BackgroundLabel = DetailsFrameWork:CreateLabel(BossFrame.MacroEditBox, "macro") + BossFrame.MacroEditBox.BackgroundLabel:SetPoint("left", BossFrame.MacroEditBox, "left", 6, 0) BossFrame.MacroEditBox.BackgroundLabel:SetTextColor (.3, .3, .3, .98) - --> Caixa do Dano total tomado pela Raid + --Caixa do Dano total tomado pela Raid -- ~containers ~damagetaken @@ -2670,45 +2670,45 @@ end local BOX_HEIGHT_UPPER = CONST_BOX_HEIGHT --175 - local container_damagetaken_window = CreateFrame ("ScrollFrame", "Details_Boss_ContainerDamageTaken", frame,"BackdropTemplate") + local container_damagetaken_window = CreateFrame("ScrollFrame", "Details_Boss_ContainerDamageTaken", frame,"BackdropTemplate") set_backdrop (container_damagetaken_window) - local container_damagetaken_frame = CreateFrame ("Frame", "Details_Boss_FrameDamageTaken", container_damagetaken_window,"BackdropTemplate") + local container_damagetaken_frame = CreateFrame("Frame", "Details_Boss_FrameDamageTaken", container_damagetaken_window,"BackdropTemplate") frame.Widgets [#frame.Widgets+1] = container_damagetaken_window - container_damagetaken_frame:SetScript ("OnMouseDown", mouse_down) - container_damagetaken_frame:SetScript ("OnMouseUp", mouse_up) + container_damagetaken_frame:SetScript("OnMouseDown", mouse_down) + container_damagetaken_frame:SetScript("OnMouseUp", mouse_up) container_damagetaken_frame.barras = {} --label titulo & background - local dano_recebido_bg = CreateFrame ("Frame", nil, frame, "BackdropTemplate") - dano_recebido_bg:SetWidth (BOX_WIDTH) - dano_recebido_bg:SetHeight (16) + local dano_recebido_bg = CreateFrame("Frame", nil, frame, "BackdropTemplate") + dano_recebido_bg:SetWidth(BOX_WIDTH) + dano_recebido_bg:SetHeight(16) dano_recebido_bg:EnableMouse (true) - dano_recebido_bg:SetResizable (false) - dano_recebido_bg:SetPoint ("topleft", frame, "topleft", 10, -78) + dano_recebido_bg:SetResizable(false) + dano_recebido_bg:SetPoint("topleft", frame, "topleft", 10, -78) frame.Widgets [#frame.Widgets+1] = dano_recebido_bg - DetailsFrameWork:NewLabel (dano_recebido_bg, dano_recebido_bg, nil, "damagetaken_title", "Damage Taken per Player", "GameFontHighlight") --localize-me - dano_recebido_bg.damagetaken_title:SetPoint ("BOTTOMLEFT", container_damagetaken_window, "TOPLEFT", 5, 1) + DetailsFrameWork:NewLabel(dano_recebido_bg, dano_recebido_bg, nil, "damagetaken_title", "Damage Taken per Player", "GameFontHighlight") --localize-me + dano_recebido_bg.damagetaken_title:SetPoint("BOTTOMLEFT", container_damagetaken_window, "TOPLEFT", 5, 1) - container_damagetaken_frame:SetBackdrop (backdrop) - container_damagetaken_frame:SetBackdropBorderColor (0,0,0,0) - container_damagetaken_frame:SetBackdropColor (0, 0, 0, 0.6) + container_damagetaken_frame:SetBackdrop(backdrop) + container_damagetaken_frame:SetBackdropBorderColor(0,0,0,0) + container_damagetaken_frame:SetBackdropColor(0, 0, 0, 0.6) - container_damagetaken_frame:SetAllPoints (container_damagetaken_window) - container_damagetaken_frame:SetWidth (BOX_WIDTH) - container_damagetaken_frame:SetHeight (BOX_HEIGHT) + container_damagetaken_frame:SetAllPoints(container_damagetaken_window) + container_damagetaken_frame:SetWidth(BOX_WIDTH) + container_damagetaken_frame:SetHeight(BOX_HEIGHT) container_damagetaken_frame:EnableMouse (true) - container_damagetaken_frame:SetResizable (false) + container_damagetaken_frame:SetResizable(false) container_damagetaken_frame:SetMovable (true) - container_damagetaken_window:SetWidth (BOX_WIDTH) - container_damagetaken_window:SetHeight (BOX_HEIGHT) + container_damagetaken_window:SetWidth(BOX_WIDTH) + container_damagetaken_window:SetHeight(BOX_HEIGHT) container_damagetaken_window:SetScrollChild (container_damagetaken_frame) - container_damagetaken_window:SetPoint ("TOPLEFT", frame, "TOPLEFT", 10, -92) + container_damagetaken_window:SetPoint("TOPLEFT", frame, "TOPLEFT", 10, -92) DetailsFrameWork:NewScrollBar (container_damagetaken_window, container_damagetaken_frame, 4, -16) container_damagetaken_window.slider:Altura (BOX_HEIGHT - 31) @@ -2722,46 +2722,46 @@ end container_damagetaken_window.ultimo = 0 frame.overall_damagetaken = container_damagetaken_window - --> Caixa das Habilidades do boss + --Caixa das Habilidades do boss --~ability ~damage taken by spell - local container_habilidades_window = CreateFrame ("ScrollFrame", "Details_Boss_ContainerHabilidades", frame,"BackdropTemplate") + local container_habilidades_window = CreateFrame("ScrollFrame", "Details_Boss_ContainerHabilidades", frame,"BackdropTemplate") set_backdrop (container_habilidades_window) - local container_habilidades_frame = CreateFrame ("Frame", "Details_Boss_FrameHabilidades", container_habilidades_window,"BackdropTemplate") - container_habilidades_frame:SetScript ("OnMouseDown", mouse_down) - container_habilidades_frame:SetScript ("OnMouseUp", mouse_up) + local container_habilidades_frame = CreateFrame("Frame", "Details_Boss_FrameHabilidades", container_habilidades_window,"BackdropTemplate") + container_habilidades_frame:SetScript("OnMouseDown", mouse_down) + container_habilidades_frame:SetScript("OnMouseUp", mouse_up) container_habilidades_frame.barras = {} --label titulo % background - local habilidades_inimigas_bg = CreateFrame ("Frame", nil, frame, "BackdropTemplate") - habilidades_inimigas_bg:SetWidth (BOX_WIDTH) - habilidades_inimigas_bg:SetHeight (16) + local habilidades_inimigas_bg = CreateFrame("Frame", nil, frame, "BackdropTemplate") + habilidades_inimigas_bg:SetWidth(BOX_WIDTH) + habilidades_inimigas_bg:SetHeight(16) habilidades_inimigas_bg:EnableMouse (true) - habilidades_inimigas_bg:SetResizable (false) - habilidades_inimigas_bg:SetPoint ("topleft", frame, "topleft", 10, -276) + habilidades_inimigas_bg:SetResizable(false) + habilidades_inimigas_bg:SetPoint("topleft", frame, "topleft", 10, -276) frame.Widgets [#frame.Widgets+1] = habilidades_inimigas_bg frame.Widgets [#frame.Widgets+1] = container_habilidades_window frame.Widgets [#frame.Widgets+1] = container_habilidades_frame - DetailsFrameWork:NewLabel (habilidades_inimigas_bg, habilidades_inimigas_bg, nil, "habilidades_title", "Damage Taken by Spell", "GameFontHighlight") --localize-me - habilidades_inimigas_bg.habilidades_title:SetPoint ("BOTTOMLEFT", container_habilidades_window, "TOPLEFT", 5, 1) + DetailsFrameWork:NewLabel(habilidades_inimigas_bg, habilidades_inimigas_bg, nil, "habilidades_title", "Damage Taken by Spell", "GameFontHighlight") --localize-me + habilidades_inimigas_bg.habilidades_title:SetPoint("BOTTOMLEFT", container_habilidades_window, "TOPLEFT", 5, 1) - container_habilidades_frame:SetBackdrop (backdrop) - container_habilidades_frame:SetBackdropBorderColor (0,0,0,0) - container_habilidades_frame:SetBackdropColor (0, 0, 0, 0.6) + container_habilidades_frame:SetBackdrop(backdrop) + container_habilidades_frame:SetBackdropBorderColor(0,0,0,0) + container_habilidades_frame:SetBackdropColor(0, 0, 0, 0.6) - container_habilidades_frame:SetAllPoints (container_habilidades_window) - container_habilidades_frame:SetWidth (BOX_WIDTH) - container_habilidades_frame:SetHeight (BOX_HEIGHT) + container_habilidades_frame:SetAllPoints(container_habilidades_window) + container_habilidades_frame:SetWidth(BOX_WIDTH) + container_habilidades_frame:SetHeight(BOX_HEIGHT) container_habilidades_frame:EnableMouse (true) - container_habilidades_frame:SetResizable (false) + container_habilidades_frame:SetResizable(false) container_habilidades_frame:SetMovable (true) - container_habilidades_window:SetWidth (BOX_WIDTH) - container_habilidades_window:SetHeight (BOX_HEIGHT) + container_habilidades_window:SetWidth(BOX_WIDTH) + container_habilidades_window:SetHeight(BOX_HEIGHT) container_habilidades_window:SetScrollChild (container_habilidades_frame) - container_habilidades_window:SetPoint ("TOPLEFT", container_damagetaken_window, "bottomleft", 0, CONST_BOX_VERTICAL_SPACING) --LOCATION + container_habilidades_window:SetPoint("TOPLEFT", container_damagetaken_window, "bottomleft", 0, CONST_BOX_VERTICAL_SPACING) --LOCATION DetailsFrameWork:NewScrollBar (container_habilidades_window, container_habilidades_frame, 4, -16) container_habilidades_window.slider:Altura (BOX_HEIGHT-31) @@ -2776,38 +2776,38 @@ end frame.overall_habilidades = container_habilidades_window - --> Caixa dos Adds + --Caixa dos Adds -- ~adds �dds local BOX_WIDTH = 270 local BOX_HEIGHT = CONST_BOX_HEIGHT --173 - local container_adds_window = CreateFrame ("ScrollFrame", "Details_Boss_ContainerAdds", frame,"BackdropTemplate") + local container_adds_window = CreateFrame("ScrollFrame", "Details_Boss_ContainerAdds", frame,"BackdropTemplate") set_backdrop (container_adds_window) - local container_adds_frame = CreateFrame ("Frame", "Details_Boss_FrameAdds", container_adds_window, "BackdropTemplate") + local container_adds_frame = CreateFrame("Frame", "Details_Boss_FrameAdds", container_adds_window, "BackdropTemplate") frame.Widgets [#frame.Widgets+1] = container_adds_frame frame.Widgets [#frame.Widgets+1] = container_adds_window container_adds_frame.barras = {} - local adds_total_string = DetailsFrameWork:CreateLabel (container_adds_window, "damage taken") + local adds_total_string = DetailsFrameWork:CreateLabel(container_adds_window, "damage taken") adds_total_string.textcolor = "gray" adds_total_string.textsize = 9 - adds_total_string:SetPoint ("bottomright", container_adds_window, "topright", 0, 3) + adds_total_string:SetPoint("bottomright", container_adds_window, "topright", 0, 3) - container_adds_frame:SetAllPoints (container_adds_window) - container_adds_frame:SetWidth (BOX_WIDTH) - container_adds_frame:SetHeight (BOX_HEIGHT) + container_adds_frame:SetAllPoints(container_adds_window) + container_adds_frame:SetWidth(BOX_WIDTH) + container_adds_frame:SetHeight(BOX_HEIGHT) container_adds_frame:EnableMouse (true) - container_adds_frame:SetResizable (false) + container_adds_frame:SetResizable(false) container_adds_frame:SetMovable (true) - container_adds_window:SetWidth (BOX_WIDTH) - container_adds_window:SetHeight (BOX_HEIGHT_UPPER) + container_adds_window:SetWidth(BOX_WIDTH) + container_adds_window:SetHeight(BOX_HEIGHT_UPPER) container_adds_window:SetScrollChild (container_adds_frame) - container_adds_window:SetPoint ("TOPLEFT", container_damagetaken_window, "topright", CONST_BOX_HORIZONTAL_SPACING, 0) + container_adds_window:SetPoint("TOPLEFT", container_damagetaken_window, "topright", CONST_BOX_HORIZONTAL_SPACING, 0) - DetailsFrameWork:NewLabel (container_adds_window, container_adds_window, nil, "titulo", "Enemy Damage Taken", "GameFontHighlight") - container_adds_window.titulo:SetPoint ("bottomleft", container_adds_window, "topleft", 0, 1) + DetailsFrameWork:NewLabel(container_adds_window, container_adds_window, nil, "titulo", "Enemy Damage Taken", "GameFontHighlight") + container_adds_window.titulo:SetPoint("bottomleft", container_adds_window, "topleft", 0, 1) DetailsFrameWork:NewScrollBar (container_adds_window, container_adds_frame, 4, -16) container_adds_window.slider:Altura (BOX_HEIGHT - 31) @@ -2821,38 +2821,38 @@ end container_adds_window.ultimo = 0 frame.overall_adds = container_adds_window - --> Caixa dos interrupts (kicks) + --Caixa dos interrupts (kicks) -- ~interrupt - local container_interrupt_window = CreateFrame ("ScrollFrame", "Details_Boss_Containerinterrupt", frame,"BackdropTemplate") + local container_interrupt_window = CreateFrame("ScrollFrame", "Details_Boss_Containerinterrupt", frame,"BackdropTemplate") set_backdrop (container_interrupt_window) - local container_interrupt_frame = CreateFrame ("Frame", "Details_Boss_Frameinterrupt", container_interrupt_window, "BackdropTemplate") + local container_interrupt_frame = CreateFrame("Frame", "Details_Boss_Frameinterrupt", container_interrupt_window, "BackdropTemplate") - local interrupt_total_string = DetailsFrameWork:CreateLabel (container_interrupt_window, "interrupts / casts") + local interrupt_total_string = DetailsFrameWork:CreateLabel(container_interrupt_window, "interrupts / casts") interrupt_total_string.textcolor = "gray" interrupt_total_string.textsize = 9 - interrupt_total_string:SetPoint ("bottomright", container_interrupt_window, "topright", 0, 3) + interrupt_total_string:SetPoint("bottomright", container_interrupt_window, "topright", 0, 3) frame.Widgets [#frame.Widgets+1] = container_interrupt_window frame.Widgets [#frame.Widgets+1] = container_interrupt_frame - container_interrupt_frame:SetScript ("OnMouseDown", mouse_down) - container_interrupt_frame:SetScript ("OnMouseUp", mouse_up) + container_interrupt_frame:SetScript("OnMouseDown", mouse_down) + container_interrupt_frame:SetScript("OnMouseUp", mouse_up) container_interrupt_frame.barras = {} - container_interrupt_frame:SetAllPoints (container_interrupt_window) - container_interrupt_frame:SetWidth (BOX_WIDTH) - container_interrupt_frame:SetHeight (BOX_HEIGHT) + container_interrupt_frame:SetAllPoints(container_interrupt_window) + container_interrupt_frame:SetWidth(BOX_WIDTH) + container_interrupt_frame:SetHeight(BOX_HEIGHT) container_interrupt_frame:EnableMouse (true) - container_interrupt_frame:SetResizable (false) + container_interrupt_frame:SetResizable(false) container_interrupt_frame:SetMovable (true) - container_interrupt_window:SetWidth (BOX_WIDTH) - container_interrupt_window:SetHeight (BOX_HEIGHT_UPPER) + container_interrupt_window:SetWidth(BOX_WIDTH) + container_interrupt_window:SetHeight(BOX_HEIGHT_UPPER) container_interrupt_window:SetScrollChild (container_interrupt_frame) - container_interrupt_window:SetPoint ("TOPLEFT", container_adds_window, "TOPRIGHT", CONST_BOX_HORIZONTAL_SPACING, 0) + container_interrupt_window:SetPoint("TOPLEFT", container_adds_window, "TOPRIGHT", CONST_BOX_HORIZONTAL_SPACING, 0) - DetailsFrameWork:NewLabel (container_interrupt_window, container_interrupt_window, nil, "titulo", Loc ["STRING_INTERRUPTS"], "GameFontHighlight") - container_interrupt_window.titulo:SetPoint ("bottomleft", container_interrupt_window, "topleft", 0, 1) + DetailsFrameWork:NewLabel(container_interrupt_window, container_interrupt_window, nil, "titulo", Loc ["STRING_INTERRUPTS"], "GameFontHighlight") + container_interrupt_window.titulo:SetPoint("bottomleft", container_interrupt_window, "topleft", 0, 1) DetailsFrameWork:NewScrollBar (container_interrupt_window, container_interrupt_frame, 4, -16) container_interrupt_window.slider:Altura (BOX_HEIGHT-31) @@ -2867,38 +2867,38 @@ end container_interrupt_window.ultimo = 0 frame.overall_interrupt = container_interrupt_window - --> Caixa dos Dispells + --Caixa dos Dispells -- ~dispel - local container_dispell_window = CreateFrame ("ScrollFrame", "Details_Boss_Containerdispell", frame,"BackdropTemplate") + local container_dispell_window = CreateFrame("ScrollFrame", "Details_Boss_Containerdispell", frame,"BackdropTemplate") set_backdrop (container_dispell_window) - local container_dispell_frame = CreateFrame ("Frame", "Details_Boss_Framedispell", container_dispell_window, "BackdropTemplate") + local container_dispell_frame = CreateFrame("Frame", "Details_Boss_Framedispell", container_dispell_window, "BackdropTemplate") - local dispell_total_string = DetailsFrameWork:CreateLabel (container_dispell_window, "total dispels") + local dispell_total_string = DetailsFrameWork:CreateLabel(container_dispell_window, "total dispels") dispell_total_string.textcolor = "gray" dispell_total_string.textsize = 9 - dispell_total_string:SetPoint ("bottomright", container_dispell_window, "topright", 0, 3) + dispell_total_string:SetPoint("bottomright", container_dispell_window, "topright", 0, 3) frame.Widgets [#frame.Widgets+1] = container_dispell_window frame.Widgets [#frame.Widgets+1] = container_dispell_frame - container_dispell_frame:SetScript ("OnMouseDown", mouse_down) - container_dispell_frame:SetScript ("OnMouseUp", mouse_up) + container_dispell_frame:SetScript("OnMouseDown", mouse_down) + container_dispell_frame:SetScript("OnMouseUp", mouse_up) container_dispell_frame.barras = {} - container_dispell_frame:SetAllPoints (container_dispell_window) - container_dispell_frame:SetWidth (BOX_WIDTH) - container_dispell_frame:SetHeight (BOX_HEIGHT) + container_dispell_frame:SetAllPoints(container_dispell_window) + container_dispell_frame:SetWidth(BOX_WIDTH) + container_dispell_frame:SetHeight(BOX_HEIGHT) container_dispell_frame:EnableMouse (true) - container_dispell_frame:SetResizable (false) + container_dispell_frame:SetResizable(false) container_dispell_frame:SetMovable (true) - container_dispell_window:SetWidth (BOX_WIDTH) - container_dispell_window:SetHeight (BOX_HEIGHT_UPPER) + container_dispell_window:SetWidth(BOX_WIDTH) + container_dispell_window:SetHeight(BOX_HEIGHT_UPPER) container_dispell_window:SetScrollChild (container_dispell_frame) - container_dispell_window:SetPoint ("TOPLEFT", container_adds_window, "BOTTOMLEFT", 0, CONST_BOX_VERTICAL_SPACING) + container_dispell_window:SetPoint("TOPLEFT", container_adds_window, "BOTTOMLEFT", 0, CONST_BOX_VERTICAL_SPACING) - DetailsFrameWork:NewLabel (container_dispell_window, container_dispell_window, nil, "titulo", Loc ["STRING_DISPELLS"], "GameFontHighlight") - container_dispell_window.titulo:SetPoint ("bottomleft", container_dispell_window, "topleft", 0, 1) + DetailsFrameWork:NewLabel(container_dispell_window, container_dispell_window, nil, "titulo", Loc ["STRING_DISPELLS"], "GameFontHighlight") + container_dispell_window.titulo:SetPoint("bottomleft", container_dispell_window, "topleft", 0, 1) DetailsFrameWork:NewScrollBar (container_dispell_window, container_dispell_frame, 4, -16) container_dispell_window.slider:Altura (BOX_HEIGHT-31) @@ -2912,43 +2912,43 @@ end container_dispell_window.ultimo = 0 frame.overall_dispell = container_dispell_window - --> Caixa das mortes + --Caixa das mortes -- ~mortes ~deaths ~dead - local container_dead_window = CreateFrame ("ScrollFrame", "Details_Boss_ContainerDead", frame,"BackdropTemplate") + local container_dead_window = CreateFrame("ScrollFrame", "Details_Boss_ContainerDead", frame,"BackdropTemplate") set_backdrop (container_dead_window) - local container_dead_frame = CreateFrame ("Frame", "Details_Boss_FrameDead", container_dead_window, "BackdropTemplate") + local container_dead_frame = CreateFrame("Frame", "Details_Boss_FrameDead", container_dead_window, "BackdropTemplate") - local dead_total_string = DetailsFrameWork:CreateLabel (container_dead_window, "time of death") + local dead_total_string = DetailsFrameWork:CreateLabel(container_dead_window, "time of death") dead_total_string.textcolor = "gray" dead_total_string.textsize = 9 - dead_total_string:SetPoint ("bottomright", container_dead_window, "topright", 0, 3) + dead_total_string:SetPoint("bottomright", container_dead_window, "topright", 0, 3) frame.Widgets [#frame.Widgets+1] = container_dead_window frame.Widgets [#frame.Widgets+1] = container_dead_frame - container_dead_frame:SetScript ("OnMouseDown", mouse_down) - container_dead_frame:SetScript ("OnMouseUp", mouse_up) + container_dead_frame:SetScript("OnMouseDown", mouse_down) + container_dead_frame:SetScript("OnMouseUp", mouse_up) container_dead_frame.barras = {} - container_dead_frame:SetPoint ("left", container_dead_window, "left") - container_dead_frame:SetPoint ("right", container_dead_window, "right") - container_dead_frame:SetPoint ("top", container_dead_window, "top") - container_dead_frame:SetPoint ("bottom", container_dead_window, "bottom", 0, 10) + container_dead_frame:SetPoint("left", container_dead_window, "left") + container_dead_frame:SetPoint("right", container_dead_window, "right") + container_dead_frame:SetPoint("top", container_dead_window, "top") + container_dead_frame:SetPoint("bottom", container_dead_window, "bottom", 0, 10) - container_dead_frame:SetWidth (BOX_WIDTH) - container_dead_frame:SetHeight (BOX_HEIGHT) + container_dead_frame:SetWidth(BOX_WIDTH) + container_dead_frame:SetHeight(BOX_HEIGHT) container_dead_frame:EnableMouse (true) - container_dead_frame:SetResizable (false) + container_dead_frame:SetResizable(false) container_dead_frame:SetMovable (true) - container_dead_window:SetWidth (BOX_WIDTH) - container_dead_window:SetHeight (BOX_HEIGHT_UPPER) + container_dead_window:SetWidth(BOX_WIDTH) + container_dead_window:SetHeight(BOX_HEIGHT_UPPER) container_dead_window:SetScrollChild (container_dead_frame) - container_dead_window:SetPoint ("TOPLEFT", container_dispell_window, "TOPRIGHT", CONST_BOX_HORIZONTAL_SPACING, 0) + container_dead_window:SetPoint("TOPLEFT", container_dispell_window, "TOPRIGHT", CONST_BOX_HORIZONTAL_SPACING, 0) - DetailsFrameWork:NewLabel (container_dead_window, container_dead_window, nil, "titulo", Loc ["STRING_DEATH_LOG"], "GameFontHighlight") - container_dead_window.titulo:SetPoint ("bottomleft", container_dead_window, "topleft", 0, 1) + DetailsFrameWork:NewLabel(container_dead_window, container_dead_window, nil, "titulo", Loc ["STRING_DEATH_LOG"], "GameFontHighlight") + container_dead_window.titulo:SetPoint("bottomleft", container_dead_window, "topleft", 0, 1) DetailsFrameWork:NewScrollBar (container_dead_window, container_dead_frame, 4, -16) container_dead_window.slider:Altura (BOX_HEIGHT-31) @@ -2964,7 +2964,7 @@ end --emotes frame - local emote_frame = CreateFrame ("frame", "DetailsEncountersEmoteFrame", UIParent, "BackdropTemplate") + local emote_frame = CreateFrame("frame", "DetailsEncountersEmoteFrame", UIParent, "BackdropTemplate") emote_frame:RegisterEvent ("CHAT_MSG_RAID_BOSS_EMOTE") emote_frame:RegisterEvent ("CHAT_MSG_RAID_BOSS_WHISPER") emote_frame:RegisterEvent ("CHAT_MSG_MONSTER_EMOTE") @@ -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_EncounterDetails/ptBR.lua b/plugins/Details_EncounterDetails/ptBR.lua index c40fcfb2..48d94591 100644 --- a/plugins/Details_EncounterDetails/ptBR.lua +++ b/plugins/Details_EncounterDetails/ptBR.lua @@ -41,7 +41,7 @@ Loc ["STRING_INTERRIPT_HELP"] = "\n\n|cFFFFFF00Clique|r na barra: abre a janela Loc ["STRING_DISPELL_HELP"] = "\n\n|cFFFFFF00Clique|r na barra: abre a janela de enviar relatorio." Loc ["STRING_DEATHS_HELP"] = "\n\n|cFFFFFF00Clique|r na barra: abre a janela de enviar relatorio." ---> mechanic types +--mechanic types Loc ["STRING_HEAL"] = "cura" Loc ["STRING_LOWDPS"] = "dpsbaixo" Loc ["STRING_LOWHEAL"] = "curabaixa" diff --git a/plugins/Details_RaidCheck/Details_RaidCheck.lua b/plugins/Details_RaidCheck/Details_RaidCheck.lua index deb578f9..ee6c5f64 100644 --- a/plugins/Details_RaidCheck/Details_RaidCheck.lua +++ b/plugins/Details_RaidCheck/Details_RaidCheck.lua @@ -1003,7 +1003,7 @@ function DetailsRaidCheck:OnEvent(_, event, ...) C_Timer.After(1, function() --install local install, savedData, isEnabled = _G.Details:InstallPlugin("TOOLBAR", Loc["STRING_RAIDCHECK_PLUGIN_NAME"], [[Interface\Buttons\UI-CheckBox-Check]], DetailsRaidCheck, "DETAILS_PLUGIN_RAIDCHECK", MINIMAL_DETAILS_VERSION_REQUIRED, "Terciob", version, defaultSettings) - if (type (install) == "table" and install.error) then + if (type(install) == "table" and install.error) then return print(install.error) end diff --git a/plugins/Details_Streamer/Details_Streamer.lua b/plugins/Details_Streamer/Details_Streamer.lua index 2bccf587..6e4f5b6c 100644 --- a/plugins/Details_Streamer/Details_Streamer.lua +++ b/plugins/Details_Streamer/Details_Streamer.lua @@ -7,20 +7,20 @@ local _ ---need cleanup Loc ["STRING_MEMORY_ALERT_BUTTON"], ---> create the plugin object +--create the plugin object -- "Details_StreamOverlay" is the old name local StreamOverlay = _detalhes:NewPluginObject("Details_Streamer", DETAILSPLUGIN_ALWAYSENABLED) --tinsert (UISpecialFrames, "Details_StreamOverlays") ---> main frame (shortcut) +--main frame (shortcut) local SOF = StreamOverlay.Frame ---> shortcut for details framework +--shortcut for details framework local playerName StreamOverlay.CurrentVersion = "v1.2" ---> mantaing the tables for casts, has hash indexes of numbers pointing to tables, tables inside store data of the UNIT_CAST events ---> also mantain information about the cast, if is done, interrupted, channeled, instant. +--mantaing the tables for casts, has hash indexes of numbers pointing to tables, tables inside store data of the UNIT_CAST events +--also mantain information about the cast, if is done, interrupted, channeled, instant. --Target = the target of the spell casted or the spellname if is a death table --Id = the CastId from UNIT_CAST events. --CastStart = GetTime from the cast start. @@ -31,9 +31,9 @@ StreamOverlay.CurrentVersion = "v1.2" --Death = this is a event from death tables. local CastsTable = {} ---> store bars references +--store bars references StreamOverlay.battle_lines = {} ---> store the information to be shown on bars, like text, icon, colors +--store the information to be shown on bars, like text, icon, colors StreamOverlay.battle_content = {} StreamOverlay.squares = {} @@ -66,10 +66,10 @@ local function CreatePluginFrames() local fader = Details.FadeHandler.Fader function StreamOverlay:OnDetailsEvent(event, ...) - if (event == "HIDE") then --> plugin hidded, disabled + if (event == "HIDE") then --plugin hidded, disabled self.open = false - elseif (event == "SHOW") then --> plugin hidded, disabled + elseif (event == "SHOW") then --plugin hidded, disabled self.open = true elseif (event == "PLUGIN_DISABLED") then @@ -88,84 +88,84 @@ local function CreatePluginFrames() --show the frame and restore position SOF:Show() - --> restore size and location + --restore size and location StreamOverlay:RestoreWindowSizeAndLocation() - --> refresh the frame + --refresh the frame StreamOverlay:Refresh() StreamOverlay:SetBackgroundColor() StreamOverlay:CreateMinimapIcon() - --> enable the minimap icon + --enable the minimap icon LDBIcon:Refresh("DetailsStreamer", StreamOverlay.db.minimap) StreamOverlay:SetLocked() - --> install the death hook + --install the death hook Details:InstallHook(DETAILS_HOOK_DEATH, StreamOverlay.OnDeath) - --> enable event listener + --enable event listener eventFrame:RegisterMyEvents() - --> enable the tick update - eventFrame:SetScript ("OnUpdate", eventFrame.track_spell_cast) + --enable the tick update + eventFrame:SetScript("OnUpdate", eventFrame.track_spell_cast) - --> refresh dps frame + --refresh dps frame StreamOverlay:UpdateDpsHpsFrameConfig() end function StreamOverlay:OnDisablePlugin() - --> shutdown the tick update - eventFrame:SetScript ("OnUpdate", nil) + --shutdown the tick update + eventFrame:SetScript("OnUpdate", nil) - --> disable the event listener + --disable the event listener eventFrame:UnregisterMyEvents() - --> unistall the death hook + --unistall the death hook Details:UnInstallHook (DETAILS_HOOK_DEATH, StreamOverlay.OnDeath) - --> shutdown minimap icon + --shutdown minimap icon StreamOverlay:CreateMinimapIcon() local realstate = StreamOverlay.db.minimap.hide StreamOverlay.db.minimap.hide = true LDBIcon:Refresh ("DetailsStreamer", StreamOverlay.db.minimap) StreamOverlay.db.minimap.hide = realstate - --> save position, size and hide the frame + --save position, size and hide the frame StreamOverlay:SaveWindowSizeAnLocation() SOF:Hide() - --> refresh dps frame + --refresh dps frame StreamOverlay:UpdateDpsHpsFrameConfig (true) end - --> title bar, only shown when the frame isn't locked - local titlebar = CreateFrame ("frame", "DetailsStreamerTitlebar", SOF, "BackdropTemplate") - titlebar:SetHeight (20) - titlebar:SetPoint ("bottomleft", SOF, "topleft") - titlebar:SetPoint ("bottomright", SOF, "topright") - titlebar:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}) - titlebar:SetBackdropColor (.1, .1, .1, .9) + --title bar, only shown when the frame isn't locked + local titlebar = CreateFrame("frame", "DetailsStreamerTitlebar", SOF, "BackdropTemplate") + titlebar:SetHeight(20) + titlebar:SetPoint("bottomleft", SOF, "topleft") + titlebar:SetPoint("bottomright", SOF, "topright") + titlebar:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}) + titlebar:SetBackdropColor(.1, .1, .1, .9) 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.text:SetPoint("center", titlebar, "center") + titlebar.text:SetText("Details! Streamer: Action Tracker") + 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") GameTooltip:Show() end) - titlebar:SetScript ("OnLeave", function() + titlebar:SetScript("OnLeave", function() 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 @@ -200,13 +200,13 @@ local function CreatePluginFrames() end end) - --> main frame parameters - SOF:SetPoint ("center", UIParent, "center") - SOF:SetSize (300, 500) - SOF:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}) + --main frame parameters + SOF:SetPoint("center", UIParent, "center") + SOF:SetSize(300, 500) + SOF:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}) SOF:EnableMouse (true) SOF:SetMovable (true) - SOF:SetResizable (true) + SOF:SetResizable(true) SOF:SetClampedToScreen (true) pcall(function() @@ -219,56 +219,56 @@ local function CreatePluginFrames() end) function StreamOverlay:SaveWindowSizeAnLocation() - --> save size first + --save size first StreamOverlay.db.main_frame_size [1] = SOF:GetWidth() StreamOverlay.db.main_frame_size [2] = SOF:GetHeight() - --> save main frame position + --save main frame position LibWindow.RegisterConfig (SOF, StreamOverlay.db) LibWindow.SavePosition (SOF) - --> save the dps frame position + --save the dps frame position LibWindow.RegisterConfig (StreamerOverlayDpsHpsFrame, StreamOverlay.db.per_second) LibWindow.SavePosition (StreamerOverlayDpsHpsFrame) end function StreamOverlay:RestoreWindowSizeAndLocation() - --> restore the size first - SOF:SetSize (unpack (StreamOverlay.db.main_frame_size)) - --> set the main window location + --restore the size first + SOF:SetSize(unpack (StreamOverlay.db.main_frame_size)) + --set the main window location LibWindow.RegisterConfig (SOF, StreamOverlay.db) LibWindow.RestorePosition (SOF) LibWindow.SavePosition (SOF) - --> set the dps frame location + --set the dps frame location LibWindow.RegisterConfig (StreamerOverlayDpsHpsFrame, StreamOverlay.db.per_second) LibWindow.RestorePosition (StreamerOverlayDpsHpsFrame) LibWindow.SavePosition (StreamerOverlayDpsHpsFrame) - --> set the frame strata + --set the frame strata SOF:SetFrameStrata (StreamOverlay.db.main_frame_strata) StreamerOverlayDpsHpsFrame:SetFrameStrata (StreamOverlay.db.main_frame_strata) end - --> two resizers - local left_resize = CreateFrame ("button", "DetailsStreamerLeftResizer", SOF, "BackdropTemplate") - local right_resize = CreateFrame ("button", "DetailsStreamerRightResizer", SOF, "BackdropTemplate") - left_resize:SetPoint ("bottomleft", SOF, "bottomleft") - right_resize:SetPoint ("bottomright", SOF, "bottomright") - left_resize:SetSize (16, 16) - right_resize:SetSize (16, 16) - right_resize:SetNormalTexture ([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Up]]) - right_resize:SetHighlightTexture ([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Highlight]]) - right_resize:SetPushedTexture ([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Down]]) - left_resize:SetNormalTexture ([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Up]]) - left_resize:SetHighlightTexture ([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Highlight]]) - left_resize:SetPushedTexture ([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Down]]) + --two resizers + local left_resize = CreateFrame("button", "DetailsStreamerLeftResizer", SOF, "BackdropTemplate") + local right_resize = CreateFrame("button", "DetailsStreamerRightResizer", SOF, "BackdropTemplate") + left_resize:SetPoint("bottomleft", SOF, "bottomleft") + right_resize:SetPoint("bottomright", SOF, "bottomright") + left_resize:SetSize(16, 16) + right_resize:SetSize(16, 16) + right_resize:SetNormalTexture([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Up]]) + right_resize:SetHighlightTexture([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Highlight]]) + right_resize:SetPushedTexture([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Down]]) + left_resize:SetNormalTexture([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Up]]) + left_resize:SetHighlightTexture([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Highlight]]) + left_resize:SetPushedTexture([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Down]]) left_resize:GetNormalTexture():SetTexCoord (1, 0, 0, 1) 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() @@ -313,11 +313,11 @@ local function CreatePluginFrames() end) - --> 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) + --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) - --> looks like this isn't working + --looks like this isn't working function StreamOverlay:ClearAll() if (StreamOverlay.db.use_square_mode) then for index = 1, #StreamOverlay.squares do @@ -454,7 +454,7 @@ local function CreatePluginFrames() end end - --> iterate each bar and update its text, icons and statusbar + --iterate each bar and update its text, icons and statusbar function StreamOverlay:UpdateLines() if (StreamOverlay.db.use_square_mode) then return @@ -463,31 +463,31 @@ local function CreatePluginFrames() FauxScrollFrame_Update(autoscroll, StreamOverlay.total_lines, StreamOverlay.total_lines, 20) for index = 1, StreamOverlay.total_lines do - --> here gets the bar and the table with the information to shown on the bar + --here gets the bar and the table with the information to shown on the bar local data = StreamOverlay.battle_content [index] local line = StreamOverlay.battle_lines [index] if (data) then - --> left - line.icon1:SetTexture (data [1]) + --left + line.icon1:SetTexture(data [1]) line.icon1:SetTexCoord (5/64, 59/64, 5/64, 59/64) local text = data [2] - line.text1:SetText (text) + line.text1:SetText(text) local loops = 20 while (line.text1:GetStringWidth() > text1Size and loops > 0) do text = strsub (text, 1, #text-1) - line.text1:SetText (text) + line.text1:SetText(text) loops = loops - 1 --just to be safe end - --> right + --right local text = data [6] - line.text2:SetText (text) + line.text2:SetText(text) local loops = 20 while (line.text2:GetStringWidth() > text2Size and loops > 0) do text = strsub (text, 1, #text-1) - line.text2:SetText (text) + line.text2:SetText(text) loops = loops - 1 --just to be safe end @@ -505,35 +505,35 @@ local function CreatePluginFrames() line.text2:SetTextColor (1, 1, 1) end - line.icon2:SetTexture (data [4]) + line.icon2:SetTexture(data [4]) line.icon2:SetTexCoord (unpack (data [5])) if (data [4] == defaultAttackIcon) then - line.icon2:SetSize (iconSize*0.8, iconSize*0.8) - line.icon2:SetPoint ("left", line, "center", 8, 0) - line.text2:SetPoint ("left", line.icon2, "right", 5, 0) + line.icon2:SetSize(iconSize*0.8, iconSize*0.8) + line.icon2:SetPoint("left", line, "center", 8, 0) + line.text2:SetPoint("left", line.icon2, "right", 5, 0) else - line.icon2:SetSize (iconSize, iconSize) - line.icon2:SetPoint ("left", line, "center", 8, 0) - line.text2:SetPoint ("left", line.icon2, "right", 5, 0) + line.icon2:SetSize(iconSize, iconSize) + line.icon2:SetPoint("left", line, "center", 8, 0) + line.text2:SetPoint("left", line.icon2, "right", 5, 0) end - --> background - line:SetBackdropColor (unpack (data [8])) + --background + line:SetBackdropColor(unpack (data [8])) if (data [9]) then - line:SetBackdropBorderColor (unpack (data [9])) + line:SetBackdropBorderColor(unpack (data [9])) else - line:SetBackdropBorderColor (0, 0, 0, 0) + line:SetBackdropBorderColor(0, 0, 0, 0) end - --> percentage + --percentage local castinfo = CastsTable [data.CastID] local percent = castinfo and castinfo.Percent or 0 if (percent > 100) then percent = 100 end - line.statusbar:SetValue (percent) + line.statusbar:SetValue(percent) if (StreamOverlay.db.use_spark) then line.spark:Show() @@ -580,48 +580,48 @@ local function CreatePluginFrames() local index = #StreamOverlay.battle_lines+1 - local f = CreateFrame ("frame", "StreamOverlayBar" .. index, SOF, "BackdropTemplate") - local statusbar = CreateFrame ("StatusBar", "StreamOverlayBar" .. index .. "StatusBar", f, "BackdropTemplate") - local statusbar_texture = statusbar:CreateTexture (nil, "border") - statusbar_texture:SetTexture (1, 1, 1, 0.15) + local f = CreateFrame("frame", "StreamOverlayBar" .. index, SOF, "BackdropTemplate") + local statusbar = CreateFrame("StatusBar", "StreamOverlayBar" .. index .. "StatusBar", f, "BackdropTemplate") + local statusbar_texture = statusbar:CreateTexture(nil, "border") + statusbar_texture:SetTexture(1, 1, 1, 0.15) statusbar:SetStatusBarColor (0, 0, 0, 0) statusbar:SetStatusBarTexture (statusbar_texture) statusbar:SetMinMaxValues (0, 100) - statusbar:SetValue (0) - local statusbar_spark = statusbar:CreateTexture (nil, "artwork") - statusbar_spark:SetTexture ([[Interface\CastingBar\UI-CastingBar-Spark]]) - statusbar_spark:SetSize (16, 50) - statusbar_spark:SetBlendMode ("ADD") + statusbar:SetValue(0) + local statusbar_spark = statusbar:CreateTexture(nil, "artwork") + statusbar_spark:SetTexture([[Interface\CastingBar\UI-CastingBar-Spark]]) + statusbar_spark:SetSize(16, 50) + statusbar_spark:SetBlendMode("ADD") statusbar_spark:Hide() local h = (index-1) * StreamOverlay.db.row_spacement * -1 - f:SetPoint ("topleft", SOF, "topleft", 0, h) - f:SetPoint ("topright", SOF, "topright", 0, h) + f:SetPoint("topleft", SOF, "topleft", 0, h) + f:SetPoint("topright", SOF, "topright", 0, h) --backdrop color not editable - f:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}) - f:SetBackdropBorderColor (0, 0, 0, 0) - --f:SetBackdropColor (0, 0, 0, 0) + f:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}) + f:SetBackdropBorderColor(0, 0, 0, 0) + --f:SetBackdropColor(0, 0, 0, 0) - local icon1 = statusbar:CreateTexture (nil, "overlay") - local icon2 = statusbar:CreateTexture (nil, "overlay") + local icon1 = statusbar:CreateTexture(nil, "overlay") + local icon2 = statusbar:CreateTexture(nil, "overlay") - local arrow = statusbar:CreateTexture (nil, "overlay") + local arrow = statusbar:CreateTexture(nil, "overlay") local text1 = statusbar:CreateFontString (nil, "overlay", "GameFontNormal") local text2 = statusbar:CreateFontString (nil, "overlay", "GameFontNormal") - icon1:SetPoint ("left", f, "left", 2, 0) --> player spell icon - text1:SetPoint ("left", icon1, "right", 2, 0) --> player spell name + icon1:SetPoint("left", f, "left", 2, 0) --player spell icon + text1:SetPoint("left", icon1, "right", 2, 0) --player spell name - arrow:SetPoint ("center", f, "center") --> separate player spell and targets + arrow:SetPoint("center", f, "center") --separate player spell and targets - icon2:SetPoint ("left", f, "center", 10, 0) - text2:SetPoint ("left", icon2, "right", 3, 0) + icon2:SetPoint("left", f, "center", 10, 0) + text2:SetPoint("left", icon2, "right", 3, 0) - statusbar:SetPoint ("topleft", f, "topleft", 0, 0) - statusbar:SetPoint ("bottomright", f, "bottomright", 0, 0) + statusbar:SetPoint("topleft", f, "topleft", 0, 0) + statusbar:SetPoint("bottomright", f, "bottomright", 0, 0) f.icon1 = icon1 f.icon2 = icon2 @@ -646,13 +646,13 @@ local function CreatePluginFrames() return end - for i, row in ipairs (StreamOverlay.battle_lines) do + for i, row in ipairs(StreamOverlay.battle_lines) do StreamOverlay:SetBattleLineStyle (row, i) end - --> update the dps hps frame text + --update the dps hps frame text StreamOverlay:SetFontFace (StreamerOverlayDpsHpsFrameText, SharedMedia:Fetch ("font", StreamOverlay.db.font_face)) - StreamOverlay:SetFontColor (StreamerOverlayDpsHpsFrameText, StreamOverlay.db.font_color) + StreamOverlay:SetFontColor(StreamerOverlayDpsHpsFrameText, StreamOverlay.db.font_color) end function StreamOverlay:RefreshAllBoxesStyle() @@ -660,7 +660,7 @@ local function CreatePluginFrames() return end - for i, square in ipairs (StreamOverlay.squares) do + for i, square in ipairs(StreamOverlay.squares) do StreamOverlay:SetSquareStyle(square, i) end end @@ -673,12 +673,12 @@ local function CreatePluginFrames() function StreamOverlay:SetBattleLineStyle (row, index) local options = StreamOverlay.db - row:SetHeight (StreamOverlay.db.row_height) + row:SetHeight(StreamOverlay.db.row_height) if (index) then local h = (index-1) * StreamOverlay.db.row_spacement * -1 - row:SetPoint ("topleft", SOF, "topleft", 0, h) - row:SetPoint ("topright", SOF, "topright", 0, h) + row:SetPoint("topleft", SOF, "topleft", 0, h) + row:SetPoint("topright", SOF, "topright", 0, h) end StreamOverlay:SetFontSize (row.text1, StreamOverlay.db.font_size) @@ -688,21 +688,21 @@ local function CreatePluginFrames() StreamOverlay:SetFontFace (row.text1, font) StreamOverlay:SetFontFace (row.text2, font) - StreamOverlay:SetFontColor (row.text1, StreamOverlay.db.font_color) - StreamOverlay:SetFontColor (row.text2, StreamOverlay.db.font_color) + StreamOverlay:SetFontColor(row.text1, StreamOverlay.db.font_color) + StreamOverlay:SetFontColor(row.text2, StreamOverlay.db.font_color) iconSize = StreamOverlay.db.row_height-4 - row.icon1:SetSize (iconSize, iconSize) - row.icon2:SetSize (iconSize, iconSize) + row.icon1:SetSize(iconSize, iconSize) + row.icon2:SetSize(iconSize, iconSize) local current_texture = row.icon2:GetTexture() if (current_texture == defaultAttackIcon) then - row.icon2:SetSize (iconSize*0.8, iconSize*0.8) - row.icon2:SetPoint ("left", row, "center", 8, 0) - row.text2:SetPoint ("left", row.icon2, "right", 5, 0) + row.icon2:SetSize(iconSize*0.8, iconSize*0.8) + row.icon2:SetPoint("left", row, "center", 8, 0) + row.text2:SetPoint("left", row.icon2, "right", 5, 0) else - row.icon2:SetPoint ("left", row, "center", 8, 0) - row.text2:SetPoint ("left", row.icon2, "right", 5, 0) + row.icon2:SetPoint("left", row, "center", 8, 0) + row.text2:SetPoint("left", row.icon2, "right", 5, 0) end if (row.text2:GetText() == "") then @@ -1110,23 +1110,23 @@ eventFrame.track_spell_cast = function() if (not castinfo.Done) then - --> is being casted? + --is being casted? if (castinfo.HasCastTime) then if (castinfo.Success) then - --> okey it's done + --okey it's done castinfo.Done = true castinfo.Percent = 100 - line.statusbar:SetValue (100) - line.spark:SetPoint ("left", line.statusbar, "left", (line.statusbar:GetWidth() / 100 * 100) - 8, 0) + line.statusbar:SetValue(100) + line.spark:SetPoint("left", line.statusbar, "left", (line.statusbar:GetWidth() / 100 * 100) - 8, 0) --line.spark:Hide() elseif (castinfo.Interrupted) then - --> has been interrupted + --has been interrupted castinfo.Done = true line.spark:SetVertexColor (1, 0.7, 0) elseif (castinfo.IsChanneled) then - --> casting a channeled spell + --casting a channeled spell local name, text, texture, startTime, endTime, isTradeSkill, notInterruptible = UnitChannelInfo ("player") if (name) then @@ -1138,7 +1138,7 @@ eventFrame.track_spell_cast = function() local percent = current / diff * 100 percent = math.abs (percent - 100) castinfo.Percent = percent - line.statusbar:SetValue (percent) + line.statusbar:SetValue(percent) if (StreamOverlay.db.use_spark) then line.spark:Show() else @@ -1150,7 +1150,7 @@ eventFrame.track_spell_cast = function() end else - --> still casting + --still casting local spell, displayName, icon, startTime, endTime, isTradeSkill, castID, interrupt = UnitCastingInfo("player") if (spell) then startTime = startTime / 1000 @@ -1161,7 +1161,7 @@ eventFrame.track_spell_cast = function() local percent = current / diff * 100 castinfo.Percent = percent - line.statusbar:SetValue (percent) + line.statusbar:SetValue(percent) if (StreamOverlay.db.use_spark) then line.spark:Show() else @@ -1173,12 +1173,12 @@ eventFrame.track_spell_cast = function() end else - --> it's instant cast + --it's instant cast if (castinfo.CastStart+1.2 < GetTime()) then castinfo.Done = true castinfo.Percent = 100 - line.statusbar:SetValue (100) - line.spark:SetPoint ("left", line.statusbar, "left", (line.statusbar:GetWidth() / 100 * 100) - 8, 0) + line.statusbar:SetValue(100) + line.spark:SetPoint("left", line.statusbar, "left", (line.statusbar:GetWidth() / 100 * 100) - 8, 0) --line.spark:Hide() else local startTime = castinfo.CastStart @@ -1189,7 +1189,7 @@ eventFrame.track_spell_cast = function() local percent = current / diff * 100 castinfo.Percent = percent - line.statusbar:SetValue (percent) + line.statusbar:SetValue(percent) if (StreamOverlay.db.use_spark) then line.spark:Show() @@ -1198,7 +1198,7 @@ eventFrame.track_spell_cast = function() end line.spark:SetVertexColor (1, 1, 1, 1) - line.spark:SetPoint ("left", line.statusbar, "left", (line.statusbar:GetWidth() / 100 * percent) - 6, 0) + line.spark:SetPoint("left", line.statusbar, "left", (line.statusbar:GetWidth() / 100 * percent) - 6, 0) end end @@ -1215,23 +1215,23 @@ eventFrame.track_spell_cast = function() if (not castinfo.Done and line) then - --> is being casted? + --is being casted? if (castinfo.HasCastTime) then if (castinfo.Success) then - --> okey it's done + --okey it's done castinfo.Done = true castinfo.Percent = 100 StreamOverlay:UpdateCooldownFrame(line, false) elseif (castinfo.Interrupted) then - --> has been interrupted + --has been interrupted castinfo.Done = true local totalTime = castinfo.CastTimeEnd - castinfo.CastTimeStart local pct = castinfo.CastTimeEnd - GetTime() castinfo.InterruptedPct = pct / totalTime elseif (castinfo.IsChanneled) then - --> casting a channeled spell + --casting a channeled spell local name, text, texture, startTime, endTime, isTradeSkill, notInterruptible = UnitChannelInfo ("player") if (name) then @@ -1247,7 +1247,7 @@ eventFrame.track_spell_cast = function() end else - --> still casting + --still casting local spell, displayName, icon, startTime, endTime, isTradeSkill, castID, interrupt = UnitCastingInfo ("player") if (spell) then startTime = startTime / 1000 @@ -1261,7 +1261,7 @@ eventFrame.track_spell_cast = function() end else - --> it's instant cast + --it's instant cast if (castinfo.CastStart+1.2 < GetTime()) then castinfo.Done = true castinfo.Percent = 100 @@ -1339,14 +1339,14 @@ local AMP_Tick = C_Timer.NewTicker (1, function() APM = ACTIONS * 60 ACTIONS = 0 end) -local APM_FRAME = CreateFrame ("frame", "DetailsAPMFrame", UIParent, "BackdropTemplate") +local APM_FRAME = CreateFrame("frame", "DetailsAPMFrame", UIParent, "BackdropTemplate") APM_FRAME:RegisterEvent ("PLAYER_STARTED_MOVING") APM_FRAME:RegisterEvent ("PLAYER_STOPPED_MOVING") -APM_FRAME:SetScript ("OnEvent", function() +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() @@ -1389,7 +1389,7 @@ eventFrame:SetScript ("OnEvent", function(self, event, ...) CastsTable [castGUID].InterruptedTime = GetTime() end - --> channels isn't passing the CastID / cast id for channels is always Zero. + --channels isn't passing the CastID / cast id for channels is always Zero. elseif (event == "UNIT_SPELLCAST_CHANNEL_STOP") then --local unitID, spell, rank, id, spellID = ... local unitID, castGUID, spellID = ... @@ -1419,7 +1419,7 @@ eventFrame:SetScript ("OnEvent", function(self, event, ...) end if (ischanneling) then - --> channel updated + --channel updated CastsTable [lastchannelid].Interrupted = true CastsTable [lastchannelid].InterruptedTime = GetTime() end @@ -1451,12 +1451,12 @@ eventFrame:SetScript ("OnEvent", function(self, event, ...) if (unitID == "player" and CastsTable[castGUID] and not channelspells [spell]) then if (CastsTable[castGUID].HasCastTime and not CastsTable[castGUID].IsChanneled) then - --> a cast (non channeled) just successful finished + --a cast (non channeled) just successful finished CastsTable [castGUID].Success = true StreamOverlay:CastFinished (castGUID) elseif (not CastsTable[castGUID].HasCastTime) then - --> instant cast finished + --instant cast finished CastsTable [castGUID].SpellId = spellID CastsTable [castGUID].Success = true StreamOverlay:CastFinished (castGUID) @@ -1480,7 +1480,7 @@ function StreamOverlay.OnDeath (_, token, time, who_serial, who_name, who_flags, for i = 1, #death_table do local ev = death_table [i] if (ev and type (ev) == "table" and ev[1] and type (ev[1]) == "boolean") then - --> it's a damage + --it's a damage local spellid = ev[2] local amount = ev[3] local attime = ev[4] @@ -1539,7 +1539,7 @@ function StreamOverlay.OnDeath (_, token, time, who_serial, who_name, who_flags, end ---> passes the new lock state +--passes the new lock state --the window is click throught when locked function StreamOverlay:SetLocked (state) @@ -1548,14 +1548,14 @@ function StreamOverlay:SetLocked (state) end if (state) then - --> is locked + --is locked StreamOverlay.db.main_frame_locked = true DetailsStreamerTitlebar:Hide() DetailsStreamerLeftResizer:Hide() DetailsStreamerRightResizer:Hide() SOF:EnableMouse (false) else - --> not locked + --not locked StreamOverlay.db.main_frame_locked = false DetailsStreamerTitlebar:Show() DetailsStreamerLeftResizer:Show() @@ -1569,21 +1569,21 @@ end ---------------------------------------------------------------------------------------------------------------------------------------------------------------- --on screen hps dps -local screen_frame = CreateFrame ("frame", "StreamerOverlayDpsHpsFrame", UIParent, "BackdropTemplate") -screen_frame:SetSize (70, 20) -screen_frame:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}) -screen_frame:SetBackdropColor (.1, .1, .1, .9) +local screen_frame = CreateFrame("frame", "StreamerOverlayDpsHpsFrame", UIParent, "BackdropTemplate") +screen_frame:SetSize(70, 20) +screen_frame:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}) +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:SetPoint("center", UIParent, "center") +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,19 +1599,19 @@ 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") GameTooltip:Show() end) -screen_frame:SetScript ("OnLeave", function() +screen_frame:SetScript("OnLeave", function() GameTooltip:Hide() end) local screen_frame_text = screen_frame:CreateFontString ("StreamerOverlayDpsHpsFrameText", "overlay", "GameFontNormal") -screen_frame_text:SetPoint ("center", screen_frame, "center") +screen_frame_text:SetPoint("center", screen_frame, "center") screen_frame.text = screen_frame_text local screen_frame_attribute = 1 @@ -1632,17 +1632,17 @@ function StreamOverlay:UpdateDpsHpsFrameConfig (PluginDisabled) StreamOverlay:SetFontSize (screen_frame.text, db.size) StreamOverlay:SetFontOutline (screen_frame.text, db.font_shadow) - screen_frame:SetScale (db.scale) + screen_frame:SetScale(db.scale) screen_frame_attribute = db.attribute_type format_function = Details:GetCurrentToKFunction() if (StreamOverlay.db.main_frame_locked) then - screen_frame:SetBackdrop (nil) + screen_frame:SetBackdrop(nil) screen_frame:EnableMouse (false) else - screen_frame:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}) - screen_frame:SetBackdropColor (.1, .1, .1, .9) + screen_frame:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}) + screen_frame:SetBackdropColor(.1, .1, .1, .9) screen_frame:EnableMouse (true) end @@ -1661,24 +1661,24 @@ function StreamOverlay:UpdateDpsHpsFrameConfig (PluginDisabled) end end - --> update the dps hps frame text + --update the dps hps frame text StreamOverlay:SetFontFace (StreamerOverlayDpsHpsFrameText, SharedMedia:Fetch ("font", StreamOverlay.db.font_face)) - StreamOverlay:SetFontColor (StreamerOverlayDpsHpsFrameText, StreamOverlay.db.font_color) + StreamOverlay:SetFontColor(StreamerOverlayDpsHpsFrameText, StreamOverlay.db.font_color) end function StreamOverlay:UpdateDpsHpsFrame() - --> low level actor parsing - we can just use Details:GetActor(), but is faster without having to call functions + --low level actor parsing - we can just use Details:GetActor(), but is faster without having to call functions local container = _detalhes.tabela_vigente [screen_frame_attribute] local actor = container._ActorTable [container._NameIndexTable [playerName]] if (actor) then - screen_frame_text:SetText (format_function (_, actor.total / _detalhes.tabela_vigente:GetCombatTime())) + screen_frame_text:SetText(format_function (_, actor.total / _detalhes.tabela_vigente:GetCombatTime())) else if (StreamOverlay.db.per_second.attribute_type == 1) then - screen_frame_text:SetText ("DPS") + screen_frame_text:SetText("DPS") else - screen_frame_text:SetText ("HPS") + screen_frame_text:SetText("HPS") end end end @@ -1825,7 +1825,7 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) end local arrowIconTable = {} - for _, arrow in ipairs (arrows) do + for _, arrow in ipairs(arrows) do arrowIconTable[#arrowIconTable+1] = {value = arrow, label = arrow:gsub ("Interface(.*)\\", ""), onclick = setArrowTextureCallback, icon = arrow} end @@ -2211,12 +2211,12 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) local selectProfile = function(_, _, profileName) local pname = UnitName("player") .. " - " .. GetRealmName() - --> save the current config on the profile + --save the current config on the profile local current_profile = Details_StreamerDB.characters [pname] local current_ptable = Details_StreamerDB.profiles [current_profile] _detalhes.table.overwrite (current_ptable, StreamOverlay.db) --overwrite the profile with the local settings - --> get the selected profile and overwrite the settings + --get the selected profile and overwrite the settings local ptable = Details_StreamerDB.profiles [profileName] _detalhes.table.deploy (ptable, StreamOverlay.DefaultConfigTable) --update with any new config from the default table @@ -2224,22 +2224,22 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) Details_StreamerDB.characters [pname] = profileName - --> restore size and location + --restore size and location StreamOverlay:RestoreWindowSizeAndLocation() - --> set locked and the backdrop color + --set locked and the backdrop color StreamOverlay:SetLocked (StreamOverlay.db.main_frame_locked) StreamOverlay:SetBackgroundColor (unpack (StreamOverlay.db.main_frame_color)) - --> update the minimap icon + --update the minimap icon if (LDBIcon) then LDBIcon:Refresh ("DetailsStreamer", StreamOverlay.db.minimap) end - --> update all settings + --update all settings StreamOverlay:RefreshAllBattleLineStyle() - --> update the options panel + --update the options panel optionsFrame:RefreshOptions() end @@ -2251,15 +2251,15 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) return t end - local label_profile = Details.gump:CreateLabel (optionsFrame, "Profile" .. ": ", Details.gump:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")) + local label_profile = Details.gump:CreateLabel(optionsFrame, "Profile" .. ": ", Details.gump:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")) local dropdown_profile = Details.gump:CreateDropDown (optionsFrame, select_profile_fill, nil, 160, 20, "dropdown_profile", nil, Details.gump:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) - dropdown_profile:SetPoint ("left", label_profile, "right", 2, 0) - label_profile:SetPoint ("topleft", optionsFrame, "topleft", 15, -65) + dropdown_profile:SetPoint("left", label_profile, "right", 2, 0) + label_profile:SetPoint("topleft", optionsFrame, "topleft", 15, -65) local pname = UnitName ("player") .. " - " .. GetRealmName() dropdown_profile:Select (Details_StreamerDB.characters [pname]) - --> new profile button + --new profile button if (not Details_StreamerDB.profiles [pname]) then local add_profile = function() --profile name @@ -2274,16 +2274,16 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) optionsFrame.NewProfileButton:Hide() - --> update all settings + --update all settings StreamOverlay:RefreshAllBattleLineStyle() - --> update the options panel + --update the options panel optionsFrame:RefreshOptions() dropdown_profile:Select (Details_StreamerDB.characters [pname]) end optionsFrame.NewProfileButton = Details.gump:CreateButton (optionsFrame, add_profile, 60, 18, "New Profiile", _, _, _, _, _, _, Details.gump:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE"), Details.gump:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")) - optionsFrame.NewProfileButton:SetPoint ("left", dropdown_profile, "right", 4, 0) + optionsFrame.NewProfileButton:SetPoint("left", dropdown_profile, "right", 4, 0) end --enable / disable plugin button @@ -2309,14 +2309,14 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) local pluginStable = Details:GetPluginSavedTable("DETAILS_PLUGIN_STREAM_OVERLAY") local toggleButton = DetailsFramework:CreateButton(optionsFrame, toggle_OnOff, 120, 20, pluginStable.enabled and "Disable Plugin" or "Start Plugin") - toggleButton:SetPoint ("topleft", optionsFrame, "topleft", 15, -35) + toggleButton:SetPoint("topleft", optionsFrame, "topleft", 15, -35) toggleButton:SetTemplate(DetailsFramework:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")) optionsFrame.toggleButton = toggleButton - optionsFrame:SetScript ("OnHide", function() + optionsFrame:SetScript("OnHide", function() if (StreamOverlay.FromOptionsPanel) then - --> reopen the options panel + --reopen the options panel C_Timer.After (0.2, function() Details:OpenOptionsWindow(Details:GetInstance(1)) end) @@ -2367,10 +2367,10 @@ function StreamOverlay:OnEvent (_, event, ...) return end - --> create widgets + --create widgets CreatePluginFrames() - --> core version required + --core version required local MINIMAL_DETAILS_VERSION_REQUIRED = 80 local default_options_table = { @@ -2416,9 +2416,9 @@ function StreamOverlay:OnEvent (_, event, ...) StreamOverlay.DefaultConfigTable = default_options_table - --> Install + --Install local install, saveddata = _G._detalhes:InstallPlugin ("TOOLBAR", "Action Tracker", [[Interface\MINIMAP\MOVIERECORDINGICON]], StreamOverlay, "DETAILS_PLUGIN_STREAM_OVERLAY", MINIMAL_DETAILS_VERSION_REQUIRED, "Terciob", StreamOverlay.CurrentVersion, default_options_table) - if (type (install) == "table" and install.error) then + if (type(install) == "table" and install.error) then print (install.error) end @@ -2446,18 +2446,18 @@ function StreamOverlay:OnEvent (_, event, ...) StreamOverlay.ShowWelcomeFrame:Cancel() - local welcomeWindow = CreateFrame ("frame", "StreamOverlayWelcomeWindow", UIParent, "BackdropTemplate") - welcomeWindow:SetPoint ("center", UIParent, "center") - welcomeWindow:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - welcomeWindow:SetBackdropColor (0, 0, 0, 0.5) - welcomeWindow:SetBackdropBorderColor (0, 0, 0, 1) - welcomeWindow:SetSize (740, 270) + local welcomeWindow = CreateFrame("frame", "StreamOverlayWelcomeWindow", UIParent, "BackdropTemplate") + welcomeWindow:SetPoint("center", UIParent, "center") + welcomeWindow:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + welcomeWindow:SetBackdropColor(0, 0, 0, 0.5) + welcomeWindow:SetBackdropBorderColor(0, 0, 0, 1) + welcomeWindow:SetSize(740, 270) DetailsFramework:ApplyStandardBackdrop(welcomeWindow) - local icon = welcomeWindow:CreateTexture (nil, "overlay") - icon:SetTexture ([[Interface\MINIMAP\MOVIERECORDINGICON]]) + local icon = welcomeWindow:CreateTexture(nil, "overlay") + icon:SetTexture([[Interface\MINIMAP\MOVIERECORDINGICON]]) local title = welcomeWindow:CreateFontString (nil, "overlay", "GameFontNormal") - title:SetText ("Details!: Action Tracker (plugin)") + title:SetText("Details!: Action Tracker (plugin)") StreamOverlay:SetFontSize (title, 20) local youtubeTwitchIcons = welcomeWindow:CreateTexture(nil, "overlay") @@ -2467,19 +2467,19 @@ function StreamOverlay:OnEvent (_, event, ...) youtubeTwitchIcons:SetPoint("topleft", welcomeWindow, "topleft", 123, -61) local text1 = welcomeWindow:CreateFontString (nil, "overlay", "GameFontNormal") - text1:SetText ("SHOW TO YOUR VIEWERS YOUR ROTATION\nThis way they can learn while watching your content") + text1:SetText("SHOW TO YOUR VIEWERS YOUR ROTATION\nThis way they can learn while watching your content") local text2 = welcomeWindow:CreateFontString (nil, "overlay", "GameFontNormal") - text2:SetText ("Use the command:") + text2:SetText("Use the command:") local text3 = welcomeWindow:CreateFontString (nil, "overlay", "GameFontNormal") - text3:SetText ("/streamer") + text3:SetText("/streamer") DetailsFramework:SetFontSize(text3, 16) - icon:SetPoint ("topleft", welcomeWindow, "topleft", 10, -20) - title:SetPoint ("left", icon, "right", 10, 0) + icon:SetPoint("topleft", welcomeWindow, "topleft", 10, -20) + title:SetPoint("left", icon, "right", 10, 0) - text1:SetPoint ("topleft", welcomeWindow, "topleft", 10, -120) - text2:SetPoint ("center", text1, "center", 0, -40) - text3:SetPoint ("center", text2, "center", 0, -16) + text1:SetPoint("topleft", welcomeWindow, "topleft", 10, -120) + text2:SetPoint("center", text1, "center", 0, -40) + text3:SetPoint("center", text2, "center", 0, -16) local image1 = welcomeWindow:CreateTexture(nil, "overlay") image1:SetTexture([[Interface\AddOns\Details_Streamer\streamer_plugin_lines]]) @@ -2493,7 +2493,7 @@ function StreamOverlay:OnEvent (_, event, ...) end local close = Details.gump:CreateButton (welcomeWindow, close_func, 120, 20, "Okay", nil, nil, nil, nil, nil, nil, Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) - close:SetPoint ("center", text3, "center", 0, -50) + close:SetPoint("center", text3, "center", 0, -50) end StreamOverlay.ShowWelcomeFrame = C_Timer.NewTicker (5, show_frame) @@ -2526,7 +2526,7 @@ function StreamOverlay:OnEvent (_, event, ...) end end ---> create minimap icon +--create minimap icon function StreamOverlay:CreateMinimapIcon() if (StreamOverlay.minimap_icon_created) then @@ -2571,25 +2571,25 @@ SLASH_STREAMER1, SLASH_STREAMER2 = "/streamer", "/detailsstreamer" function SlashCmdList.STREAMER (msg, editbox) local command, rest = msg:match ("^(%S*)%s*(.-)$") - --> open options panel + --open options panel StreamOverlay.OpenOptionsPanel() end --[[ extrair lista das magias -local editbox = CreateFrame ("editbox", nil, UIParent) -editbox:SetSize (300, 700) -editbox:SetPoint ("topleft", UIParent, "topleft") -editbox:SetBackdrop ({bgFile = "Interface\\AddOns\\Details\\images\\background", tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}) -editbox:SetBackdropColor (0, 0, 0, .2) +local editbox = CreateFrame("editbox", nil, UIParent) +editbox:SetSize(300, 700) +editbox:SetPoint("topleft", UIParent, "topleft") +editbox:SetBackdrop({bgFile = "Interface\\AddOns\\Details\\images\\background", tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}) +editbox:SetBackdropColor(0, 0, 0, .2) editbox:SetAutoFocus (false) editbox:ClearFocus() editbox:SetMultiLine (true) editbox:SetFontObject (GameFontHighlightSmall) editbox:SetJustifyH("CENTER") editbox:EnableMouse(true) -editbox:SetText ("") -editbox:SetScript ("OnEscapePressed", function() editbox:ClearFocus() end) -editbox:SetScript ("OnEditFocusGained", function() editbox:HighlightText() end) +editbox:SetText("") +editbox:SetScript("OnEscapePressed", function() editbox:ClearFocus() end) +editbox:SetScript("OnEditFocusGained", function() editbox:HighlightText() end) local list = "" @@ -2605,7 +2605,7 @@ if (not harmful_spells [spellid] and not helpful_spells [spellid]) then if (class ~= "unknow") then text = text .. "\n"..spellid .. " " .. spellname .. " " .. class - editbox:SetText (text) + editbox:SetText(text) end end end diff --git a/plugins/Details_TinyThreat/Details_TinyThreat.lua b/plugins/Details_TinyThreat/Details_TinyThreat.lua index 868ac70d..e7cde9f4 100644 --- a/plugins/Details_TinyThreat/Details_TinyThreat.lua +++ b/plugins/Details_TinyThreat/Details_TinyThreat.lua @@ -1,18 +1,18 @@ local AceLocale = LibStub ("AceLocale-3.0") local Loc = AceLocale:GetLocale ("Details_Threat") -local _GetNumSubgroupMembers = GetNumSubgroupMembers --> wow api -local _GetNumGroupMembers = GetNumGroupMembers --> wow api -local _UnitIsFriend = UnitIsFriend --> wow api -local _UnitName = UnitName --> wow api -local _IsInRaid = IsInRaid --> wow api -local _IsInGroup = IsInGroup --> wow api -local _UnitGroupRolesAssigned = DetailsFramework.UnitGroupRolesAssigned --> wow api +local _GetNumSubgroupMembers = GetNumSubgroupMembers --wow api +local _GetNumGroupMembers = GetNumGroupMembers --wow api +local _UnitIsFriend = UnitIsFriend --wow api +local _UnitName = UnitName --wow api +local _IsInRaid = IsInRaid --wow api +local _IsInGroup = IsInGroup --wow api +local _UnitGroupRolesAssigned = DetailsFramework.UnitGroupRolesAssigned --wow api local GetUnitName = GetUnitName -local _ipairs = ipairs --> lua api -local _table_sort = table.sort --> lua api -local _cstr = string.format --> lua api +local _ipairs = ipairs --lua api +local _table_sort = table.sort --lua api +local _cstr = string.format --lua api local _unpack = unpack local _math_floor = math.floor local _math_abs = math.abs @@ -20,10 +20,10 @@ local RAID_CLASS_COLORS = RAID_CLASS_COLORS ---> Create the plugin Object +--Create the plugin Object local ThreatMeter = _detalhes:NewPluginObject ("Details_TinyThreat") ---> Main Frame +--Main Frame local ThreatMeterFrame = ThreatMeter.Frame ThreatMeter:SetPluginDescription ("Small tool for track the threat you and other raid members have in your current target.") @@ -49,41 +49,41 @@ end local function CreatePluginFrames (data) - --> catch Details! main object + --catch Details! main object local _detalhes = _G._detalhes local DetailsFrameWork = _detalhes.gump - --> data + --data ThreatMeter.data = data or {} - --> defaults + --defaults ThreatMeter.RowWidth = 294 ThreatMeter.RowHeight = 14 - --> amount of row wich can be displayed + --amount of row wich can be displayed ThreatMeter.CanShow = 0 - --> all rows already created + --all rows already created ThreatMeter.Rows = {} - --> current shown rows + --current shown rows ThreatMeter.ShownRows = {} --> ThreatMeter.Actived = false - --> localize functions + --localize functions ThreatMeter.percent_color = ThreatMeter.percent_color ThreatMeter.GetOnlyName = ThreatMeter.GetOnlyName - --> window reference + --window reference local instance local player - --> OnEvent Table + --OnEvent Table function ThreatMeter:OnDetailsEvent (event, ...) if (event == "DETAILS_STARTED") then ThreatMeter:RefreshRows() - elseif (event == "HIDE") then --> plugin hidded, disabled + elseif (event == "HIDE") then --plugin hidded, disabled ThreatMeter.Actived = false ThreatMeter:Cancel() @@ -149,23 +149,23 @@ local function CreatePluginFrames (data) end end - ThreatMeterFrame:SetWidth (300) - ThreatMeterFrame:SetHeight (100) + ThreatMeterFrame:SetWidth(300) + ThreatMeterFrame:SetHeight(100) function ThreatMeter:UpdateContainers() - for _, row in _ipairs (ThreatMeter.Rows) do + for _, row in _ipairs(ThreatMeter.Rows) do row:SetContainer (instance.baseframe) end end function ThreatMeter:UpdateRows() - for _, row in _ipairs (ThreatMeter.Rows) do + for _, row in _ipairs(ThreatMeter.Rows) do row.width = ThreatMeter.RowWidth end end function ThreatMeter:HideBars() - for _, row in _ipairs (ThreatMeter.Rows) do + for _, row in _ipairs(ThreatMeter.Rows) do row:Hide() end end @@ -186,8 +186,8 @@ local function CreatePluginFrames (data) local instance = ThreatMeter:GetPluginInstance() local w, h = instance:GetSize() - ThreatMeterFrame:SetWidth (w) - ThreatMeterFrame:SetHeight (h) + ThreatMeterFrame:SetWidth(w) + ThreatMeterFrame:SetHeight(h) ThreatMeter.RowHeight = instance.row_info.height ThreatMeter.CanShow = math.floor ( h / (instance.row_info.height+1)) @@ -229,8 +229,8 @@ local function CreatePluginFrames (data) row.height = instance.row_info.height local rowHeight = - ( (row.rowId -1) * (instance.row_info.height + 1) ) row:ClearAllPoints() - row:SetPoint ("topleft", ThreatMeterFrame, "topleft", 1, rowHeight) - row:SetPoint ("topright", ThreatMeterFrame, "topright", -1, rowHeight) + row:SetPoint("topleft", ThreatMeterFrame, "topleft", 1, rowHeight) + row:SetPoint("topright", ThreatMeterFrame, "topright", -1, rowHeight) end end @@ -243,7 +243,7 @@ local function CreatePluginFrames (data) function ThreatMeter:NewRow (i) local newrow = DetailsFrameWork:NewBar (ThreatMeterFrame, nil, "DetailsThreatRow"..i, nil, 300, ThreatMeter.RowHeight) - newrow:SetPoint (3, -((i-1)*(ThreatMeter.RowHeight+1))) + newrow:SetPoint(3, -((i-1)*(ThreatMeter.RowHeight+1))) newrow.lefttext = "bar " .. i newrow.color = "skyblue" newrow.fontsize = 9.9 @@ -322,7 +322,7 @@ local function CreatePluginFrames (data) if (ThreatMeter.Actived and UnitExists(unitId) and not _UnitIsFriend("player", unitId)) then - --> get the threat of all players + --get the threat of all players if (_IsInRaid()) then for i = 1, _GetNumGroupMembers(), 1 do @@ -331,7 +331,7 @@ local function CreatePluginFrames (data) local threat_table = ThreatMeter.player_list_indexes [threat_table_index] if (not threat_table) then - --> some one joined the group while the player are in combat + --some one joined the group while the player are in combat ThreatMeter:Start() return end @@ -347,7 +347,7 @@ local function CreatePluginFrames (data) local threat_table = ThreatMeter.player_list_indexes [threat_table_index] if (not threat_table) then - --> some one joined the group while the player are in combat + --some one joined the group while the player are in combat ThreatMeter:Start() return end @@ -364,14 +364,14 @@ local function CreatePluginFrames (data) else - --> player + --player local thisplayer_name = GetUnitName ("player", true) local threat_table_index = ThreatMeter.player_list_hash [thisplayer_name] local threat_table = ThreatMeter.player_list_indexes [threat_table_index] UpdateTableFromThreatSituation(threat_table, "player", unitId) - --> pet + --pet if (UnitExists ("pet")) then local thisplayer_name = GetUnitName ("pet", true) .. " *PET*" local threat_table_index = ThreatMeter.player_list_hash [thisplayer_name] @@ -387,23 +387,23 @@ local function CreatePluginFrames (data) local gougeSpellId = (not disableGougeMode) and FindGougeSpellForUnit(unitId) local useAbsoluteMode = gougeSpellId or ThreatMeter.saveddata.absolute_mode - --> sort + --sort _table_sort (ThreatMeter.player_list_indexes, useAbsoluteMode and absoluteSort or relativeSort) local needMainTankDummyBar = true - for index, t in _ipairs (ThreatMeter.player_list_indexes) do + for index, t in _ipairs(ThreatMeter.player_list_indexes) do ThreatMeter.player_list_hash [t[1]] = index if t[3] then needMainTankDummyBar = false end end - --> no threat on this enemy + --no threat on this enemy if (ThreatMeter.player_list_indexes [1][7] < 1) then ThreatMeter:HideBars() return end - --> find main tank threat, even if they are not in group + --find main tank threat, even if they are not in group local mainTankAbsoluteThreat = ThreatMeter.player_list_indexes[1][6]/(ThreatMeter.player_list_indexes[1][7]/100) local lastIndex = 0 @@ -415,7 +415,7 @@ local function CreatePluginFrames (data) local needMeleePullBar = (not hidePullBar) and useAbsoluteMode local needRelativePullBar = (not hidePullBar) and (not useAbsoluteMode) and me and (me[2] > 0) and (not me[3]) - --> find out scaling factor for bars + --find out scaling factor for bars local barValueUnit if useAbsoluteMode then barValueUnit = max(ThreatMeter.player_list_indexes[1][7]/100, needRangedPullBar and 1.3 or needMeleePullBar and 1.1 or 1.0) @@ -423,10 +423,10 @@ local function CreatePluginFrames (data) barValueUnit = 1.0 end - --> find out gouge threshold (highest offtank threat, divided by 110%; this prevents the offtank from taking the boss back) + --find out gouge threshold (highest offtank threat, divided by 110%; this prevents the offtank from taking the boss back) local gougeThreshold = nil if gougeSpellId then - for _, t in _ipairs (ThreatMeter.player_list_indexes) do + for _, t in _ipairs(ThreatMeter.player_list_indexes) do if not t[3] then gougeThreshold = t[6] / 1.1 break @@ -442,7 +442,7 @@ local function CreatePluginFrames (data) local threatActor = ThreatMeter.player_list_indexes[index-dummyBarCount] if needRelativePullBar then - thisRow._icon:SetTexture ([[Interface\PVPFrame\Icon-Combat]]) + thisRow._icon:SetTexture([[Interface\PVPFrame\Icon-Combat]]) thisRow._icon:SetTexCoord (0, 1, 0, 1) local myPullThreat = me[6]*(100/me[2]) @@ -464,7 +464,7 @@ local function CreatePluginFrames (data) if needRangedPullBar and ((not threatActor) or (threatActor[7] < 130)) then - thisRow._icon:SetTexture ([[Interface\PaperDoll\UI-PaperDoll-Slot-Ranged]]) + thisRow._icon:SetTexture([[Interface\PaperDoll\UI-PaperDoll-Slot-Ranged]]) thisRow._icon:SetTexCoord (0, 1, 0, 1) thisRow:SetLeftText ("Ranged pull at") @@ -482,7 +482,7 @@ local function CreatePluginFrames (data) end if needMeleePullBar and ((not threatActor) or (threatActor[7] < 110)) then - thisRow._icon:SetTexture ([[Interface\PaperDoll\UI-PaperDoll-Slot-MainHand]]) + thisRow._icon:SetTexture([[Interface\PaperDoll\UI-PaperDoll-Slot-MainHand]]) thisRow._icon:SetTexCoord (0, 1, 0, 1) thisRow:SetLeftText ("Melee pull at") @@ -500,7 +500,7 @@ local function CreatePluginFrames (data) end if needMainTankDummyBar and ((not threatActor) or (not useAbsoluteMode) or (threatActor[6] < mainTankAbsoluteThreat)) then - thisRow._icon:SetTexture ([[Interface\LFGFrame\UI-LFG-Icon-PortraitRoles]]) + thisRow._icon:SetTexture([[Interface\LFGFrame\UI-LFG-Icon-PortraitRoles]]) thisRow._icon:SetTexCoord (_unpack (RoleIconCoord ["TANK"])) thisRow:SetLeftText ("Current Tank") @@ -509,7 +509,7 @@ local function CreatePluginFrames (data) -- color main tank based on highest non-tank threat local r,g = 0,1 - for _, t in _ipairs (ThreatMeter.player_list_indexes) do + for _, t in _ipairs(ThreatMeter.player_list_indexes) do if not t[3] then local otherPct = t[useAbsoluteMode and 7 or 2] r,g = (otherPct*0.01), (_math_abs(otherPct-100)*0.01) @@ -529,7 +529,7 @@ local function CreatePluginFrames (data) if gougeThreshold and ((not threatActor) or (threatActor[6] < gougeThreshold)) then local spellName, _, spellTexture = GetSpellInfo(gougeSpellId) - thisRow._icon:SetTexture (spellTexture) + thisRow._icon:SetTexture(spellTexture) thisRow._icon:SetTexCoord (0, 1, 0, 1) local pct = gougeThreshold * 100 / mainTankAbsoluteThreat @@ -550,7 +550,7 @@ local function CreatePluginFrames (data) if (threatActor) then local role = threatActor[4] - thisRow._icon:SetTexture ([[Interface\LFGFrame\UI-LFG-Icon-PortraitRoles]]) + thisRow._icon:SetTexture([[Interface\LFGFrame\UI-LFG-Icon-PortraitRoles]]) thisRow._icon:SetTexCoord (_unpack (RoleIconCoord [role])) thisRow:SetLeftText (ThreatMeter:GetOnlyName (threatActor [1])) @@ -558,7 +558,7 @@ local function CreatePluginFrames (data) local pct = threatActor [useAbsoluteMode and 7 or 2] thisRow:SetRightText (ThreatMeter:ToK2 (threatActor [6]) .. " (" .. _cstr ("%.1f", pct) .. "%)") - thisRow:SetValue (pct/barValueUnit) + thisRow:SetValue(pct/barValueUnit) if (options.useplayercolor and threatActor [1] == player) then thisRow:SetColor (_unpack (options.playercolor)) @@ -574,7 +574,7 @@ local function CreatePluginFrames (data) if threatActor[3] then -- color main tank based on highest non-tank threat local r,g = 0,1 - for _, t in _ipairs (ThreatMeter.player_list_indexes) do + for _, t in _ipairs(ThreatMeter.player_list_indexes) do if not t[3] then local otherPct = t[useAbsoluteMode and 7 or 2] r,g = (otherPct*0.01), (_math_abs(otherPct-100)*0.01) @@ -602,7 +602,7 @@ local function CreatePluginFrames (data) end if (not shownMe) then - --> show my self into last bar + --show my self into last bar local threat_actor = ThreatMeter.player_list_indexes [ ThreatMeter.player_list_hash [player] ] if (threat_actor) then if (threat_actor [2] and threat_actor [2] > 0.1) then @@ -610,10 +610,10 @@ local function CreatePluginFrames (data) thisRow:SetLeftText (player) --thisRow.textleft:SetTextColor (unpack (RAID_CLASS_COLORS [threat_actor [5]])) local role = threat_actor [4] - thisRow._icon:SetTexture ([[Interface\LFGFrame\UI-LFG-Icon-PortraitRoles]]) + thisRow._icon:SetTexture([[Interface\LFGFrame\UI-LFG-Icon-PortraitRoles]]) thisRow._icon:SetTexCoord (_unpack (RoleIconCoord [role])) thisRow:SetRightText (ThreatMeter:ToK2 (threat_actor [6]) .. " (" .. _cstr ("%.1f", threat_actor [2]) .. "%)") - thisRow:SetValue (threat_actor [2]) + thisRow:SetValue(threat_actor [2]) if (options.useplayercolor) then thisRow:SetColor (_unpack (options.playercolor)) @@ -660,7 +660,7 @@ local function CreatePluginFrames (data) ThreatMeter.player_list_indexes = {} ThreatMeter.player_list_hash = {} - --> pre build player list + --pre build player list if (_IsInRaid()) then for i = 1, _GetNumGroupMembers(), 1 do local thisplayer_name = GetUnitName ("raid"..i, true) @@ -851,18 +851,18 @@ function ThreatMeter:OnEvent (_, event, ...) --return end - --> create widgets + --create widgets CreatePluginFrames (data) local MINIMAL_DETAILS_VERSION_REQUIRED = 1 - --> Install + --Install local install, saveddata = _G._detalhes:InstallPlugin ("RAID", Loc ["STRING_PLUGIN_NAME"], "Interface\\Icons\\Ability_Druid_Cower", ThreatMeter, "DETAILS_PLUGIN_TINY_THREAT", MINIMAL_DETAILS_VERSION_REQUIRED, "Terciob", "v2.01") - if (type (install) == "table" and install.error) then + if (type(install) == "table" and install.error) then print (install.error) end - --> Register needed events + --Register needed events _G._detalhes:RegisterEvent (ThreatMeter, "COMBAT_PLAYER_ENTER") _G._detalhes:RegisterEvent (ThreatMeter, "COMBAT_PLAYER_LEAVE") _G._detalhes:RegisterEvent (ThreatMeter, "DETAILS_INSTANCE_ENDRESIZE") @@ -875,7 +875,7 @@ function ThreatMeter:OnEvent (_, event, ...) ThreatMeterFrame:RegisterEvent ("PLAYER_REGEN_DISABLED") ThreatMeterFrame:RegisterEvent ("PLAYER_REGEN_ENABLED") - --> Saved data + --Saved data ThreatMeter.saveddata = saveddata or {} ThreatMeter.saveddata.updatespeed = ThreatMeter.saveddata.updatespeed or 1 @@ -894,7 +894,7 @@ function ThreatMeter:OnEvent (_, event, ...) ThreatMeter.options = ThreatMeter.saveddata - --> Register slash commands + --Register slash commands SLASH_DETAILS_TINYTHREAT1, SLASH_DETAILS_TINYTHREAT2 = "/tinythreat", "/tt" function SlashCmdList.DETAILS_TINYTHREAT (msg, editbox) diff --git a/plugins/Details_Vanguard/Details_Vanguard.lua b/plugins/Details_Vanguard/Details_Vanguard.lua index 7e8e5f0f..31c8ddfd 100644 --- a/plugins/Details_Vanguard/Details_Vanguard.lua +++ b/plugins/Details_Vanguard/Details_Vanguard.lua @@ -15,17 +15,17 @@ local DF = _G.DetailsFramework --ignorar bloodlust, shield d priest --reler os tanks ao sair de um grupo -local _GetTime = GetTime --> wow api local -local _UFC = UnitAffectingCombat --> wow api local -local _IsInRaid = IsInRaid --> wow api local -local _IsInGroup = IsInGroup --> wow api local -local _UnitName = UnitName --> wow api local +local _GetTime = GetTime --wow api local +local _UFC = UnitAffectingCombat --wow api local +local _IsInRaid = IsInRaid --wow api local +local _IsInGroup = IsInGroup --wow api local +local _UnitName = UnitName --wow api local local _UnitGroupRolesAssigned = DetailsFramework.UnitGroupRolesAssigned -local _UnitHealth = UnitHealth --> wow api local -local _UnitHealthMax = UnitHealthMax --> wow api local -local _UnitIsPlayer = UnitIsPlayer --> wow api local -local _UnitClass = UnitClass --> wow api local -local _UnitDebuff = UnitDebuff --> wow api local +local _UnitHealth = UnitHealth --wow api local +local _UnitHealthMax = UnitHealthMax --wow api local +local _UnitIsPlayer = UnitIsPlayer --wow api local +local _UnitClass = UnitClass --wow api local +local _UnitDebuff = UnitDebuff --wow api local local UnitGetIncomingHeals = UnitGetIncomingHeals local _unpack = unpack local UnitGetTotalAbsorbs = UnitGetTotalAbsorbs @@ -35,14 +35,14 @@ local DB_ANIMATION_TIME_DILATATION = 0.515321 local CONST_DEBUFF_AMOUNT = 5 local CONST_MAX_TANKS = 2 -local _cstr = string.format --> lua library local -local _table_insert = table.insert --> lua library local -local _table_remove = table.remove --> lua library local -local _ipairs = ipairs --> lua library local -local _pairs = pairs --> lua library local -local _math_floor = math.floor --> lua library local -local _math_abs = math.abs --> lua library local -local _math_min = math.min --> lua library local +local _cstr = string.format --lua library local +local _table_insert = table.insert --lua library local +local _table_remove = table.remove --lua library local +local _ipairs = ipairs --lua library local +local _pairs = pairs --lua library local +local _math_floor = math.floor --lua library local +local _math_abs = math.abs --lua library local +local _math_min = math.min --lua library local local _table_sort = table.sort local ignored_debuffs = { @@ -55,9 +55,9 @@ local ignored_debuffs = { --------------------------------------------------------------------------------------------- ---> Create plugin Object +--Create plugin Object local Vanguard = _detalhes:NewPluginObject ("Details_Vanguard") ---> Main Frame +--Main Frame local VanguardFrame = Vanguard.Frame local onUpdateFrame = CreateFrame("frame") @@ -72,40 +72,40 @@ end local function CreatePluginFrames (data) - --> localize details functions + --localize details functions Vanguard.GetSpec = Vanguard.GetSpec Vanguard.class_specs_coords = Vanguard.class_specs_coords local framework = Vanguard:GetFramework() - --> OnDetailsEvent Parser + --OnDetailsEvent Parser function Vanguard:OnDetailsEvent (event, ...) - if (event == "HIDE") then --> plugin hidded, disabled + if (event == "HIDE") then --plugin hidded, disabled VanguardFrame:UnregisterEvent ("ROLE_CHANGED_INFORM") VanguardFrame:UnregisterEvent ("GROUP_ROSTER_UPDATE") VanguardFrame:UnregisterEvent ("PLAYER_TARGET_CHANGED") Vanguard:CombatEnd() - elseif (event == "SHOW") then --> plugin shown, enabled + elseif (event == "SHOW") then --plugin shown, enabled if (not Vanguard.db.first_run) then Vanguard.db.first_run = true - local welcome = CreateFrame ("frame", nil, UIParent, "BackdropTemplate") + local welcome = CreateFrame("frame", nil, UIParent, "BackdropTemplate") welcome:SetFrameStrata ("TOOLTIP") - welcome:SetPoint ("center", UIParent, "center") - welcome:SetSize (400, 200) + welcome:SetPoint("center", UIParent, "center") + welcome:SetSize(400, 200) DF:ApplyStandardBackdrop(welcome) - local str = _detalhes.gump:CreateLabel (welcome, "Welcome to Vanguard!\n\n\n- The green-left bar represents the incoming healing plus absorbs on the tank.\n\n- The red-right show the incoming damage.\n\n- Tanks health bar and debuffs on them are shown in the bottom side.\n\n- Click anywhere to show options.", nil, nil, "GameFontNormal") - str:SetPoint (15, -15) - str:SetWidth (375) + local str = _detalhes.gump:CreateLabel(welcome, "Welcome to Vanguard!\n\n\n- The green-left bar represents the incoming healing plus absorbs on the tank.\n\n- The red-right show the incoming damage.\n\n- Tanks health bar and debuffs on them are shown in the bottom side.\n\n- Click anywhere to show options.", nil, nil, "GameFontNormal") + str:SetPoint(15, -15) + str:SetWidth(375) local close_button = _detalhes.gump:CreateButton (welcome, function() welcome:Hide() end, 120, 20, "Close") close_button:SetTemplate(_detalhes.gump:GetTemplate ("button", "DETAILS_PLUGINPANEL_BUTTON_TEMPLATE")) - close_button:SetPoint ("center", welcome, "center") - close_button:SetPoint ("bottom", welcome, "bottom", 0, 10) + close_button:SetPoint("center", welcome, "center") + close_button:SetPoint("bottom", welcome, "bottom", 0, 10) end @@ -127,10 +127,10 @@ local function CreatePluginFrames (data) Vanguard:CombatStart() end - VanguardFrame:SetPoint ("topleft", Vanguard.CurrentInstance.baseframe, "topleft") - VanguardFrame:SetPoint ("bottomright", Vanguard.CurrentInstance.baseframe, "bottomright") + VanguardFrame:SetPoint("topleft", Vanguard.CurrentInstance.baseframe, "topleft") + VanguardFrame:SetPoint("bottomright", Vanguard.CurrentInstance.baseframe, "bottomright") - elseif (event == "COMBAT_PLAYER_ENTER") then --> a new combat has been started + elseif (event == "COMBAT_PLAYER_ENTER") then --a new combat has been started Vanguard.CurrentInstance = Vanguard:GetInstance (Vanguard.instance_id) Vanguard.CurrentCombat = select (1, ...) @@ -138,7 +138,7 @@ local function CreatePluginFrames (data) Vanguard:CombatStart() - elseif (event == "COMBAT_PLAYER_LEAVE") then --> current combat has finished + elseif (event == "COMBAT_PLAYER_LEAVE") then --current combat has finished Vanguard.CurrentCombat = select (1, ...) @@ -173,14 +173,14 @@ local function CreatePluginFrames (data) end end - --> list with tank names - Vanguard.TankList = {} --> tanks - Vanguard.TankHashNames = {} --> tanks - Vanguard.TankBlocks = {} --> tank frames - Vanguard.TankIncDamage = {} --> tank damage taken from last 5 seconds + --list with tank names + Vanguard.TankList = {} --tanks + Vanguard.TankHashNames = {} --tanks + Vanguard.TankBlocks = {} --tank frames + Vanguard.TankIncDamage = {} --tank damage taken from last 5 seconds Vanguard.UnitIdCache = {} - --> search for tanks in the raid or party group + --search for tanks in the raid or party group function Vanguard:IdentifyTanks() table.wipe (Vanguard.TankList) @@ -271,7 +271,7 @@ local function CreatePluginFrames (data) function Vanguard:ResetBars() if (Vanguard.db.show_inc_bars) then - for i, tankblock in ipairs (Vanguard.TankBlocks) do + for i, tankblock in ipairs(Vanguard.TankBlocks) do local bar = tankblock.heal_inc bar:SetSplit (50) bar:SetLeftText (tankblock.tankname_string) @@ -284,7 +284,7 @@ local function CreatePluginFrames (data) bar:Show() end else - for i, tankblock in ipairs (Vanguard.TankBlocks) do + for i, tankblock in ipairs(Vanguard.TankBlocks) do local bar = tankblock.heal_inc bar:Hide() end @@ -292,7 +292,7 @@ local function CreatePluginFrames (data) end function Vanguard:ResetBlocks() - for i, tblock in ipairs (Vanguard.TankBlocks) do + for i, tblock in ipairs(Vanguard.TankBlocks) do local _, maxValue = tblock.unitFrame.healthBar:GetMinMaxValues() tblock.unitFrame.healthBar:SetValue(maxValue) @@ -301,8 +301,8 @@ local function CreatePluginFrames (data) for i = 1, CONST_DEBUFF_AMOUNT do local dblock = tblock.debuffs_blocks [i] - dblock.texture:SetTexture (nil) - dblock.stack:SetText ("") + dblock.texture:SetTexture(nil) + dblock.stack:SetText("") dblock.stack_bg:Hide() dblock:SetCooldown (0, 0, 0, 0) dblock.in_use = nil @@ -313,7 +313,7 @@ local function CreatePluginFrames (data) local SetTank = function(self, index) local name = Vanguard.TankList [index] - self.tankname:SetText (Vanguard:GetOnlyName (name)) + self.tankname:SetText(Vanguard:GetOnlyName (name)) self.tankname_string = name local bar = self.heal_inc @@ -324,10 +324,10 @@ local function CreatePluginFrames (data) local spec = Vanguard:GetSpec (name) if (spec) then - self.specicon:SetTexture (Vanguard.CurrentInstance.row_info.spec_file) + self.specicon:SetTexture(Vanguard.CurrentInstance.row_info.spec_file) self.specicon:SetTexCoord (_unpack (Vanguard.class_specs_coords [spec])) else - self.specicon:SetTexture (Vanguard.CurrentInstance.row_info.icon_file) + self.specicon:SetTexture(Vanguard.CurrentInstance.row_info.icon_file) self.specicon:SetTexCoord (left, right, top, bottom) end @@ -343,27 +343,27 @@ local function CreatePluginFrames (data) bar:SetLeftText (name) local width = Vanguard.db.tank_block_size - self:SetWidth (width) - self:SetBackdropColor (unpack (Vanguard.db.tank_block_color)) + self:SetWidth(width) + self:SetBackdropColor(unpack (Vanguard.db.tank_block_color)) self.unitFrame.healthBar.background:SetColorTexture(unpack (Vanguard.db.tank_block_color)) self.unitFrame.healthBar.Settings.BackgroundColor = Vanguard.db.tank_block_color --texture - self.unitFrame.healthBar:SetTexture (SharedMedia:Fetch("statusbar", Vanguard.db.tank_block_texture)) - self.unitFrame.powerBar:SetTexture (SharedMedia:Fetch("statusbar", Vanguard.db.tank_block_texture)) - self.unitFrame.castBar:SetTexture (SharedMedia:Fetch("statusbar", Vanguard.db.tank_block_texture)) + self.unitFrame.healthBar:SetTexture(SharedMedia:Fetch("statusbar", Vanguard.db.tank_block_texture)) + self.unitFrame.powerBar:SetTexture(SharedMedia:Fetch("statusbar", Vanguard.db.tank_block_texture)) + self.unitFrame.castBar:SetTexture(SharedMedia:Fetch("statusbar", Vanguard.db.tank_block_texture)) end local debuff_on_enter = function(self) if (self.spellid) then - --self.texture:SetBlendMode ("ADD") + --self.texture:SetBlendMode("ADD") GameTooltip:SetOwner (self, "ANCHOR_TOPLEFT") GameTooltip:SetSpellByID(self.spellid) GameTooltip:Show() end end local debuff_on_leave = function(self) - --self.texture:SetBlendMode ("BLEND") + --self.texture:SetBlendMode("BLEND") if (self.spellid) then GameTooltip:Hide() end @@ -384,21 +384,21 @@ local function CreatePluginFrames (data) function Vanguard:CreateTankBlock (index) --frame - local f = CreateFrame ("button", "VanguardTankBlock" .. index, VanguardFrame, "BackdropTemplate") + local f = CreateFrame("button", "VanguardTankBlock" .. index, VanguardFrame, "BackdropTemplate") f.SetTank = SetTank - f:SetSize (Vanguard.db.tank_block_size, Vanguard.db.tank_block_size_height) + f:SetSize(Vanguard.db.tank_block_size, Vanguard.db.tank_block_size_height) - f:SetScript ("OnMouseUp", on_click) + f:SetScript("OnMouseUp", on_click) if (index == 1) then - f:SetPoint ("bottomleft", VanguardFrame, "bottomleft", 0 + ((index-1) * 155), 0) + f:SetPoint("bottomleft", VanguardFrame, "bottomleft", 0 + ((index-1) * 155), 0) else - f:SetPoint ("left", Vanguard.TankBlocks [index-1], "right", 5, 0) + f:SetPoint("left", Vanguard.TankBlocks [index-1], "right", 5, 0) end - f:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}, edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1}) - f:SetBackdropColor (unpack (Vanguard.db.tank_block_color)) - f:SetBackdropBorderColor (0, 0, 0, 1) + f:SetBackdrop({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}, edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1}) + f:SetBackdropColor(unpack (Vanguard.db.tank_block_color)) + f:SetBackdropBorderColor(0, 0, 0, 1) --debuff icons f.debufficons = {} @@ -431,19 +431,19 @@ local function CreatePluginFrames (data) } f.unitFrame = DetailsFramework:CreateUnitFrame(f, "VanguardTankUnitFrame" .. index, unitFrameSettingsOverride, healthBarSettingsOverride, castBarSettingsOverride, powerBarSettingsOverride) - f.unitFrame:SetPoint ("topleft", f, "topleft", 1, -1) - f.unitFrame:SetPoint ("bottomright", f, "bottomright", -1, 1) + f.unitFrame:SetPoint("topleft", f, "topleft", 1, -1) + f.unitFrame:SetPoint("bottomright", f, "bottomright", -1, 1) --spec icon f.specicon = f.unitFrame.healthBar:CreateTexture(nil, "overlay") - f.specicon:SetPoint ("topleft", f.unitFrame.healthBar, "topleft", 5, -5) - f.specicon:SetSize (14, 14) + f.specicon:SetPoint("topleft", f.unitFrame.healthBar, "topleft", 5, -5) + f.specicon:SetSize(14, 14) --tank name f.tankname = f.unitFrame.healthBar:CreateFontString(nil, "overlay", "GameFontNormal") - f.tankname:SetPoint ("left", f.specicon, "right", 2, 1) + f.tankname:SetPoint("left", f.specicon, "right", 2, 1) - f.unitFrame.castBar:SetTexture (SharedMedia:Fetch("statusbar", Vanguard.db.tank_block_texture)) - f.unitFrame.healthBar:SetTexture (SharedMedia:Fetch("statusbar", Vanguard.db.tank_block_texture)) - f.unitFrame.powerBar:SetTexture (SharedMedia:Fetch("statusbar", Vanguard.db.tank_block_texture)) + f.unitFrame.castBar:SetTexture(SharedMedia:Fetch("statusbar", Vanguard.db.tank_block_texture)) + f.unitFrame.healthBar:SetTexture(SharedMedia:Fetch("statusbar", Vanguard.db.tank_block_texture)) + f.unitFrame.powerBar:SetTexture(SharedMedia:Fetch("statusbar", Vanguard.db.tank_block_texture)) f.unitFrame.powerBar.background:SetColorTexture(0, 0, 0, 1) f.unitFrame.powerBar.background:SetVertexColor(0, 0, 0, 1) @@ -451,13 +451,13 @@ local function CreatePluginFrames (data) --inc heals inc damage f.heal_inc = DF:CreateSplitBar(f, 294, Vanguard.db.bar_height) f.heal_inc:SetSize(294, Vanguard.db.bar_height) - f.heal_inc:SetPoint ("topleft", VanguardFrame, "topleft", 0, ((index - 1) * -Vanguard.db.bar_height)) - f.heal_inc:SetPoint ("topright", VanguardFrame, "topright", 0, ((index - 1) * -Vanguard.db.bar_height)) + f.heal_inc:SetPoint("topleft", VanguardFrame, "topleft", 0, ((index - 1) * -Vanguard.db.bar_height)) + f.heal_inc:SetPoint("topright", VanguardFrame, "topright", 0, ((index - 1) * -Vanguard.db.bar_height)) f.heal_inc.fontsize = 10 f.heal_inc:SetTexture(SharedMedia:Fetch ("statusbar", Vanguard.db.tank_block_texture)) f.heal_inc:EnableAnimations() - f.heal_inc:SetScript ("OnMouseUp", on_click) + f.heal_inc:SetScript("OnMouseUp", on_click) --debuffs blocks f.debuffs_blocks = {} @@ -465,30 +465,30 @@ local function CreatePluginFrames (data) f.debuffs_next_index = 1 for i = 1, CONST_DEBUFF_AMOUNT do - local support_frame = CreateFrame ("frame", "VanguardSupportFrame_"..index.."_"..i, f.unitFrame, "BackdropTemplate") + local support_frame = CreateFrame("frame", "VanguardSupportFrame_"..index.."_"..i, f.unitFrame, "BackdropTemplate") support_frame:SetFrameLevel (f.unitFrame:GetFrameLevel()+10) - support_frame:SetSize (24, 24) - support_frame:SetScript ("OnMouseUp", on_click) + support_frame:SetSize(24, 24) + support_frame:SetScript("OnMouseUp", on_click) --icon texture - local texture = support_frame:CreateTexture (support_frame:GetName() .. "_Texture", "overlay") - texture:SetSize (24, 24) + local texture = support_frame:CreateTexture(support_frame:GetName() .. "_Texture", "overlay") + texture:SetSize(24, 24) texture:SetPoint("center", support_frame, "center", 0, 0) local y = 3 local xOffSet = (i-1) * (texture:GetWidth() + 1) support_frame.offset = xOffSet - support_frame:SetPoint ("left", f, "left", 5 + xOffSet, -8) + support_frame:SetPoint("left", f, "left", 5 + xOffSet, -8) - local dblock = CreateFrame ("cooldown", "VanguardTankDebuffCooldown" .. index.. "_" .. i, support_frame, "CooldownFrameTemplate, BackdropTemplate") + local dblock = CreateFrame("cooldown", "VanguardTankDebuffCooldown" .. index.. "_" .. i, support_frame, "CooldownFrameTemplate, BackdropTemplate") dblock:SetAlpha (0.7) - dblock:SetPoint ("topleft", texture, "topleft") - dblock:SetPoint ("bottomright", texture, "bottomright") + dblock:SetPoint("topleft", texture, "topleft") + dblock:SetPoint("bottomright", texture, "bottomright") --scripts - dblock:SetScript ("OnMouseUp", on_click) - dblock:SetScript ("OnEnter", debuff_on_enter) - dblock:SetScript ("OnLeave", debuff_on_leave) + dblock:SetScript("OnMouseUp", on_click) + dblock:SetScript("OnEnter", debuff_on_enter) + dblock:SetScript("OnLeave", debuff_on_leave) dblock.texture = texture @@ -500,12 +500,12 @@ local function CreatePluginFrames (data) elevateStringsFrame:EnableMouse(false) local stack = elevateStringsFrame:CreateFontString (elevateStringsFrame:GetName() .. "_StackText", "overlay", "GameFontNormal") - stack:SetPoint ("bottomright", dblock, "bottomright", 0, 0) + stack:SetPoint("bottomright", dblock, "bottomright", 0, 0) DetailsFramework:SetFontColor(stack, "yellow") - local stack_bg = elevateStringsFrame:CreateTexture (elevateStringsFrame:GetName() .. "_StackBG", "artwork") + local stack_bg = elevateStringsFrame:CreateTexture(elevateStringsFrame:GetName() .. "_StackBG", "artwork") stack_bg:SetColorTexture(0, 0, 0, 1) - stack_bg:SetPoint ("center", stack, "center", 0, 0) + stack_bg:SetPoint("center", stack, "center", 0, 0) stack_bg:SetSize(10, 10) stack_bg:Hide() @@ -556,7 +556,7 @@ local function CreatePluginFrames (data) for debuffBlockId = 1, CONST_DEBUFF_AMOUNT do local debuffBlock = f.debuffs_blocks[debuffBlockId] DetailsFramework:SetFontSize(debuffBlock.Timer, Vanguard.db.aura_timer_text_size) - debuffBlock.support:SetPoint ("left", f, "left", 5 + debuffBlock.support.offset, -8 + Vanguard.db.aura_offset_y) + debuffBlock.support:SetPoint("left", f, "left", 5 + debuffBlock.support.offset, -8 + Vanguard.db.aura_offset_y) end if (isClickThrough) then @@ -631,14 +631,14 @@ local function CreatePluginFrames (data) if (not Vanguard.db.show_health_bar and not Vanguard.db.show_cast_bar and not Vanguard.db.show_power_bar) then f.unitFrame:Hide() f.Center:Hide() - f:SetBackdropBorderColor (0, 0, 0, 0) + f:SetBackdropBorderColor(0, 0, 0, 0) return end f.unitFrame:Show() f.unitFrame.healthBar:Show() f.Center:Show() - f:SetBackdropBorderColor (0, 0, 0, 1) + f:SetBackdropBorderColor(0, 0, 0, 1) f.unitFrame.healthBar:SetPoint("topleft", f, "topleft", 0, 0) f.unitFrame.healthBar:SetPoint("topright", f, "topright", 0, 0) @@ -688,7 +688,7 @@ local function CreatePluginFrames (data) self.CurrentHealth = self.AnimationStart if (self.Spark) then - self.Spark:SetPoint ("center", self, "left", self.AnimationStart / self.CurrentHealthMax * self:GetWidth(), 0) + self.Spark:SetPoint("center", self, "left", self.AnimationStart / self.CurrentHealthMax * self:GetWidth(), 0) self.Spark:Show() end @@ -742,7 +742,7 @@ local function CreatePluginFrames (data) local timeNow = time() if (events_table) then - for _, event in ipairs (events_table) do + for _, event in ipairs(events_table) do if (event[1] and event[4]+5 > timeNow) then --damage event taken = taken + event [3] end @@ -758,7 +758,7 @@ local function CreatePluginFrames (data) --split animation tframe.heal_inc:SetLeftText (Vanguard:ToK (shields + heals) .. " [|cFFFFFF55" .. Vanguard:ToK (shields) .. "|r]") - tframe.heal_inc:SetRightText (Vanguard:ToK ( _math_floor (taken))) + tframe.heal_inc:SetRightText (Vanguard:ToK ( _math_floor(taken))) heals = heals + shields @@ -1124,20 +1124,20 @@ function Vanguard:OnEvent (_, event, arg1, token, time, who_serial, who_name, wh tank_block_powerbar_size_height = 10, } - --> Install - function Vanguard:OnDetailsEvent() end --> dummy func to stop warnings. + --Install + function Vanguard:OnDetailsEvent() end --dummy func to stop warnings. local install, saveddata = _G._detalhes:InstallPlugin ("TANK", "Vanguard", "Interface\\Icons\\INV_Shield_04", Vanguard, "DETAILS_PLUGIN_VANGUARD", MINIMAL_DETAILS_VERSION_REQUIRED, "Terciob", "v3.0", default_saved_table) - if (type (install) == "table" and install.error) then + if (type(install) == "table" and install.error) then print (install.error) end --Vanguard.db.first_run = false --debug - --> create widgets + --create widgets CreatePluginFrames() - --> Register needed events + --Register needed events _G._detalhes:RegisterEvent (Vanguard, "COMBAT_PLAYER_ENTER") _G._detalhes:RegisterEvent (Vanguard, "COMBAT_PLAYER_LEAVE") _G._detalhes:RegisterEvent (Vanguard, "DETAILS_INSTANCE_ENDRESIZE") @@ -1150,12 +1150,12 @@ function Vanguard:OnEvent (_, event, arg1, token, time, who_serial, who_name, wh end end - elseif (event == "ROLE_CHANGED_INFORM" or event == "GROUP_ROSTER_UPDATE") then --> raid changes + elseif (event == "ROLE_CHANGED_INFORM" or event == "GROUP_ROSTER_UPDATE") then --raid changes if (Vanguard.CurrentInstance) then Vanguard:IdentifyTanks() end - elseif (event == "ZONE_CHANGED_NEW_AREA" or event == "PLAYER_ENTERING_WORLD") then --> logon or map changes + elseif (event == "ZONE_CHANGED_NEW_AREA" or event == "PLAYER_ENTERING_WORLD") then --logon or map changes if (Vanguard.CurrentInstance) then Vanguard:IdentifyTanks() end diff --git a/startup.lua b/startup.lua index 6388c300..60b5dfc3 100644 --- a/startup.lua +++ b/startup.lua @@ -13,9 +13,9 @@ function Details:StartMeUp() --I'll never stop! Details.lastBattlegroundStartTime = GetTime() ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> row single click, this determines what happen when the user click on a bar +--row single click, this determines what happen when the user click on a bar - --> single click row function replace + --single click row function replace --damage, dps, damage taken, friendly fire self.row_singleclick_overwrite[1] = {true, true, true, true, self.atributo_damage.ReportSingleFragsLine, self.atributo_damage.ReportEnemyDamageTaken, self.atributo_damage.ReportSingleVoidZoneLine, self.atributo_damage.ReportSingleDTBSLine} --healing, hps, overheal, healing taken @@ -37,7 +37,7 @@ function Details:StartMeUp() --I'll never stop! self.click_to_report_color = {1, 0.8, 0, 1} ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> initialize +--initialize C_Timer.After(2, function() --test libOpenRaid deprecated code --[=[ @@ -106,7 +106,7 @@ function Details:StartMeUp() --I'll never stop! self.atributo_misc:UpdateSelectedToKFunction() self.atributo_custom:UpdateSelectedToKFunction() - --> start instances updater + --start instances updater self:CheckSwitchOnLogon() function Details:ScheduledWindowUpdate(forced) @@ -225,11 +225,11 @@ function Details:StartMeUp() --I'll never stop! --player role self.last_assigned_role = UnitGroupRolesAssigned and UnitGroupRolesAssigned("player") - --> start parser - --> load parser capture options + --start parser + --load parser capture options self:CaptureRefresh() - --> register parser events + --register parser events self.listener:RegisterEvent("PLAYER_REGEN_DISABLED") self.listener:RegisterEvent("PLAYER_REGEN_ENABLED") self.listener:RegisterEvent("UNIT_PET") @@ -534,7 +534,7 @@ function Details:StartMeUp() --I'll never stop! if (level == 1) then if (Details.overall_clear_newtorghast) then Details.historico:resetar_overall() - Details:Msg ("overall data are now reset.") --localize-me + Details:Msg("overall data are now reset.") --localize-me end end end)